@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
129 lines • 5.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.Link = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a link resource within HuaweiCloud. A link enables the CDM cluster to read data from and write data to
* a data source.
*
* ## Example Usage
* ### Link to MySql
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const mysqlLinkName = config.requireObject("mysqlLinkName");
* const cdmClusterId = config.requireObject("cdmClusterId");
* const mysqlHost = config.requireObject("mysqlHost");
* const dbName = config.requireObject("dbName");
* const dbPassword = config.requireObject("dbPassword");
* const mysqlLink = new huaweicloud.cdm.Link("mysqlLink", {
* connector: "generic-jdbc-connector",
* clusterId: cdmClusterId,
* config: {
* databaseType: "MYSQL",
* host: mysqlHost,
* port: "3306",
* database: dbName,
* username: _var.username,
* },
* password: dbPassword,
* });
* ```
*
* ## Import
*
* The link can be imported by `id`, It is composed of the ID of CDM cluster and the name of job, separated by a slash.
*
* For example, bash
*
* ```sh
* $ pulumi import huaweicloud:Cdm/link:Link test b11b407c-e604-4e8d-8bc4-92398320b847/linkName
* ```
*
* 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`, `secret_key` and `config`. It is generally recommended running `terraform plan` after importing an 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_cdm_link" "test" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [
*
* password, secret_key, config,
*
* ]
*
* } }
*/
class Link extends pulumi.CustomResource {
/**
* Get an existing Link 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 Link(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Link. 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'] === Link.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessKey"] = state ? state.accessKey : undefined;
resourceInputs["clusterId"] = state ? state.clusterId : undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["connector"] = state ? state.connector : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["password"] = state ? state.password : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["secretKey"] = state ? state.secretKey : undefined;
}
else {
const args = argsOrState;
if ((!args || args.clusterId === undefined) && !opts.urn) {
throw new Error("Missing required property 'clusterId'");
}
if ((!args || args.config === undefined) && !opts.urn) {
throw new Error("Missing required property 'config'");
}
if ((!args || args.connector === undefined) && !opts.urn) {
throw new Error("Missing required property 'connector'");
}
resourceInputs["accessKey"] = args ? args.accessKey : undefined;
resourceInputs["clusterId"] = args ? args.clusterId : undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["connector"] = args ? args.connector : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["password"] = args ? args.password : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["secretKey"] = args ? args.secretKey : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Link.__pulumiType, name, resourceInputs, opts);
}
}
exports.Link = Link;
/** @internal */
Link.__pulumiType = 'huaweicloud:Cdm/link:Link';
//# sourceMappingURL=link.js.map