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

Token

Import

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

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

Create a Token Resource

new Token(name: string, args?: TokenArgs, opts?: CustomResourceOptions);
def Token(resource_name: str, opts: Optional[ResourceOptions] = None, display_name: Optional[str] = None, explicit_max_ttl: Optional[str] = None, no_default_policy: Optional[bool] = None, no_parent: Optional[bool] = None, num_uses: Optional[int] = None, period: Optional[str] = None, pgp_key: Optional[str] = None, policies: Optional[Sequence[str]] = None, renew_increment: Optional[int] = None, renew_min_lease: Optional[int] = None, renewable: Optional[bool] = None, role_name: Optional[str] = None, ttl: Optional[str] = None, wrapping_ttl: Optional[str] = None)
func NewToken(ctx *Context, name string, args *TokenArgs, opts ...ResourceOption) (*Token, error)
public Token(string name, TokenArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args TokenArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args TokenArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TokenArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Token Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Token resource accepts the following input properties:

DisplayName string

String containing the token display name

ExplicitMaxTtl string

The explicit max TTL of this token

NoDefaultPolicy bool

Flag to not attach the default policy to this token

NoParent bool

Flag to create a token without parent

NumUses int

The number of allowed uses of this token

Period string

The period of this token

PgpKey string

The PGP key (base64 encoded) to encrypt the token.

Policies List<string>

List of policies to attach to this token

RenewIncrement int

The renew increment

RenewMinLease int

The minimal lease to renew this token

Renewable bool

Flag to allow to renew this token

RoleName string

The token role name

Ttl string

The TTL period of this token

WrappingTtl string

The TTL period of the wrapped token.

DisplayName string

String containing the token display name

ExplicitMaxTtl string

The explicit max TTL of this token

NoDefaultPolicy bool

Flag to not attach the default policy to this token

NoParent bool

Flag to create a token without parent

NumUses int

The number of allowed uses of this token

Period string

The period of this token

PgpKey string

The PGP key (base64 encoded) to encrypt the token.

Policies []string

List of policies to attach to this token

RenewIncrement int

The renew increment

RenewMinLease int

The minimal lease to renew this token

Renewable bool

Flag to allow to renew this token

RoleName string

The token role name

Ttl string

The TTL period of this token

WrappingTtl string

The TTL period of the wrapped token.

displayName string

String containing the token display name

explicitMaxTtl string

The explicit max TTL of this token

noDefaultPolicy boolean

Flag to not attach the default policy to this token

noParent boolean

Flag to create a token without parent

numUses number

The number of allowed uses of this token

period string

The period of this token

pgpKey string

The PGP key (base64 encoded) to encrypt the token.

policies string[]

List of policies to attach to this token

renewIncrement number

The renew increment

renewMinLease number

The minimal lease to renew this token

renewable boolean

Flag to allow to renew this token

roleName string

The token role name

ttl string

The TTL period of this token

wrappingTtl string

The TTL period of the wrapped token.

display_name str

String containing the token display name

explicit_max_ttl str

The explicit max TTL of this token

no_default_policy bool

Flag to not attach the default policy to this token

no_parent bool

Flag to create a token without parent

num_uses int

The number of allowed uses of this token

period str

The period of this token

pgp_key str

The PGP key (base64 encoded) to encrypt the token.

policies Sequence[str]

List of policies to attach to this token

renew_increment int

The renew increment

renew_min_lease int

The minimal lease to renew this token

renewable bool

Flag to allow to renew this token

role_name str

The token role name

ttl str

The TTL period of this token

wrapping_ttl str

The TTL period of the wrapped token.

Outputs

All input properties are implicitly available as output properties. Additionally, the Token resource produces the following output properties:

ClientToken string

String containing the client token if stored in present file

EncryptedClientToken string

String containing the client token encrypted with the given pgp_key if stored in present file

Id string
The provider-assigned unique ID for this managed resource.
LeaseDuration int

String containing the token lease duration if present in state file

LeaseStarted string

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

WrappedToken string

The client wrapped token.

WrappingAccessor string

The client wrapping accessor.

ClientToken string

String containing the client token if stored in present file

EncryptedClientToken string

String containing the client token encrypted with the given pgp_key if stored in present file

Id string
The provider-assigned unique ID for this managed resource.
LeaseDuration int

String containing the token lease duration if present in state file

LeaseStarted string

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

WrappedToken string

The client wrapped token.

WrappingAccessor string

The client wrapping accessor.

clientToken string

String containing the client token if stored in present file

encryptedClientToken string

String containing the client token encrypted with the given pgp_key if stored in present file

id string
The provider-assigned unique ID for this managed resource.
leaseDuration number

String containing the token lease duration if present in state file

leaseStarted string

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

wrappedToken string

The client wrapped token.

wrappingAccessor string

The client wrapping accessor.

client_token str

String containing the client token if stored in present file

encrypted_client_token str

String containing the client token encrypted with the given pgp_key if stored in present file

id str
The provider-assigned unique ID for this managed resource.
lease_duration int

String containing the token lease duration if present in state file

lease_started str

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

wrapped_token str

The client wrapped token.

wrapping_accessor str

The client wrapping accessor.

Look up an Existing Token Resource

Get an existing Token resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TokenState, opts?: CustomResourceOptions): Token
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, client_token: Optional[str] = None, display_name: Optional[str] = None, encrypted_client_token: Optional[str] = None, explicit_max_ttl: Optional[str] = None, lease_duration: Optional[int] = None, lease_started: Optional[str] = None, no_default_policy: Optional[bool] = None, no_parent: Optional[bool] = None, num_uses: Optional[int] = None, period: Optional[str] = None, pgp_key: Optional[str] = None, policies: Optional[Sequence[str]] = None, renew_increment: Optional[int] = None, renew_min_lease: Optional[int] = None, renewable: Optional[bool] = None, role_name: Optional[str] = None, ttl: Optional[str] = None, wrapped_token: Optional[str] = None, wrapping_accessor: Optional[str] = None, wrapping_ttl: Optional[str] = None) -> Token
func GetToken(ctx *Context, name string, id IDInput, state *TokenState, opts ...ResourceOption) (*Token, error)
public static Token Get(string name, Input<string> id, TokenState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ClientToken string

String containing the client token if stored in present file

DisplayName string

String containing the token display name

EncryptedClientToken string

String containing the client token encrypted with the given pgp_key if stored in present file

ExplicitMaxTtl string

The explicit max TTL of this token

LeaseDuration int

String containing the token lease duration if present in state file

LeaseStarted string

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

NoDefaultPolicy bool

Flag to not attach the default policy to this token

NoParent bool

Flag to create a token without parent

NumUses int

The number of allowed uses of this token

Period string

The period of this token

PgpKey string

The PGP key (base64 encoded) to encrypt the token.

Policies List<string>

List of policies to attach to this token

RenewIncrement int

The renew increment

RenewMinLease int

The minimal lease to renew this token

Renewable bool

Flag to allow to renew this token

RoleName string

The token role name

Ttl string

The TTL period of this token

WrappedToken string

The client wrapped token.

WrappingAccessor string

The client wrapping accessor.

WrappingTtl string

The TTL period of the wrapped token.

ClientToken string

String containing the client token if stored in present file

DisplayName string

String containing the token display name

EncryptedClientToken string

String containing the client token encrypted with the given pgp_key if stored in present file

ExplicitMaxTtl string

The explicit max TTL of this token

LeaseDuration int

String containing the token lease duration if present in state file

LeaseStarted string

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

NoDefaultPolicy bool

Flag to not attach the default policy to this token

NoParent bool

Flag to create a token without parent

NumUses int

The number of allowed uses of this token

Period string

The period of this token

PgpKey string

The PGP key (base64 encoded) to encrypt the token.

Policies []string

List of policies to attach to this token

RenewIncrement int

The renew increment

RenewMinLease int

The minimal lease to renew this token

Renewable bool

Flag to allow to renew this token

RoleName string

The token role name

Ttl string

The TTL period of this token

WrappedToken string

The client wrapped token.

WrappingAccessor string

The client wrapping accessor.

WrappingTtl string

The TTL period of the wrapped token.

clientToken string

String containing the client token if stored in present file

displayName string

String containing the token display name

encryptedClientToken string

String containing the client token encrypted with the given pgp_key if stored in present file

explicitMaxTtl string

The explicit max TTL of this token

leaseDuration number

String containing the token lease duration if present in state file

leaseStarted string

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

noDefaultPolicy boolean

Flag to not attach the default policy to this token

noParent boolean

Flag to create a token without parent

numUses number

The number of allowed uses of this token

period string

The period of this token

pgpKey string

The PGP key (base64 encoded) to encrypt the token.

policies string[]

List of policies to attach to this token

renewIncrement number

The renew increment

renewMinLease number

The minimal lease to renew this token

renewable boolean

Flag to allow to renew this token

roleName string

The token role name

ttl string

The TTL period of this token

wrappedToken string

The client wrapped token.

wrappingAccessor string

The client wrapping accessor.

wrappingTtl string

The TTL period of the wrapped token.

client_token str

String containing the client token if stored in present file

display_name str

String containing the token display name

encrypted_client_token str

String containing the client token encrypted with the given pgp_key if stored in present file

explicit_max_ttl str

The explicit max TTL of this token

lease_duration int

String containing the token lease duration if present in state file

lease_started str

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

no_default_policy bool

Flag to not attach the default policy to this token

no_parent bool

Flag to create a token without parent

num_uses int

The number of allowed uses of this token

period str

The period of this token

pgp_key str

The PGP key (base64 encoded) to encrypt the token.

policies Sequence[str]

List of policies to attach to this token

renew_increment int

The renew increment

renew_min_lease int

The minimal lease to renew this token

renewable bool

Flag to allow to renew this token

role_name str

The token role name

ttl str

The TTL period of this token

wrapped_token str

The client wrapped token.

wrapping_accessor str

The client wrapping accessor.

wrapping_ttl str

The TTL period of the wrapped token.

Package Details

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