1. Packages
  2. Consul Provider
  3. API Docs
  4. getAclToken
Consul v3.12.4 published on Wednesday, Feb 12, 2025 by Pulumi

consul.getAclToken

Explore with Pulumi AI

Consul v3.12.4 published on Wednesday, Feb 12, 2025 by Pulumi

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

import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const test = consul.getAclToken({
    accessorId: "00000000-0000-0000-0000-000000000002",
});
export const consulAclPolicies = test.then(test => test.policies);
Copy
import pulumi
import pulumi_consul as consul

test = consul.get_acl_token(accessor_id="00000000-0000-0000-0000-000000000002")
pulumi.export("consulAclPolicies", test.policies)
Copy
package main

import (
	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
	"github.com/pulumi/pulumi/sdk/v3/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
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Consul = Pulumi.Consul;

return await Deployment.RunAsync(() => 
{
    var test = Consul.GetAclToken.Invoke(new()
    {
        AccessorId = "00000000-0000-0000-0000-000000000002",
    });

    return new Dictionary<string, object?>
    {
        ["consulAclPolicies"] = test.Apply(getAclTokenResult => getAclTokenResult.Policies),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.consul.ConsulFunctions;
import com.pulumi.consul.inputs.GetAclTokenArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var test = ConsulFunctions.getAclToken(GetAclTokenArgs.builder()
            .accessorId("00000000-0000-0000-0000-000000000002")
            .build());

        ctx.export("consulAclPolicies", test.applyValue(getAclTokenResult -> getAclTokenResult.policies()));
    }
}
Copy
variables:
  test:
    fn::invoke:
      function: consul:getAclToken
      arguments:
        accessorId: 00000000-0000-0000-0000-000000000002
outputs:
  consulAclPolicies: ${test.policies}
Copy

Using getAclToken

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAclToken(args: GetAclTokenArgs, opts?: InvokeOptions): Promise<GetAclTokenResult>
function getAclTokenOutput(args: GetAclTokenOutputArgs, opts?: InvokeOptions): Output<GetAclTokenResult>
Copy
def get_acl_token(accessor_id: Optional[str] = None,
                  namespace: Optional[str] = None,
                  partition: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetAclTokenResult
def get_acl_token_output(accessor_id: Optional[pulumi.Input[str]] = None,
                  namespace: Optional[pulumi.Input[str]] = None,
                  partition: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetAclTokenResult]
Copy
func LookupAclToken(ctx *Context, args *LookupAclTokenArgs, opts ...InvokeOption) (*LookupAclTokenResult, error)
func LookupAclTokenOutput(ctx *Context, args *LookupAclTokenOutputArgs, opts ...InvokeOption) LookupAclTokenResultOutput
Copy

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

public static class GetAclToken 
{
    public static Task<GetAclTokenResult> InvokeAsync(GetAclTokenArgs args, InvokeOptions? opts = null)
    public static Output<GetAclTokenResult> Invoke(GetAclTokenInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAclTokenResult> getAclToken(GetAclTokenArgs args, InvokeOptions options)
public static Output<GetAclTokenResult> getAclToken(GetAclTokenArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: consul:index/getAclToken:getAclToken
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AccessorId This property is required. string
The accessor ID of the ACL token.
Namespace string
The namespace to lookup the ACL token.
Partition string
The partition to lookup the ACL token.
AccessorId This property is required. string
The accessor ID of the ACL token.
Namespace string
The namespace to lookup the ACL token.
Partition string
The partition to lookup the ACL token.
accessorId This property is required. String
The accessor ID of the ACL token.
namespace String
The namespace to lookup the ACL token.
partition String
The partition to lookup the ACL token.
accessorId This property is required. string
The accessor ID of the ACL token.
namespace string
The namespace to lookup the ACL token.
partition string
The partition to lookup the ACL token.
accessor_id This property is required. str
The accessor ID of the ACL token.
namespace str
The namespace to lookup the ACL token.
partition str
The partition to lookup the ACL token.
accessorId This property is required. String
The accessor ID of the ACL token.
namespace String
The namespace to lookup the ACL token.
partition String
The partition to lookup the ACL token.

getAclToken Result

The following output properties are available:

AccessorId string
The accessor ID of the ACL token.
Description string
The description of the ACL token.
ExpirationTime string
If set this represents the point after which a token should be considered revoked and is eligible for destruction.
Id string
The provider-assigned unique ID for this managed resource.
Local bool
Whether the ACL token is local to the datacenter it was created within.
NodeIdentities List<GetAclTokenNodeIdentity>
The list of node identities attached to the token.
Policies List<GetAclTokenPolicy>
A list of policies associated with the ACL token.
Roles List<GetAclTokenRole>
List of roles linked to the token
ServiceIdentities List<GetAclTokenServiceIdentity>
The list of service identities attached to the token.
TemplatedPolicies List<GetAclTokenTemplatedPolicy>
The list of templated policies that should be applied to the token.
Namespace string
The namespace to lookup the ACL token.
Partition string
The partition to lookup the ACL token.
AccessorId string
The accessor ID of the ACL token.
Description string
The description of the ACL token.
ExpirationTime string
If set this represents the point after which a token should be considered revoked and is eligible for destruction.
Id string
The provider-assigned unique ID for this managed resource.
Local bool
Whether the ACL token is local to the datacenter it was created within.
NodeIdentities []GetAclTokenNodeIdentity
The list of node identities attached to the token.
Policies []GetAclTokenPolicy
A list of policies associated with the ACL token.
Roles []GetAclTokenRole
List of roles linked to the token
ServiceIdentities []GetAclTokenServiceIdentity
The list of service identities attached to the token.
TemplatedPolicies []GetAclTokenTemplatedPolicy
The list of templated policies that should be applied to the token.
Namespace string
The namespace to lookup the ACL token.
Partition string
The partition to lookup the ACL token.
accessorId String
The accessor ID of the ACL token.
description String
The description of the ACL token.
expirationTime String
If set this represents the point after which a token should be considered revoked and is eligible for destruction.
id String
The provider-assigned unique ID for this managed resource.
local Boolean
Whether the ACL token is local to the datacenter it was created within.
nodeIdentities List<GetAclTokenNodeIdentity>
The list of node identities attached to the token.
policies List<GetAclTokenPolicy>
A list of policies associated with the ACL token.
roles List<GetAclTokenRole>
List of roles linked to the token
serviceIdentities List<GetAclTokenServiceIdentity>
The list of service identities attached to the token.
templatedPolicies List<GetAclTokenTemplatedPolicy>
The list of templated policies that should be applied to the token.
namespace String
The namespace to lookup the ACL token.
partition String
The partition to lookup the ACL token.
accessorId string
The accessor ID of the ACL token.
description string
The description of the ACL token.
expirationTime string
If set this represents the point after which a token should be considered revoked and is eligible for destruction.
id string
The provider-assigned unique ID for this managed resource.
local boolean
Whether the ACL token is local to the datacenter it was created within.
nodeIdentities GetAclTokenNodeIdentity[]
The list of node identities attached to the token.
policies GetAclTokenPolicy[]
A list of policies associated with the ACL token.
roles GetAclTokenRole[]
List of roles linked to the token
serviceIdentities GetAclTokenServiceIdentity[]
The list of service identities attached to the token.
templatedPolicies GetAclTokenTemplatedPolicy[]
The list of templated policies that should be applied to the token.
namespace string
The namespace to lookup the ACL token.
partition string
The partition to lookup the ACL token.
accessor_id str
The accessor ID of the ACL token.
description str
The description of the ACL token.
expiration_time str
If set this represents the point after which a token should be considered revoked and is eligible for destruction.
id str
The provider-assigned unique ID for this managed resource.
local bool
Whether the ACL token is local to the datacenter it was created within.
node_identities Sequence[GetAclTokenNodeIdentity]
The list of node identities attached to the token.
policies Sequence[GetAclTokenPolicy]
A list of policies associated with the ACL token.
roles Sequence[GetAclTokenRole]
List of roles linked to the token
service_identities Sequence[GetAclTokenServiceIdentity]
The list of service identities attached to the token.
templated_policies Sequence[GetAclTokenTemplatedPolicy]
The list of templated policies that should be applied to the token.
namespace str
The namespace to lookup the ACL token.
partition str
The partition to lookup the ACL token.
accessorId String
The accessor ID of the ACL token.
description String
The description of the ACL token.
expirationTime String
If set this represents the point after which a token should be considered revoked and is eligible for destruction.
id String
The provider-assigned unique ID for this managed resource.
local Boolean
Whether the ACL token is local to the datacenter it was created within.
nodeIdentities List<Property Map>
The list of node identities attached to the token.
policies List<Property Map>
A list of policies associated with the ACL token.
roles List<Property Map>
List of roles linked to the token
serviceIdentities List<Property Map>
The list of service identities attached to the token.
templatedPolicies List<Property Map>
The list of templated policies that should be applied to the token.
namespace String
The namespace to lookup the ACL token.
partition String
The partition to lookup the ACL token.

Supporting Types

GetAclTokenNodeIdentity

Datacenter This property is required. string
Specifies the node's datacenter.
NodeName This property is required. string
The list of node identities that should be applied to the token.
Datacenter This property is required. string
Specifies the node's datacenter.
NodeName This property is required. string
The list of node identities that should be applied to the token.
datacenter This property is required. String
Specifies the node's datacenter.
nodeName This property is required. String
The list of node identities that should be applied to the token.
datacenter This property is required. string
Specifies the node's datacenter.
nodeName This property is required. string
The list of node identities that should be applied to the token.
datacenter This property is required. str
Specifies the node's datacenter.
node_name This property is required. str
The list of node identities that should be applied to the token.
datacenter This property is required. String
Specifies the node's datacenter.
nodeName This property is required. String
The list of node identities that should be applied to the token.

GetAclTokenPolicy

Id This property is required. string
Name This property is required. string
Id This property is required. string
Name This property is required. string
id This property is required. String
name This property is required. String
id This property is required. string
name This property is required. string
id This property is required. str
name This property is required. str
id This property is required. String
name This property is required. String

GetAclTokenRole

Id This property is required. string
Name This property is required. string
Id This property is required. string
Name This property is required. string
id This property is required. String
name This property is required. String
id This property is required. string
name This property is required. string
id This property is required. str
name This property is required. str
id This property is required. String
name This property is required. String

GetAclTokenServiceIdentity

Datacenters This property is required. List<string>
Specifies the datacenters the effective policy is valid within.
ServiceName This property is required. string
The name of the service.
Datacenters This property is required. []string
Specifies the datacenters the effective policy is valid within.
ServiceName This property is required. string
The name of the service.
datacenters This property is required. List<String>
Specifies the datacenters the effective policy is valid within.
serviceName This property is required. String
The name of the service.
datacenters This property is required. string[]
Specifies the datacenters the effective policy is valid within.
serviceName This property is required. string
The name of the service.
datacenters This property is required. Sequence[str]
Specifies the datacenters the effective policy is valid within.
service_name This property is required. str
The name of the service.
datacenters This property is required. List<String>
Specifies the datacenters the effective policy is valid within.
serviceName This property is required. String
The name of the service.

GetAclTokenTemplatedPolicy

Datacenters This property is required. List<string>
Specifies the datacenters the effective policy is valid within.
TemplateName This property is required. string
The name of the templated policies.
TemplateVariables This property is required. List<GetAclTokenTemplatedPolicyTemplateVariable>
The templated policy variables.
Datacenters This property is required. []string
Specifies the datacenters the effective policy is valid within.
TemplateName This property is required. string
The name of the templated policies.
TemplateVariables This property is required. []GetAclTokenTemplatedPolicyTemplateVariable
The templated policy variables.
datacenters This property is required. List<String>
Specifies the datacenters the effective policy is valid within.
templateName This property is required. String
The name of the templated policies.
templateVariables This property is required. List<GetAclTokenTemplatedPolicyTemplateVariable>
The templated policy variables.
datacenters This property is required. string[]
Specifies the datacenters the effective policy is valid within.
templateName This property is required. string
The name of the templated policies.
templateVariables This property is required. GetAclTokenTemplatedPolicyTemplateVariable[]
The templated policy variables.
datacenters This property is required. Sequence[str]
Specifies the datacenters the effective policy is valid within.
template_name This property is required. str
The name of the templated policies.
template_variables This property is required. Sequence[GetAclTokenTemplatedPolicyTemplateVariable]
The templated policy variables.
datacenters This property is required. List<String>
Specifies the datacenters the effective policy is valid within.
templateName This property is required. String
The name of the templated policies.
templateVariables This property is required. List<Property Map>
The templated policy variables.

GetAclTokenTemplatedPolicyTemplateVariable

Name This property is required. string
The name of node, workload identity or service.
Name This property is required. string
The name of node, workload identity or service.
name This property is required. String
The name of node, workload identity or service.
name This property is required. string
The name of node, workload identity or service.
name This property is required. str
The name of node, workload identity or service.
name This property is required. String
The name of node, workload identity or service.

Package Details

Repository
HashiCorp Consul pulumi/pulumi-consul
License
Apache-2.0
Notes
This Pulumi package is based on the consul Terraform Provider.
Consul v3.12.4 published on Wednesday, Feb 12, 2025 by Pulumi