UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

132 lines 5.53 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.CmekConfig = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * CmekConfig represents configurations used to enable CMEK data encryption with * Cloud KMS keys. * * To get more information about CmekConfig, see: * * * [API documentation](https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.cmekConfigs) * * ## Example Usage * * ### Discoveryengine Cmekconfig Default * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const cryptoKey = new gcp.kms.CryptoKeyIAMMember("crypto_key", { * cryptoKeyId: "kms-key-name", * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-discoveryengine.iam.gserviceaccount.com`), * }); * const _default = new gcp.discoveryengine.CmekConfig("default", { * location: "us", * cmekConfigId: "cmek-config-id", * kmsKey: "kms-key-name", * }, { * dependsOn: [cryptoKey], * }); * ``` * * ## Import * * CmekConfig can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/cmekConfigs/{{cmek_config_id}}` * * * `{{project}}/{{location}}/{{cmek_config_id}}` * * * `{{location}}/{{cmek_config_id}}` * * When using the `pulumi import` command, CmekConfig can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:discoveryengine/cmekConfig:CmekConfig default projects/{{project}}/locations/{{location}}/cmekConfigs/{{cmek_config_id}} * ``` * * ```sh * $ pulumi import gcp:discoveryengine/cmekConfig:CmekConfig default {{project}}/{{location}}/{{cmek_config_id}} * ``` * * ```sh * $ pulumi import gcp:discoveryengine/cmekConfig:CmekConfig default {{location}}/{{cmek_config_id}} * ``` */ class CmekConfig extends pulumi.CustomResource { /** * Get an existing CmekConfig 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 CmekConfig(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of CmekConfig. 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'] === CmekConfig.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cmekConfigId"] = state?.cmekConfigId; resourceInputs["isDefault"] = state?.isDefault; resourceInputs["kmsKey"] = state?.kmsKey; resourceInputs["kmsKeyVersion"] = state?.kmsKeyVersion; resourceInputs["lastRotationTimestampMicros"] = state?.lastRotationTimestampMicros; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["notebooklmState"] = state?.notebooklmState; resourceInputs["project"] = state?.project; resourceInputs["setDefault"] = state?.setDefault; resourceInputs["singleRegionKeys"] = state?.singleRegionKeys; resourceInputs["state"] = state?.state; } else { const args = argsOrState; if (args?.kmsKey === undefined && !opts.urn) { throw new Error("Missing required property 'kmsKey'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["cmekConfigId"] = args?.cmekConfigId; resourceInputs["kmsKey"] = args?.kmsKey; resourceInputs["location"] = args?.location; resourceInputs["project"] = args?.project; resourceInputs["setDefault"] = args?.setDefault; resourceInputs["singleRegionKeys"] = args?.singleRegionKeys; resourceInputs["isDefault"] = undefined /*out*/; resourceInputs["kmsKeyVersion"] = undefined /*out*/; resourceInputs["lastRotationTimestampMicros"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["notebooklmState"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CmekConfig.__pulumiType, name, resourceInputs, opts); } } exports.CmekConfig = CmekConfig; /** @internal */ CmekConfig.__pulumiType = 'gcp:discoveryengine/cmekConfig:CmekConfig'; //# sourceMappingURL=cmekConfig.js.map