Show / Hide Table of Contents

Class Service

A high-level resource for creating a Service in Consul in the Consul catalog. This is appropriate for registering external services and can be used to create services addressable by Consul that cannot be registered with a local agent.

If the Consul agent is running on the node where this service is registered, it is not recommended to use this resource.

Example Usage

using Pulumi;
using Consul = Pulumi.Consul;

class MyStack : Stack
{
public MyStack()
{
    var compute = new Consul.Node("compute", new Consul.NodeArgs
    {
        Address = "www.google.com",
    });
    var google = new Consul.Service("google", new Consul.ServiceArgs
    {
        Node = compute.Name,
        Port = 80,
        Tags = 
        {
            "tag0",
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Service
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Consul
Assembly: Pulumi.Consul.dll
Syntax
public class Service : CustomResource

Constructors

View Source

Service(String, ServiceArgs, CustomResourceOptions)

Create a Service resource with the given unique name, arguments, and options.

Declaration
public Service(string name, ServiceArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

ServiceArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Address

The address of the service. Defaults to the address of the node.

Declaration
public Output<string> Address { get; }
Property Value
Type Description
Output<System.String>
View Source

Checks

Declaration
public Output<ImmutableArray<ServiceCheck>> Checks { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<ServiceCheck>>
View Source

Datacenter

The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.

Declaration
public Output<string> Datacenter { get; }
Property Value
Type Description
Output<System.String>
View Source

External

Declaration
public Output<bool?> External { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Meta

A map of arbitrary KV metadata linked to the service instance.

Declaration
public Output<ImmutableDictionary<string, string>> Meta { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

Name

The name of the health-check.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Namespace

The namespace to create the service within.

Declaration
public Output<string> Namespace { get; }
Property Value
Type Description
Output<System.String>
View Source

Node

The name of the node the to register the service on.

Declaration
public Output<string> Node { get; }
Property Value
Type Description
Output<System.String>
View Source

Port

The port of the service.

Declaration
public Output<int?> Port { get; }
Property Value
Type Description
Output<System.Nullable<System.Int32>>
View Source

ServiceId

  • If the service ID is not provided, it will be defaulted to the value of the name attribute.
Declaration
public Output<string> ServiceId { get; }
Property Value
Type Description
Output<System.String>
View Source

Tags

A list of values that are opaque to Consul, but can be used to distinguish between services or nodes.

Declaration
public Output<ImmutableArray<string>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>

Methods

View Source

Get(String, Input<String>, ServiceState, CustomResourceOptions)

Get an existing Service resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Service Get(string name, Input<string> id, ServiceState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

ServiceState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Service
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.