Token

class Token : KotlinCustomResource

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";
const example = new vault.Token("example", {
roleName: "app",
policies: [
"policy1",
"policy2",
],
renewable: true,
ttl: "24h",
renewMinLease: 43200,
renewIncrement: 86400,
metadata: {
purpose: "service-account",
},
});
import pulumi
import pulumi_vault as vault
example = vault.Token("example",
role_name="app",
policies=[
"policy1",
"policy2",
],
renewable=True,
ttl="24h",
renew_min_lease=43200,
renew_increment=86400,
metadata={
"purpose": "service-account",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;
return await Deployment.RunAsync(() =>
{
var example = new Vault.Token("example", new()
{
RoleName = "app",
Policies = new[]
{
"policy1",
"policy2",
},
Renewable = true,
Ttl = "24h",
RenewMinLease = 43200,
RenewIncrement = 86400,
Metadata =
{
{ "purpose", "service-account" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vault.NewToken(ctx, "example", &vault.TokenArgs{
RoleName: pulumi.String("app"),
Policies: pulumi.StringArray{
pulumi.String("policy1"),
pulumi.String("policy2"),
},
Renewable: pulumi.Bool(true),
Ttl: pulumi.String("24h"),
RenewMinLease: pulumi.Int(43200),
RenewIncrement: pulumi.Int(86400),
Metadata: pulumi.StringMap{
"purpose": pulumi.String("service-account"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vault.Token;
import com.pulumi.vault.TokenArgs;
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) {
var example = new Token("example", TokenArgs.builder()
.roleName("app")
.policies(
"policy1",
"policy2")
.renewable(true)
.ttl("24h")
.renewMinLease(43200)
.renewIncrement(86400)
.metadata(Map.of("purpose", "service-account"))
.build());
}
}
resources:
example:
type: vault:Token
properties:
roleName: app
policies:
- policy1
- policy2
renewable: true
ttl: 24h
renewMinLease: 43200
renewIncrement: 86400
metadata:
purpose: service-account

Import

Tokens can be imported using its id as accessor id, e.g.

$ pulumi import vault:index/token:Token example <accessor_id>

Properties

Link copied to clipboard
val clientToken: Output<String>

String containing the client token if stored in present file

Link copied to clipboard
val displayName: Output<String>?

String containing the token display name

Link copied to clipboard
val explicitMaxTtl: Output<String>?

The explicit max TTL of this token. This is specified as a numeric string with suffix like "30s" ro "5m"

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val leaseDuration: Output<Int>

String containing the token lease duration if present in state file

Link copied to clipboard
val leaseStarted: Output<String>

String containing the token lease started time if present in state file

Link copied to clipboard
val metadata: Output<Map<String, String>>?

Metadata to be set on this token

Link copied to clipboard
val namespace: Output<String>?

The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

Link copied to clipboard
val noDefaultPolicy: Output<Boolean>?

Flag to not attach the default policy to this token

Link copied to clipboard
val noParent: Output<Boolean>

Flag to create a token without parent

Link copied to clipboard
val numUses: Output<Int>

The number of allowed uses of this token

Link copied to clipboard
val period: Output<String>?

The period of this token. This is specified as a numeric string with suffix like "30s" ro "5m"

Link copied to clipboard
val policies: Output<List<String>>?

List of policies to attach to this token

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val renewable: Output<Boolean>

Flag to allow to renew this token

Link copied to clipboard
val renewIncrement: Output<Int>?

The renew increment. This is specified in seconds

Link copied to clipboard
val renewMinLease: Output<Int>?

The minimal lease to renew this token

Link copied to clipboard
val roleName: Output<String>?

The token role name

Link copied to clipboard
val ttl: Output<String>?

The TTL period of this token. This is specified as a numeric string with suffix like "30s" ro "5m"

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val wrappedToken: Output<String>

The client wrapped token.

Link copied to clipboard

The client wrapping accessor.

Link copied to clipboard
val wrappingTtl: Output<String>?

The TTL period of the wrapped token.