Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

AgentService

!> The consul.AgentService resource has been deprecated in version 2.0.0 of the provider and will be removed in a future release. Please read the upgrade guide for more information.

Provides access to the agent service data in Consul. This can be used to define a service associated with a particular agent. Currently, defining health checks for an agent service is not supported.

Example Usage

using Pulumi;
using Consul = Pulumi.Consul;

class MyStack : Stack
{
    public MyStack()
    {
        var app = new Consul.AgentService("app", new Consul.AgentServiceArgs
        {
            Address = "www.google.com",
            Port = 80,
            Tags = 
            {
                "tag0",
                "tag1",
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-consul/sdk/v2/go/consul"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := consul.NewAgentService(ctx, "app", &consul.AgentServiceArgs{
            Address: pulumi.String("www.google.com"),
            Port:    pulumi.Int(80),
            Tags: pulumi.StringArray{
                pulumi.String("tag0"),
                pulumi.String("tag1"),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_consul as consul

app = consul.AgentService("app",
    address="www.google.com",
    port=80,
    tags=[
        "tag0",
        "tag1",
    ])
import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const app = new consul.AgentService("app", {
    address: "www.google.com",
    port: 80,
    tags: [
        "tag0",
        "tag1",
    ],
});

Create a AgentService Resource

new AgentService(name: string, args?: AgentServiceArgs, opts?: CustomResourceOptions);
def AgentService(resource_name: str, opts: Optional[ResourceOptions] = None, address: Optional[str] = None, name: Optional[str] = None, port: Optional[int] = None, tags: Optional[Sequence[str]] = None)
func NewAgentService(ctx *Context, name string, args *AgentServiceArgs, opts ...ResourceOption) (*AgentService, error)
public AgentService(string name, AgentServiceArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args AgentServiceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AgentServiceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AgentServiceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

AgentService Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The AgentService resource accepts the following input properties:

Address string

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

Name string

The name of the service.

Port int

The port of the service.

Tags List<string>

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

Address string

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

Name string

The name of the service.

Port int

The port of the service.

Tags []string

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

address string

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

name string

The name of the service.

port number

The port of the service.

tags string[]

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

address str

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

name str

The name of the service.

port int

The port of the service.

tags Sequence[str]

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

Outputs

All input properties are implicitly available as output properties. Additionally, the AgentService resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing AgentService Resource

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

public static get(name: string, id: Input<ID>, state?: AgentServiceState, opts?: CustomResourceOptions): AgentService
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, address: Optional[str] = None, name: Optional[str] = None, port: Optional[int] = None, tags: Optional[Sequence[str]] = None) -> AgentService
func GetAgentService(ctx *Context, name string, id IDInput, state *AgentServiceState, opts ...ResourceOption) (*AgentService, error)
public static AgentService Get(string name, Input<string> id, AgentServiceState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Address string

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

Name string

The name of the service.

Port int

The port of the service.

Tags List<string>

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

Address string

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

Name string

The name of the service.

Port int

The port of the service.

Tags []string

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

address string

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

name string

The name of the service.

port number

The port of the service.

tags string[]

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

address str

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

name str

The name of the service.

port int

The port of the service.

tags Sequence[str]

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

Package Details

Repository
https://github.com/pulumi/pulumi-consul
License
Apache-2.0
Notes
This Pulumi package is based on the consul Terraform Provider.