UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

113 lines 5.39 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.DeviceCertificate = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an IoTDA device CA certificate within HuaweiCloud. * * > When accessing an IoTDA **standard** or **enterprise** edition instance, you need to specify the IoTDA service * endpoint in `provider` block. * You can login to the IoTDA console, choose the instance **Overview** and click **Access Details** * to view the HTTPS application access address. An example of the access address might be * **9bc34xxxxx.st1.iotda-app.ap-southeast-1.myhuaweicloud.com**, then you need to configure the * `provider` block as follows: * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const certificateContent = config.requireObject("certificateContent"); * const test = new huaweicloud.iotda.DeviceCertificate("test", {content: certificateContent}); * ``` * * ## Import * * Device CA certificates can be imported by `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:IoTDA/deviceCertificate:DeviceCertificate test 62b3cec5558d4b703f064534 * ``` * * 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`content`, `space_id`, `verify_content`. It is generally recommended running `terraform plan` after importing the resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the group. Also you can ignore changes as below. hcl resource "huaweicloud_iotda_device_certificate" "test" { * * ... * * lifecycle { * * ignore_changes = [ * * content, space_id, verify_content * * ] * * } } */ class DeviceCertificate extends pulumi.CustomResource { /** * Get an existing DeviceCertificate 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 DeviceCertificate(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of DeviceCertificate. 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'] === DeviceCertificate.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cn"] = state ? state.cn : undefined; resourceInputs["content"] = state ? state.content : undefined; resourceInputs["effectiveDate"] = state ? state.effectiveDate : undefined; resourceInputs["expiryDate"] = state ? state.expiryDate : undefined; resourceInputs["owner"] = state ? state.owner : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["spaceId"] = state ? state.spaceId : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["verifyCode"] = state ? state.verifyCode : undefined; resourceInputs["verifyContent"] = state ? state.verifyContent : undefined; } else { const args = argsOrState; if ((!args || args.content === undefined) && !opts.urn) { throw new Error("Missing required property 'content'"); } resourceInputs["content"] = args ? args.content : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["spaceId"] = args ? args.spaceId : undefined; resourceInputs["verifyContent"] = args ? args.verifyContent : undefined; resourceInputs["cn"] = undefined /*out*/; resourceInputs["effectiveDate"] = undefined /*out*/; resourceInputs["expiryDate"] = undefined /*out*/; resourceInputs["owner"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["verifyCode"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DeviceCertificate.__pulumiType, name, resourceInputs, opts); } } exports.DeviceCertificate = DeviceCertificate; /** @internal */ DeviceCertificate.__pulumiType = 'huaweicloud:IoTDA/deviceCertificate:DeviceCertificate'; //# sourceMappingURL=deviceCertificate.js.map