Show / Hide Table of Contents

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_id should 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,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Token
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Rancher2
Assembly: Pulumi.Rancher2.dll
Syntax
public class Token : CustomResource

Constructors

View Source

Token(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 Source

AccessKey

(Computed) Token access key part (string)

Declaration
public Output<string> AccessKey { get; }
Property Value
Type Description
Output<System.String>
View Source

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>>
View Source

ClusterId

Cluster ID for scoped token (string)

Declaration
public Output<string> ClusterId { get; }
Property Value
Type Description
Output<System.String>
View Source

Description

Token description (string)

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

Enabled

(Computed) Token is enabled (bool)

Declaration
public Output<bool> Enabled { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

Expired

(Computed) Token is expired (bool)

Declaration
public Output<bool> Expired { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

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>>
View Source

Name

(Computed) Token name (string)

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

Renew

Renew expired or disabled token

Declaration
public Output<bool?> Renew { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

SecretKey

(Computed/Sensitive) Token secret key part (string)

Declaration
public Output<string> SecretKey { get; }
Property Value
Type Description
Output<System.String>
View Source

TokenName

(Computed/Sensitive) Token value (string)

Declaration
public Output<string> TokenName { get; }
Property Value
Type Description
Output<System.String>
View Source

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>>
View Source

UserId

(Computed) Token user ID (string)

Declaration
public Output<string> UserId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(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
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.