@pulumi/tls
Version:
A Pulumi package to create TLS resources in Pulumi programs.
90 lines • 4.74 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.LocallySignedCert = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
class LocallySignedCert extends pulumi.CustomResource {
/**
* Get an existing LocallySignedCert 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 LocallySignedCert(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of LocallySignedCert. 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'] === LocallySignedCert.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allowedUses"] = state?.allowedUses;
resourceInputs["caCertPem"] = state?.caCertPem;
resourceInputs["caKeyAlgorithm"] = state?.caKeyAlgorithm;
resourceInputs["caPrivateKeyPem"] = state?.caPrivateKeyPem;
resourceInputs["certPem"] = state?.certPem;
resourceInputs["certRequestPem"] = state?.certRequestPem;
resourceInputs["earlyRenewalHours"] = state?.earlyRenewalHours;
resourceInputs["isCaCertificate"] = state?.isCaCertificate;
resourceInputs["readyForRenewal"] = state?.readyForRenewal;
resourceInputs["setSubjectKeyId"] = state?.setSubjectKeyId;
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?.caCertPem === undefined && !opts.urn) {
throw new Error("Missing required property 'caCertPem'");
}
if (args?.caPrivateKeyPem === undefined && !opts.urn) {
throw new Error("Missing required property 'caPrivateKeyPem'");
}
if (args?.certRequestPem === undefined && !opts.urn) {
throw new Error("Missing required property 'certRequestPem'");
}
if (args?.validityPeriodHours === undefined && !opts.urn) {
throw new Error("Missing required property 'validityPeriodHours'");
}
resourceInputs["allowedUses"] = args?.allowedUses;
resourceInputs["caCertPem"] = args?.caCertPem;
resourceInputs["caPrivateKeyPem"] = args?.caPrivateKeyPem ? pulumi.secret(args.caPrivateKeyPem) : undefined;
resourceInputs["certRequestPem"] = args?.certRequestPem;
resourceInputs["earlyRenewalHours"] = args?.earlyRenewalHours;
resourceInputs["isCaCertificate"] = args?.isCaCertificate;
resourceInputs["setSubjectKeyId"] = args?.setSubjectKeyId;
resourceInputs["validityPeriodHours"] = args?.validityPeriodHours;
resourceInputs["caKeyAlgorithm"] = undefined /*out*/;
resourceInputs["certPem"] = undefined /*out*/;
resourceInputs["readyForRenewal"] = undefined /*out*/;
resourceInputs["validityEndTime"] = undefined /*out*/;
resourceInputs["validityStartTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["caPrivateKeyPem"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(LocallySignedCert.__pulumiType, name, resourceInputs, opts);
}
}
exports.LocallySignedCert = LocallySignedCert;
/** @internal */
LocallySignedCert.__pulumiType = 'tls:index/locallySignedCert:LocallySignedCert';
//# sourceMappingURL=locallySignedCert.js.map