AWS Native

Pulumi Official
Package maintained by Pulumi
v0.19.0 published on Wednesday, Jun 8, 2022 by Pulumi

Distribution

Resource Type definition for AWS::CloudFront::Distribution

Example Usage

Example

using Pulumi;
using AwsNative = Pulumi.AwsNative;

class MyStack : Stack
{
    public MyStack()
    {
        var cloudfrontdistribution = new AwsNative.CloudFront.Distribution("cloudfrontdistribution", new AwsNative.CloudFront.DistributionArgs
        {
            DistributionConfig = new AwsNative.CloudFront.Inputs.DistributionConfigArgs
            {
                CacheBehaviors = 
                {
                    new AwsNative.CloudFront.Inputs.DistributionCacheBehaviorArgs
                    {
                        LambdaFunctionAssociations = 
                        {
                            new AwsNative.CloudFront.Inputs.DistributionLambdaFunctionAssociationArgs
                            {
                                EventType = "string-value",
                                LambdaFunctionARN = "string-value",
                            },
                        },
                    },
                },
                DefaultCacheBehavior = new AwsNative.CloudFront.Inputs.DistributionDefaultCacheBehaviorArgs
                {
                    LambdaFunctionAssociations = 
                    {
                        new AwsNative.CloudFront.Inputs.DistributionLambdaFunctionAssociationArgs
                        {
                            EventType = "string-value",
                            LambdaFunctionARN = "string-value",
                        },
                    },
                },
                Ipv6Enabled = "boolean-value",
                Origins = 
                {
                    new AwsNative.CloudFront.Inputs.DistributionOriginArgs
                    {
                        CustomOriginConfig = new AwsNative.CloudFront.Inputs.DistributionCustomOriginConfigArgs
                        {
                            OriginKeepaliveTimeout = "integer-value",
                            OriginReadTimeout = "integer-value",
                        },
                    },
                },
            },
            Tags = 
            {
                new AwsNative.CloudFront.Inputs.DistributionTagArgs
                {
                    Key = "string-value",
                    Value = "string-value",
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfront.NewDistribution(ctx, "cloudfrontdistribution", &cloudfront.DistributionArgs{
			DistributionConfig: &cloudfront.DistributionConfigArgs{
				CacheBehaviors: cloudfront.DistributionCacheBehaviorArray{
					&cloudfront.DistributionCacheBehaviorArgs{
						LambdaFunctionAssociations: cloudfront.DistributionLambdaFunctionAssociationArray{
							&cloudfront.DistributionLambdaFunctionAssociationArgs{
								EventType:         pulumi.String("string-value"),
								LambdaFunctionARN: pulumi.String("string-value"),
							},
						},
					},
				},
				DefaultCacheBehavior: &cloudfront.DistributionDefaultCacheBehaviorArgs{
					LambdaFunctionAssociations: cloudfront.DistributionLambdaFunctionAssociationArray{
						&cloudfront.DistributionLambdaFunctionAssociationArgs{
							EventType:         pulumi.String("string-value"),
							LambdaFunctionARN: pulumi.String("string-value"),
						},
					},
				},
				Ipv6Enabled: "boolean-value",
				Origins: cloudfront.DistributionOriginArray{
					&cloudfront.DistributionOriginArgs{
						CustomOriginConfig: &cloudfront.DistributionCustomOriginConfigArgs{
							OriginKeepaliveTimeout: pulumi.Int("integer-value"),
							OriginReadTimeout:      pulumi.Int("integer-value"),
						},
					},
				},
			},
			Tags: []cloudfront.DistributionTagArgs{
				&cloudfront.DistributionTagArgs{
					Key:   pulumi.String("string-value"),
					Value: pulumi.String("string-value"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

cloudfrontdistribution = aws_native.cloudfront.Distribution("cloudfrontdistribution",
    distribution_config=aws_native.cloudfront.DistributionConfigArgs(
        cache_behaviors=[aws_native.cloudfront.DistributionCacheBehaviorArgs(
            lambda_function_associations=[aws_native.cloudfront.DistributionLambdaFunctionAssociationArgs(
                event_type="string-value",
                lambda_function_arn="string-value",
            )],
        )],
        default_cache_behavior=aws_native.cloudfront.DistributionDefaultCacheBehaviorArgs(
            lambda_function_associations=[aws_native.cloudfront.DistributionLambdaFunctionAssociationArgs(
                event_type="string-value",
                lambda_function_arn="string-value",
            )],
        ),
        ipv6_enabled="boolean-value",
        origins=[aws_native.cloudfront.DistributionOriginArgs(
            custom_origin_config=aws_native.cloudfront.DistributionCustomOriginConfigArgs(
                origin_keepalive_timeout="integer-value",
                origin_read_timeout="integer-value",
            ),
        )],
    ),
    tags=[aws_native.cloudfront.DistributionTagArgs(
        key="string-value",
        value="string-value",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const cloudfrontdistribution = new aws_native.cloudfront.Distribution("cloudfrontdistribution", {
    distributionConfig: {
        cacheBehaviors: [{
            lambdaFunctionAssociations: [{
                eventType: "string-value",
                lambdaFunctionARN: "string-value",
            }],
        }],
        defaultCacheBehavior: {
            lambdaFunctionAssociations: [{
                eventType: "string-value",
                lambdaFunctionARN: "string-value",
            }],
        },
        ipv6Enabled: "boolean-value",
        origins: [{
            customOriginConfig: {
                originKeepaliveTimeout: "integer-value",
                originReadTimeout: "integer-value",
            },
        }],
    },
    tags: [{
        key: "string-value",
        value: "string-value",
    }],
});

Coming soon!

Example

using Pulumi;
using AwsNative = Pulumi.AwsNative;

class MyStack : Stack
{
    public MyStack()
    {
        var cloudfrontdistribution = new AwsNative.CloudFront.Distribution("cloudfrontdistribution", new AwsNative.CloudFront.DistributionArgs
        {
            DistributionConfig = new AwsNative.CloudFront.Inputs.DistributionConfigArgs
            {
                CacheBehaviors = 
                {
                    new AwsNative.CloudFront.Inputs.DistributionCacheBehaviorArgs
                    {
                        LambdaFunctionAssociations = 
                        {
                            new AwsNative.CloudFront.Inputs.DistributionLambdaFunctionAssociationArgs
                            {
                                EventType = "string-value",
                                LambdaFunctionARN = "string-value",
                            },
                        },
                    },
                },
                DefaultCacheBehavior = new AwsNative.CloudFront.Inputs.DistributionDefaultCacheBehaviorArgs
                {
                    LambdaFunctionAssociations = 
                    {
                        new AwsNative.CloudFront.Inputs.DistributionLambdaFunctionAssociationArgs
                        {
                            EventType = "string-value",
                            LambdaFunctionARN = "string-value",
                        },
                    },
                },
                Ipv6Enabled = "boolean-value",
                Origins = 
                {
                    new AwsNative.CloudFront.Inputs.DistributionOriginArgs
                    {
                        CustomOriginConfig = new AwsNative.CloudFront.Inputs.DistributionCustomOriginConfigArgs
                        {
                            OriginKeepaliveTimeout = "integer-value",
                            OriginReadTimeout = "integer-value",
                        },
                    },
                },
            },
            Tags = 
            {
                new AwsNative.CloudFront.Inputs.DistributionTagArgs
                {
                    Key = "string-value",
                    Value = "string-value",
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/cloudfront"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudfront.NewDistribution(ctx, "cloudfrontdistribution", &cloudfront.DistributionArgs{
			DistributionConfig: &cloudfront.DistributionConfigArgs{
				CacheBehaviors: cloudfront.DistributionCacheBehaviorArray{
					&cloudfront.DistributionCacheBehaviorArgs{
						LambdaFunctionAssociations: cloudfront.DistributionLambdaFunctionAssociationArray{
							&cloudfront.DistributionLambdaFunctionAssociationArgs{
								EventType:         pulumi.String("string-value"),
								LambdaFunctionARN: pulumi.String("string-value"),
							},
						},
					},
				},
				DefaultCacheBehavior: &cloudfront.DistributionDefaultCacheBehaviorArgs{
					LambdaFunctionAssociations: cloudfront.DistributionLambdaFunctionAssociationArray{
						&cloudfront.DistributionLambdaFunctionAssociationArgs{
							EventType:         pulumi.String("string-value"),
							LambdaFunctionARN: pulumi.String("string-value"),
						},
					},
				},
				Ipv6Enabled: "boolean-value",
				Origins: cloudfront.DistributionOriginArray{
					&cloudfront.DistributionOriginArgs{
						CustomOriginConfig: &cloudfront.DistributionCustomOriginConfigArgs{
							OriginKeepaliveTimeout: pulumi.Int("integer-value"),
							OriginReadTimeout:      pulumi.Int("integer-value"),
						},
					},
				},
			},
			Tags: []cloudfront.DistributionTagArgs{
				&cloudfront.DistributionTagArgs{
					Key:   pulumi.String("string-value"),
					Value: pulumi.String("string-value"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_aws_native as aws_native

cloudfrontdistribution = aws_native.cloudfront.Distribution("cloudfrontdistribution",
    distribution_config=aws_native.cloudfront.DistributionConfigArgs(
        cache_behaviors=[aws_native.cloudfront.DistributionCacheBehaviorArgs(
            lambda_function_associations=[aws_native.cloudfront.DistributionLambdaFunctionAssociationArgs(
                event_type="string-value",
                lambda_function_arn="string-value",
            )],
        )],
        default_cache_behavior=aws_native.cloudfront.DistributionDefaultCacheBehaviorArgs(
            lambda_function_associations=[aws_native.cloudfront.DistributionLambdaFunctionAssociationArgs(
                event_type="string-value",
                lambda_function_arn="string-value",
            )],
        ),
        ipv6_enabled="boolean-value",
        origins=[aws_native.cloudfront.DistributionOriginArgs(
            custom_origin_config=aws_native.cloudfront.DistributionCustomOriginConfigArgs(
                origin_keepalive_timeout="integer-value",
                origin_read_timeout="integer-value",
            ),
        )],
    ),
    tags=[aws_native.cloudfront.DistributionTagArgs(
        key="string-value",
        value="string-value",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws_native from "@pulumi/aws-native";

const cloudfrontdistribution = new aws_native.cloudfront.Distribution("cloudfrontdistribution", {
    distributionConfig: {
        cacheBehaviors: [{
            lambdaFunctionAssociations: [{
                eventType: "string-value",
                lambdaFunctionARN: "string-value",
            }],
        }],
        defaultCacheBehavior: {
            lambdaFunctionAssociations: [{
                eventType: "string-value",
                lambdaFunctionARN: "string-value",
            }],
        },
        ipv6Enabled: "boolean-value",
        origins: [{
            customOriginConfig: {
                originKeepaliveTimeout: "integer-value",
                originReadTimeout: "integer-value",
            },
        }],
    },
    tags: [{
        key: "string-value",
        value: "string-value",
    }],
});

Coming soon!

Create a Distribution Resource

new Distribution(name: string, args: DistributionArgs, opts?: CustomResourceOptions);
@overload
def Distribution(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 distribution_config: Optional[DistributionConfigArgs] = None,
                 tags: Optional[Sequence[DistributionTagArgs]] = None)
@overload
def Distribution(resource_name: str,
                 args: DistributionArgs,
                 opts: Optional[ResourceOptions] = None)
func NewDistribution(ctx *Context, name string, args DistributionArgs, opts ...ResourceOption) (*Distribution, error)
public Distribution(string name, DistributionArgs args, CustomResourceOptions? opts = null)
public Distribution(String name, DistributionArgs args)
public Distribution(String name, DistributionArgs args, CustomResourceOptions options)
type: aws-native:cloudfront:Distribution
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DistributionArgs
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 DistributionArgs
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 DistributionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DistributionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DistributionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Distribution 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 Distribution resource accepts the following input properties:

Outputs

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

DomainName string
Id string

The provider-assigned unique ID for this managed resource.

DomainName string
Id string

The provider-assigned unique ID for this managed resource.

domainName String
id String

The provider-assigned unique ID for this managed resource.

domainName string
id string

The provider-assigned unique ID for this managed resource.

domain_name str
id str

The provider-assigned unique ID for this managed resource.

domainName String
id String

The provider-assigned unique ID for this managed resource.

Supporting Types

DistributionCacheBehavior

DistributionConfig

Enabled bool
Aliases List<string>
CNAMEs List<string>
CacheBehaviors List<Pulumi.AwsNative.CloudFront.Inputs.DistributionCacheBehavior>
Comment string
CustomErrorResponses List<Pulumi.AwsNative.CloudFront.Inputs.DistributionCustomErrorResponse>
CustomOrigin Pulumi.AwsNative.CloudFront.Inputs.DistributionLegacyCustomOrigin
DefaultCacheBehavior Pulumi.AwsNative.CloudFront.Inputs.DistributionDefaultCacheBehavior
DefaultRootObject string
HttpVersion string
IPV6Enabled bool
Logging Pulumi.AwsNative.CloudFront.Inputs.DistributionLogging
OriginGroups Pulumi.AwsNative.CloudFront.Inputs.DistributionOriginGroups
Origins List<Pulumi.AwsNative.CloudFront.Inputs.DistributionOrigin>
PriceClass string
Restrictions Pulumi.AwsNative.CloudFront.Inputs.DistributionRestrictions
S3Origin Pulumi.AwsNative.CloudFront.Inputs.DistributionLegacyS3Origin
ViewerCertificate Pulumi.AwsNative.CloudFront.Inputs.DistributionViewerCertificate
WebACLId string

DistributionCookies

Forward string
WhitelistedNames List<string>
Forward string
WhitelistedNames []string
forward String
whitelistedNames List<String>
forward string
whitelistedNames string[]
forward str
whitelisted_names Sequence[str]
forward String
whitelistedNames List<String>

DistributionCustomErrorResponse

DistributionCustomOriginConfig

DistributionDefaultCacheBehavior

DistributionForwardedValues

DistributionFunctionAssociation

EventType string
FunctionARN string
EventType string
FunctionARN string
eventType String
functionARN String
eventType string
functionARN string
eventType String
functionARN String

DistributionGeoRestriction

RestrictionType string
Locations List<string>
RestrictionType string
Locations []string
restrictionType String
locations List<String>
restrictionType string
locations string[]
restriction_type str
locations Sequence[str]
restrictionType String
locations List<String>

DistributionLambdaFunctionAssociation

DistributionLegacyCustomOrigin

dNSName String
originProtocolPolicy String
originSSLProtocols List<String>
hTTPPort Integer
hTTPSPort Integer

DistributionLegacyS3Origin

DistributionLogging

Bucket string
IncludeCookies bool
Prefix string
Bucket string
IncludeCookies bool
Prefix string
bucket String
includeCookies Boolean
prefix String
bucket string
includeCookies boolean
prefix string
bucket String
includeCookies Boolean
prefix String

DistributionOrigin

DistributionOriginCustomHeader

HeaderName string
HeaderValue string
HeaderName string
HeaderValue string
headerName String
headerValue String
headerName string
headerValue string
headerName String
headerValue String

DistributionOriginGroup

DistributionOriginGroupFailoverCriteria

DistributionOriginGroupMember

OriginId string
OriginId string
originId String
originId string
originId String

DistributionOriginGroupMembers

DistributionOriginGroups

DistributionOriginShield

DistributionRestrictions

DistributionS3OriginConfig

DistributionStatusCodes

Items List<int>
Quantity int
Items []int
Quantity int
items List<Integer>
quantity Integer
items number[]
quantity number
items Sequence[int]
quantity int
items List<Number>
quantity Number

DistributionTag

Key string
Value string
Key string
Value string
key String
value String
key string
value string
key str
value str
key String
value String

DistributionViewerCertificate

Package Details

Repository
https://github.com/pulumi/pulumi-aws-native
License
Apache-2.0