@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
178 lines • 8.15 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.ConnectCluster = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* ## Example Usage
*
* ### Managedkafka Connect Cluster Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const mkcNetwork = new gcp.compute.Network("mkc_network", {
* name: "my-network",
* autoCreateSubnetworks: false,
* });
* const mkcSubnet = new gcp.compute.Subnetwork("mkc_subnet", {
* name: "my-subnetwork",
* ipCidrRange: "10.2.0.0/16",
* region: "us-central1",
* network: mkcNetwork.id,
* });
* const mkcAdditionalSubnet = new gcp.compute.Subnetwork("mkc_additional_subnet", {
* name: "my-additional-subnetwork-0",
* ipCidrRange: "10.3.0.0/16",
* region: "us-central1",
* network: mkcNetwork.id,
* });
* const project = gcp.organizations.getProject({});
* const gmkCluster = new gcp.managedkafka.Cluster("gmk_cluster", {
* clusterId: "my-cluster",
* location: "us-central1",
* capacityConfig: {
* vcpuCount: "3",
* memoryBytes: "3221225472",
* },
* gcpConfig: {
* accessConfig: {
* networkConfigs: [{
* subnet: pulumi.all([project, mkcSubnet.id]).apply(([project, id]) => `projects/${project.projectId}/regions/us-central1/subnetworks/${id}`),
* }],
* },
* },
* });
* const example = new gcp.managedkafka.ConnectCluster("example", {
* connectClusterId: "my-connect-cluster",
* kafkaCluster: pulumi.all([project, gmkCluster.clusterId]).apply(([project, clusterId]) => `projects/${project.projectId}/locations/us-central1/clusters/${clusterId}`),
* location: "us-central1",
* capacityConfig: {
* vcpuCount: "12",
* memoryBytes: "21474836480",
* },
* gcpConfig: {
* accessConfig: {
* networkConfigs: [{
* primarySubnet: pulumi.all([project, mkcSubnet.id]).apply(([project, id]) => `projects/${project.projectId}/regions/us-central1/subnetworks/${id}`),
* additionalSubnets: [mkcAdditionalSubnet.id],
* dnsDomainNames: [pulumi.all([gmkCluster.clusterId, project]).apply(([clusterId, project]) => `${clusterId}.us-central1.managedkafka-staging.${project.projectId}.cloud-staging.goog`)],
* }],
* },
* },
* labels: {
* key: "value",
* },
* });
* ```
*
* ## Import
*
* ConnectCluster can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/connectClusters/{{connect_cluster_id}}`
*
* * `{{project}}/{{location}}/{{connect_cluster_id}}`
*
* * `{{location}}/{{connect_cluster_id}}`
*
* When using the `pulumi import` command, ConnectCluster can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:managedkafka/connectCluster:ConnectCluster default projects/{{project}}/locations/{{location}}/connectClusters/{{connect_cluster_id}}
* ```
*
* ```sh
* $ pulumi import gcp:managedkafka/connectCluster:ConnectCluster default {{project}}/{{location}}/{{connect_cluster_id}}
* ```
*
* ```sh
* $ pulumi import gcp:managedkafka/connectCluster:ConnectCluster default {{location}}/{{connect_cluster_id}}
* ```
*/
class ConnectCluster extends pulumi.CustomResource {
/**
* Get an existing ConnectCluster 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 ConnectCluster(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ConnectCluster. 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'] === ConnectCluster.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["capacityConfig"] = state ? state.capacityConfig : undefined;
resourceInputs["connectClusterId"] = state ? state.connectClusterId : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["gcpConfig"] = state ? state.gcpConfig : undefined;
resourceInputs["kafkaCluster"] = state ? state.kafkaCluster : 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["state"] = state ? state.state : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
}
else {
const args = argsOrState;
if ((!args || args.capacityConfig === undefined) && !opts.urn) {
throw new Error("Missing required property 'capacityConfig'");
}
if ((!args || args.connectClusterId === undefined) && !opts.urn) {
throw new Error("Missing required property 'connectClusterId'");
}
if ((!args || args.gcpConfig === undefined) && !opts.urn) {
throw new Error("Missing required property 'gcpConfig'");
}
if ((!args || args.kafkaCluster === undefined) && !opts.urn) {
throw new Error("Missing required property 'kafkaCluster'");
}
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["capacityConfig"] = args ? args.capacityConfig : undefined;
resourceInputs["connectClusterId"] = args ? args.connectClusterId : undefined;
resourceInputs["gcpConfig"] = args ? args.gcpConfig : undefined;
resourceInputs["kafkaCluster"] = args ? args.kafkaCluster : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ConnectCluster.__pulumiType, name, resourceInputs, opts);
}
}
exports.ConnectCluster = ConnectCluster;
/** @internal */
ConnectCluster.__pulumiType = 'gcp:managedkafka/connectCluster:ConnectCluster';
//# sourceMappingURL=connectCluster.js.map