UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

151 lines 5.35 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.ContinuousDeploymentPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS CloudFront Continuous Deployment Policy. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const staging = new aws.cloudfront.Distribution("staging", { * enabled: true, * staging: true, * }); * const example = new aws.cloudfront.ContinuousDeploymentPolicy("example", { * enabled: true, * stagingDistributionDnsNames: { * items: [staging.domainName], * quantity: 1, * }, * trafficConfig: { * type: "SingleWeight", * singleWeightConfig: { * weight: 0.01, * }, * }, * }); * const production = new aws.cloudfront.Distribution("production", { * enabled: true, * continuousDeploymentPolicyId: example.id, * }); * ``` * * ### Single Weight Config with Session Stickiness * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloudfront.ContinuousDeploymentPolicy("example", { * enabled: true, * stagingDistributionDnsNames: { * items: [staging.domainName], * quantity: 1, * }, * trafficConfig: { * type: "SingleWeight", * singleWeightConfig: { * weight: 0.01, * sessionStickinessConfig: { * idleTtl: 300, * maximumTtl: 600, * }, * }, * }, * }); * ``` * * ### Single Header Config * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloudfront.ContinuousDeploymentPolicy("example", { * enabled: true, * stagingDistributionDnsNames: { * items: [staging.domainName], * quantity: 1, * }, * trafficConfig: { * type: "SingleHeader", * singleHeaderConfig: { * header: "aws-cf-cd-example", * value: "example", * }, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import CloudFront Continuous Deployment Policy using the `id`. For example: * * ```sh * $ pulumi import aws:cloudfront/continuousDeploymentPolicy:ContinuousDeploymentPolicy example abcd-1234 * ``` */ class ContinuousDeploymentPolicy extends pulumi.CustomResource { /** * Get an existing ContinuousDeploymentPolicy 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 ContinuousDeploymentPolicy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ContinuousDeploymentPolicy. 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'] === ContinuousDeploymentPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["enabled"] = state?.enabled; resourceInputs["etag"] = state?.etag; resourceInputs["lastModifiedTime"] = state?.lastModifiedTime; resourceInputs["stagingDistributionDnsNames"] = state?.stagingDistributionDnsNames; resourceInputs["trafficConfig"] = state?.trafficConfig; } else { const args = argsOrState; if (args?.enabled === undefined && !opts.urn) { throw new Error("Missing required property 'enabled'"); } resourceInputs["enabled"] = args?.enabled; resourceInputs["stagingDistributionDnsNames"] = args?.stagingDistributionDnsNames; resourceInputs["trafficConfig"] = args?.trafficConfig; resourceInputs["arn"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["lastModifiedTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ContinuousDeploymentPolicy.__pulumiType, name, resourceInputs, opts); } } exports.ContinuousDeploymentPolicy = ContinuousDeploymentPolicy; /** @internal */ ContinuousDeploymentPolicy.__pulumiType = 'aws:cloudfront/continuousDeploymentPolicy:ContinuousDeploymentPolicy'; //# sourceMappingURL=continuousDeploymentPolicy.js.map