@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
96 lines • 4.21 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.KafkaUser = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a DMS kafka user resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const kafkaInstanceId = config.requireObject("kafkaInstanceId");
* const userPassword = config.requireObject("userPassword");
* const user = new huaweicloud.dms.KafkaUser("user", {
* instanceId: kafkaInstanceId,
* password: userPassword,
* description: "test_description",
* });
* ```
*
* ## Import
*
* DMS kafka users can be imported using the kafka instance ID and user name separated by a slash, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Dms/kafkaUser:KafkaUser user c8057fe5-23a8-46ef-ad83-c0055b4e0c5c/user_1
* ```
*/
class KafkaUser extends pulumi.CustomResource {
/**
* Get an existing KafkaUser 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 KafkaUser(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of KafkaUser. 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'] === KafkaUser.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["defaultApp"] = state ? state.defaultApp : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["instanceId"] = state ? state.instanceId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["role"] = state ? state.role : undefined;
}
else {
const args = argsOrState;
if ((!args || args.instanceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceId'");
}
if ((!args || args.password === undefined) && !opts.urn) {
throw new Error("Missing required property 'password'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["instanceId"] = args ? args.instanceId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["password"] = args ? args.password : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["defaultApp"] = undefined /*out*/;
resourceInputs["role"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(KafkaUser.__pulumiType, name, resourceInputs, opts);
}
}
exports.KafkaUser = KafkaUser;
/** @internal */
KafkaUser.__pulumiType = 'huaweicloud:Dms/kafkaUser:KafkaUser';
//# sourceMappingURL=kafkaUser.js.map