@pulumi/tls
Version:
A Pulumi package to create TLS resources in Pulumi programs.
90 lines • 4.71 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SelfSignedCert = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
class SelfSignedCert extends pulumi.CustomResource {
/**
* Get an existing SelfSignedCert 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 SelfSignedCert(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of SelfSignedCert. 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'] === SelfSignedCert.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allowedUses"] = state?.allowedUses;
resourceInputs["certPem"] = state?.certPem;
resourceInputs["dnsNames"] = state?.dnsNames;
resourceInputs["earlyRenewalHours"] = state?.earlyRenewalHours;
resourceInputs["ipAddresses"] = state?.ipAddresses;
resourceInputs["isCaCertificate"] = state?.isCaCertificate;
resourceInputs["keyAlgorithm"] = state?.keyAlgorithm;
resourceInputs["privateKeyPem"] = state?.privateKeyPem;
resourceInputs["readyForRenewal"] = state?.readyForRenewal;
resourceInputs["setAuthorityKeyId"] = state?.setAuthorityKeyId;
resourceInputs["setSubjectKeyId"] = state?.setSubjectKeyId;
resourceInputs["subject"] = state?.subject;
resourceInputs["uris"] = state?.uris;
resourceInputs["validityEndTime"] = state?.validityEndTime;
resourceInputs["validityPeriodHours"] = state?.validityPeriodHours;
resourceInputs["validityStartTime"] = state?.validityStartTime;
}
else {
const args = argsOrState;
if (args?.allowedUses === undefined && !opts.urn) {
throw new Error("Missing required property 'allowedUses'");
}
if (args?.privateKeyPem === undefined && !opts.urn) {
throw new Error("Missing required property 'privateKeyPem'");
}
if (args?.validityPeriodHours === undefined && !opts.urn) {
throw new Error("Missing required property 'validityPeriodHours'");
}
resourceInputs["allowedUses"] = args?.allowedUses;
resourceInputs["dnsNames"] = args?.dnsNames;
resourceInputs["earlyRenewalHours"] = args?.earlyRenewalHours;
resourceInputs["ipAddresses"] = args?.ipAddresses;
resourceInputs["isCaCertificate"] = args?.isCaCertificate;
resourceInputs["privateKeyPem"] = args?.privateKeyPem ? pulumi.secret(args.privateKeyPem) : undefined;
resourceInputs["setAuthorityKeyId"] = args?.setAuthorityKeyId;
resourceInputs["setSubjectKeyId"] = args?.setSubjectKeyId;
resourceInputs["subject"] = args?.subject;
resourceInputs["uris"] = args?.uris;
resourceInputs["validityPeriodHours"] = args?.validityPeriodHours;
resourceInputs["certPem"] = undefined /*out*/;
resourceInputs["keyAlgorithm"] = undefined /*out*/;
resourceInputs["readyForRenewal"] = undefined /*out*/;
resourceInputs["validityEndTime"] = undefined /*out*/;
resourceInputs["validityStartTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["privateKeyPem"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(SelfSignedCert.__pulumiType, name, resourceInputs, opts);
}
}
exports.SelfSignedCert = SelfSignedCert;
/** @internal */
SelfSignedCert.__pulumiType = 'tls:index/selfSignedCert:SelfSignedCert';
//# sourceMappingURL=selfSignedCert.js.map