UNPKG

@pulumi/fastly

Version:

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

115 lines 4.86 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.TlsActivation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Enables TLS on a domain using a specified custom TLS certificate. * * > **Note:** The Fastly service must be provisioned _prior_ to enabling TLS on it. This can be achieved in Pulumi using `dependsOn`. * * ## Example Usage * * Basic usage: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fastly from "@pulumi/fastly"; * * const demo = new fastly.ServiceVcl("demo", { * name: "my-service", * domains: [{ * name: "example.com", * }], * backends: [{ * address: "127.0.0.1", * name: "localhost", * }], * forceDestroy: true, * }); * const demoTlsPrivateKey = new fastly.TlsPrivateKey("demo", { * keyPem: "...", * name: "demo-key", * }); * const demoTlsCertificate = new fastly.TlsCertificate("demo", { * certificateBody: "...", * name: "demo-cert", * }, { * dependsOn: [demoTlsPrivateKey], * }); * const test = new fastly.TlsActivation("test", { * certificateId: demoTlsCertificate.id, * domain: "example.com", * }, { * dependsOn: [demo], * }); * ``` * * > **Warning:** Updating the `fastly.TlsPrivateKey`/`fastly.TlsCertificate` resources should be done in multiple plan/apply steps to avoid potential downtime. The new certificate and associated private key must first be created so they exist alongside the currently active resources. Once the new resources have been created, then the `fastly.TlsActivation` can be updated to point to the new certificate. Finally, the original key/certificate resources can be deleted. * * ## Import * * A TLS activation can be imported using its ID, e.g. * * ```sh * $ pulumi import fastly:index/tlsActivation:TlsActivation demo xxxxxxxx * ``` */ class TlsActivation extends pulumi.CustomResource { /** * Get an existing TlsActivation 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 TlsActivation(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of TlsActivation. 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'] === TlsActivation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["certificateId"] = state ? state.certificateId : undefined; resourceInputs["configurationId"] = state ? state.configurationId : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["domain"] = state ? state.domain : undefined; resourceInputs["mutualAuthenticationId"] = state ? state.mutualAuthenticationId : undefined; } else { const args = argsOrState; if ((!args || args.certificateId === undefined) && !opts.urn) { throw new Error("Missing required property 'certificateId'"); } if ((!args || args.domain === undefined) && !opts.urn) { throw new Error("Missing required property 'domain'"); } resourceInputs["certificateId"] = args ? args.certificateId : undefined; resourceInputs["configurationId"] = args ? args.configurationId : undefined; resourceInputs["domain"] = args ? args.domain : undefined; resourceInputs["mutualAuthenticationId"] = args ? args.mutualAuthenticationId : undefined; resourceInputs["createdAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(TlsActivation.__pulumiType, name, resourceInputs, opts); } } exports.TlsActivation = TlsActivation; /** @internal */ TlsActivation.__pulumiType = 'fastly:index/tlsActivation:TlsActivation'; //# sourceMappingURL=tlsActivation.js.map