@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
122 lines • 6.2 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.Secret = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage kms secret
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.kms.Secret("foo", {
* description: "tf-test",
* secretName: "tf-test1",
* secretType: "Generic",
* secretValue: "{\"dasdasd\":\"dasdasd\"}",
* });
* ```
*
* ## Import
*
* KmsSecret can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:kms/secret:Secret default resource_id
* ```
*/
class Secret extends pulumi.CustomResource {
/**
* Get an existing Secret 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 Secret(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Secret. 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'] === Secret.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["automaticRotation"] = state ? state.automaticRotation : undefined;
resourceInputs["creationDate"] = state ? state.creationDate : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["encryptionKey"] = state ? state.encryptionKey : undefined;
resourceInputs["extendedConfig"] = state ? state.extendedConfig : undefined;
resourceInputs["lastRotationTime"] = state ? state.lastRotationTime : undefined;
resourceInputs["managed"] = state ? state.managed : undefined;
resourceInputs["projectName"] = state ? state.projectName : undefined;
resourceInputs["rotationInterval"] = state ? state.rotationInterval : undefined;
resourceInputs["rotationIntervalSecond"] = state ? state.rotationIntervalSecond : undefined;
resourceInputs["rotationState"] = state ? state.rotationState : undefined;
resourceInputs["scheduleDeleteTime"] = state ? state.scheduleDeleteTime : undefined;
resourceInputs["scheduleRotationTime"] = state ? state.scheduleRotationTime : undefined;
resourceInputs["secretName"] = state ? state.secretName : undefined;
resourceInputs["secretType"] = state ? state.secretType : undefined;
resourceInputs["secretValue"] = state ? state.secretValue : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["trn"] = state ? state.trn : undefined;
resourceInputs["uid"] = state ? state.uid : undefined;
resourceInputs["updateDate"] = state ? state.updateDate : undefined;
resourceInputs["uuid"] = state ? state.uuid : undefined;
}
else {
const args = argsOrState;
if ((!args || args.secretName === undefined) && !opts.urn) {
throw new Error("Missing required property 'secretName'");
}
if ((!args || args.secretType === undefined) && !opts.urn) {
throw new Error("Missing required property 'secretType'");
}
if ((!args || args.secretValue === undefined) && !opts.urn) {
throw new Error("Missing required property 'secretValue'");
}
resourceInputs["automaticRotation"] = args ? args.automaticRotation : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["encryptionKey"] = args ? args.encryptionKey : undefined;
resourceInputs["extendedConfig"] = args ? args.extendedConfig : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["rotationInterval"] = args ? args.rotationInterval : undefined;
resourceInputs["secretName"] = args ? args.secretName : undefined;
resourceInputs["secretType"] = args ? args.secretType : undefined;
resourceInputs["secretValue"] = args ? args.secretValue : undefined;
resourceInputs["creationDate"] = undefined /*out*/;
resourceInputs["lastRotationTime"] = undefined /*out*/;
resourceInputs["managed"] = undefined /*out*/;
resourceInputs["rotationIntervalSecond"] = undefined /*out*/;
resourceInputs["rotationState"] = undefined /*out*/;
resourceInputs["scheduleDeleteTime"] = undefined /*out*/;
resourceInputs["scheduleRotationTime"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["trn"] = undefined /*out*/;
resourceInputs["uid"] = undefined /*out*/;
resourceInputs["updateDate"] = undefined /*out*/;
resourceInputs["uuid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Secret.__pulumiType, name, resourceInputs, opts);
}
}
exports.Secret = Secret;
/** @internal */
Secret.__pulumiType = 'volcengine:kms/secret:Secret';
//# sourceMappingURL=secret.js.map