1. Packages
  2. AWS Classic
  3. API Docs
  4. cloudfront
  5. ContinuousDeploymentPolicy

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.cloudfront.ContinuousDeploymentPolicy

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Resource for managing an AWS CloudFront Continuous Deployment Policy.

    Example Usage

    Basic Usage

    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,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    staging = aws.cloudfront.Distribution("staging",
        enabled=True,
        staging=True)
    example = aws.cloudfront.ContinuousDeploymentPolicy("example",
        enabled=True,
        staging_distribution_dns_names={
            "items": [staging.domain_name],
            "quantity": 1,
        },
        traffic_config={
            "type": "SingleWeight",
            "singleWeightConfig": {
                "weight": 0.01,
            },
        })
    production = aws.cloudfront.Distribution("production",
        enabled=True,
        continuous_deployment_policy_id=example.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		staging, err := cloudfront.NewDistribution(ctx, "staging", &cloudfront.DistributionArgs{
    			Enabled: pulumi.Bool(true),
    			Staging: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		example, err := cloudfront.NewContinuousDeploymentPolicy(ctx, "example", &cloudfront.ContinuousDeploymentPolicyArgs{
    			Enabled: pulumi.Bool(true),
    			StagingDistributionDnsNames: &cloudfront.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs{
    				Items: pulumi.StringArray{
    					staging.DomainName,
    				},
    				Quantity: pulumi.Int(1),
    			},
    			TrafficConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigArgs{
    				Type: pulumi.String("SingleWeight"),
    				SingleWeightConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs{
    					Weight: pulumi.Float64(0.01),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudfront.NewDistribution(ctx, "production", &cloudfront.DistributionArgs{
    			Enabled:                      pulumi.Bool(true),
    			ContinuousDeploymentPolicyId: example.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var staging = new Aws.CloudFront.Distribution("staging", new()
        {
            Enabled = true,
            Staging = true,
        });
    
        var example = new Aws.CloudFront.ContinuousDeploymentPolicy("example", new()
        {
            Enabled = true,
            StagingDistributionDnsNames = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs
            {
                Items = new[]
                {
                    staging.DomainName,
                },
                Quantity = 1,
            },
            TrafficConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigArgs
            {
                Type = "SingleWeight",
                SingleWeightConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs
                {
                    Weight = 0.01,
                },
            },
        });
    
        var production = new Aws.CloudFront.Distribution("production", new()
        {
            Enabled = true,
            ContinuousDeploymentPolicyId = example.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.Distribution;
    import com.pulumi.aws.cloudfront.DistributionArgs;
    import com.pulumi.aws.cloudfront.ContinuousDeploymentPolicy;
    import com.pulumi.aws.cloudfront.ContinuousDeploymentPolicyArgs;
    import com.pulumi.aws.cloudfront.inputs.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs;
    import com.pulumi.aws.cloudfront.inputs.ContinuousDeploymentPolicyTrafficConfigArgs;
    import com.pulumi.aws.cloudfront.inputs.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var staging = new Distribution("staging", DistributionArgs.builder()
                .enabled(true)
                .staging(true)
                .build());
    
            var example = new ContinuousDeploymentPolicy("example", ContinuousDeploymentPolicyArgs.builder()
                .enabled(true)
                .stagingDistributionDnsNames(ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs.builder()
                    .items(staging.domainName())
                    .quantity(1)
                    .build())
                .trafficConfig(ContinuousDeploymentPolicyTrafficConfigArgs.builder()
                    .type("SingleWeight")
                    .singleWeightConfig(ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs.builder()
                        .weight("0.01")
                        .build())
                    .build())
                .build());
    
            var production = new Distribution("production", DistributionArgs.builder()
                .enabled(true)
                .continuousDeploymentPolicyId(example.id())
                .build());
    
        }
    }
    
    resources:
      staging:
        type: aws:cloudfront:Distribution
        properties:
          enabled: true
          staging: true # ... other configuration ...
      example:
        type: aws:cloudfront:ContinuousDeploymentPolicy
        properties:
          enabled: true
          stagingDistributionDnsNames:
            items:
              - ${staging.domainName}
            quantity: 1
          trafficConfig:
            type: SingleWeight
            singleWeightConfig:
              weight: '0.01'
      production:
        type: aws:cloudfront:Distribution
        properties:
          enabled: true # NOTE: A continuous deployment policy cannot be associated to distribution
          #   # on creation. Set this argument once the resource exists.
          continuousDeploymentPolicyId: ${example.id}
    

    Single Weight Config with Session Stickiness

    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,
                },
            },
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.cloudfront.ContinuousDeploymentPolicy("example",
        enabled=True,
        staging_distribution_dns_names={
            "items": [staging["domainName"]],
            "quantity": 1,
        },
        traffic_config={
            "type": "SingleWeight",
            "singleWeightConfig": {
                "weight": 0.01,
                "sessionStickinessConfig": {
                    "idleTtl": 300,
                    "maximumTtl": 600,
                },
            },
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudfront.NewContinuousDeploymentPolicy(ctx, "example", &cloudfront.ContinuousDeploymentPolicyArgs{
    			Enabled: pulumi.Bool(true),
    			StagingDistributionDnsNames: &cloudfront.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs{
    				Items: pulumi.StringArray{
    					staging.DomainName,
    				},
    				Quantity: pulumi.Int(1),
    			},
    			TrafficConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigArgs{
    				Type: pulumi.String("SingleWeight"),
    				SingleWeightConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs{
    					Weight: pulumi.Float64(0.01),
    					SessionStickinessConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfigArgs{
    						IdleTtl:    pulumi.Int(300),
    						MaximumTtl: pulumi.Int(600),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.CloudFront.ContinuousDeploymentPolicy("example", new()
        {
            Enabled = true,
            StagingDistributionDnsNames = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs
            {
                Items = new[]
                {
                    staging.DomainName,
                },
                Quantity = 1,
            },
            TrafficConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigArgs
            {
                Type = "SingleWeight",
                SingleWeightConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs
                {
                    Weight = 0.01,
                    SessionStickinessConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfigArgs
                    {
                        IdleTtl = 300,
                        MaximumTtl = 600,
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.ContinuousDeploymentPolicy;
    import com.pulumi.aws.cloudfront.ContinuousDeploymentPolicyArgs;
    import com.pulumi.aws.cloudfront.inputs.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs;
    import com.pulumi.aws.cloudfront.inputs.ContinuousDeploymentPolicyTrafficConfigArgs;
    import com.pulumi.aws.cloudfront.inputs.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs;
    import com.pulumi.aws.cloudfront.inputs.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ContinuousDeploymentPolicy("example", ContinuousDeploymentPolicyArgs.builder()
                .enabled(true)
                .stagingDistributionDnsNames(ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs.builder()
                    .items(staging.domainName())
                    .quantity(1)
                    .build())
                .trafficConfig(ContinuousDeploymentPolicyTrafficConfigArgs.builder()
                    .type("SingleWeight")
                    .singleWeightConfig(ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs.builder()
                        .weight("0.01")
                        .sessionStickinessConfig(ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfigArgs.builder()
                            .idleTtl(300)
                            .maximumTtl(600)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:cloudfront:ContinuousDeploymentPolicy
        properties:
          enabled: true
          stagingDistributionDnsNames:
            items:
              - ${staging.domainName}
            quantity: 1
          trafficConfig:
            type: SingleWeight
            singleWeightConfig:
              weight: '0.01'
              sessionStickinessConfig:
                idleTtl: 300
                maximumTtl: 600
    

    Single Header Config

    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 pulumi
    import pulumi_aws as aws
    
    example = aws.cloudfront.ContinuousDeploymentPolicy("example",
        enabled=True,
        staging_distribution_dns_names={
            "items": [staging["domainName"]],
            "quantity": 1,
        },
        traffic_config={
            "type": "SingleHeader",
            "singleHeaderConfig": {
                "header": "aws-cf-cd-example",
                "value": "example",
            },
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudfront"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudfront.NewContinuousDeploymentPolicy(ctx, "example", &cloudfront.ContinuousDeploymentPolicyArgs{
    			Enabled: pulumi.Bool(true),
    			StagingDistributionDnsNames: &cloudfront.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs{
    				Items: pulumi.StringArray{
    					staging.DomainName,
    				},
    				Quantity: pulumi.Int(1),
    			},
    			TrafficConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigArgs{
    				Type: pulumi.String("SingleHeader"),
    				SingleHeaderConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfigArgs{
    					Header: pulumi.String("aws-cf-cd-example"),
    					Value:  pulumi.String("example"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.CloudFront.ContinuousDeploymentPolicy("example", new()
        {
            Enabled = true,
            StagingDistributionDnsNames = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs
            {
                Items = new[]
                {
                    staging.DomainName,
                },
                Quantity = 1,
            },
            TrafficConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigArgs
            {
                Type = "SingleHeader",
                SingleHeaderConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfigArgs
                {
                    Header = "aws-cf-cd-example",
                    Value = "example",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.cloudfront.ContinuousDeploymentPolicy;
    import com.pulumi.aws.cloudfront.ContinuousDeploymentPolicyArgs;
    import com.pulumi.aws.cloudfront.inputs.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs;
    import com.pulumi.aws.cloudfront.inputs.ContinuousDeploymentPolicyTrafficConfigArgs;
    import com.pulumi.aws.cloudfront.inputs.ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new ContinuousDeploymentPolicy("example", ContinuousDeploymentPolicyArgs.builder()
                .enabled(true)
                .stagingDistributionDnsNames(ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs.builder()
                    .items(staging.domainName())
                    .quantity(1)
                    .build())
                .trafficConfig(ContinuousDeploymentPolicyTrafficConfigArgs.builder()
                    .type("SingleHeader")
                    .singleHeaderConfig(ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfigArgs.builder()
                        .header("aws-cf-cd-example")
                        .value("example")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:cloudfront:ContinuousDeploymentPolicy
        properties:
          enabled: true
          stagingDistributionDnsNames:
            items:
              - ${staging.domainName}
            quantity: 1
          trafficConfig:
            type: SingleHeader
            singleHeaderConfig:
              header: aws-cf-cd-example
              value: example
    

    Create ContinuousDeploymentPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ContinuousDeploymentPolicy(name: string, args: ContinuousDeploymentPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ContinuousDeploymentPolicy(resource_name: str,
                                   args: ContinuousDeploymentPolicyArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ContinuousDeploymentPolicy(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   enabled: Optional[bool] = None,
                                   staging_distribution_dns_names: Optional[ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs] = None,
                                   traffic_config: Optional[ContinuousDeploymentPolicyTrafficConfigArgs] = None)
    func NewContinuousDeploymentPolicy(ctx *Context, name string, args ContinuousDeploymentPolicyArgs, opts ...ResourceOption) (*ContinuousDeploymentPolicy, error)
    public ContinuousDeploymentPolicy(string name, ContinuousDeploymentPolicyArgs args, CustomResourceOptions? opts = null)
    public ContinuousDeploymentPolicy(String name, ContinuousDeploymentPolicyArgs args)
    public ContinuousDeploymentPolicy(String name, ContinuousDeploymentPolicyArgs args, CustomResourceOptions options)
    
    type: aws:cloudfront:ContinuousDeploymentPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ContinuousDeploymentPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ContinuousDeploymentPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ContinuousDeploymentPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ContinuousDeploymentPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ContinuousDeploymentPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var continuousDeploymentPolicyResource = new Aws.CloudFront.ContinuousDeploymentPolicy("continuousDeploymentPolicyResource", new()
    {
        Enabled = false,
        StagingDistributionDnsNames = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs
        {
            Quantity = 0,
            Items = new[]
            {
                "string",
            },
        },
        TrafficConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigArgs
        {
            Type = "string",
            SingleHeaderConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfigArgs
            {
                Header = "string",
                Value = "string",
            },
            SingleWeightConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs
            {
                Weight = 0,
                SessionStickinessConfig = new Aws.CloudFront.Inputs.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfigArgs
                {
                    IdleTtl = 0,
                    MaximumTtl = 0,
                },
            },
        },
    });
    
    example, err := cloudfront.NewContinuousDeploymentPolicy(ctx, "continuousDeploymentPolicyResource", &cloudfront.ContinuousDeploymentPolicyArgs{
    	Enabled: pulumi.Bool(false),
    	StagingDistributionDnsNames: &cloudfront.ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs{
    		Quantity: pulumi.Int(0),
    		Items: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	TrafficConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigArgs{
    		Type: pulumi.String("string"),
    		SingleHeaderConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfigArgs{
    			Header: pulumi.String("string"),
    			Value:  pulumi.String("string"),
    		},
    		SingleWeightConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs{
    			Weight: pulumi.Float64(0),
    			SessionStickinessConfig: &cloudfront.ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfigArgs{
    				IdleTtl:    pulumi.Int(0),
    				MaximumTtl: pulumi.Int(0),
    			},
    		},
    	},
    })
    
    var continuousDeploymentPolicyResource = new ContinuousDeploymentPolicy("continuousDeploymentPolicyResource", ContinuousDeploymentPolicyArgs.builder()
        .enabled(false)
        .stagingDistributionDnsNames(ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs.builder()
            .quantity(0)
            .items("string")
            .build())
        .trafficConfig(ContinuousDeploymentPolicyTrafficConfigArgs.builder()
            .type("string")
            .singleHeaderConfig(ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfigArgs.builder()
                .header("string")
                .value("string")
                .build())
            .singleWeightConfig(ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs.builder()
                .weight(0)
                .sessionStickinessConfig(ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfigArgs.builder()
                    .idleTtl(0)
                    .maximumTtl(0)
                    .build())
                .build())
            .build())
        .build());
    
    continuous_deployment_policy_resource = aws.cloudfront.ContinuousDeploymentPolicy("continuousDeploymentPolicyResource",
        enabled=False,
        staging_distribution_dns_names={
            "quantity": 0,
            "items": ["string"],
        },
        traffic_config={
            "type": "string",
            "singleHeaderConfig": {
                "header": "string",
                "value": "string",
            },
            "singleWeightConfig": {
                "weight": 0,
                "sessionStickinessConfig": {
                    "idleTtl": 0,
                    "maximumTtl": 0,
                },
            },
        })
    
    const continuousDeploymentPolicyResource = new aws.cloudfront.ContinuousDeploymentPolicy("continuousDeploymentPolicyResource", {
        enabled: false,
        stagingDistributionDnsNames: {
            quantity: 0,
            items: ["string"],
        },
        trafficConfig: {
            type: "string",
            singleHeaderConfig: {
                header: "string",
                value: "string",
            },
            singleWeightConfig: {
                weight: 0,
                sessionStickinessConfig: {
                    idleTtl: 0,
                    maximumTtl: 0,
                },
            },
        },
    });
    
    type: aws:cloudfront:ContinuousDeploymentPolicy
    properties:
        enabled: false
        stagingDistributionDnsNames:
            items:
                - string
            quantity: 0
        trafficConfig:
            singleHeaderConfig:
                header: string
                value: string
            singleWeightConfig:
                sessionStickinessConfig:
                    idleTtl: 0
                    maximumTtl: 0
                weight: 0
            type: string
    

    ContinuousDeploymentPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The ContinuousDeploymentPolicy resource accepts the following input properties:

    Enabled bool
    Whether this continuous deployment policy is enabled.
    StagingDistributionDnsNames ContinuousDeploymentPolicyStagingDistributionDnsNames
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    TrafficConfig ContinuousDeploymentPolicyTrafficConfig
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.
    Enabled bool
    Whether this continuous deployment policy is enabled.
    StagingDistributionDnsNames ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    TrafficConfig ContinuousDeploymentPolicyTrafficConfigArgs
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.
    enabled Boolean
    Whether this continuous deployment policy is enabled.
    stagingDistributionDnsNames ContinuousDeploymentPolicyStagingDistributionDnsNames
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    trafficConfig ContinuousDeploymentPolicyTrafficConfig
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.
    enabled boolean
    Whether this continuous deployment policy is enabled.
    stagingDistributionDnsNames ContinuousDeploymentPolicyStagingDistributionDnsNames
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    trafficConfig ContinuousDeploymentPolicyTrafficConfig
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.
    enabled bool
    Whether this continuous deployment policy is enabled.
    staging_distribution_dns_names ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    traffic_config ContinuousDeploymentPolicyTrafficConfigArgs
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.
    enabled Boolean
    Whether this continuous deployment policy is enabled.
    stagingDistributionDnsNames Property Map
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    trafficConfig Property Map
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ContinuousDeploymentPolicy resource produces the following output properties:

    Etag string
    Current version of the continuous distribution policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastModifiedTime string
    Date and time the continuous deployment policy was last modified.
    Etag string
    Current version of the continuous distribution policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    LastModifiedTime string
    Date and time the continuous deployment policy was last modified.
    etag String
    Current version of the continuous distribution policy.
    id String
    The provider-assigned unique ID for this managed resource.
    lastModifiedTime String
    Date and time the continuous deployment policy was last modified.
    etag string
    Current version of the continuous distribution policy.
    id string
    The provider-assigned unique ID for this managed resource.
    lastModifiedTime string
    Date and time the continuous deployment policy was last modified.
    etag str
    Current version of the continuous distribution policy.
    id str
    The provider-assigned unique ID for this managed resource.
    last_modified_time str
    Date and time the continuous deployment policy was last modified.
    etag String
    Current version of the continuous distribution policy.
    id String
    The provider-assigned unique ID for this managed resource.
    lastModifiedTime String
    Date and time the continuous deployment policy was last modified.

    Look up Existing ContinuousDeploymentPolicy Resource

    Get an existing ContinuousDeploymentPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ContinuousDeploymentPolicyState, opts?: CustomResourceOptions): ContinuousDeploymentPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enabled: Optional[bool] = None,
            etag: Optional[str] = None,
            last_modified_time: Optional[str] = None,
            staging_distribution_dns_names: Optional[ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs] = None,
            traffic_config: Optional[ContinuousDeploymentPolicyTrafficConfigArgs] = None) -> ContinuousDeploymentPolicy
    func GetContinuousDeploymentPolicy(ctx *Context, name string, id IDInput, state *ContinuousDeploymentPolicyState, opts ...ResourceOption) (*ContinuousDeploymentPolicy, error)
    public static ContinuousDeploymentPolicy Get(string name, Input<string> id, ContinuousDeploymentPolicyState? state, CustomResourceOptions? opts = null)
    public static ContinuousDeploymentPolicy get(String name, Output<String> id, ContinuousDeploymentPolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Enabled bool
    Whether this continuous deployment policy is enabled.
    Etag string
    Current version of the continuous distribution policy.
    LastModifiedTime string
    Date and time the continuous deployment policy was last modified.
    StagingDistributionDnsNames ContinuousDeploymentPolicyStagingDistributionDnsNames
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    TrafficConfig ContinuousDeploymentPolicyTrafficConfig
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.
    Enabled bool
    Whether this continuous deployment policy is enabled.
    Etag string
    Current version of the continuous distribution policy.
    LastModifiedTime string
    Date and time the continuous deployment policy was last modified.
    StagingDistributionDnsNames ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    TrafficConfig ContinuousDeploymentPolicyTrafficConfigArgs
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.
    enabled Boolean
    Whether this continuous deployment policy is enabled.
    etag String
    Current version of the continuous distribution policy.
    lastModifiedTime String
    Date and time the continuous deployment policy was last modified.
    stagingDistributionDnsNames ContinuousDeploymentPolicyStagingDistributionDnsNames
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    trafficConfig ContinuousDeploymentPolicyTrafficConfig
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.
    enabled boolean
    Whether this continuous deployment policy is enabled.
    etag string
    Current version of the continuous distribution policy.
    lastModifiedTime string
    Date and time the continuous deployment policy was last modified.
    stagingDistributionDnsNames ContinuousDeploymentPolicyStagingDistributionDnsNames
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    trafficConfig ContinuousDeploymentPolicyTrafficConfig
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.
    enabled bool
    Whether this continuous deployment policy is enabled.
    etag str
    Current version of the continuous distribution policy.
    last_modified_time str
    Date and time the continuous deployment policy was last modified.
    staging_distribution_dns_names ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    traffic_config ContinuousDeploymentPolicyTrafficConfigArgs
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.
    enabled Boolean
    Whether this continuous deployment policy is enabled.
    etag String
    Current version of the continuous distribution policy.
    lastModifiedTime String
    Date and time the continuous deployment policy was last modified.
    stagingDistributionDnsNames Property Map
    CloudFront domain name of the staging distribution. See staging_distribution_dns_names.
    trafficConfig Property Map
    Parameters for routing production traffic from primary to staging distributions. See traffic_config.

    Supporting Types

    ContinuousDeploymentPolicyStagingDistributionDnsNames, ContinuousDeploymentPolicyStagingDistributionDnsNamesArgs

    Quantity int
    Number of CloudFront domain names in the staging distribution.
    Items List<string>
    A list of CloudFront domain names for the staging distribution.
    Quantity int
    Number of CloudFront domain names in the staging distribution.
    Items []string
    A list of CloudFront domain names for the staging distribution.
    quantity Integer
    Number of CloudFront domain names in the staging distribution.
    items List<String>
    A list of CloudFront domain names for the staging distribution.
    quantity number
    Number of CloudFront domain names in the staging distribution.
    items string[]
    A list of CloudFront domain names for the staging distribution.
    quantity int
    Number of CloudFront domain names in the staging distribution.
    items Sequence[str]
    A list of CloudFront domain names for the staging distribution.
    quantity Number
    Number of CloudFront domain names in the staging distribution.
    items List<String>
    A list of CloudFront domain names for the staging distribution.

    ContinuousDeploymentPolicyTrafficConfig, ContinuousDeploymentPolicyTrafficConfigArgs

    Type string
    Type of traffic configuration. Valid values are SingleWeight and SingleHeader.
    SingleHeaderConfig ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfig
    Determines which HTTP requests are sent to the staging distribution. See single_header_config.
    SingleWeightConfig ContinuousDeploymentPolicyTrafficConfigSingleWeightConfig
    Contains the percentage of traffic to send to the staging distribution. See single_weight_config.
    Type string
    Type of traffic configuration. Valid values are SingleWeight and SingleHeader.
    SingleHeaderConfig ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfig
    Determines which HTTP requests are sent to the staging distribution. See single_header_config.
    SingleWeightConfig ContinuousDeploymentPolicyTrafficConfigSingleWeightConfig
    Contains the percentage of traffic to send to the staging distribution. See single_weight_config.
    type String
    Type of traffic configuration. Valid values are SingleWeight and SingleHeader.
    singleHeaderConfig ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfig
    Determines which HTTP requests are sent to the staging distribution. See single_header_config.
    singleWeightConfig ContinuousDeploymentPolicyTrafficConfigSingleWeightConfig
    Contains the percentage of traffic to send to the staging distribution. See single_weight_config.
    type string
    Type of traffic configuration. Valid values are SingleWeight and SingleHeader.
    singleHeaderConfig ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfig
    Determines which HTTP requests are sent to the staging distribution. See single_header_config.
    singleWeightConfig ContinuousDeploymentPolicyTrafficConfigSingleWeightConfig
    Contains the percentage of traffic to send to the staging distribution. See single_weight_config.
    type str
    Type of traffic configuration. Valid values are SingleWeight and SingleHeader.
    single_header_config ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfig
    Determines which HTTP requests are sent to the staging distribution. See single_header_config.
    single_weight_config ContinuousDeploymentPolicyTrafficConfigSingleWeightConfig
    Contains the percentage of traffic to send to the staging distribution. See single_weight_config.
    type String
    Type of traffic configuration. Valid values are SingleWeight and SingleHeader.
    singleHeaderConfig Property Map
    Determines which HTTP requests are sent to the staging distribution. See single_header_config.
    singleWeightConfig Property Map
    Contains the percentage of traffic to send to the staging distribution. See single_weight_config.

    ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfig, ContinuousDeploymentPolicyTrafficConfigSingleHeaderConfigArgs

    Header string
    Request header name to send to the staging distribution. The header must contain the prefix aws-cf-cd-.
    Value string
    Request header value.
    Header string
    Request header name to send to the staging distribution. The header must contain the prefix aws-cf-cd-.
    Value string
    Request header value.
    header String
    Request header name to send to the staging distribution. The header must contain the prefix aws-cf-cd-.
    value String
    Request header value.
    header string
    Request header name to send to the staging distribution. The header must contain the prefix aws-cf-cd-.
    value string
    Request header value.
    header str
    Request header name to send to the staging distribution. The header must contain the prefix aws-cf-cd-.
    value str
    Request header value.
    header String
    Request header name to send to the staging distribution. The header must contain the prefix aws-cf-cd-.
    value String
    Request header value.

    ContinuousDeploymentPolicyTrafficConfigSingleWeightConfig, ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigArgs

    Weight double
    The percentage of traffic to send to a staging distribution, expressed as a decimal number between 0 and .15.
    SessionStickinessConfig ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfig
    Session stickiness provides the ability to define multiple requests from a single viewer as a single session. This prevents the potentially inconsistent experience of sending some of a given user's requests to the staging distribution, while others are sent to the primary distribution. Define the session duration using TTL values. See session_stickiness_config.
    Weight float64
    The percentage of traffic to send to a staging distribution, expressed as a decimal number between 0 and .15.
    SessionStickinessConfig ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfig
    Session stickiness provides the ability to define multiple requests from a single viewer as a single session. This prevents the potentially inconsistent experience of sending some of a given user's requests to the staging distribution, while others are sent to the primary distribution. Define the session duration using TTL values. See session_stickiness_config.
    weight Double
    The percentage of traffic to send to a staging distribution, expressed as a decimal number between 0 and .15.
    sessionStickinessConfig ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfig
    Session stickiness provides the ability to define multiple requests from a single viewer as a single session. This prevents the potentially inconsistent experience of sending some of a given user's requests to the staging distribution, while others are sent to the primary distribution. Define the session duration using TTL values. See session_stickiness_config.
    weight number
    The percentage of traffic to send to a staging distribution, expressed as a decimal number between 0 and .15.
    sessionStickinessConfig ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfig
    Session stickiness provides the ability to define multiple requests from a single viewer as a single session. This prevents the potentially inconsistent experience of sending some of a given user's requests to the staging distribution, while others are sent to the primary distribution. Define the session duration using TTL values. See session_stickiness_config.
    weight float
    The percentage of traffic to send to a staging distribution, expressed as a decimal number between 0 and .15.
    session_stickiness_config ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfig
    Session stickiness provides the ability to define multiple requests from a single viewer as a single session. This prevents the potentially inconsistent experience of sending some of a given user's requests to the staging distribution, while others are sent to the primary distribution. Define the session duration using TTL values. See session_stickiness_config.
    weight Number
    The percentage of traffic to send to a staging distribution, expressed as a decimal number between 0 and .15.
    sessionStickinessConfig Property Map
    Session stickiness provides the ability to define multiple requests from a single viewer as a single session. This prevents the potentially inconsistent experience of sending some of a given user's requests to the staging distribution, while others are sent to the primary distribution. Define the session duration using TTL values. See session_stickiness_config.

    ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfig, ContinuousDeploymentPolicyTrafficConfigSingleWeightConfigSessionStickinessConfigArgs

    IdleTtl int
    The amount of time in seconds after which sessions will cease if no requests are received. Valid values are 3003600 (5–60 minutes). The value must be less than or equal to maximum_ttl.
    MaximumTtl int
    The maximum amount of time in seconds to consider requests from the viewer as being part of the same session. Valid values are 3003600 (5–60 minutes). The value must be greater than or equal to idle_ttl.
    IdleTtl int
    The amount of time in seconds after which sessions will cease if no requests are received. Valid values are 3003600 (5–60 minutes). The value must be less than or equal to maximum_ttl.
    MaximumTtl int
    The maximum amount of time in seconds to consider requests from the viewer as being part of the same session. Valid values are 3003600 (5–60 minutes). The value must be greater than or equal to idle_ttl.
    idleTtl Integer
    The amount of time in seconds after which sessions will cease if no requests are received. Valid values are 3003600 (5–60 minutes). The value must be less than or equal to maximum_ttl.
    maximumTtl Integer
    The maximum amount of time in seconds to consider requests from the viewer as being part of the same session. Valid values are 3003600 (5–60 minutes). The value must be greater than or equal to idle_ttl.
    idleTtl number
    The amount of time in seconds after which sessions will cease if no requests are received. Valid values are 3003600 (5–60 minutes). The value must be less than or equal to maximum_ttl.
    maximumTtl number
    The maximum amount of time in seconds to consider requests from the viewer as being part of the same session. Valid values are 3003600 (5–60 minutes). The value must be greater than or equal to idle_ttl.
    idle_ttl int
    The amount of time in seconds after which sessions will cease if no requests are received. Valid values are 3003600 (5–60 minutes). The value must be less than or equal to maximum_ttl.
    maximum_ttl int
    The maximum amount of time in seconds to consider requests from the viewer as being part of the same session. Valid values are 3003600 (5–60 minutes). The value must be greater than or equal to idle_ttl.
    idleTtl Number
    The amount of time in seconds after which sessions will cease if no requests are received. Valid values are 3003600 (5–60 minutes). The value must be less than or equal to maximum_ttl.
    maximumTtl Number
    The maximum amount of time in seconds to consider requests from the viewer as being part of the same session. Valid values are 3003600 (5–60 minutes). The value must be greater than or equal to idle_ttl.

    Import

    Using pulumi import, import CloudFront Continuous Deployment Policy using the id. For example:

    $ pulumi import aws:cloudfront/continuousDeploymentPolicy:ContinuousDeploymentPolicy example abcd-1234
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi