UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

131 lines 6.51 kB
"use strict"; // *** 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.Key = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a KMS key resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const keyAlias = config.requireObject("keyAlias"); * const test = new huaweicloud.dew.Key("test", { * keyAlias: keyAlias, * pendingDays: "7", * }); * ``` * * ## Import * * The KMS Key resource can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Dew/key:Key test <id> * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include`pending_days` and `is_enabled`. It is generally recommended running `terraform plan` after importing the resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the resource. Also you can ignore changes as below. hcl resource "huaweicloud_kms_key" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * pending_days, is_enabled * * ] * * } } */ class Key extends pulumi.CustomResource { /** * Get an existing Key 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 Key(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Key. 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'] === Key.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["creationDate"] = state ? state.creationDate : undefined; resourceInputs["defaultKeyFlag"] = state ? state.defaultKeyFlag : undefined; resourceInputs["domainId"] = state ? state.domainId : undefined; resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined; resourceInputs["expirationTime"] = state ? state.expirationTime : undefined; resourceInputs["isEnabled"] = state ? state.isEnabled : undefined; resourceInputs["keyAlgorithm"] = state ? state.keyAlgorithm : undefined; resourceInputs["keyAlias"] = state ? state.keyAlias : undefined; resourceInputs["keyDescription"] = state ? state.keyDescription : undefined; resourceInputs["keyId"] = state ? state.keyId : undefined; resourceInputs["keyState"] = state ? state.keyState : undefined; resourceInputs["keyUsage"] = state ? state.keyUsage : undefined; resourceInputs["keystoreId"] = state ? state.keystoreId : undefined; resourceInputs["origin"] = state ? state.origin : undefined; resourceInputs["pendingDays"] = state ? state.pendingDays : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["rotationEnabled"] = state ? state.rotationEnabled : undefined; resourceInputs["rotationInterval"] = state ? state.rotationInterval : undefined; resourceInputs["rotationNumber"] = state ? state.rotationNumber : undefined; resourceInputs["scheduledDeletionDate"] = state ? state.scheduledDeletionDate : undefined; resourceInputs["tags"] = state ? state.tags : undefined; } else { const args = argsOrState; if ((!args || args.keyAlias === undefined) && !opts.urn) { throw new Error("Missing required property 'keyAlias'"); } resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined; resourceInputs["isEnabled"] = args ? args.isEnabled : undefined; resourceInputs["keyAlgorithm"] = args ? args.keyAlgorithm : undefined; resourceInputs["keyAlias"] = args ? args.keyAlias : undefined; resourceInputs["keyDescription"] = args ? args.keyDescription : undefined; resourceInputs["keyUsage"] = args ? args.keyUsage : undefined; resourceInputs["keystoreId"] = args ? args.keystoreId : undefined; resourceInputs["origin"] = args ? args.origin : undefined; resourceInputs["pendingDays"] = args ? args.pendingDays : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["rotationEnabled"] = args ? args.rotationEnabled : undefined; resourceInputs["rotationInterval"] = args ? args.rotationInterval : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["creationDate"] = undefined /*out*/; resourceInputs["defaultKeyFlag"] = undefined /*out*/; resourceInputs["domainId"] = undefined /*out*/; resourceInputs["expirationTime"] = undefined /*out*/; resourceInputs["keyId"] = undefined /*out*/; resourceInputs["keyState"] = undefined /*out*/; resourceInputs["rotationNumber"] = undefined /*out*/; resourceInputs["scheduledDeletionDate"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Key.__pulumiType, name, resourceInputs, opts); } } exports.Key = Key; /** @internal */ Key.__pulumiType = 'huaweicloud:Dew/key:Key'; //# sourceMappingURL=key.js.map