@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
271 lines • 16.6 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.KafkaInstance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manage DMS Kafka instance resources within HuaweiCloud.
*
* ## Example Usage
* ### Create a Kafka instance using flavor ID
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const vpcId = config.requireObject("vpcId");
* const subnetId = config.requireObject("subnetId");
* const securityGroupId = config.requireObject("securityGroupId");
* const accessPassword = config.requireObject("accessPassword");
* const availabilityZones = config.getObject("availabilityZones") || [
* "your_availability_zones_a",
* "your_availability_zones_b",
* "your_availability_zones_c",
* ];
* const flavorId = config.get("flavorId") || "your_flavor_id, such: c6.2u4g.cluster";
* const storageSpecCode = config.get("storageSpecCode") || "your_storage_spec_code, such: dms.physical.storage.ultra.v2";
* const testFlavors = huaweicloud.Dms.getFlavors({
* type: "cluster",
* flavorId: flavorId,
* availabilityZones: availabilityZones,
* storageSpecCode: storageSpecCode,
* });
* const testKafkaInstance = new huaweicloud.dms.KafkaInstance("testKafkaInstance", {
* vpcId: vpcId,
* networkId: subnetId,
* securityGroupId: securityGroupId,
* flavorId: testFlavors.then(testFlavors => testFlavors.flavorId),
* storageSpecCode: testFlavors.then(testFlavors => testFlavors.flavors?[0]?.ios?[0]?.storageSpecCode),
* availabilityZones: availabilityZones,
* engineVersion: "2.7",
* storageSpace: 600,
* brokerNum: 3,
* sslEnable: true,
* accessUser: "user",
* password: accessPassword,
* parameters: [{
* name: "min.insync.replicas",
* value: "2",
* }],
* });
* ```
*
* ## Import
*
* DMS Kafka instance can be imported using the instance id, e.g.
*
* ```sh
* $ pulumi import huaweicloud:Dms/kafkaInstance:KafkaInstance huaweicloud_dms_kafka_instance.instance_1 8d3c7938-dc47-4937-a30f-c80de381c5e3
* ```
*
* 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`password`, `public_ip_ids`, `security_protocol`, `enabled_mechanisms` and `arch_type`. It is generally recommended running `terraform plan` after importing a DMS Kafka instance. You can then decide if changes should be applied to the instance, or the resource definition should be updated to align with the instance. Also you can ignore changes as below. hcl resource "huaweicloud_dms_kafka_instance" "instance_1" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* password,
*
* ]
*
* } }
*/
class KafkaInstance extends pulumi.CustomResource {
/**
* Get an existing KafkaInstance 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 KafkaInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of KafkaInstance. 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'] === KafkaInstance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessUser"] = state ? state.accessUser : undefined;
resourceInputs["archType"] = state ? state.archType : undefined;
resourceInputs["autoRenew"] = state ? state.autoRenew : undefined;
resourceInputs["availabilityZones"] = state ? state.availabilityZones : undefined;
resourceInputs["availableZones"] = state ? state.availableZones : undefined;
resourceInputs["bandwidth"] = state ? state.bandwidth : undefined;
resourceInputs["brokerNum"] = state ? state.brokerNum : undefined;
resourceInputs["certReplaced"] = state ? state.certReplaced : undefined;
resourceInputs["chargingMode"] = state ? state.chargingMode : undefined;
resourceInputs["connectAddress"] = state ? state.connectAddress : undefined;
resourceInputs["connectorId"] = state ? state.connectorId : undefined;
resourceInputs["connectorNodeNum"] = state ? state.connectorNodeNum : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["crossVpcAccesses"] = state ? state.crossVpcAccesses : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["dumping"] = state ? state.dumping : undefined;
resourceInputs["enableAutoTopic"] = state ? state.enableAutoTopic : undefined;
resourceInputs["enablePublicIp"] = state ? state.enablePublicIp : undefined;
resourceInputs["enabledMechanisms"] = state ? state.enabledMechanisms : undefined;
resourceInputs["engine"] = state ? state.engine : undefined;
resourceInputs["engineVersion"] = state ? state.engineVersion : undefined;
resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined;
resourceInputs["extendTimes"] = state ? state.extendTimes : undefined;
resourceInputs["flavorId"] = state ? state.flavorId : undefined;
resourceInputs["ipv6ConnectAddresses"] = state ? state.ipv6ConnectAddresses : undefined;
resourceInputs["ipv6Enable"] = state ? state.ipv6Enable : undefined;
resourceInputs["isLogicalVolume"] = state ? state.isLogicalVolume : undefined;
resourceInputs["maintainBegin"] = state ? state.maintainBegin : undefined;
resourceInputs["maintainEnd"] = state ? state.maintainEnd : undefined;
resourceInputs["managementConnectAddress"] = state ? state.managementConnectAddress : undefined;
resourceInputs["managerPassword"] = state ? state.managerPassword : undefined;
resourceInputs["managerUser"] = state ? state.managerUser : undefined;
resourceInputs["manegementConnectAddress"] = state ? state.manegementConnectAddress : undefined;
resourceInputs["messageQueryInstEnable"] = state ? state.messageQueryInstEnable : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["networkId"] = state ? state.networkId : undefined;
resourceInputs["newTenantIps"] = state ? state.newTenantIps : undefined;
resourceInputs["nodeNum"] = state ? state.nodeNum : undefined;
resourceInputs["parameters"] = state ? state.parameters : undefined;
resourceInputs["partitionNum"] = state ? state.partitionNum : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["period"] = state ? state.period : undefined;
resourceInputs["periodUnit"] = state ? state.periodUnit : undefined;
resourceInputs["podConnectAddress"] = state ? state.podConnectAddress : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["portProtocols"] = state ? state.portProtocols : undefined;
resourceInputs["productId"] = state ? state.productId : undefined;
resourceInputs["publicBandwidth"] = state ? state.publicBandwidth : undefined;
resourceInputs["publicIpAddresses"] = state ? state.publicIpAddresses : undefined;
resourceInputs["publicIpIds"] = state ? state.publicIpIds : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["resourceSpecCode"] = state ? state.resourceSpecCode : undefined;
resourceInputs["retentionPolicy"] = state ? state.retentionPolicy : undefined;
resourceInputs["securityGroupId"] = state ? state.securityGroupId : undefined;
resourceInputs["securityProtocol"] = state ? state.securityProtocol : undefined;
resourceInputs["sslEnable"] = state ? state.sslEnable : undefined;
resourceInputs["sslTwoWayEnable"] = state ? state.sslTwoWayEnable : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["storageResourceId"] = state ? state.storageResourceId : undefined;
resourceInputs["storageSpace"] = state ? state.storageSpace : undefined;
resourceInputs["storageSpecCode"] = state ? state.storageSpecCode : undefined;
resourceInputs["storageType"] = state ? state.storageType : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["usedStorageSpace"] = state ? state.usedStorageSpace : undefined;
resourceInputs["userId"] = state ? state.userId : undefined;
resourceInputs["userName"] = state ? state.userName : undefined;
resourceInputs["vpcClientPlain"] = state ? state.vpcClientPlain : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.engineVersion === undefined) && !opts.urn) {
throw new Error("Missing required property 'engineVersion'");
}
if ((!args || args.networkId === undefined) && !opts.urn) {
throw new Error("Missing required property 'networkId'");
}
if ((!args || args.securityGroupId === undefined) && !opts.urn) {
throw new Error("Missing required property 'securityGroupId'");
}
if ((!args || args.storageSpecCode === undefined) && !opts.urn) {
throw new Error("Missing required property 'storageSpecCode'");
}
if ((!args || args.vpcId === undefined) && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["accessUser"] = args ? args.accessUser : undefined;
resourceInputs["archType"] = args ? args.archType : undefined;
resourceInputs["autoRenew"] = args ? args.autoRenew : undefined;
resourceInputs["availabilityZones"] = args ? args.availabilityZones : undefined;
resourceInputs["availableZones"] = args ? args.availableZones : undefined;
resourceInputs["bandwidth"] = args ? args.bandwidth : undefined;
resourceInputs["brokerNum"] = args ? args.brokerNum : undefined;
resourceInputs["chargingMode"] = args ? args.chargingMode : undefined;
resourceInputs["crossVpcAccesses"] = args ? args.crossVpcAccesses : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["dumping"] = args ? args.dumping : undefined;
resourceInputs["enableAutoTopic"] = args ? args.enableAutoTopic : undefined;
resourceInputs["enabledMechanisms"] = args ? args.enabledMechanisms : undefined;
resourceInputs["engineVersion"] = args ? args.engineVersion : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["flavorId"] = args ? args.flavorId : undefined;
resourceInputs["ipv6Enable"] = args ? args.ipv6Enable : undefined;
resourceInputs["maintainBegin"] = args ? args.maintainBegin : undefined;
resourceInputs["maintainEnd"] = args ? args.maintainEnd : undefined;
resourceInputs["managerPassword"] = args ? args.managerPassword : undefined;
resourceInputs["managerUser"] = args ? args.managerUser : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["networkId"] = args ? args.networkId : undefined;
resourceInputs["newTenantIps"] = args ? args.newTenantIps : undefined;
resourceInputs["parameters"] = args ? args.parameters : undefined;
resourceInputs["password"] = args ? args.password : undefined;
resourceInputs["period"] = args ? args.period : undefined;
resourceInputs["periodUnit"] = args ? args.periodUnit : undefined;
resourceInputs["productId"] = args ? args.productId : undefined;
resourceInputs["publicIpIds"] = args ? args.publicIpIds : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["retentionPolicy"] = args ? args.retentionPolicy : undefined;
resourceInputs["securityGroupId"] = args ? args.securityGroupId : undefined;
resourceInputs["securityProtocol"] = args ? args.securityProtocol : undefined;
resourceInputs["sslEnable"] = args ? args.sslEnable : undefined;
resourceInputs["storageSpace"] = args ? args.storageSpace : undefined;
resourceInputs["storageSpecCode"] = args ? args.storageSpecCode : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["vpcClientPlain"] = args ? args.vpcClientPlain : undefined;
resourceInputs["vpcId"] = args ? args.vpcId : undefined;
resourceInputs["certReplaced"] = undefined /*out*/;
resourceInputs["connectAddress"] = undefined /*out*/;
resourceInputs["connectorId"] = undefined /*out*/;
resourceInputs["connectorNodeNum"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["enablePublicIp"] = undefined /*out*/;
resourceInputs["engine"] = undefined /*out*/;
resourceInputs["extendTimes"] = undefined /*out*/;
resourceInputs["ipv6ConnectAddresses"] = undefined /*out*/;
resourceInputs["isLogicalVolume"] = undefined /*out*/;
resourceInputs["managementConnectAddress"] = undefined /*out*/;
resourceInputs["manegementConnectAddress"] = undefined /*out*/;
resourceInputs["messageQueryInstEnable"] = undefined /*out*/;
resourceInputs["nodeNum"] = undefined /*out*/;
resourceInputs["partitionNum"] = undefined /*out*/;
resourceInputs["podConnectAddress"] = undefined /*out*/;
resourceInputs["port"] = undefined /*out*/;
resourceInputs["portProtocols"] = undefined /*out*/;
resourceInputs["publicBandwidth"] = undefined /*out*/;
resourceInputs["publicIpAddresses"] = undefined /*out*/;
resourceInputs["resourceSpecCode"] = undefined /*out*/;
resourceInputs["sslTwoWayEnable"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["storageResourceId"] = undefined /*out*/;
resourceInputs["storageType"] = undefined /*out*/;
resourceInputs["type"] = undefined /*out*/;
resourceInputs["usedStorageSpace"] = undefined /*out*/;
resourceInputs["userId"] = undefined /*out*/;
resourceInputs["userName"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(KafkaInstance.__pulumiType, name, resourceInputs, opts);
}
}
exports.KafkaInstance = KafkaInstance;
/** @internal */
KafkaInstance.__pulumiType = 'huaweicloud:Dms/kafkaInstance:KafkaInstance';
//# sourceMappingURL=kafkaInstance.js.map