@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
280 lines (279 loc) • 10.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages CSMS(Cloud Secret Management Service) secrets within HuaweiCloud.
*
* ## Example Usage
* ### Encrypt Plaintext
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
*
* const test1 = new huaweicloud.Dew.Secret("test1", {
* secretText: "this is a password",
* });
* ```
* ### Encrypt JSON Data
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const test2 = new huaweicloud.dew.Secret("test2", {secretText: JSON.stringify({
* username: "admin",
* password: "123456",
* })});
* ```
* ### Encrypt String Binary
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const secretBinary = config.requireObject("secretBinary");
* const test3 = new huaweicloud.dew.Secret("test3", {secretBinary: secretBinary});
* ```
*
* ## Import
*
* CSMS secret can be imported using the ID and the name of secret, separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Dew/secret:Secret test <id>/<name>
* ```
*/
export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: SecretState, opts?: pulumi.CustomResourceOptions): Secret;
/**
* 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: any): obj is Secret;
/**
* Time when the CSMS secrets created, in UTC format.
*/
readonly createTime: pulumi.Output<string>;
/**
* Specifies the description of a secret.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Specifies the enterprise project ID to which the secret belongs.
* If omitted, the default enterprise project will be used.
* If the enterprise project function is not enabled, ignore this parameter.
*/
readonly enterpriseProjectId: pulumi.Output<string>;
/**
* Specifies the event list associated with the secret.
* Currently, only one event can be associated.
*/
readonly eventSubscriptions: pulumi.Output<string | undefined>;
/**
* Specifies the expiration time of a secret, `expireTime` can only be edited
* when `status` is **ENABLED**. The time is in the format of timestamp, that is, the offset milliseconds
* from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
*/
readonly expireTime: pulumi.Output<number>;
readonly kmsKeyId: pulumi.Output<string>;
/**
* The latest version id.
*/
readonly latestVersion: pulumi.Output<string>;
/**
* Specifies the secret name. The maximum length is 64 characters.
* Only digits, letters, underscores(_), hyphens(-) and dots(.) are allowed.
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the region in which to create the CSMS secrets.
* If omitted, the provider-level region will be used. Changing this setting will create a new resource.
*/
readonly region: pulumi.Output<string>;
/**
* Specifies the plaintext of a binary secret encoded using Base64. CSMS encrypts
* the plaintext and stores it in the initial version of the secret. The maximum size is 32 KB.
*/
readonly secretBinary: pulumi.Output<string | undefined>;
/**
* The secret ID in UUID format.
*/
readonly secretId: pulumi.Output<string>;
/**
* Specifies the plaintext of a text secret. CSMS encrypts the plaintext and stores
* it in the initial version of the secret. The maximum size is 32 KB.
*/
readonly secretText: pulumi.Output<string | undefined>;
/**
* Specifies the type of the secret.
* Currently, only supported **COMMON**. The default value is **COMMON**.
*/
readonly secretType: pulumi.Output<string>;
/**
* The CSMS secret status. Values can be: **ENABLED**, **DISABLED**, **PENDING_DELETE** and **FROZEN**.
*/
readonly status: pulumi.Output<string>;
/**
* Specifies the tags of a CSMS secrets, key/value pair format.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The secret version status list.
*/
readonly versionStages: pulumi.Output<string[]>;
/**
* Create a Secret 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?: SecretArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Secret resources.
*/
export interface SecretState {
/**
* Time when the CSMS secrets created, in UTC format.
*/
createTime?: pulumi.Input<string>;
/**
* Specifies the description of a secret.
*/
description?: pulumi.Input<string>;
/**
* Specifies the enterprise project ID to which the secret belongs.
* If omitted, the default enterprise project will be used.
* If the enterprise project function is not enabled, ignore this parameter.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies the event list associated with the secret.
* Currently, only one event can be associated.
*/
eventSubscriptions?: pulumi.Input<string>;
/**
* Specifies the expiration time of a secret, `expireTime` can only be edited
* when `status` is **ENABLED**. The time is in the format of timestamp, that is, the offset milliseconds
* from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
*/
expireTime?: pulumi.Input<number>;
kmsKeyId?: pulumi.Input<string>;
/**
* The latest version id.
*/
latestVersion?: pulumi.Input<string>;
/**
* Specifies the secret name. The maximum length is 64 characters.
* Only digits, letters, underscores(_), hyphens(-) and dots(.) are allowed.
*/
name?: pulumi.Input<string>;
/**
* Specifies the region in which to create the CSMS secrets.
* If omitted, the provider-level region will be used. Changing this setting will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the plaintext of a binary secret encoded using Base64. CSMS encrypts
* the plaintext and stores it in the initial version of the secret. The maximum size is 32 KB.
*/
secretBinary?: pulumi.Input<string>;
/**
* The secret ID in UUID format.
*/
secretId?: pulumi.Input<string>;
/**
* Specifies the plaintext of a text secret. CSMS encrypts the plaintext and stores
* it in the initial version of the secret. The maximum size is 32 KB.
*/
secretText?: pulumi.Input<string>;
/**
* Specifies the type of the secret.
* Currently, only supported **COMMON**. The default value is **COMMON**.
*/
secretType?: pulumi.Input<string>;
/**
* The CSMS secret status. Values can be: **ENABLED**, **DISABLED**, **PENDING_DELETE** and **FROZEN**.
*/
status?: pulumi.Input<string>;
/**
* Specifies the tags of a CSMS secrets, key/value pair format.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The secret version status list.
*/
versionStages?: pulumi.Input<pulumi.Input<string>[]>;
}
/**
* The set of arguments for constructing a Secret resource.
*/
export interface SecretArgs {
/**
* Specifies the description of a secret.
*/
description?: pulumi.Input<string>;
/**
* Specifies the enterprise project ID to which the secret belongs.
* If omitted, the default enterprise project will be used.
* If the enterprise project function is not enabled, ignore this parameter.
*/
enterpriseProjectId?: pulumi.Input<string>;
/**
* Specifies the event list associated with the secret.
* Currently, only one event can be associated.
*/
eventSubscriptions?: pulumi.Input<string>;
/**
* Specifies the expiration time of a secret, `expireTime` can only be edited
* when `status` is **ENABLED**. The time is in the format of timestamp, that is, the offset milliseconds
* from 1970-01-01 00:00:00 UTC to the specified time. The time must be greater than the current time.
*/
expireTime?: pulumi.Input<number>;
kmsKeyId?: pulumi.Input<string>;
/**
* Specifies the secret name. The maximum length is 64 characters.
* Only digits, letters, underscores(_), hyphens(-) and dots(.) are allowed.
*/
name?: pulumi.Input<string>;
/**
* Specifies the region in which to create the CSMS secrets.
* If omitted, the provider-level region will be used. Changing this setting will create a new resource.
*/
region?: pulumi.Input<string>;
/**
* Specifies the plaintext of a binary secret encoded using Base64. CSMS encrypts
* the plaintext and stores it in the initial version of the secret. The maximum size is 32 KB.
*/
secretBinary?: pulumi.Input<string>;
/**
* Specifies the plaintext of a text secret. CSMS encrypts the plaintext and stores
* it in the initial version of the secret. The maximum size is 32 KB.
*/
secretText?: pulumi.Input<string>;
/**
* Specifies the type of the secret.
* Currently, only supported **COMMON**. The default value is **COMMON**.
*/
secretType?: pulumi.Input<string>;
/**
* Specifies the tags of a CSMS secrets, key/value pair format.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
}