UNPKG

@pulumi/tls

Version:

A Pulumi package to create TLS resources in Pulumi programs.

85 lines 3.83 kB
"use strict"; // *** 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.CertRequest = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as std from "@pulumi/std"; * import * as tls from "@pulumi/tls"; * * const example = new tls.CertRequest("example", { * privateKeyPem: std.file({ * input: "private_key.pem", * }).then(invoke => invoke.result), * subject: { * commonName: "example.com", * organization: "ACME Examples, Inc", * }, * }); * ``` */ class CertRequest extends pulumi.CustomResource { /** * Get an existing CertRequest 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 CertRequest(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of CertRequest. 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'] === CertRequest.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["certRequestPem"] = state ? state.certRequestPem : undefined; resourceInputs["dnsNames"] = state ? state.dnsNames : undefined; resourceInputs["ipAddresses"] = state ? state.ipAddresses : undefined; resourceInputs["keyAlgorithm"] = state ? state.keyAlgorithm : undefined; resourceInputs["privateKeyPem"] = state ? state.privateKeyPem : undefined; resourceInputs["subject"] = state ? state.subject : undefined; resourceInputs["uris"] = state ? state.uris : undefined; } else { const args = argsOrState; if ((!args || args.privateKeyPem === undefined) && !opts.urn) { throw new Error("Missing required property 'privateKeyPem'"); } resourceInputs["dnsNames"] = args ? args.dnsNames : undefined; resourceInputs["ipAddresses"] = args ? args.ipAddresses : undefined; resourceInputs["privateKeyPem"] = (args === null || args === void 0 ? void 0 : args.privateKeyPem) ? pulumi.secret(args.privateKeyPem) : undefined; resourceInputs["subject"] = args ? args.subject : undefined; resourceInputs["uris"] = args ? args.uris : undefined; resourceInputs["certRequestPem"] = undefined /*out*/; resourceInputs["keyAlgorithm"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["privateKeyPem"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(CertRequest.__pulumiType, name, resourceInputs, opts); } } exports.CertRequest = CertRequest; /** @internal */ CertRequest.__pulumiType = 'tls:index/certRequest:CertRequest'; //# sourceMappingURL=certRequest.js.map