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

getAgentConfig

Note: The consul.getAgentConfig resource differs from consul.getAgentSelf, providing less information but utilizing stable APIs. consul.getAgentSelf will be deprecated in a future release.

The consul.getAgentConfig data source returns configuration data from the agent specified in the provider.

Example Usage

using Pulumi;
using Consul = Pulumi.Consul;

class MyStack : Stack
{
    public MyStack()
    {
        var remoteAgent = Output.Create(Consul.GetAgentConfig.InvokeAsync());
        this.ConsulVersion = remoteAgent.Apply(remoteAgent => remoteAgent.Version);
    }

    [Output("consulVersion")]
    public Output<string> ConsulVersion { get; set; }
}
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 {
        remoteAgent, err := consul.GetAgentConfig(ctx, nil, nil)
        if err != nil {
            return err
        }
        ctx.Export("consulVersion", remoteAgent.Version)
        return nil
    })
}
import pulumi
import pulumi_consul as consul

remote_agent = consul.get_agent_config()
pulumi.export("consulVersion", remote_agent.version)
import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const remoteAgent = pulumi.output(consul.getAgentConfig({ async: true }));

export const consulVersion = remoteAgent.version;

Using getAgentConfig

function getAgentConfig(opts?: InvokeOptions): Promise<GetAgentConfigResult>
def get_agent_config(opts: Optional[InvokeOptions] = None) -> GetAgentConfigResult
func GetAgentConfig(ctx *Context, opts ...InvokeOption) (*GetAgentConfigResult, error)

Note: This function is named GetAgentConfig in the Go SDK.

public static class GetAgentConfig {
    public static Task<GetAgentConfigResult> InvokeAsync(InvokeOptions? opts = null)
}

getAgentConfig Result

The following output properties are available:

Datacenter string

The datacenter the agent is running in

Id string

The provider-assigned unique ID for this managed resource.

NodeId string

The ID of the node the agent is running on

NodeName string

The name of the node the agent is running on

Revision string

The first 9 characters of the VCS revision of the build of Consul that is running

Server bool

Boolean if the agent is a server or not

Version string

The version of the build of Consul that is running

Datacenter string

The datacenter the agent is running in

Id string

The provider-assigned unique ID for this managed resource.

NodeId string

The ID of the node the agent is running on

NodeName string

The name of the node the agent is running on

Revision string

The first 9 characters of the VCS revision of the build of Consul that is running

Server bool

Boolean if the agent is a server or not

Version string

The version of the build of Consul that is running

datacenter string

The datacenter the agent is running in

id string

The provider-assigned unique ID for this managed resource.

nodeId string

The ID of the node the agent is running on

nodeName string

The name of the node the agent is running on

revision string

The first 9 characters of the VCS revision of the build of Consul that is running

server boolean

Boolean if the agent is a server or not

version string

The version of the build of Consul that is running

datacenter str

The datacenter the agent is running in

id str

The provider-assigned unique ID for this managed resource.

node_id str

The ID of the node the agent is running on

node_name str

The name of the node the agent is running on

revision str

The first 9 characters of the VCS revision of the build of Consul that is running

server bool

Boolean if the agent is a server or not

version str

The version of the build of Consul that is running

Package Details

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