UNPKG

@pulumi/fastly

Version:

A Pulumi package for creating and managing fastly cloud resources.. Based on terraform-provider-fastly: version v4

95 lines 4.11 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.TlsPrivateKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Uploads a Custom TLS Private Key to Fastly. This can be combined with a `fastly.TlsCertificate` resource to provide a TLS Certificate able to be applied to a Fastly Service. * * The Private Key resource requires a key in PEM format, and a name to identify it. * * ## Example Usage * * Basic usage: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fastly from "@pulumi/fastly"; * import * as tls from "@pulumi/tls"; * * const demo = new tls.index.PrivateKey("demo", {algorithm: "RSA"}); * const demoTlsPrivateKey = new fastly.TlsPrivateKey("demo", { * keyPem: demo.privateKeyPem, * name: "tf-demo", * }); * ``` * * ## Import * * A Private Key can be imported using its ID, e.g. * * ```sh * $ pulumi import fastly:index/tlsPrivateKey:TlsPrivateKey demo xxxxxxxxxxx * ``` */ class TlsPrivateKey extends pulumi.CustomResource { /** * Get an existing TlsPrivateKey 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 TlsPrivateKey(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of TlsPrivateKey. 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'] === TlsPrivateKey.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["keyLength"] = state ? state.keyLength : undefined; resourceInputs["keyPem"] = state ? state.keyPem : undefined; resourceInputs["keyType"] = state ? state.keyType : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["publicKeySha1"] = state ? state.publicKeySha1 : undefined; resourceInputs["replace"] = state ? state.replace : undefined; } else { const args = argsOrState; if ((!args || args.keyPem === undefined) && !opts.urn) { throw new Error("Missing required property 'keyPem'"); } resourceInputs["keyPem"] = (args === null || args === void 0 ? void 0 : args.keyPem) ? pulumi.secret(args.keyPem) : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["keyLength"] = undefined /*out*/; resourceInputs["keyType"] = undefined /*out*/; resourceInputs["publicKeySha1"] = undefined /*out*/; resourceInputs["replace"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["keyPem"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(TlsPrivateKey.__pulumiType, name, resourceInputs, opts); } } exports.TlsPrivateKey = TlsPrivateKey; /** @internal */ TlsPrivateKey.__pulumiType = 'fastly:index/tlsPrivateKey:TlsPrivateKey'; //# sourceMappingURL=tlsPrivateKey.js.map