@pulumi/fastly
Version:
A Pulumi package for creating and managing fastly cloud resources.. Based on terraform-provider-fastly: version v4
98 lines • 5.36 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.TlsSubscription = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Enables TLS on a domain using a certificate managed by Fastly.
*
* DNS records need to be modified on the domain being secured, in order to respond to the ACME domain ownership challenge.
*
* There are two options for doing this: the `managedDnsChallenges`, which is the default method; and the `managedHttpChallenges`, which points production traffic to Fastly.
*
* > See the [Fastly documentation](https://docs.fastly.com/en/guides/serving-https-traffic-using-fastly-managed-certificates#verifying-domain-ownership) for more information on verifying domain ownership.
*
* The examples below demonstrate usage with AWS Route53 to configure DNS, and the `fastly.TlsSubscriptionValidation` resource to wait for validation to complete.
*
* ## Import
*
* A subscription can be imported using its Fastly subscription ID, e.g.
*
* ```sh
* $ pulumi import fastly:index/tlsSubscription:TlsSubscription demo xxxxxxxxxxx
* ```
*/
class TlsSubscription extends pulumi.CustomResource {
/**
* Get an existing TlsSubscription 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 TlsSubscription(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of TlsSubscription. 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'] === TlsSubscription.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["certificateAuthority"] = state ? state.certificateAuthority : undefined;
resourceInputs["certificateId"] = state ? state.certificateId : undefined;
resourceInputs["commonName"] = state ? state.commonName : undefined;
resourceInputs["configurationId"] = state ? state.configurationId : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["domains"] = state ? state.domains : undefined;
resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined;
resourceInputs["forceUpdate"] = state ? state.forceUpdate : undefined;
resourceInputs["managedDnsChallenge"] = state ? state.managedDnsChallenge : undefined;
resourceInputs["managedDnsChallenges"] = state ? state.managedDnsChallenges : undefined;
resourceInputs["managedHttpChallenges"] = state ? state.managedHttpChallenges : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
if ((!args || args.certificateAuthority === undefined) && !opts.urn) {
throw new Error("Missing required property 'certificateAuthority'");
}
if ((!args || args.domains === undefined) && !opts.urn) {
throw new Error("Missing required property 'domains'");
}
resourceInputs["certificateAuthority"] = args ? args.certificateAuthority : undefined;
resourceInputs["commonName"] = args ? args.commonName : undefined;
resourceInputs["configurationId"] = args ? args.configurationId : undefined;
resourceInputs["domains"] = args ? args.domains : undefined;
resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined;
resourceInputs["forceUpdate"] = args ? args.forceUpdate : undefined;
resourceInputs["certificateId"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["managedDnsChallenge"] = undefined /*out*/;
resourceInputs["managedDnsChallenges"] = undefined /*out*/;
resourceInputs["managedHttpChallenges"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(TlsSubscription.__pulumiType, name, resourceInputs, opts);
}
}
exports.TlsSubscription = TlsSubscription;
/** @internal */
TlsSubscription.__pulumiType = 'fastly:index/tlsSubscription:TlsSubscription';
//# sourceMappingURL=tlsSubscription.js.map