@mapped/pulumi-astra
Version:
A Pulumi package for creating and managing astra cloud resources.
78 lines • 2.98 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Token = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* `astra.Token` resource represents a token with a specific role assigned.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as astra from "@pulumi/astra";
*
* const example = new astra.Token("example", {
* roles: ["a8cd363d-5069-4a2b-86d8-0578139812ac"],
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import astra:index/token:Token example client-secret
* ```
*/
class Token extends pulumi.CustomResource {
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["clientId"] = state ? state.clientId : undefined;
resourceInputs["roles"] = state ? state.roles : undefined;
resourceInputs["secret"] = state ? state.secret : undefined;
resourceInputs["token"] = state ? state.token : undefined;
}
else {
const args = argsOrState;
if ((!args || args.roles === undefined) && !opts.urn) {
throw new Error("Missing required property 'roles'");
}
resourceInputs["roles"] = args ? args.roles : undefined;
resourceInputs["clientId"] = undefined /*out*/;
resourceInputs["secret"] = undefined /*out*/;
resourceInputs["token"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Token.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing Token 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, id, state, opts) {
return new Token(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Token. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Token.__pulumiType;
}
}
exports.Token = Token;
/** @internal */
Token.__pulumiType = 'astra:index/token:Token';
//# sourceMappingURL=token.js.map