@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
126 lines • 5.52 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.Kmsconfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* NetApp Volumes always encrypts your data at rest using volume-specific keys.
*
* A CMEK policy (customer-managed encryption key) warps such volume-specific keys in a key stored in Cloud Key Management Service (KMS).
*
* To get more information about kmsconfig, see:
*
* * [API documentation](https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.kmsConfigs)
* * How-to Guides
* * [Documentation](https://cloud.google.com/netapp/volumes/docs/configure-and-use/cmek/cmek-overview)
*
* ## Example Usage
*
* ### Kms Config Create
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const kmsConfig = new gcp.netapp.Kmsconfig("kmsConfig", {
* name: "kms-test",
* description: "this is a test description",
* cryptoKeyName: "crypto-name",
* location: "us-central1",
* });
* ```
*
* ## Import
*
* kmsconfig can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/kmsConfigs/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, kmsconfig can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:netapp/kmsconfig:Kmsconfig default projects/{{project}}/locations/{{location}}/kmsConfigs/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:netapp/kmsconfig:Kmsconfig default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:netapp/kmsconfig:Kmsconfig default {{location}}/{{name}}
* ```
*/
class Kmsconfig extends pulumi.CustomResource {
/**
* Get an existing Kmsconfig 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 Kmsconfig(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Kmsconfig. 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'] === Kmsconfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cryptoKeyName"] = state ? state.cryptoKeyName : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["instructions"] = state ? state.instructions : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined;
resourceInputs["serviceAccount"] = state ? state.serviceAccount : undefined;
}
else {
const args = argsOrState;
if ((!args || args.cryptoKeyName === undefined) && !opts.urn) {
throw new Error("Missing required property 'cryptoKeyName'");
}
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["cryptoKeyName"] = args ? args.cryptoKeyName : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["instructions"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["serviceAccount"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Kmsconfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.Kmsconfig = Kmsconfig;
/** @internal */
Kmsconfig.__pulumiType = 'gcp:netapp/kmsconfig:Kmsconfig';
//# sourceMappingURL=kmsconfig.js.map