HashiCorp Consul

v3.7.0 published on Wednesday, Oct 12, 2022 by Pulumi

getAclTokenSecretId

Example Usage

using Pulumi;
using Consul = Pulumi.Consul;

class MyStack : Stack
{
    public MyStack()
    {
        var testAclPolicy = new Consul.AclPolicy("testAclPolicy", new Consul.AclPolicyArgs
        {
            Rules = "node \"\" { policy = \"read\" }",
            Datacenters = 
            {
                "dc1",
            },
        });
        var testAclToken = new Consul.AclToken("testAclToken", new Consul.AclTokenArgs
        {
            Description = "test",
            Policies = 
            {
                testAclPolicy.Name,
            },
            Local = true,
        });
        var read = Consul.GetAclTokenSecretId.Invoke(new Consul.GetAclTokenSecretIdInvokeArgs
        {
            AccessorId = testAclToken.Id,
            PgpKey = "keybase:my_username",
        });
        this.ConsulAclTokenSecretId = read.Apply(read => read.EncryptedSecretId);
    }

    [Output("consulAclTokenSecretId")]
    public Output<string> ConsulAclTokenSecretId { get; set; }
}
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 {
		testAclPolicy, err := consul.NewAclPolicy(ctx, "testAclPolicy", &consul.AclPolicyArgs{
			Rules: pulumi.String("node \"\" { policy = \"read\" }"),
			Datacenters: pulumi.StringArray{
				pulumi.String("dc1"),
			},
		})
		if err != nil {
			return err
		}
		testAclToken, err := consul.NewAclToken(ctx, "testAclToken", &consul.AclTokenArgs{
			Description: pulumi.String("test"),
			Policies: pulumi.StringArray{
				testAclPolicy.Name,
			},
			Local: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		read := consul.GetAclTokenSecretIdOutput(ctx, GetAclTokenSecretIdOutputArgs{
			AccessorId: testAclToken.ID(),
			PgpKey:     pulumi.String("keybase:my_username"),
		}, nil)
		ctx.Export("consulAclTokenSecretId", read.ApplyT(func(read GetAclTokenSecretIdResult) (string, error) {
			return read.EncryptedSecretId, nil
		}).(pulumi.StringOutput))
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_consul as consul

test_acl_policy = consul.AclPolicy("testAclPolicy",
    rules="node \"\" { policy = \"read\" }",
    datacenters=["dc1"])
test_acl_token = consul.AclToken("testAclToken",
    description="test",
    policies=[test_acl_policy.name],
    local=True)
read = consul.get_acl_token_secret_id_output(accessor_id=test_acl_token.id,
    pgp_key="keybase:my_username")
pulumi.export("consulAclTokenSecretId", read.encrypted_secret_id)
import * as pulumi from "@pulumi/pulumi";
import * as consul from "@pulumi/consul";

const testAclPolicy = new consul.AclPolicy("testAclPolicy", {
    rules: "node \"\" { policy = \"read\" }",
    datacenters: ["dc1"],
});
const testAclToken = new consul.AclToken("testAclToken", {
    description: "test",
    policies: [testAclPolicy.name],
    local: true,
});
const read = consul.getAclTokenSecretIdOutput({
    accessorId: testAclToken.id,
    pgpKey: "keybase:my_username",
});
export const consulAclTokenSecretId = read.apply(read => read.encryptedSecretId);

Coming soon!

Using getAclTokenSecretId

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 getAclTokenSecretId(args: GetAclTokenSecretIdArgs, opts?: InvokeOptions): Promise<GetAclTokenSecretIdResult>
function getAclTokenSecretIdOutput(args: GetAclTokenSecretIdOutputArgs, opts?: InvokeOptions): Output<GetAclTokenSecretIdResult>
def get_acl_token_secret_id(accessor_id: Optional[str] = None,
                            namespace: Optional[str] = None,
                            partition: Optional[str] = None,
                            pgp_key: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetAclTokenSecretIdResult
def get_acl_token_secret_id_output(accessor_id: Optional[pulumi.Input[str]] = None,
                            namespace: Optional[pulumi.Input[str]] = None,
                            partition: Optional[pulumi.Input[str]] = None,
                            pgp_key: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetAclTokenSecretIdResult]
func GetAclTokenSecretId(ctx *Context, args *GetAclTokenSecretIdArgs, opts ...InvokeOption) (*GetAclTokenSecretIdResult, error)
func GetAclTokenSecretIdOutput(ctx *Context, args *GetAclTokenSecretIdOutputArgs, opts ...InvokeOption) GetAclTokenSecretIdResultOutput

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

public static class GetAclTokenSecretId 
{
    public static Task<GetAclTokenSecretIdResult> InvokeAsync(GetAclTokenSecretIdArgs args, InvokeOptions? opts = null)
    public static Output<GetAclTokenSecretIdResult> Invoke(GetAclTokenSecretIdInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAclTokenSecretIdResult> getAclTokenSecretId(GetAclTokenSecretIdArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: consul:index/getAclTokenSecretId:getAclTokenSecretId
  arguments:
    # arguments dictionary

The following arguments are supported:

AccessorId string

The accessor ID of the ACL token.

Namespace string

The namespace to lookup the token.

Partition string

The partition to lookup the token.

PgpKey string
AccessorId string

The accessor ID of the ACL token.

Namespace string

The namespace to lookup the token.

Partition string

The partition to lookup the token.

PgpKey string
accessorId String

The accessor ID of the ACL token.

namespace String

The namespace to lookup the token.

partition String

The partition to lookup the token.

pgpKey String
accessorId string

The accessor ID of the ACL token.

namespace string

The namespace to lookup the token.

partition string

The partition to lookup the token.

pgpKey string
accessor_id str

The accessor ID of the ACL token.

namespace str

The namespace to lookup the token.

partition str

The partition to lookup the token.

pgp_key str
accessorId String

The accessor ID of the ACL token.

namespace String

The namespace to lookup the token.

partition String

The partition to lookup the token.

pgpKey String

getAclTokenSecretId Result

The following output properties are available:

AccessorId string
EncryptedSecretId string
Id string

The provider-assigned unique ID for this managed resource.

SecretId string

The secret ID of the ACL token if pgp_key has not been set.

Namespace string
Partition string
PgpKey string
AccessorId string
EncryptedSecretId string
Id string

The provider-assigned unique ID for this managed resource.

SecretId string

The secret ID of the ACL token if pgp_key has not been set.

Namespace string
Partition string
PgpKey string
accessorId String
encryptedSecretId String
id String

The provider-assigned unique ID for this managed resource.

secretId String

The secret ID of the ACL token if pgp_key has not been set.

namespace String
partition String
pgpKey String
accessorId string
encryptedSecretId string
id string

The provider-assigned unique ID for this managed resource.

secretId string

The secret ID of the ACL token if pgp_key has not been set.

namespace string
partition string
pgpKey string
accessor_id str
encrypted_secret_id str
id str

The provider-assigned unique ID for this managed resource.

secret_id str

The secret ID of the ACL token if pgp_key has not been set.

namespace str
partition str
pgp_key str
accessorId String
encryptedSecretId String
id String

The provider-assigned unique ID for this managed resource.

secretId String

The secret ID of the ACL token if pgp_key has not been set.

namespace String
partition String
pgpKey String

Package Details

Repository
https://github.com/pulumi/pulumi-consul
License
Apache-2.0
Notes

This Pulumi package is based on the consul Terraform Provider.