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

getAclToken

The consul.AclToken data source returns the information related to the consul.AclToken resource with the exception of its secret ID.

If you want to get the secret ID associated with a token, use the consul.getAclTokenSecretId data source.

Example Usage

using Pulumi;
using Consul = Pulumi.Consul;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(Consul.GetAclToken.InvokeAsync(new Consul.GetAclTokenArgs
        {
            AccessorId = "00000000-0000-0000-0000-000000000002",
        }));
        this.ConsulAclPolicies = test.Apply(test => test.Policies);
    }

    [Output("consulAclPolicies")]
    public Output<string> ConsulAclPolicies { 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 {
        test, err := consul.LookupAclToken(ctx, &consul.LookupAclTokenArgs{
            AccessorId: "00000000-0000-0000-0000-000000000002",
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("consulAclPolicies", test.Policies)
        return nil
    })
}
import pulumi
import pulumi_consul as consul

test = consul.get_acl_token(accessor_id="00000000-0000-0000-0000-000000000002")
pulumi.export("consulAclPolicies", test.policies)
import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const test = pulumi.output(consul.getAclToken({
    accessorId: "00000000-0000-0000-0000-000000000002",
}, { async: true }));

export const consulAclPolicies = test.policies!;

Using getAclToken

function getAclToken(args: GetAclTokenArgs, opts?: InvokeOptions): Promise<GetAclTokenResult>
def get_acl_token(accessor_id: Optional[str] = None, description: Optional[str] = None, local: Optional[bool] = None, namespace: Optional[str] = None, policies: Optional[Sequence[GetAclTokenPolicyArgs]] = None, opts: Optional[InvokeOptions] = None) -> GetAclTokenResult
func LookupAclToken(ctx *Context, args *LookupAclTokenArgs, opts ...InvokeOption) (*LookupAclTokenResult, error)

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

public static class GetAclToken {
    public static Task<GetAclTokenResult> InvokeAsync(GetAclTokenArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

AccessorId string

The accessor ID of the ACL token.

Description string

The description of the ACL token.

Local bool

Whether the ACL token is local to the datacenter it was created within.

Namespace string

The namespace to lookup the ACL token.

Policies List<GetAclTokenPolicyArgs>

A list of policies associated with the ACL token. Each entry has an id and a name attribute.

AccessorId string

The accessor ID of the ACL token.

Description string

The description of the ACL token.

Local bool

Whether the ACL token is local to the datacenter it was created within.

Namespace string

The namespace to lookup the ACL token.

Policies []GetAclTokenPolicy

A list of policies associated with the ACL token. Each entry has an id and a name attribute.

accessorId string

The accessor ID of the ACL token.

description string

The description of the ACL token.

local boolean

Whether the ACL token is local to the datacenter it was created within.

namespace string

The namespace to lookup the ACL token.

policies GetAclTokenPolicy[]

A list of policies associated with the ACL token. Each entry has an id and a name attribute.

accessor_id str

The accessor ID of the ACL token.

description str

The description of the ACL token.

local bool

Whether the ACL token is local to the datacenter it was created within.

namespace str

The namespace to lookup the ACL token.

policies Sequence[GetAclTokenPolicyArgs]

A list of policies associated with the ACL token. Each entry has an id and a name attribute.

getAclToken Result

The following output properties are available:

AccessorId string
Id string

The provider-assigned unique ID for this managed resource.

Description string

The description of the ACL token.

Local bool

Whether the ACL token is local to the datacenter it was created within.

Namespace string
Policies List<GetAclTokenPolicy>

A list of policies associated with the ACL token. Each entry has an id and a name attribute.

AccessorId string
Id string

The provider-assigned unique ID for this managed resource.

Description string

The description of the ACL token.

Local bool

Whether the ACL token is local to the datacenter it was created within.

Namespace string
Policies []GetAclTokenPolicy

A list of policies associated with the ACL token. Each entry has an id and a name attribute.

accessorId string
id string

The provider-assigned unique ID for this managed resource.

description string

The description of the ACL token.

local boolean

Whether the ACL token is local to the datacenter it was created within.

namespace string
policies GetAclTokenPolicy[]

A list of policies associated with the ACL token. Each entry has an id and a name attribute.

accessor_id str
id str

The provider-assigned unique ID for this managed resource.

description str

The description of the ACL token.

local bool

Whether the ACL token is local to the datacenter it was created within.

namespace str
policies Sequence[GetAclTokenPolicy]

A list of policies associated with the ACL token. Each entry has an id and a name attribute.

Supporting Types

GetAclTokenPolicy

Id string
Name string
Id string
Name string
id string
name string
id str
name str

Package Details

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