UNPKG

@pulumi/nomad

Version:

A Pulumi package for creating and managing nomad cloud resources.

243 lines (242 loc) 8.45 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * ## Example Usage * * Creating a token with limited policies: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * const dakota = new nomad.AclToken("dakota", { * name: "Dakota", * type: "client", * policies: [ * "dev", * "qa", * ], * }); * ``` * * Creating a global token that will be replicated to all regions: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * const dakota = new nomad.AclToken("dakota", { * name: "Dakota", * type: "client", * policies: [ * "dev", * "qa", * ], * global: true, * }); * ``` * * Creating a token with full access to the cluster: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * const iman = new nomad.AclToken("iman", { * name: "Iman", * type: "management", * }); * ``` * * Accessing the token: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as nomad from "@pulumi/nomad"; * * const token = new nomad.AclToken("token", { * type: "client", * policies: ["dev"], * }); * export const nomadToken = token.secretId; * ``` */ export declare class AclToken extends pulumi.CustomResource { /** * Get an existing AclToken resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AclTokenState, opts?: pulumi.CustomResourceOptions): AclToken; /** * Returns true if the given object is an instance of AclToken. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is AclToken; /** * `(string)` - A non-sensitive identifier for this token that * can be logged and shared safely without granting any access to the cluster. */ readonly accessorId: pulumi.Output<string>; /** * `(string)` - The timestamp the token was created. */ readonly createTime: pulumi.Output<string>; /** * `(string)` - The timestamp after which the token is * considered expired and eligible for destruction. */ readonly expirationTime: pulumi.Output<string>; /** * `(string: "")` - Provides a TTL for the token in the form of * a time duration such as `"5m"` or `"1h"`. * * In addition to the above arguments, the following attributes are exported and * can be referenced: */ readonly expirationTtl: pulumi.Output<string | undefined>; /** * `(bool: false)` - Whether the token should be replicated to all * regions, or if it will only be used in the region it was created in. */ readonly global: pulumi.Output<boolean | undefined>; /** * `(string: "")` - A human-friendly name for this token. */ readonly name: pulumi.Output<string>; /** * `(set: [])` - A set of policy names to associate with this * token. Must be set on `client`-type tokens, must not be set on * `management`-type tokens. Policies do not need to exist before being * used here. */ readonly policies: pulumi.Output<string[] | undefined>; /** * `(set: [])` - The list of roles attached to the token. Each entry has * `name` and `id` attributes. It may be used multiple times. */ readonly roles: pulumi.Output<outputs.AclTokenRole[] | undefined>; /** * `(string)` - The token value itself, which is presented for * access to the cluster. */ readonly secretId: pulumi.Output<string>; /** * `(string: <required>)` - The type of token this is. Use `client` * for tokens that will have policies associated with them. Use `management` * for tokens that can perform any action. */ readonly type: pulumi.Output<string>; /** * Create a AclToken resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: AclTokenArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AclToken resources. */ export interface AclTokenState { /** * `(string)` - A non-sensitive identifier for this token that * can be logged and shared safely without granting any access to the cluster. */ accessorId?: pulumi.Input<string>; /** * `(string)` - The timestamp the token was created. */ createTime?: pulumi.Input<string>; /** * `(string)` - The timestamp after which the token is * considered expired and eligible for destruction. */ expirationTime?: pulumi.Input<string>; /** * `(string: "")` - Provides a TTL for the token in the form of * a time duration such as `"5m"` or `"1h"`. * * In addition to the above arguments, the following attributes are exported and * can be referenced: */ expirationTtl?: pulumi.Input<string>; /** * `(bool: false)` - Whether the token should be replicated to all * regions, or if it will only be used in the region it was created in. */ global?: pulumi.Input<boolean>; /** * `(string: "")` - A human-friendly name for this token. */ name?: pulumi.Input<string>; /** * `(set: [])` - A set of policy names to associate with this * token. Must be set on `client`-type tokens, must not be set on * `management`-type tokens. Policies do not need to exist before being * used here. */ policies?: pulumi.Input<pulumi.Input<string>[]>; /** * `(set: [])` - The list of roles attached to the token. Each entry has * `name` and `id` attributes. It may be used multiple times. */ roles?: pulumi.Input<pulumi.Input<inputs.AclTokenRole>[]>; /** * `(string)` - The token value itself, which is presented for * access to the cluster. */ secretId?: pulumi.Input<string>; /** * `(string: <required>)` - The type of token this is. Use `client` * for tokens that will have policies associated with them. Use `management` * for tokens that can perform any action. */ type?: pulumi.Input<string>; } /** * The set of arguments for constructing a AclToken resource. */ export interface AclTokenArgs { /** * `(string: "")` - Provides a TTL for the token in the form of * a time duration such as `"5m"` or `"1h"`. * * In addition to the above arguments, the following attributes are exported and * can be referenced: */ expirationTtl?: pulumi.Input<string>; /** * `(bool: false)` - Whether the token should be replicated to all * regions, or if it will only be used in the region it was created in. */ global?: pulumi.Input<boolean>; /** * `(string: "")` - A human-friendly name for this token. */ name?: pulumi.Input<string>; /** * `(set: [])` - A set of policy names to associate with this * token. Must be set on `client`-type tokens, must not be set on * `management`-type tokens. Policies do not need to exist before being * used here. */ policies?: pulumi.Input<pulumi.Input<string>[]>; /** * `(set: [])` - The list of roles attached to the token. Each entry has * `name` and `id` attributes. It may be used multiple times. */ roles?: pulumi.Input<pulumi.Input<inputs.AclTokenRole>[]>; /** * `(string: <required>)` - The type of token this is. Use `client` * for tokens that will have policies associated with them. Use `management` * for tokens that can perform any action. */ type: pulumi.Input<string>; }