TokenArgs

data class TokenArgs(val displayName: Output<String>? = null, val explicitMaxTtl: Output<String>? = null, val metadata: Output<Map<String, String>>? = null, val namespace: Output<String>? = null, val noDefaultPolicy: Output<Boolean>? = null, val noParent: Output<Boolean>? = null, val numUses: Output<Int>? = null, val period: Output<String>? = null, val policies: Output<List<String>>? = null, val renewIncrement: Output<Int>? = null, val renewMinLease: Output<Int>? = null, val renewable: Output<Boolean>? = null, val roleName: Output<String>? = null, val ttl: Output<String>? = null, val wrappingTtl: Output<String>? = null) : ConvertibleToJava<TokenArgs>

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>

Constructors

Link copied to clipboard
constructor(displayName: Output<String>? = null, explicitMaxTtl: Output<String>? = null, metadata: Output<Map<String, String>>? = null, namespace: Output<String>? = null, noDefaultPolicy: Output<Boolean>? = null, noParent: Output<Boolean>? = null, numUses: Output<Int>? = null, period: Output<String>? = null, policies: Output<List<String>>? = null, renewIncrement: Output<Int>? = null, renewMinLease: Output<Int>? = null, renewable: Output<Boolean>? = null, roleName: Output<String>? = null, ttl: Output<String>? = null, wrappingTtl: Output<String>? = null)

Properties

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

String containing the token display name

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

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 metadata: Output<Map<String, String>>? = null

Metadata to be set on this token

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

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>? = null

Flag to not attach the default policy to this token

Link copied to clipboard
val noParent: Output<Boolean>? = null

Flag to create a token without parent

Link copied to clipboard
val numUses: Output<Int>? = null

The number of allowed uses of this token

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

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>>? = null

List of policies to attach to this token

Link copied to clipboard
val renewable: Output<Boolean>? = null

Flag to allow to renew this token

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

The renew increment. This is specified in seconds

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

The minimal lease to renew this token

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

The token role name

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

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

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

The TTL period of the wrapped token.

Functions

Link copied to clipboard
open override fun toJava(): TokenArgs