Class Token
Provides a Rancher v2 Token resource. This can be used to create Tokens for Rancher v2 provider user and retrieve their information.
There are 2 kind of tokens:
- no scoped: valid for global system.
- scoped: valid for just a specific cluster (
cluster_idshould be provided).
Tokens can't be updated once created. Any diff in token data will recreate the token. If any token expire, Rancher2 provider will generate a diff to regenerate it.
Example Usage
using Pulumi;
using Rancher2 = Pulumi.Rancher2;
class MyStack : Stack
{
public MyStack()
{
// Create a new rancher2 Token scoped
var foo = new Rancher2.Token("foo", new Rancher2.TokenArgs
{
ClusterId = "<cluster-id>",
Description = "foo token",
Ttl = 1200,
});
}
}
Inherited Members
Namespace: Pulumi.Rancher2
Assembly: Pulumi.Rancher2.dll
Syntax
public class Token : CustomResource
Constructors
View SourceToken(String, TokenArgs, CustomResourceOptions)
Create a Token resource with the given unique name, arguments, and options.
Declaration
public Token(string name, TokenArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| TokenArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAccessKey
(Computed) Token access key part (string)
Declaration
public Output<string> AccessKey { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Annotations
Annotations of the token (map)
Declaration
public Output<ImmutableDictionary<string, object>> Annotations { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
ClusterId
Cluster ID for scoped token (string)
Declaration
public Output<string> ClusterId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
Token description (string)
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Enabled
(Computed) Token is enabled (bool)
Declaration
public Output<bool> Enabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
Expired
(Computed) Token is expired (bool)
Declaration
public Output<bool> Expired { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
Labels
Labels of the token (map)
Declaration
public Output<ImmutableDictionary<string, object>> Labels { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
Name
(Computed) Token name (string)
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Renew
Renew expired or disabled token
Declaration
public Output<bool?> Renew { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
SecretKey
(Computed/Sensitive) Token secret key part (string)
Declaration
public Output<string> SecretKey { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TokenName
(Computed/Sensitive) Token value (string)
Declaration
public Output<string> TokenName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Ttl
Token time to live in seconds. Default 0 (int)
Declaration
public Output<int?> Ttl { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
UserId
(Computed) Token user ID (string)
Declaration
public Output<string> UserId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, TokenState, CustomResourceOptions)
Get an existing Token resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Token Get(string name, Input<string> id, TokenState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| TokenState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Token |