UNPKG

@pulumi/gcp

Version:

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

126 lines 5.13 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.GoogleChannelConfig = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * The Eventarc GoogleChannelConfig resource * * To get more information about GoogleChannelConfig, see: * * * [API documentation](https://cloud.google.com/eventarc/docs/reference/rest/v1/projects.locations) * * How-to Guides * * [Official Documentation](https://cloud.google.com/eventarc/docs/use-cmek#enable-cmek-google-channel) * * ## Example Usage * * ### Eventarc Google Channel Config With Cmek * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const testProject = gcp.organizations.getProject({ * projectId: "my-project-name", * }); * const testKeyRing = gcp.kms.getKMSKeyRing({ * name: "keyring", * location: "us-centra1", * }); * const key = testKeyRing.then(testKeyRing => gcp.kms.getKMSCryptoKey({ * name: "key", * keyRing: testKeyRing.id, * })); * const keyMember = new gcp.kms.CryptoKeyIAMMember("key_member", { * cryptoKeyId: key.then(key => key.id), * role: "roles/cloudkms.cryptoKeyEncrypterDecrypter", * member: testProject.then(testProject => `serviceAccount:service-${testProject.number}@gcp-sa-eventarc.iam.gserviceaccount.com`), * }); * const primary = new gcp.eventarc.GoogleChannelConfig("primary", { * location: "us-central1", * name: "googleChannelConfig", * cryptoKeyName: key.then(key => key.id), * }, { * dependsOn: [keyMember], * }); * ``` * * ## Import * * GoogleChannelConfig can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/googleChannelConfig` * * * `{{project}}/{{location}}` * * * `{{location}}` * * When using the `pulumi import` command, GoogleChannelConfig can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default projects/{{project}}/locations/{{location}}/googleChannelConfig * ``` * * ```sh * $ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default {{project}}/{{location}} * ``` * * ```sh * $ pulumi import gcp:eventarc/googleChannelConfig:GoogleChannelConfig default {{location}} * ``` */ class GoogleChannelConfig extends pulumi.CustomResource { /** * Get an existing GoogleChannelConfig 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 GoogleChannelConfig(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of GoogleChannelConfig. 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'] === GoogleChannelConfig.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cryptoKeyName"] = state ? state.cryptoKeyName : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["updateTime"] = state ? state.updateTime : undefined; } else { const args = argsOrState; if ((!args || args.location === undefined) && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["cryptoKeyName"] = args ? args.cryptoKeyName : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(GoogleChannelConfig.__pulumiType, name, resourceInputs, opts); } } exports.GoogleChannelConfig = GoogleChannelConfig; /** @internal */ GoogleChannelConfig.__pulumiType = 'gcp:eventarc/googleChannelConfig:GoogleChannelConfig'; //# sourceMappingURL=googleChannelConfig.js.map