@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
95 lines • 4.25 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.CdnCertificate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage cdn certificate
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.cdn.CdnCertificate("foo", {
* certificate: "",
* desc: "tftest",
* privateKey: "",
* source: "cdn_cert_hosting",
* });
* ```
*
* ## Import
*
* CdnCertificate can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:cdn/cdnCertificate:CdnCertificate default resource_id
* ```
* You can delete the certificate hosted on the content delivery network.
* You can configure the HTTPS module to associate the certificate and domain name through the domain_config field of volcengine_cdn_domain.
* If the certificate to be deleted is already associated with a domain name, the deletion will fail.
* To remove the association between the domain name and the certificate, you can disable the HTTPS function for the domain name in the Content Delivery Network console.
*/
class CdnCertificate extends pulumi.CustomResource {
/**
* Get an existing CdnCertificate 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 CdnCertificate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CdnCertificate. 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'] === CdnCertificate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["certificate"] = state ? state.certificate : undefined;
resourceInputs["desc"] = state ? state.desc : undefined;
resourceInputs["privateKey"] = state ? state.privateKey : undefined;
resourceInputs["source"] = state ? state.source : undefined;
}
else {
const args = argsOrState;
if ((!args || args.certificate === undefined) && !opts.urn) {
throw new Error("Missing required property 'certificate'");
}
if ((!args || args.desc === undefined) && !opts.urn) {
throw new Error("Missing required property 'desc'");
}
if ((!args || args.privateKey === undefined) && !opts.urn) {
throw new Error("Missing required property 'privateKey'");
}
if ((!args || args.source === undefined) && !opts.urn) {
throw new Error("Missing required property 'source'");
}
resourceInputs["certificate"] = args ? args.certificate : undefined;
resourceInputs["desc"] = args ? args.desc : undefined;
resourceInputs["privateKey"] = args ? args.privateKey : undefined;
resourceInputs["source"] = args ? args.source : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CdnCertificate.__pulumiType, name, resourceInputs, opts);
}
}
exports.CdnCertificate = CdnCertificate;
/** @internal */
CdnCertificate.__pulumiType = 'volcengine:cdn/cdnCertificate:CdnCertificate';
//# sourceMappingURL=cdnCertificate.js.map