astra.Token
Explore with Pulumi AI
astra.Token
resource represents a token with a specific role assigned.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Astra = Pulumiverse.Astra;
return await Deployment.RunAsync(() =>
{
var example = new Astra.Token("example", new()
{
Roles = new[]
{
"a8cd363d-5069-4a2b-86d8-0578139812ac",
},
});
});
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-astra/sdk/go/astra"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := astra.NewToken(ctx, "example", &astra.TokenArgs{
Roles: pulumi.StringArray{
pulumi.String("a8cd363d-5069-4a2b-86d8-0578139812ac"),
},
})
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.astra.Token;
import com.pulumi.astra.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()
.roles("a8cd363d-5069-4a2b-86d8-0578139812ac")
.build());
}
}
import pulumi
import pulumiverse_astra as astra
example = astra.Token("example", roles=["a8cd363d-5069-4a2b-86d8-0578139812ac"])
import * as pulumi from "@pulumi/pulumi";
import * as astra from "@pulumi/astra";
const example = new astra.Token("example", {
roles: ["a8cd363d-5069-4a2b-86d8-0578139812ac"],
});
resources:
example:
type: astra:Token
properties:
roles:
- a8cd363d-5069-4a2b-86d8-0578139812ac
Create Token Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Token(name: string, args: TokenArgs, opts?: CustomResourceOptions);
@overload
def Token(resource_name: str,
args: TokenArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Token(resource_name: str,
opts: Optional[ResourceOptions] = None,
roles: Optional[Sequence[str]] = None)
func NewToken(ctx *Context, name string, args TokenArgs, opts ...ResourceOption) (*Token, error)
public Token(string name, TokenArgs args, CustomResourceOptions? opts = null)
type: astra:Token
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
- args TokenArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control 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.
- name String
- The unique name of the resource.
- args TokenArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var tokenResource = new Astra.Token("tokenResource", new()
{
Roles = new[]
{
"string",
},
});
example, err := astra.NewToken(ctx, "tokenResource", &astra.TokenArgs{
Roles: pulumi.StringArray{
pulumi.String("string"),
},
})
var tokenResource = new Token("tokenResource", TokenArgs.builder()
.roles("string")
.build());
token_resource = astra.Token("tokenResource", roles=["string"])
const tokenResource = new astra.Token("tokenResource", {roles: ["string"]});
type: astra:Token
properties:
roles:
- string
Token Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Token resource accepts the following input properties:
- Roles List<string>
- List of Role IDs to be assigned to the generated token
- Roles []string
- List of Role IDs to be assigned to the generated token
- roles List<String>
- List of Role IDs to be assigned to the generated token
- roles string[]
- List of Role IDs to be assigned to the generated token
- roles Sequence[str]
- List of Role IDs to be assigned to the generated token
- roles List<String>
- List of Role IDs to be assigned to the generated token
Outputs
All input properties are implicitly available as output properties. Additionally, the Token resource produces the following output properties:
- Astra
Token string - Token, use as auth bearer for API calls or as password in combination with the word
token
in cql - Client
Id string - Client id, use as username in cql to connect
- Id string
- The provider-assigned unique ID for this managed resource.
- Secret string
- Secret, use as password in cql to connect
Look up 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_id: Optional[str] = None,
roles: Optional[Sequence[str]] = None,
secret: Optional[str] = None,
token: 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)
public static Token get(String name, Output<String> id, TokenState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Astra
Token string - Token, use as auth bearer for API calls or as password in combination with the word
token
in cql - Client
Id string - Client id, use as username in cql to connect
- Roles List<string>
- List of Role IDs to be assigned to the generated token
- Secret string
- Secret, use as password in cql to connect
Import
$ pulumi import astra:index/token:Token example client-secret
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- astra pulumiverse/pulumi-astra
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
astra
Terraform Provider.