awscloudfront

package
v2.159.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 22

README

Amazon CloudFront Construct Library

Amazon CloudFront is a web service that speeds up distribution of your static and dynamic web content, such as .html, .css, .js, and image files, to your users. CloudFront delivers your content through a worldwide network of data centers called edge locations. When a user requests content that you're serving with CloudFront, the user is routed to the edge location that provides the lowest latency, so that content is delivered with the best possible performance.

Distribution API

The Distribution API replaces the CloudFrontWebDistribution API which is now deprecated. The Distribution API is optimized for the most common use cases of CloudFront distributions (e.g., single origin and behavior, few customizations) while still providing the ability for more advanced use cases. The API focuses on simplicity for the common use cases, and convenience methods for creating the behaviors and origins necessary for more complex use cases.

Creating a distribution

CloudFront distributions deliver your content from one or more origins; an origin is the location where you store the original version of your content. Origins can be created from S3 buckets or a custom origin (HTTP server). Constructs to define origins are in the aws-cdk-lib/aws-cloudfront-origins module.

Each distribution has a default behavior which applies to all requests to that distribution, and routes requests to a primary origin. Additional behaviors may be specified for an origin with a given URL path pattern. Behaviors allow routing with multiple origins, controlling which HTTP methods to support, whether to require users to use HTTPS, and what query strings or cookies to forward to your origin, among other settings.

From an S3 Bucket

An S3 bucket can be added as an origin. An S3 bucket origin can either be configured as a standard bucket or as a website endpoint (see AWS docs for Using an S3 Bucket).

// Creates a distribution from an S3 bucket with origin access control
myBucket := s3.NewBucket(this, jsii.String("myBucket"))
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.S3BucketOrigin_WithOriginAccessControl(myBucket),
	},
})

See the README of the aws-cdk-lib/aws-cloudfront-origins module for more information on setting up S3 origins and origin access control (OAC).

ELBv2 Load Balancer

An Elastic Load Balancing (ELB) v2 load balancer may be used as an origin. In order for a load balancer to serve as an origin, it must be publicly accessible (internetFacing is true). Both Application and Network load balancers are supported.

// Creates a distribution from an ELBv2 load balancer
var vpc vpc

// Create an application load balancer in a VPC. 'internetFacing' must be 'true'
// for CloudFront to access the load balancer and use it as an origin.
lb := elbv2.NewApplicationLoadBalancer(this, jsii.String("LB"), &ApplicationLoadBalancerProps{
	Vpc: Vpc,
	InternetFacing: jsii.Boolean(true),
})
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewLoadBalancerV2Origin(lb),
	},
})
From an HTTP endpoint

Origins can also be created from any other HTTP endpoint, given the domain name, and optionally, other origin properties.

// Creates a distribution from an HTTP endpoint
// Creates a distribution from an HTTP endpoint
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
	},
})
Domain Names and Certificates

When you create a distribution, CloudFront assigns a domain name for the distribution, for example: d111111abcdef8.cloudfront.net; this value can be retrieved from distribution.distributionDomainName. CloudFront distributions use a default certificate (*.cloudfront.net) to support HTTPS by default. If you want to use your own domain name, such as www.example.com, you must associate a certificate with your distribution that contains your domain name, and provide one (or more) domain names from the certificate for the distribution.

The certificate must be present in the AWS Certificate Manager (ACM) service in the US East (N. Virginia) region; the certificate may either be created by ACM, or created elsewhere and imported into ACM. When a certificate is used, the distribution will support HTTPS connections from SNI only and a minimum protocol version of TLSv1.2_2021 if the @aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021 feature flag is set, and TLSv1.2_2019 otherwise.

// To use your own domain name in a Distribution, you must associate a certificate
import "github.com/aws/aws-cdk-go/awscdk"
import route53 "github.com/aws/aws-cdk-go/awscdk"

var hostedZone hostedZone

var myBucket bucket

myCertificate := acm.NewCertificate(this, jsii.String("mySiteCert"), &CertificateProps{
	DomainName: jsii.String("www.example.com"),
	Validation: acm.CertificateValidation_FromDns(hostedZone),
})
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(myBucket),
	},
	DomainNames: []*string{
		jsii.String("www.example.com"),
	},
	Certificate: myCertificate,
})

However, you can customize the minimum protocol version for the certificate while creating the distribution using minimumProtocolVersion property.

// Create a Distribution with a custom domain name and a minimum protocol version.
var myBucket bucket

cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(myBucket),
	},
	DomainNames: []*string{
		jsii.String("www.example.com"),
	},
	MinimumProtocolVersion: cloudfront.SecurityPolicyProtocol_TLS_V1_2016,
	SslSupportMethod: cloudfront.SSLMethod_SNI,
})
Moving an alternate domain name to a different distribution

When you try to add an alternate domain name to a distribution but the alternate domain name is already in use on a different distribution, you get a CNAMEAlreadyExists error (One or more of the CNAMEs you provided are already associated with a different resource).

In that case, you might want to move the existing alternate domain name from one distribution (the source distribution) to another (the target distribution). The following steps are an overview of the process. For more information, see Moving an alternate domain name to a different distribution.

  1. Deploy the stack with the target distribution. The certificate property must be specified but the domainNames should be absent.
  2. Move the alternate domain name by running CloudFront associate-alias command. For the example and preconditions, see the AWS documentation above.
  3. Specify the domainNames property with the alternative domain name, then deploy the stack again to resolve the drift at the alternative domain name.
Cross Region Certificates

This feature is currently experimental

You can enable the Stack property crossRegionReferences in order to access resources in a different stack and region. With this feature flag enabled it is possible to do something like creating a CloudFront distribution in us-east-2 and an ACM certificate in us-east-1.

import "github.com/aws/aws-cdk-go/awscdk"
import route53 "github.com/aws/aws-cdk-go/awscdk"

var app app


stack1 := awscdk.Newstack(app, jsii.String("Stack1"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-east-1"),
	},
	CrossRegionReferences: jsii.Boolean(true),
})
cert := acm.NewCertificate(stack1, jsii.String("Cert"), &CertificateProps{
	DomainName: jsii.String("*.example.com"),
	Validation: acm.CertificateValidation_FromDns(route53.PublicHostedZone_FromHostedZoneId(stack1, jsii.String("Zone"), jsii.String("Z0329774B51CGXTDQV3X"))),
})

stack2 := awscdk.Newstack(app, jsii.String("Stack2"), &StackProps{
	Env: &Environment{
		Region: jsii.String("us-east-2"),
	},
	CrossRegionReferences: jsii.Boolean(true),
})
cloudfront.NewDistribution(stack2, jsii.String("Distribution"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("example.com")),
	},
	DomainNames: []*string{
		jsii.String("dev.example.com"),
	},
	Certificate: cert,
})
Multiple Behaviors & Origins

Each distribution has a default behavior which applies to all requests to that distribution; additional behaviors may be specified for a given URL path pattern. Behaviors allow routing with multiple origins, controlling which HTTP methods to support, whether to require users to use HTTPS, and what query strings or cookies to forward to your origin, among others.

The properties of the default behavior can be adjusted as part of the distribution creation. The following example shows configuring the HTTP methods and viewer protocol policy of the cache.

// Create a Distribution with configured HTTP methods and viewer protocol policy of the cache.
var myBucket bucket

myWebDistribution := cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(myBucket),
		AllowedMethods: cloudfront.AllowedMethods_ALLOW_ALL(),
		ViewerProtocolPolicy: cloudfront.ViewerProtocolPolicy_REDIRECT_TO_HTTPS,
	},
})

Additional behaviors can be specified at creation, or added after the initial creation. Each additional behavior is associated with an origin, and enable customization for a specific set of resources based on a URL path pattern. For example, we can add a behavior to myWebDistribution to override the default viewer protocol policy for all of the images.

// Add a behavior to a Distribution after initial creation.
var myBucket bucket
var myWebDistribution distribution

myWebDistribution.AddBehavior(jsii.String("/images/*.jpg"), origins.NewS3Origin(myBucket), &AddBehaviorOptions{
	ViewerProtocolPolicy: cloudfront.ViewerProtocolPolicy_REDIRECT_TO_HTTPS,
})

These behaviors can also be specified at distribution creation time.

// Create a Distribution with additional behaviors at creation time.
var myBucket bucket

bucketOrigin := origins.NewS3Origin(myBucket)
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		AllowedMethods: cloudfront.AllowedMethods_ALLOW_ALL(),
		ViewerProtocolPolicy: cloudfront.ViewerProtocolPolicy_REDIRECT_TO_HTTPS,
	},
	AdditionalBehaviors: map[string]behaviorOptions{
		"/images/*.jpg": &behaviorOptions{
			"origin": bucketOrigin,
			"viewerProtocolPolicy": cloudfront.ViewerProtocolPolicy_REDIRECT_TO_HTTPS,
		},
	},
})
Customizing Cache Keys and TTLs with Cache Policies

You can use a cache policy to improve your cache hit ratio by controlling the values (URL query strings, HTTP headers, and cookies) that are included in the cache key, and/or adjusting how long items remain in the cache via the time-to-live (TTL) settings. CloudFront provides some predefined cache policies, known as managed policies, for common use cases. You can use these managed policies, or you can create your own cache policy that’s specific to your needs. See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html for more details.

// Using an existing cache policy for a Distribution
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		CachePolicy: cloudfront.CachePolicy_CACHING_OPTIMIZED(),
	},
})
// Creating a custom cache policy for a Distribution -- all parameters optional
var bucketOrigin s3Origin

myCachePolicy := cloudfront.NewCachePolicy(this, jsii.String("myCachePolicy"), &CachePolicyProps{
	CachePolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	DefaultTtl: awscdk.Duration_Days(jsii.Number(2)),
	MinTtl: awscdk.Duration_Minutes(jsii.Number(1)),
	MaxTtl: awscdk.Duration_*Days(jsii.Number(10)),
	CookieBehavior: cloudfront.CacheCookieBehavior_All(),
	HeaderBehavior: cloudfront.CacheHeaderBehavior_AllowList(jsii.String("X-CustomHeader")),
	QueryStringBehavior: cloudfront.CacheQueryStringBehavior_DenyList(jsii.String("username")),
	EnableAcceptEncodingGzip: jsii.Boolean(true),
	EnableAcceptEncodingBrotli: jsii.Boolean(true),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		CachePolicy: myCachePolicy,
	},
})
Customizing Origin Requests with Origin Request Policies

When CloudFront makes a request to an origin, the URL path, request body (if present), and a few standard headers are included. Other information from the viewer request, such as URL query strings, HTTP headers, and cookies, is not included in the origin request by default. You can use an origin request policy to control the information that’s included in an origin request. CloudFront provides some predefined origin request policies, known as managed policies, for common use cases. You can use these managed policies, or you can create your own origin request policy that’s specific to your needs. See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html for more details.

// Using an existing origin request policy for a Distribution
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		OriginRequestPolicy: cloudfront.OriginRequestPolicy_CORS_S3_ORIGIN(),
	},
})
// Creating a custom origin request policy for a Distribution -- all parameters optional
var bucketOrigin s3Origin

myOriginRequestPolicy := cloudfront.NewOriginRequestPolicy(this, jsii.String("OriginRequestPolicy"), &OriginRequestPolicyProps{
	OriginRequestPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CookieBehavior: cloudfront.OriginRequestCookieBehavior_None(),
	HeaderBehavior: cloudfront.OriginRequestHeaderBehavior_All(jsii.String("CloudFront-Is-Android-Viewer")),
	QueryStringBehavior: cloudfront.OriginRequestQueryStringBehavior_AllowList(jsii.String("username")),
})

cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		OriginRequestPolicy: myOriginRequestPolicy,
	},
})
Customizing Response Headers with Response Headers Policies

You can configure CloudFront to add one or more HTTP headers to the responses that it sends to viewers (web browsers or other clients), without making any changes to the origin or writing any code. To specify the headers that CloudFront adds to HTTP responses, you use a response headers policy. CloudFront adds the headers regardless of whether it serves the object from the cache or has to retrieve the object from the origin. If the origin response includes one or more of the headers that’s in a response headers policy, the policy can specify whether CloudFront uses the header it received from the origin or overwrites it with the one in the policy. See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/adding-response-headers.html

[!NOTE] If xssProtection reportUri is specified, then modeBlock cannot be set to true.

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})
Validating signed URLs or signed cookies with Trusted Key Groups

CloudFront Distribution supports validating signed URLs or signed cookies using key groups. When a cache behavior contains trusted key groups, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior.

// Validating signed URLs or signed cookies with Trusted Key Groups

// public key in PEM format
var publicKey string

pubKey := cloudfront.NewPublicKey(this, jsii.String("MyPubKey"), &PublicKeyProps{
	EncodedKey: publicKey,
})

keyGroup := cloudfront.NewKeyGroup(this, jsii.String("MyKeyGroup"), &KeyGroupProps{
	Items: []iPublicKey{
		pubKey,
	},
})

cloudfront.NewDistribution(this, jsii.String("Dist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
		TrustedKeyGroups: []iKeyGroup{
			keyGroup,
		},
	},
})
Lambda@Edge

Lambda@Edge is an extension of AWS Lambda, a compute service that lets you execute functions that customize the content that CloudFront delivers. You can author Node.js or Python functions in the US East (N. Virginia) region, and then execute them in AWS locations globally that are closer to the viewer, without provisioning or managing servers. Lambda@Edge functions are associated with a specific behavior and event type. Lambda@Edge can be used to rewrite URLs, alter responses based on headers or cookies, or authorize requests based on headers or authorization tokens.

The following shows a Lambda@Edge function added to the default behavior and triggered on every request:

var myBucket bucket
// A Lambda@Edge function added to default behavior of a Distribution
// and triggered on every request
myFunc := experimental.NewEdgeFunction(this, jsii.String("MyFunction"), &EdgeFunctionProps{
	Runtime: lambda.Runtime_NODEJS_LATEST(),
	Handler: jsii.String("index.handler"),
	Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))),
})
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(myBucket),
		EdgeLambdas: []edgeLambda{
			&edgeLambda{
				FunctionVersion: myFunc.currentVersion,
				EventType: cloudfront.LambdaEdgeEventType_VIEWER_REQUEST,
			},
		},
	},
})

Note: Lambda@Edge functions must be created in the us-east-1 region, regardless of the region of the CloudFront distribution and stack. To make it easier to request functions for Lambda@Edge, the EdgeFunction construct can be used. The EdgeFunction construct will automatically request a function in us-east-1, regardless of the region of the current stack. EdgeFunction has the same interface as Function and can be created and used interchangeably. Please note that using EdgeFunction requires that the us-east-1 region has been bootstrapped. See https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html for more about bootstrapping regions.

If the stack is in us-east-1, a "normal" lambda.Function can be used instead of an EdgeFunction.

// Using a lambda Function instead of an EdgeFunction for stacks in `us-east-`.
myFunc := lambda.NewFunction(this, jsii.String("MyFunction"), &FunctionProps{
	Runtime: lambda.Runtime_NODEJS_LATEST(),
	Handler: jsii.String("index.handler"),
	Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))),
})

If the stack is not in us-east-1, and you need references from different applications on the same account, you can also set a specific stack ID for each Lambda@Edge.

// Setting stackIds for EdgeFunctions that can be referenced from different applications
// on the same account.
myFunc1 := experimental.NewEdgeFunction(this, jsii.String("MyFunction1"), &EdgeFunctionProps{
	Runtime: lambda.Runtime_NODEJS_LATEST(),
	Handler: jsii.String("index.handler"),
	Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler1"))),
	StackId: jsii.String("edge-lambda-stack-id-1"),
})

myFunc2 := experimental.NewEdgeFunction(this, jsii.String("MyFunction2"), &EdgeFunctionProps{
	Runtime: lambda.Runtime_NODEJS_LATEST(),
	Handler: jsii.String("index.handler"),
	Code: lambda.Code_*FromAsset(path.join(__dirname, jsii.String("lambda-handler2"))),
	StackId: jsii.String("edge-lambda-stack-id-2"),
})

Lambda@Edge functions can also be associated with additional behaviors, either at or after Distribution creation time.

// Associating a Lambda@Edge function with additional behaviors.

var myFunc edgeFunction
// assigning at Distribution creation
var myBucket bucket

myOrigin := origins.NewS3Origin(myBucket)
myDistribution := cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: myOrigin,
	},
	AdditionalBehaviors: map[string]behaviorOptions{
		"images/*": &behaviorOptions{
			"origin": myOrigin,
			"edgeLambdas": []EdgeLambda{
				&EdgeLambda{
					"functionVersion": myFunc.currentVersion,
					"eventType": cloudfront.LambdaEdgeEventType_ORIGIN_REQUEST,
					"includeBody": jsii.Boolean(true),
				},
			},
		},
	},
})

// assigning after creation
myDistribution.AddBehavior(jsii.String("images/*"), myOrigin, &AddBehaviorOptions{
	EdgeLambdas: []edgeLambda{
		&edgeLambda{
			FunctionVersion: myFunc.currentVersion,
			EventType: cloudfront.LambdaEdgeEventType_VIEWER_RESPONSE,
		},
	},
})

Adding an existing Lambda@Edge function created in a different stack to a CloudFront distribution.

// Adding an existing Lambda@Edge function created in a different stack
// to a CloudFront distribution.
var s3Bucket bucket

functionVersion := lambda.Version_FromVersionArn(this, jsii.String("Version"), jsii.String("arn:aws:lambda:us-east-1:123456789012:function:functionName:1"))

cloudfront.NewDistribution(this, jsii.String("distro"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(s3Bucket),
		EdgeLambdas: []edgeLambda{
			&edgeLambda{
				FunctionVersion: *FunctionVersion,
				EventType: cloudfront.LambdaEdgeEventType_VIEWER_REQUEST,
			},
		},
	},
})
CloudFront Function

You can also deploy CloudFront functions and add them to a CloudFront distribution.

var s3Bucket bucket
// Add a cloudfront Function to a Distribution
cfFunction := cloudfront.NewFunction(this, jsii.String("Function"), &FunctionProps{
	Code: cloudfront.FunctionCode_FromInline(jsii.String("function handler(event) { return event.request }")),
	Runtime: cloudfront.FunctionRuntime_JS_2_0(),
})
cloudfront.NewDistribution(this, jsii.String("distro"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(s3Bucket),
		FunctionAssociations: []functionAssociation{
			&functionAssociation{
				Function: cfFunction,
				EventType: cloudfront.FunctionEventType_VIEWER_REQUEST,
			},
		},
	},
})

It will auto-generate the name of the function and deploy it to the live stage.

Additionally, you can load the function's code from a file using the FunctionCode.fromFile() method.

If you set autoPublish to false, the function will not be automatically published to the LIVE stage when it’s created.

cloudfront.NewFunction(this, jsii.String("Function"), &FunctionProps{
	Code: cloudfront.FunctionCode_FromInline(jsii.String("function handler(event) { return event.request }")),
	Runtime: cloudfront.FunctionRuntime_JS_2_0(),
	AutoPublish: jsii.Boolean(false),
})
Key Value Store

A CloudFront Key Value Store can be created and optionally have data imported from a JSON file by default.

To create an empty Key Value Store:

store := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStore"))

To also include an initial set of values, the source property can be specified, either from a local file or an inline string. For the structure of this file, see Creating a file of key value pairs.

storeAsset := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStoreAsset"), &KeyValueStoreProps{
	KeyValueStoreName: jsii.String("KeyValueStoreAsset"),
	Source: cloudfront.ImportSource_FromAsset(jsii.String("path-to-data.json")),
})

storeInline := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStoreInline"), &KeyValueStoreProps{
	KeyValueStoreName: jsii.String("KeyValueStoreInline"),
	Source: cloudfront.ImportSource_FromInline(jSON.stringify(map[string][]map[string]*string{
		"data": []map[string]*string{
			map[string]*string{
				"key": jsii.String("key1"),
				"value": jsii.String("value1"),
			},
			map[string]*string{
				"key": jsii.String("key2"),
				"value": jsii.String("value2"),
			},
		},
	})),
})

The Key Value Store can then be associated to a function using the cloudfront-js-2.0 runtime or newer:

store := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStore"))
cloudfront.NewFunction(this, jsii.String("Function"), &FunctionProps{
	Code: cloudfront.FunctionCode_FromInline(jsii.String("function handler(event) { return event.request }")),
	// Note that JS_2_0 must be used for Key Value Store support
	Runtime: cloudfront.FunctionRuntime_JS_2_0(),
	KeyValueStore: store,
})
Logging

You can configure CloudFront to create log files that contain detailed information about every user request that CloudFront receives. The logs can go to either an existing bucket, or a bucket will be created for you.

// Configure logging for Distributions

// Simplest form - creates a new bucket and logs to it.
// Configure logging for Distributions
// Simplest form - creates a new bucket and logs to it.
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
	},
	EnableLogging: jsii.Boolean(true),
})

// You can optionally log to a specific bucket, configure whether cookies are logged, and give the log files a prefix.
// You can optionally log to a specific bucket, configure whether cookies are logged, and give the log files a prefix.
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
	},
	EnableLogging: jsii.Boolean(true),
	 // Optional, this is implied if logBucket is specified
	LogBucket: s3.NewBucket(this, jsii.String("LogBucket"), &BucketProps{
		ObjectOwnership: s3.ObjectOwnership_OBJECT_WRITER,
	}),
	LogFilePrefix: jsii.String("distribution-access-logs/"),
	LogIncludesCookies: jsii.Boolean(true),
})
CloudFront Distribution Metrics

You can view operational metrics about your CloudFront distributions.

Default CloudFront Distribution Metrics

The following metrics are available by default for all CloudFront distributions:

  • Total requests: The total number of viewer requests received by CloudFront for all HTTP methods and for both HTTP and HTTPS requests.
  • Total bytes uploaded: The total number of bytes that viewers uploaded to your origin with CloudFront, using POST and PUT requests.
  • Total bytes downloaded: The total number of bytes downloaded by viewers for GET, HEAD, and OPTIONS requests.
  • Total error rate: The percentage of all viewer requests for which the response's HTTP status code was 4xx or 5xx.
  • 4xx error rate: The percentage of all viewer requests for which the response's HTTP status code was 4xx.
  • 5xx error rate: The percentage of all viewer requests for which the response's HTTP status code was 5xx.
dist := cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
	},
})

// Retrieving default distribution metrics
requestsMetric := dist.MetricRequests()
bytesUploadedMetric := dist.MetricBytesUploaded()
bytesDownloadedMetric := dist.MetricBytesDownloaded()
totalErrorRateMetric := dist.MetricTotalErrorRate()
http4xxErrorRateMetric := dist.Metric4xxErrorRate()
http5xxErrorRateMetric := dist.Metric5xxErrorRate()
Additional CloudFront Distribution Metrics

You can enable additional CloudFront distribution metrics, which include the following metrics:

  • 4xx and 5xx error rates: View 4xx and 5xx error rates by the specific HTTP status code, as a percentage of total requests.
  • Origin latency: See the total time spent from when CloudFront receives a request to when it provides a response to the network (not the viewer), for responses that are served from the origin, not the CloudFront cache.
  • Cache hit rate: View cache hits as a percentage of total cacheable requests, excluding errors.
dist := cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
	},
	PublishAdditionalMetrics: jsii.Boolean(true),
})

// Retrieving additional distribution metrics
latencyMetric := dist.MetricOriginLatency()
cacheHitRateMetric := dist.MetricCacheHitRate()
http401ErrorRateMetric := dist.Metric401ErrorRate()
http403ErrorRateMetric := dist.Metric403ErrorRate()
http404ErrorRateMetric := dist.Metric404ErrorRate()
http502ErrorRateMetric := dist.Metric502ErrorRate()
http503ErrorRateMetric := dist.Metric503ErrorRate()
http504ErrorRateMetric := dist.Metric504ErrorRate()
HTTP Versions

You can configure CloudFront to use a particular version of the HTTP protocol. By default, newly created distributions use HTTP/2 but can be configured to use both HTTP/2 and HTTP/3 or just HTTP/3. For all supported HTTP versions, see the HttpVerson enum.

// Configure a distribution to use HTTP/2 and HTTP/3
// Configure a distribution to use HTTP/2 and HTTP/3
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
	},
	HttpVersion: cloudfront.HttpVersion_HTTP2_AND_3,
})
Importing Distributions

Existing distributions can be imported as well; note that like most imported constructs, an imported distribution cannot be modified. However, it can be used as a reference for other higher-level constructs.

// Using a reference to an imported Distribution
distribution := cloudfront.Distribution_FromDistributionAttributes(this, jsii.String("ImportedDist"), &DistributionAttributes{
	DomainName: jsii.String("d111111abcdef8.cloudfront.net"),
	DistributionId: jsii.String("012345ABCDEF"),
})
Permissions

Use the grant() method to allow actions on the distribution. grantCreateInvalidation() is a shorthand to allow CreateInvalidation.

var distribution distribution
var lambdaFn function

distribution.Grant(lambdaFn, jsii.String("cloudfront:ListInvalidations"), jsii.String("cloudfront:GetInvalidation"))
distribution.GrantCreateInvalidation(lambdaFn)
Realtime Log Config

CloudFront supports realtime log delivery from your distribution to a Kinesis stream.

See Real-time logs in the CloudFront User Guide.

Example:

// Adding realtime logs config to a Cloudfront Distribution on default behavior.
import kinesis "github.com/aws/aws-cdk-go/awscdk"

var stream stream


realTimeConfig := cloudfront.NewRealtimeLogConfig(this, jsii.String("realtimeLog"), &RealtimeLogConfigProps{
	EndPoints: []endpoint{
		cloudfront.*endpoint_FromKinesisStream(stream),
	},
	Fields: []*string{
		jsii.String("timestamp"),
		jsii.String("c-ip"),
		jsii.String("time-to-first-byte"),
		jsii.String("sc-status"),
	},
	RealtimeLogConfigName: jsii.String("my-delivery-stream"),
	SamplingRate: jsii.Number(100),
})

cloudfront.NewDistribution(this, jsii.String("myCdn"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
		RealtimeLogConfig: realTimeConfig,
	},
})

Migrating from the original CloudFrontWebDistribution to the newer Distribution construct

It's possible to migrate a distribution from the original to the modern API. The changes necessary are the following:

The Distribution

Replace new CloudFrontWebDistribution with new Distribution. Some configuration properties have been changed:

Old API New API
originConfigs defaultBehavior; use additionalBehaviors if necessary
viewerCertificate certificate; use domainNames for aliases
errorConfigurations errorResponses
loggingConfig enableLogging; configure with logBucket logFilePrefix and logIncludesCookies
viewerProtocolPolicy removed; set on each behavior instead. default changed from REDIRECT_TO_HTTPS to ALLOW_ALL

After switching constructs, you need to maintain the same logical ID for the underlying CfnDistribution if you wish to avoid the deletion and recreation of your distribution. To do this, use escape hatches to override the logical ID created by the new Distribution construct with the logical ID created by the old construct.

Example:

var sourceBucket bucket


myDistribution := cloudfront.NewDistribution(this, jsii.String("MyCfWebDistribution"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(sourceBucket),
	},
})
cfnDistribution := myDistribution.Node.defaultChild.(cfnDistribution)
cfnDistribution.OverrideLogicalId(jsii.String("MyDistributionCFDistribution3H55TI9Q"))
Behaviors

The modern API makes use of the CloudFront Origins module to easily configure your origin. Replace your origin configuration with the relevant CloudFront Origins class. For example, here's a behavior with an S3 origin:

var sourceBucket bucket
var oai originAccessIdentity


cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyCfWebDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
				OriginAccessIdentity: oai,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
})

Becomes:

var sourceBucket bucket


distribution := cloudfront.NewDistribution(this, jsii.String("MyCfWebDistribution"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(sourceBucket),
	},
})

In the original API all behaviors are defined in the originConfigs property. The new API is optimized for a single origin and behavior, so the default behavior and additional behaviors will be defined separately.

var sourceBucket bucket
var oai originAccessIdentity


cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyCfWebDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
				OriginAccessIdentity: oai,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
		&sourceConfiguration{
			CustomOriginSource: &CustomOriginConfig{
				DomainName: jsii.String("MYALIAS"),
			},
			Behaviors: []*behavior{
				&behavior{
					PathPattern: jsii.String("/somewhere"),
				},
			},
		},
	},
})

Becomes:

var sourceBucket bucket


distribution := cloudfront.NewDistribution(this, jsii.String("MyCfWebDistribution"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(sourceBucket),
	},
	AdditionalBehaviors: map[string]behaviorOptions{
		"/somewhere": &behaviorOptions{
			"origin": origins.NewHttpOrigin(jsii.String("MYALIAS")),
		},
	},
})
Certificates

If you are using an ACM certificate, you can pass the certificate directly to the certificate prop. Any aliases used before in the ViewerCertificate class should be passed in to the domainNames prop in the modern API.

import acm "github.com/aws/aws-cdk-go/awscdk"
var certificate certificate
var sourceBucket bucket


viewerCertificate := cloudfront.ViewerCertificate_FromAcmCertificate(certificate, &ViewerCertificateOptions{
	Aliases: []*string{
		jsii.String("MYALIAS"),
	},
})

cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyCfWebDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: viewerCertificate,
})

Becomes:

import acm "github.com/aws/aws-cdk-go/awscdk"
var certificate certificate
var sourceBucket bucket


distribution := cloudfront.NewDistribution(this, jsii.String("MyCfWebDistribution"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(sourceBucket),
	},
	DomainNames: []*string{
		jsii.String("MYALIAS"),
	},
	Certificate: certificate,
})

IAM certificates aren't directly supported by the new API, but can be easily configured through escape hatches

var sourceBucket bucket

viewerCertificate := cloudfront.ViewerCertificate_FromIamCertificate(jsii.String("MYIAMROLEIDENTIFIER"), &ViewerCertificateOptions{
	Aliases: []*string{
		jsii.String("MYALIAS"),
	},
})

cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyCfWebDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: viewerCertificate,
})

Becomes:

var sourceBucket bucket

distribution := cloudfront.NewDistribution(this, jsii.String("MyCfWebDistribution"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(sourceBucket),
	},
	DomainNames: []*string{
		jsii.String("MYALIAS"),
	},
})

cfnDistribution := distribution.Node.defaultChild.(cfnDistribution)

cfnDistribution.AddPropertyOverride(jsii.String("ViewerCertificate.IamCertificateId"), jsii.String("MYIAMROLEIDENTIFIER"))
cfnDistribution.AddPropertyOverride(jsii.String("ViewerCertificate.SslSupportMethod"), jsii.String("sni-only"))
Other changes

A number of default settings have changed on the new API when creating a new distribution, behavior, and origin. After making the major changes needed for the migration, run cdk diff to see what settings have changed. If no changes are desired during migration, you will at the least be able to use escape hatches to override what the CDK synthesizes, if you can't change the properties directly.

CloudFrontWebDistribution API

The CloudFrontWebDistribution construct is the original construct written for working with CloudFront distributions and has been marked as deprecated. Users are encouraged to use the newer Distribution instead, as it has a simpler interface and receives new features faster.

Example usage:

// Using a CloudFrontWebDistribution construct.

var sourceBucket bucket

distribution := cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
})
Viewer certificate

By default, CloudFront Web Distributions will answer HTTPS requests with CloudFront's default certificate, only containing the distribution domainName (e.g. d111111abcdef8.cloudfront.net). You can customize the viewer certificate property to provide a custom certificate and/or list of domain name aliases to fit your needs.

See Using Alternate Domain Names and HTTPS in the CloudFront User Guide.

Default certificate

You can customize the default certificate aliases. This is intended to be used in combination with CNAME records in your DNS zone.

Example:

s3BucketSource := s3.NewBucket(this, jsii.String("Bucket"))

distribution := cloudfront.NewCloudFrontWebDistribution(this, jsii.String("AnAmazingWebsiteProbably"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: *S3BucketSource,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: cloudfront.ViewerCertificate_FromCloudFrontDefaultCertificate(jsii.String("www.example.com")),
})
ACM certificate

You can change the default certificate by one stored AWS Certificate Manager, or ACM. Those certificate can either be generated by AWS, or purchased by another CA imported into ACM.

For more information, see the aws-certificatemanager module documentation or Importing Certificates into AWS Certificate Manager in the AWS Certificate Manager User Guide.

Example:

s3BucketSource := s3.NewBucket(this, jsii.String("Bucket"))

certificate := certificatemanager.NewCertificate(this, jsii.String("Certificate"), &CertificateProps{
	DomainName: jsii.String("example.com"),
	SubjectAlternativeNames: []*string{
		jsii.String("*.example.com"),
	},
})

distribution := cloudfront.NewCloudFrontWebDistribution(this, jsii.String("AnAmazingWebsiteProbably"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: *S3BucketSource,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: cloudfront.ViewerCertificate_FromAcmCertificate(certificate, &ViewerCertificateOptions{
		Aliases: []*string{
			jsii.String("example.com"),
			jsii.String("www.example.com"),
		},
		SecurityPolicy: cloudfront.SecurityPolicyProtocol_TLS_V1,
		 // default
		SslMethod: cloudfront.SSLMethod_SNI,
	}),
})
IAM certificate

You can also import a certificate into the IAM certificate store.

See Importing an SSL/TLS Certificate in the CloudFront User Guide.

Example:

s3BucketSource := s3.NewBucket(this, jsii.String("Bucket"))

distribution := cloudfront.NewCloudFrontWebDistribution(this, jsii.String("AnAmazingWebsiteProbably"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: *S3BucketSource,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: cloudfront.ViewerCertificate_FromIamCertificate(jsii.String("certificateId"), &ViewerCertificateOptions{
		Aliases: []*string{
			jsii.String("example.com"),
		},
		SecurityPolicy: cloudfront.SecurityPolicyProtocol_SSL_V3,
		 // default
		SslMethod: cloudfront.SSLMethod_SNI,
	}),
})
Trusted Key Groups

CloudFront Web Distributions supports validating signed URLs or signed cookies using key groups. When a cache behavior contains trusted key groups, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior.

Example:

// Using trusted key groups for Cloudfront Web Distributions.
var sourceBucket bucket
var publicKey string

pubKey := cloudfront.NewPublicKey(this, jsii.String("MyPubKey"), &PublicKeyProps{
	EncodedKey: publicKey,
})

keyGroup := cloudfront.NewKeyGroup(this, jsii.String("MyKeyGroup"), &KeyGroupProps{
	Items: []iPublicKey{
		pubKey,
	},
})

cloudfront.NewCloudFrontWebDistribution(this, jsii.String("AnAmazingWebsiteProbably"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
					TrustedKeyGroups: []iKeyGroup{
						keyGroup,
					},
				},
			},
		},
	},
})
Restrictions

CloudFront supports adding restrictions to your distribution.

See Restricting the Geographic Distribution of Your Content in the CloudFront User Guide.

Example:

// Adding restrictions to a Cloudfront Web Distribution.
var sourceBucket bucket

cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	GeoRestriction: cloudfront.GeoRestriction_Allowlist(jsii.String("US"), jsii.String("GB")),
})
Connection behaviors between CloudFront and your origin

CloudFront provides you even more control over the connection behaviors between CloudFront and your origin. You can now configure the number of connection attempts CloudFront will make to your origin and the origin connection timeout for each attempt.

See Origin Connection Attempts

See Origin Connection Timeout

Example usage:

// Configuring connection behaviors between Cloudfront and your origin
distribution := cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			ConnectionAttempts: jsii.Number(3),
			ConnectionTimeout: awscdk.Duration_Seconds(jsii.Number(10)),
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
})
Origin Fallback

In case the origin source is not available and answers with one of the specified status codes the failover origin source will be used.

// Configuring origin fallback options for the CloudFrontWebDistribution
// Configuring origin fallback options for the CloudFrontWebDistribution
cloudfront.NewCloudFrontWebDistribution(this, jsii.String("ADistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: s3.Bucket_FromBucketName(this, jsii.String("aBucket"), jsii.String("myoriginbucket")),
				OriginPath: jsii.String("/"),
				OriginHeaders: map[string]*string{
					"myHeader": jsii.String("42"),
				},
				OriginShieldRegion: jsii.String("us-west-2"),
			},
			FailoverS3OriginSource: &S3OriginConfig{
				S3BucketSource: s3.Bucket_*FromBucketName(this, jsii.String("aBucketFallback"), jsii.String("myoriginbucketfallback")),
				OriginPath: jsii.String("/somewhere"),
				OriginHeaders: map[string]*string{
					"myHeader2": jsii.String("21"),
				},
				OriginShieldRegion: jsii.String("us-east-1"),
			},
			FailoverCriteriaStatusCodes: []failoverStatusCode{
				cloudfront.*failoverStatusCode_INTERNAL_SERVER_ERROR,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
})

KeyGroup & PublicKey API

You can create a key group to use with CloudFront signed URLs and signed cookies You can add public keys to use with CloudFront features such as signed URLs, signed cookies, and field-level encryption.

The following example command uses OpenSSL to generate an RSA key pair with a length of 2048 bits and save to the file named private_key.pem.

openssl genrsa -out private_key.pem 2048

The resulting file contains both the public and the private key. The following example command extracts the public key from the file named private_key.pem and stores it in public_key.pem.

openssl rsa -pubout -in private_key.pem -out public_key.pem

Note: Don't forget to copy/paste the contents of public_key.pem file including -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- lines into encodedKey parameter when creating a PublicKey.

Example:

// Create a key group to use with CloudFront signed URLs and signed cookies.
// Create a key group to use with CloudFront signed URLs and signed cookies.
cloudfront.NewKeyGroup(this, jsii.String("MyKeyGroup"), &KeyGroupProps{
	Items: []iPublicKey{
		cloudfront.NewPublicKey(this, jsii.String("MyPublicKey"), &PublicKeyProps{
			EncodedKey: jsii.String("..."),
		}),
	},
})

See:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CachePolicy_IsConstruct

func CachePolicy_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CachePolicy_IsOwnedResource added in v2.32.0

func CachePolicy_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func CachePolicy_IsResource

func CachePolicy_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func CfnCachePolicy_CFN_RESOURCE_TYPE_NAME

func CfnCachePolicy_CFN_RESOURCE_TYPE_NAME() *string

func CfnCachePolicy_IsCfnElement

func CfnCachePolicy_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnCachePolicy_IsCfnResource

func CfnCachePolicy_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnCachePolicy_IsConstruct

func CfnCachePolicy_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnCloudFrontOriginAccessIdentity_CFN_RESOURCE_TYPE_NAME

func CfnCloudFrontOriginAccessIdentity_CFN_RESOURCE_TYPE_NAME() *string

func CfnCloudFrontOriginAccessIdentity_IsCfnElement

func CfnCloudFrontOriginAccessIdentity_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnCloudFrontOriginAccessIdentity_IsCfnResource

func CfnCloudFrontOriginAccessIdentity_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnCloudFrontOriginAccessIdentity_IsConstruct

func CfnCloudFrontOriginAccessIdentity_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnContinuousDeploymentPolicy_CFN_RESOURCE_TYPE_NAME added in v2.54.0

func CfnContinuousDeploymentPolicy_CFN_RESOURCE_TYPE_NAME() *string

func CfnContinuousDeploymentPolicy_IsCfnElement added in v2.54.0

func CfnContinuousDeploymentPolicy_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnContinuousDeploymentPolicy_IsCfnResource added in v2.54.0

func CfnContinuousDeploymentPolicy_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnContinuousDeploymentPolicy_IsConstruct added in v2.54.0

func CfnContinuousDeploymentPolicy_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnDistribution_CFN_RESOURCE_TYPE_NAME

func CfnDistribution_CFN_RESOURCE_TYPE_NAME() *string

func CfnDistribution_IsCfnElement

func CfnDistribution_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnDistribution_IsCfnResource

func CfnDistribution_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnDistribution_IsConstruct

func CfnDistribution_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnFunction_CFN_RESOURCE_TYPE_NAME

func CfnFunction_CFN_RESOURCE_TYPE_NAME() *string

func CfnFunction_IsCfnElement

func CfnFunction_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnFunction_IsCfnResource

func CfnFunction_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnFunction_IsConstruct

func CfnFunction_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnKeyGroup_CFN_RESOURCE_TYPE_NAME

func CfnKeyGroup_CFN_RESOURCE_TYPE_NAME() *string

func CfnKeyGroup_IsCfnElement

func CfnKeyGroup_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnKeyGroup_IsCfnResource

func CfnKeyGroup_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnKeyGroup_IsConstruct

func CfnKeyGroup_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnKeyValueStore_CFN_RESOURCE_TYPE_NAME added in v2.116.0

func CfnKeyValueStore_CFN_RESOURCE_TYPE_NAME() *string

func CfnKeyValueStore_IsCfnElement added in v2.116.0

func CfnKeyValueStore_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnKeyValueStore_IsCfnResource added in v2.116.0

func CfnKeyValueStore_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnKeyValueStore_IsConstruct added in v2.116.0

func CfnKeyValueStore_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnMonitoringSubscription_CFN_RESOURCE_TYPE_NAME added in v2.45.0

func CfnMonitoringSubscription_CFN_RESOURCE_TYPE_NAME() *string

func CfnMonitoringSubscription_IsCfnElement added in v2.45.0

func CfnMonitoringSubscription_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnMonitoringSubscription_IsCfnResource added in v2.45.0

func CfnMonitoringSubscription_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnMonitoringSubscription_IsConstruct added in v2.45.0

func CfnMonitoringSubscription_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnOriginAccessControl_CFN_RESOURCE_TYPE_NAME added in v2.42.0

func CfnOriginAccessControl_CFN_RESOURCE_TYPE_NAME() *string

func CfnOriginAccessControl_IsCfnElement added in v2.42.0

func CfnOriginAccessControl_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnOriginAccessControl_IsCfnResource added in v2.42.0

func CfnOriginAccessControl_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnOriginAccessControl_IsConstruct added in v2.42.0

func CfnOriginAccessControl_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnOriginRequestPolicy_CFN_RESOURCE_TYPE_NAME

func CfnOriginRequestPolicy_CFN_RESOURCE_TYPE_NAME() *string

func CfnOriginRequestPolicy_IsCfnElement

func CfnOriginRequestPolicy_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnOriginRequestPolicy_IsCfnResource

func CfnOriginRequestPolicy_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnOriginRequestPolicy_IsConstruct

func CfnOriginRequestPolicy_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnPublicKey_CFN_RESOURCE_TYPE_NAME

func CfnPublicKey_CFN_RESOURCE_TYPE_NAME() *string

func CfnPublicKey_IsCfnElement

func CfnPublicKey_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnPublicKey_IsCfnResource

func CfnPublicKey_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnPublicKey_IsConstruct

func CfnPublicKey_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnRealtimeLogConfig_CFN_RESOURCE_TYPE_NAME

func CfnRealtimeLogConfig_CFN_RESOURCE_TYPE_NAME() *string

func CfnRealtimeLogConfig_IsCfnElement

func CfnRealtimeLogConfig_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnRealtimeLogConfig_IsCfnResource

func CfnRealtimeLogConfig_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnRealtimeLogConfig_IsConstruct

func CfnRealtimeLogConfig_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnResponseHeadersPolicy_CFN_RESOURCE_TYPE_NAME

func CfnResponseHeadersPolicy_CFN_RESOURCE_TYPE_NAME() *string

func CfnResponseHeadersPolicy_IsCfnElement

func CfnResponseHeadersPolicy_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnResponseHeadersPolicy_IsCfnResource

func CfnResponseHeadersPolicy_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnResponseHeadersPolicy_IsConstruct

func CfnResponseHeadersPolicy_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CfnStreamingDistribution_CFN_RESOURCE_TYPE_NAME

func CfnStreamingDistribution_CFN_RESOURCE_TYPE_NAME() *string

func CfnStreamingDistribution_IsCfnElement

func CfnStreamingDistribution_IsCfnElement(x interface{}) *bool

Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.

Returns: The construct as a stack element or undefined if it is not a stack element.

func CfnStreamingDistribution_IsCfnResource

func CfnStreamingDistribution_IsCfnResource(x interface{}) *bool

Check whether the given object is a CfnResource.

func CfnStreamingDistribution_IsConstruct

func CfnStreamingDistribution_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func CloudFrontWebDistribution_IsConstruct

func CloudFrontWebDistribution_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: Use `Distribution` instead.

func CloudFrontWebDistribution_IsOwnedResource added in v2.32.0

func CloudFrontWebDistribution_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Deprecated: Use `Distribution` instead.

func CloudFrontWebDistribution_IsResource

func CloudFrontWebDistribution_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Deprecated: Use `Distribution` instead.

func Distribution_IsConstruct

func Distribution_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func Distribution_IsOwnedResource added in v2.32.0

func Distribution_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func Distribution_IsResource

func Distribution_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func Function_IsConstruct

func Function_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func Function_IsOwnedResource added in v2.32.0

func Function_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func Function_IsResource

func Function_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func KeyGroup_IsConstruct

func KeyGroup_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func KeyGroup_IsOwnedResource added in v2.32.0

func KeyGroup_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func KeyGroup_IsResource

func KeyGroup_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func KeyValueStore_IsConstruct added in v2.118.0

func KeyValueStore_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func KeyValueStore_IsOwnedResource added in v2.118.0

func KeyValueStore_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func KeyValueStore_IsResource added in v2.118.0

func KeyValueStore_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func NewAssetImportSource_Override added in v2.118.0

func NewAssetImportSource_Override(a AssetImportSource, path *string, options *awss3assets.AssetOptions)

func NewCachePolicy_Override

func NewCachePolicy_Override(c CachePolicy, scope constructs.Construct, id *string, props *CachePolicyProps)

func NewCfnCachePolicy_Override

func NewCfnCachePolicy_Override(c CfnCachePolicy, scope constructs.Construct, id *string, props *CfnCachePolicyProps)

func NewCfnCloudFrontOriginAccessIdentity_Override

func NewCfnCloudFrontOriginAccessIdentity_Override(c CfnCloudFrontOriginAccessIdentity, scope constructs.Construct, id *string, props *CfnCloudFrontOriginAccessIdentityProps)

func NewCfnContinuousDeploymentPolicy_Override added in v2.54.0

func NewCfnContinuousDeploymentPolicy_Override(c CfnContinuousDeploymentPolicy, scope constructs.Construct, id *string, props *CfnContinuousDeploymentPolicyProps)

func NewCfnDistribution_Override

func NewCfnDistribution_Override(c CfnDistribution, scope constructs.Construct, id *string, props *CfnDistributionProps)

func NewCfnFunction_Override

func NewCfnFunction_Override(c CfnFunction, scope constructs.Construct, id *string, props *CfnFunctionProps)

func NewCfnKeyGroup_Override

func NewCfnKeyGroup_Override(c CfnKeyGroup, scope constructs.Construct, id *string, props *CfnKeyGroupProps)

func NewCfnKeyValueStore_Override added in v2.116.0

func NewCfnKeyValueStore_Override(c CfnKeyValueStore, scope constructs.Construct, id *string, props *CfnKeyValueStoreProps)

func NewCfnMonitoringSubscription_Override added in v2.45.0

func NewCfnMonitoringSubscription_Override(c CfnMonitoringSubscription, scope constructs.Construct, id *string, props *CfnMonitoringSubscriptionProps)

func NewCfnOriginAccessControl_Override added in v2.42.0

func NewCfnOriginAccessControl_Override(c CfnOriginAccessControl, scope constructs.Construct, id *string, props *CfnOriginAccessControlProps)

func NewCfnOriginRequestPolicy_Override

func NewCfnOriginRequestPolicy_Override(c CfnOriginRequestPolicy, scope constructs.Construct, id *string, props *CfnOriginRequestPolicyProps)

func NewCfnPublicKey_Override

func NewCfnPublicKey_Override(c CfnPublicKey, scope constructs.Construct, id *string, props *CfnPublicKeyProps)

func NewCfnRealtimeLogConfig_Override

func NewCfnRealtimeLogConfig_Override(c CfnRealtimeLogConfig, scope constructs.Construct, id *string, props *CfnRealtimeLogConfigProps)

func NewCfnResponseHeadersPolicy_Override

func NewCfnResponseHeadersPolicy_Override(c CfnResponseHeadersPolicy, scope constructs.Construct, id *string, props *CfnResponseHeadersPolicyProps)

func NewCfnStreamingDistribution_Override

func NewCfnStreamingDistribution_Override(c CfnStreamingDistribution, scope constructs.Construct, id *string, props *CfnStreamingDistributionProps)

func NewCloudFrontWebDistribution_Override deprecated

func NewCloudFrontWebDistribution_Override(c CloudFrontWebDistribution, scope constructs.Construct, id *string, props *CloudFrontWebDistributionProps)

Deprecated: Use `Distribution` instead.

func NewDistribution_Override

func NewDistribution_Override(d Distribution, scope constructs.Construct, id *string, props *DistributionProps)

func NewFunctionCode_Override

func NewFunctionCode_Override(f FunctionCode)

func NewFunction_Override

func NewFunction_Override(f Function, scope constructs.Construct, id *string, props *FunctionProps)

func NewImportSource_Override added in v2.118.0

func NewImportSource_Override(i ImportSource)

func NewInlineImportSource_Override added in v2.137.0

func NewInlineImportSource_Override(i InlineImportSource, data *string)

func NewKeyGroup_Override

func NewKeyGroup_Override(k KeyGroup, scope constructs.Construct, id *string, props *KeyGroupProps)

func NewKeyValueStore_Override added in v2.118.0

func NewKeyValueStore_Override(k KeyValueStore, scope constructs.Construct, id *string, props *KeyValueStoreProps)

func NewOriginAccessIdentity_Override

func NewOriginAccessIdentity_Override(o OriginAccessIdentity, scope constructs.Construct, id *string, props *OriginAccessIdentityProps)

func NewOriginBase_Override

func NewOriginBase_Override(o OriginBase, domainName *string, props *OriginProps)

func NewOriginRequestPolicy_Override

func NewOriginRequestPolicy_Override(o OriginRequestPolicy, scope constructs.Construct, id *string, props *OriginRequestPolicyProps)

func NewPublicKey_Override

func NewPublicKey_Override(p PublicKey, scope constructs.Construct, id *string, props *PublicKeyProps)

func NewRealtimeLogConfig_Override added in v2.94.0

func NewRealtimeLogConfig_Override(r RealtimeLogConfig, scope constructs.Construct, id *string, props *RealtimeLogConfigProps)

func NewResponseHeadersPolicy_Override added in v2.1.0

func NewResponseHeadersPolicy_Override(r ResponseHeadersPolicy, scope constructs.Construct, id *string, props *ResponseHeadersPolicyProps)

func NewS3ImportSource_Override added in v2.118.0

func NewS3ImportSource_Override(s S3ImportSource, bucket awss3.IBucket, key *string)

func NewS3OriginAccessControl_Override added in v2.156.0

func NewS3OriginAccessControl_Override(s S3OriginAccessControl, scope constructs.Construct, id *string, props *S3OriginAccessControlProps)

func NewSigning_Override added in v2.156.0

func NewSigning_Override(s Signing, protocol SigningProtocol, behavior SigningBehavior)

func OriginAccessIdentity_IsConstruct

func OriginAccessIdentity_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func OriginAccessIdentity_IsOwnedResource added in v2.32.0

func OriginAccessIdentity_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func OriginAccessIdentity_IsResource

func OriginAccessIdentity_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func OriginRequestPolicy_IsConstruct

func OriginRequestPolicy_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func OriginRequestPolicy_IsOwnedResource added in v2.32.0

func OriginRequestPolicy_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func OriginRequestPolicy_IsResource

func OriginRequestPolicy_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func PublicKey_IsConstruct

func PublicKey_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func PublicKey_IsOwnedResource added in v2.32.0

func PublicKey_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func PublicKey_IsResource

func PublicKey_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func RealtimeLogConfig_IsConstruct added in v2.94.0

func RealtimeLogConfig_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func RealtimeLogConfig_IsOwnedResource added in v2.94.0

func RealtimeLogConfig_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func RealtimeLogConfig_IsResource added in v2.94.0

func RealtimeLogConfig_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func ResponseHeadersPolicy_IsConstruct added in v2.1.0

func ResponseHeadersPolicy_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func ResponseHeadersPolicy_IsOwnedResource added in v2.32.0

func ResponseHeadersPolicy_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func ResponseHeadersPolicy_IsResource added in v2.1.0

func ResponseHeadersPolicy_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

func S3OriginAccessControl_IsConstruct added in v2.156.0

func S3OriginAccessControl_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`.

func S3OriginAccessControl_IsOwnedResource added in v2.156.0

func S3OriginAccessControl_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise.

func S3OriginAccessControl_IsResource added in v2.156.0

func S3OriginAccessControl_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource.

Types

type AccessLevel added in v2.156.0

type AccessLevel string

The level of permissions granted to the CloudFront Distribution when configuring OAC.

Example:

myBucket := s3.NewBucket(this, jsii.String("myBucket"))
s3Origin := origins.S3BucketOrigin_WithOriginAccessControl(myBucket, &S3BucketOriginWithOACProps{
	OriginAccessLevels: []accessLevel{
		cloudfront.*accessLevel_READ,
		cloudfront.*accessLevel_WRITE,
		cloudfront.*accessLevel_DELETE,
	},
})
const (
	// Grants read permissions to CloudFront Distribution.
	AccessLevel_READ AccessLevel = "READ"
	// Grants write permission to CloudFront Distribution.
	AccessLevel_WRITE AccessLevel = "WRITE"
	// Grants delete permission to CloudFront Distribution.
	AccessLevel_DELETE AccessLevel = "DELETE"
)

type AddBehaviorOptions

type AddBehaviorOptions struct {
	// HTTP methods to allow for this behavior.
	// Default: AllowedMethods.ALLOW_GET_HEAD
	//
	AllowedMethods AllowedMethods `field:"optional" json:"allowedMethods" yaml:"allowedMethods"`
	// HTTP methods to cache for this behavior.
	// Default: CachedMethods.CACHE_GET_HEAD
	//
	CachedMethods CachedMethods `field:"optional" json:"cachedMethods" yaml:"cachedMethods"`
	// The cache policy for this behavior.
	//
	// The cache policy determines what values are included in the cache key,
	// and the time-to-live (TTL) values for the cache.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html.
	//
	// Default: CachePolicy.CACHING_OPTIMIZED
	//
	CachePolicy ICachePolicy `field:"optional" json:"cachePolicy" yaml:"cachePolicy"`
	// Whether you want CloudFront to automatically compress certain files for this cache behavior.
	//
	// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-cloudfront-file-types
	// for file types CloudFront will compress.
	// Default: true.
	//
	Compress *bool `field:"optional" json:"compress" yaml:"compress"`
	// The Lambda@Edge functions to invoke before serving the contents.
	// See: https://aws.amazon.com/lambda/edge
	//
	// Default: - no Lambda functions will be invoked.
	//
	EdgeLambdas *[]*EdgeLambda `field:"optional" json:"edgeLambdas" yaml:"edgeLambdas"`
	// The CloudFront functions to invoke before serving the contents.
	// Default: - no functions will be invoked.
	//
	FunctionAssociations *[]*FunctionAssociation `field:"optional" json:"functionAssociations" yaml:"functionAssociations"`
	// The origin request policy for this behavior.
	//
	// The origin request policy determines which values (e.g., headers, cookies)
	// are included in requests that CloudFront sends to the origin.
	// Default: - none.
	//
	OriginRequestPolicy IOriginRequestPolicy `field:"optional" json:"originRequestPolicy" yaml:"originRequestPolicy"`
	// The real-time log configuration to be attached to this cache behavior.
	// Default: - none.
	//
	RealtimeLogConfig IRealtimeLogConfig `field:"optional" json:"realtimeLogConfig" yaml:"realtimeLogConfig"`
	// The response headers policy for this behavior.
	//
	// The response headers policy determines which headers are included in responses.
	// Default: - none.
	//
	ResponseHeadersPolicy IResponseHeadersPolicy `field:"optional" json:"responseHeadersPolicy" yaml:"responseHeadersPolicy"`
	// Set this to true to indicate you want to distribute media files in the Microsoft Smooth Streaming format using this behavior.
	// Default: false.
	//
	SmoothStreaming *bool `field:"optional" json:"smoothStreaming" yaml:"smoothStreaming"`
	// A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html
	//
	// Default: - no KeyGroups are associated with cache behavior.
	//
	TrustedKeyGroups *[]IKeyGroup `field:"optional" json:"trustedKeyGroups" yaml:"trustedKeyGroups"`
	// The protocol that viewers can use to access the files controlled by this behavior.
	// Default: ViewerProtocolPolicy.ALLOW_ALL
	//
	ViewerProtocolPolicy ViewerProtocolPolicy `field:"optional" json:"viewerProtocolPolicy" yaml:"viewerProtocolPolicy"`
}

Options for adding a new behavior to a Distribution.

Example:

// Add a behavior to a Distribution after initial creation.
var myBucket bucket
var myWebDistribution distribution

myWebDistribution.AddBehavior(jsii.String("/images/*.jpg"), origins.NewS3Origin(myBucket), &AddBehaviorOptions{
	ViewerProtocolPolicy: cloudfront.ViewerProtocolPolicy_REDIRECT_TO_HTTPS,
})

type AllowedMethods

type AllowedMethods interface {
	// HTTP methods supported.
	Methods() *[]*string
}

The HTTP methods that the Behavior will accept requests on.

Example:

// Create a Distribution with configured HTTP methods and viewer protocol policy of the cache.
var myBucket bucket

myWebDistribution := cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(myBucket),
		AllowedMethods: cloudfront.AllowedMethods_ALLOW_ALL(),
		ViewerProtocolPolicy: cloudfront.ViewerProtocolPolicy_REDIRECT_TO_HTTPS,
	},
})

func AllowedMethods_ALLOW_ALL

func AllowedMethods_ALLOW_ALL() AllowedMethods

func AllowedMethods_ALLOW_GET_HEAD

func AllowedMethods_ALLOW_GET_HEAD() AllowedMethods

func AllowedMethods_ALLOW_GET_HEAD_OPTIONS

func AllowedMethods_ALLOW_GET_HEAD_OPTIONS() AllowedMethods

type AssetImportSource added in v2.118.0

type AssetImportSource interface {
	ImportSource
	// the path to the local file.
	Path() *string
}

An import source from a local file.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var dockerImage dockerImage
var grantable iGrantable
var localBundling iLocalBundling

assetImportSource := awscdk.Aws_cloudfront.AssetImportSource_FromAsset(jsii.String("path"), &AssetOptions{
	AssetHash: jsii.String("assetHash"),
	AssetHashType: cdk.AssetHashType_SOURCE,
	Bundling: &BundlingOptions{
		Image: dockerImage,

		// the properties below are optional
		BundlingFileAccess: cdk.BundlingFileAccess_VOLUME_COPY,
		Command: []*string{
			jsii.String("command"),
		},
		Entrypoint: []*string{
			jsii.String("entrypoint"),
		},
		Environment: map[string]*string{
			"environmentKey": jsii.String("environment"),
		},
		Local: localBundling,
		Network: jsii.String("network"),
		OutputType: cdk.BundlingOutput_ARCHIVED,
		Platform: jsii.String("platform"),
		SecurityOpt: jsii.String("securityOpt"),
		User: jsii.String("user"),
		Volumes: []dockerVolume{
			&dockerVolume{
				ContainerPath: jsii.String("containerPath"),
				HostPath: jsii.String("hostPath"),

				// the properties below are optional
				Consistency: cdk.DockerVolumeConsistency_CONSISTENT,
			},
		},
		VolumesFrom: []*string{
			jsii.String("volumesFrom"),
		},
		WorkingDirectory: jsii.String("workingDirectory"),
	},
	DeployTime: jsii.Boolean(false),
	Exclude: []*string{
		jsii.String("exclude"),
	},
	FollowSymlinks: cdk.SymlinkFollowMode_NEVER,
	IgnoreMode: cdk.IgnoreMode_GLOB,
	Readers: []*iGrantable{
		grantable,
	},
})

func NewAssetImportSource added in v2.118.0

func NewAssetImportSource(path *string, options *awss3assets.AssetOptions) AssetImportSource

type Behavior

type Behavior struct {
	// The method this CloudFront distribution responds do.
	// Default: GET_HEAD.
	//
	AllowedMethods CloudFrontAllowedMethods `field:"optional" json:"allowedMethods" yaml:"allowedMethods"`
	// Which methods are cached by CloudFront by default.
	// Default: GET_HEAD.
	//
	CachedMethods CloudFrontAllowedCachedMethods `field:"optional" json:"cachedMethods" yaml:"cachedMethods"`
	// If CloudFront should automatically compress some content types.
	// Default: true.
	//
	Compress *bool `field:"optional" json:"compress" yaml:"compress"`
	// The default amount of time CloudFront will cache an object.
	//
	// This value applies only when your custom origin does not add HTTP headers,
	// such as Cache-Control max-age, Cache-Control s-maxage, and Expires to objects.
	// Default: 86400 (1 day).
	//
	DefaultTtl awscdk.Duration `field:"optional" json:"defaultTtl" yaml:"defaultTtl"`
	// The values CloudFront will forward to the origin when making a request.
	// Default: none (no cookies - no headers).
	//
	ForwardedValues *CfnDistribution_ForwardedValuesProperty `field:"optional" json:"forwardedValues" yaml:"forwardedValues"`
	// The CloudFront functions to invoke before serving the contents.
	// Default: - no functions will be invoked.
	//
	FunctionAssociations *[]*FunctionAssociation `field:"optional" json:"functionAssociations" yaml:"functionAssociations"`
	// If this behavior is the default behavior for the distribution.
	//
	// You must specify exactly one default distribution per CloudFront distribution.
	// The default behavior is allowed to omit the "path" property.
	IsDefaultBehavior *bool `field:"optional" json:"isDefaultBehavior" yaml:"isDefaultBehavior"`
	// Declares associated lambda@edge functions for this distribution behaviour.
	// Default: No lambda function associated.
	//
	LambdaFunctionAssociations *[]*LambdaFunctionAssociation `field:"optional" json:"lambdaFunctionAssociations" yaml:"lambdaFunctionAssociations"`
	// The max amount of time you want objects to stay in the cache before CloudFront queries your origin.
	// Default: Duration.seconds(31536000) (one year)
	//
	MaxTtl awscdk.Duration `field:"optional" json:"maxTtl" yaml:"maxTtl"`
	// The minimum amount of time that you want objects to stay in the cache before CloudFront queries your origin.
	MinTtl awscdk.Duration `field:"optional" json:"minTtl" yaml:"minTtl"`
	// The path this behavior responds to.
	//
	// Required for all non-default behaviors. (The default behavior implicitly has "*" as the path pattern. )
	PathPattern *string `field:"optional" json:"pathPattern" yaml:"pathPattern"`
	// A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html
	//
	// Default: - no KeyGroups are associated with cache behavior.
	//
	TrustedKeyGroups *[]IKeyGroup `field:"optional" json:"trustedKeyGroups" yaml:"trustedKeyGroups"`
	// Trusted signers is how CloudFront allows you to serve private content.
	//
	// The signers are the account IDs that are allowed to sign cookies/presigned URLs for this distribution.
	//
	// If you pass a non empty value, all requests for this behavior must be signed (no public access will be allowed).
	// Deprecated: - We recommend using trustedKeyGroups instead of trustedSigners.
	TrustedSigners *[]*string `field:"optional" json:"trustedSigners" yaml:"trustedSigners"`
	// The viewer policy for this behavior.
	// Default: - the distribution wide viewer protocol policy will be used.
	//
	ViewerProtocolPolicy ViewerProtocolPolicy `field:"optional" json:"viewerProtocolPolicy" yaml:"viewerProtocolPolicy"`
}

A CloudFront behavior wrapper.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var function_ function
var keyGroup keyGroup
var version version

behavior := &Behavior{
	AllowedMethods: awscdk.Aws_cloudfront.CloudFrontAllowedMethods_GET_HEAD,
	CachedMethods: awscdk.*Aws_cloudfront.CloudFrontAllowedCachedMethods_GET_HEAD,
	Compress: jsii.Boolean(false),
	DefaultTtl: cdk.Duration_Minutes(jsii.Number(30)),
	ForwardedValues: &ForwardedValuesProperty{
		QueryString: jsii.Boolean(false),

		// the properties below are optional
		Cookies: &CookiesProperty{
			Forward: jsii.String("forward"),

			// the properties below are optional
			WhitelistedNames: []*string{
				jsii.String("whitelistedNames"),
			},
		},
		Headers: []*string{
			jsii.String("headers"),
		},
		QueryStringCacheKeys: []*string{
			jsii.String("queryStringCacheKeys"),
		},
	},
	FunctionAssociations: []functionAssociation{
		&functionAssociation{
			EventType: awscdk.*Aws_cloudfront.FunctionEventType_VIEWER_REQUEST,
			Function: function_,
		},
	},
	IsDefaultBehavior: jsii.Boolean(false),
	LambdaFunctionAssociations: []lambdaFunctionAssociation{
		&lambdaFunctionAssociation{
			EventType: awscdk.*Aws_cloudfront.LambdaEdgeEventType_ORIGIN_REQUEST,
			LambdaFunction: version,

			// the properties below are optional
			IncludeBody: jsii.Boolean(false),
		},
	},
	MaxTtl: cdk.Duration_*Minutes(jsii.Number(30)),
	MinTtl: cdk.Duration_*Minutes(jsii.Number(30)),
	PathPattern: jsii.String("pathPattern"),
	TrustedKeyGroups: []iKeyGroup{
		keyGroup,
	},
	TrustedSigners: []*string{
		jsii.String("trustedSigners"),
	},
	ViewerProtocolPolicy: awscdk.*Aws_cloudfront.ViewerProtocolPolicy_HTTPS_ONLY,
}

type BehaviorOptions

type BehaviorOptions struct {
	// HTTP methods to allow for this behavior.
	// Default: AllowedMethods.ALLOW_GET_HEAD
	//
	AllowedMethods AllowedMethods `field:"optional" json:"allowedMethods" yaml:"allowedMethods"`
	// HTTP methods to cache for this behavior.
	// Default: CachedMethods.CACHE_GET_HEAD
	//
	CachedMethods CachedMethods `field:"optional" json:"cachedMethods" yaml:"cachedMethods"`
	// The cache policy for this behavior.
	//
	// The cache policy determines what values are included in the cache key,
	// and the time-to-live (TTL) values for the cache.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html.
	//
	// Default: CachePolicy.CACHING_OPTIMIZED
	//
	CachePolicy ICachePolicy `field:"optional" json:"cachePolicy" yaml:"cachePolicy"`
	// Whether you want CloudFront to automatically compress certain files for this cache behavior.
	//
	// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-cloudfront-file-types
	// for file types CloudFront will compress.
	// Default: true.
	//
	Compress *bool `field:"optional" json:"compress" yaml:"compress"`
	// The Lambda@Edge functions to invoke before serving the contents.
	// See: https://aws.amazon.com/lambda/edge
	//
	// Default: - no Lambda functions will be invoked.
	//
	EdgeLambdas *[]*EdgeLambda `field:"optional" json:"edgeLambdas" yaml:"edgeLambdas"`
	// The CloudFront functions to invoke before serving the contents.
	// Default: - no functions will be invoked.
	//
	FunctionAssociations *[]*FunctionAssociation `field:"optional" json:"functionAssociations" yaml:"functionAssociations"`
	// The origin request policy for this behavior.
	//
	// The origin request policy determines which values (e.g., headers, cookies)
	// are included in requests that CloudFront sends to the origin.
	// Default: - none.
	//
	OriginRequestPolicy IOriginRequestPolicy `field:"optional" json:"originRequestPolicy" yaml:"originRequestPolicy"`
	// The real-time log configuration to be attached to this cache behavior.
	// Default: - none.
	//
	RealtimeLogConfig IRealtimeLogConfig `field:"optional" json:"realtimeLogConfig" yaml:"realtimeLogConfig"`
	// The response headers policy for this behavior.
	//
	// The response headers policy determines which headers are included in responses.
	// Default: - none.
	//
	ResponseHeadersPolicy IResponseHeadersPolicy `field:"optional" json:"responseHeadersPolicy" yaml:"responseHeadersPolicy"`
	// Set this to true to indicate you want to distribute media files in the Microsoft Smooth Streaming format using this behavior.
	// Default: false.
	//
	SmoothStreaming *bool `field:"optional" json:"smoothStreaming" yaml:"smoothStreaming"`
	// A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html
	//
	// Default: - no KeyGroups are associated with cache behavior.
	//
	TrustedKeyGroups *[]IKeyGroup `field:"optional" json:"trustedKeyGroups" yaml:"trustedKeyGroups"`
	// The protocol that viewers can use to access the files controlled by this behavior.
	// Default: ViewerProtocolPolicy.ALLOW_ALL
	//
	ViewerProtocolPolicy ViewerProtocolPolicy `field:"optional" json:"viewerProtocolPolicy" yaml:"viewerProtocolPolicy"`
	// The origin that you want CloudFront to route requests to when they match this behavior.
	Origin IOrigin `field:"required" json:"origin" yaml:"origin"`
}

Options for creating a new behavior.

Example:

// Adding an existing Lambda@Edge function created in a different stack
// to a CloudFront distribution.
var s3Bucket bucket

functionVersion := lambda.Version_FromVersionArn(this, jsii.String("Version"), jsii.String("arn:aws:lambda:us-east-1:123456789012:function:functionName:1"))

cloudfront.NewDistribution(this, jsii.String("distro"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(s3Bucket),
		EdgeLambdas: []edgeLambda{
			&edgeLambda{
				FunctionVersion: *FunctionVersion,
				EventType: cloudfront.LambdaEdgeEventType_VIEWER_REQUEST,
			},
		},
	},
})

type CacheCookieBehavior

type CacheCookieBehavior interface {
	// The behavior of cookies: allow all, none, an allow list, or a deny list.
	Behavior() *string
	// The cookies to allow or deny, if the behavior is an allow or deny list.
	Cookies() *[]*string
}

Determines whether any cookies in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin.

Example:

// Creating a custom cache policy for a Distribution -- all parameters optional
var bucketOrigin s3Origin

myCachePolicy := cloudfront.NewCachePolicy(this, jsii.String("myCachePolicy"), &CachePolicyProps{
	CachePolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	DefaultTtl: awscdk.Duration_Days(jsii.Number(2)),
	MinTtl: awscdk.Duration_Minutes(jsii.Number(1)),
	MaxTtl: awscdk.Duration_*Days(jsii.Number(10)),
	CookieBehavior: cloudfront.CacheCookieBehavior_All(),
	HeaderBehavior: cloudfront.CacheHeaderBehavior_AllowList(jsii.String("X-CustomHeader")),
	QueryStringBehavior: cloudfront.CacheQueryStringBehavior_DenyList(jsii.String("username")),
	EnableAcceptEncodingGzip: jsii.Boolean(true),
	EnableAcceptEncodingBrotli: jsii.Boolean(true),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		CachePolicy: myCachePolicy,
	},
})

func CacheCookieBehavior_All

func CacheCookieBehavior_All() CacheCookieBehavior

All cookies in viewer requests are included in the cache key and are automatically included in requests that CloudFront sends to the origin.

func CacheCookieBehavior_AllowList

func CacheCookieBehavior_AllowList(cookies ...*string) CacheCookieBehavior

Only the provided `cookies` are included in the cache key and automatically included in requests that CloudFront sends to the origin.

func CacheCookieBehavior_DenyList

func CacheCookieBehavior_DenyList(cookies ...*string) CacheCookieBehavior

All cookies except the provided `cookies` are included in the cache key and automatically included in requests that CloudFront sends to the origin.

func CacheCookieBehavior_None

func CacheCookieBehavior_None() CacheCookieBehavior

Cookies in viewer requests are not included in the cache key and are not automatically included in requests that CloudFront sends to the origin.

type CacheHeaderBehavior

type CacheHeaderBehavior interface {
	// If no headers will be passed, or an allow list of headers.
	Behavior() *string
	// The headers for the allow/deny list, if applicable.
	Headers() *[]*string
}

Determines whether any HTTP headers are included in the cache key and automatically included in requests that CloudFront sends to the origin.

Example:

// Creating a custom cache policy for a Distribution -- all parameters optional
var bucketOrigin s3Origin

myCachePolicy := cloudfront.NewCachePolicy(this, jsii.String("myCachePolicy"), &CachePolicyProps{
	CachePolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	DefaultTtl: awscdk.Duration_Days(jsii.Number(2)),
	MinTtl: awscdk.Duration_Minutes(jsii.Number(1)),
	MaxTtl: awscdk.Duration_*Days(jsii.Number(10)),
	CookieBehavior: cloudfront.CacheCookieBehavior_All(),
	HeaderBehavior: cloudfront.CacheHeaderBehavior_AllowList(jsii.String("X-CustomHeader")),
	QueryStringBehavior: cloudfront.CacheQueryStringBehavior_DenyList(jsii.String("username")),
	EnableAcceptEncodingGzip: jsii.Boolean(true),
	EnableAcceptEncodingBrotli: jsii.Boolean(true),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		CachePolicy: myCachePolicy,
	},
})

func CacheHeaderBehavior_AllowList

func CacheHeaderBehavior_AllowList(headers ...*string) CacheHeaderBehavior

Listed headers are included in the cache key and are automatically included in requests that CloudFront sends to the origin.

func CacheHeaderBehavior_None

func CacheHeaderBehavior_None() CacheHeaderBehavior

HTTP headers are not included in the cache key and are not automatically included in requests that CloudFront sends to the origin.

type CachePolicy

type CachePolicy interface {
	awscdk.Resource
	ICachePolicy
	// The ID of the cache policy.
	CachePolicyId() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

A Cache Policy configuration.

Example:

// Using an existing cache policy for a Distribution
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		CachePolicy: cloudfront.CachePolicy_CACHING_OPTIMIZED(),
	},
})

func NewCachePolicy

func NewCachePolicy(scope constructs.Construct, id *string, props *CachePolicyProps) CachePolicy

type CachePolicyProps

type CachePolicyProps struct {
	// A unique name to identify the cache policy.
	//
	// The name must only include '-', '_', or alphanumeric characters.
	// Default: - generated from the `id`.
	//
	CachePolicyName *string `field:"optional" json:"cachePolicyName" yaml:"cachePolicyName"`
	// A comment to describe the cache policy.
	//
	// The comment cannot be longer than 128 characters.
	// Default: - no comment.
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// Determines whether any cookies in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin.
	// Default: CacheCookieBehavior.none()
	//
	CookieBehavior CacheCookieBehavior `field:"optional" json:"cookieBehavior" yaml:"cookieBehavior"`
	// The default amount of time for objects to stay in the CloudFront cache.
	//
	// Only used when the origin does not send Cache-Control or Expires headers with the object.
	// Default: - The greater of 1 day and “minTtl“.
	//
	DefaultTtl awscdk.Duration `field:"optional" json:"defaultTtl" yaml:"defaultTtl"`
	// Whether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'br'.
	// Default: false.
	//
	EnableAcceptEncodingBrotli *bool `field:"optional" json:"enableAcceptEncodingBrotli" yaml:"enableAcceptEncodingBrotli"`
	// Whether to normalize and include the `Accept-Encoding` header in the cache key when the `Accept-Encoding` header is 'gzip'.
	// Default: false.
	//
	EnableAcceptEncodingGzip *bool `field:"optional" json:"enableAcceptEncodingGzip" yaml:"enableAcceptEncodingGzip"`
	// Determines whether any HTTP headers are included in the cache key and automatically included in requests that CloudFront sends to the origin.
	// Default: CacheHeaderBehavior.none()
	//
	HeaderBehavior CacheHeaderBehavior `field:"optional" json:"headerBehavior" yaml:"headerBehavior"`
	// The maximum amount of time for objects to stay in the CloudFront cache.
	//
	// CloudFront uses this value only when the origin sends Cache-Control or Expires headers with the object.
	// Default: - The greater of 1 year and “defaultTtl“.
	//
	MaxTtl awscdk.Duration `field:"optional" json:"maxTtl" yaml:"maxTtl"`
	// The minimum amount of time for objects to stay in the CloudFront cache.
	// Default: Duration.seconds(0)
	//
	MinTtl awscdk.Duration `field:"optional" json:"minTtl" yaml:"minTtl"`
	// Determines whether any query strings are included in the cache key and automatically included in requests that CloudFront sends to the origin.
	// Default: CacheQueryStringBehavior.none()
	//
	QueryStringBehavior CacheQueryStringBehavior `field:"optional" json:"queryStringBehavior" yaml:"queryStringBehavior"`
}

Properties for creating a Cache Policy.

Example:

// Creating a custom cache policy for a Distribution -- all parameters optional
var bucketOrigin s3Origin

myCachePolicy := cloudfront.NewCachePolicy(this, jsii.String("myCachePolicy"), &CachePolicyProps{
	CachePolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	DefaultTtl: awscdk.Duration_Days(jsii.Number(2)),
	MinTtl: awscdk.Duration_Minutes(jsii.Number(1)),
	MaxTtl: awscdk.Duration_*Days(jsii.Number(10)),
	CookieBehavior: cloudfront.CacheCookieBehavior_All(),
	HeaderBehavior: cloudfront.CacheHeaderBehavior_AllowList(jsii.String("X-CustomHeader")),
	QueryStringBehavior: cloudfront.CacheQueryStringBehavior_DenyList(jsii.String("username")),
	EnableAcceptEncodingGzip: jsii.Boolean(true),
	EnableAcceptEncodingBrotli: jsii.Boolean(true),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		CachePolicy: myCachePolicy,
	},
})

type CacheQueryStringBehavior

type CacheQueryStringBehavior interface {
	// The behavior of query strings -- allow all, none, only an allow list, or a deny list.
	Behavior() *string
	// The query strings to allow or deny, if the behavior is an allow or deny list.
	QueryStrings() *[]*string
}

Determines whether any URL query strings in viewer requests are included in the cache key and automatically included in requests that CloudFront sends to the origin.

Example:

// Creating a custom cache policy for a Distribution -- all parameters optional
var bucketOrigin s3Origin

myCachePolicy := cloudfront.NewCachePolicy(this, jsii.String("myCachePolicy"), &CachePolicyProps{
	CachePolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	DefaultTtl: awscdk.Duration_Days(jsii.Number(2)),
	MinTtl: awscdk.Duration_Minutes(jsii.Number(1)),
	MaxTtl: awscdk.Duration_*Days(jsii.Number(10)),
	CookieBehavior: cloudfront.CacheCookieBehavior_All(),
	HeaderBehavior: cloudfront.CacheHeaderBehavior_AllowList(jsii.String("X-CustomHeader")),
	QueryStringBehavior: cloudfront.CacheQueryStringBehavior_DenyList(jsii.String("username")),
	EnableAcceptEncodingGzip: jsii.Boolean(true),
	EnableAcceptEncodingBrotli: jsii.Boolean(true),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		CachePolicy: myCachePolicy,
	},
})

func CacheQueryStringBehavior_All

func CacheQueryStringBehavior_All() CacheQueryStringBehavior

All query strings in viewer requests are included in the cache key and are automatically included in requests that CloudFront sends to the origin.

func CacheQueryStringBehavior_AllowList

func CacheQueryStringBehavior_AllowList(queryStrings ...*string) CacheQueryStringBehavior

Only the provided `queryStrings` are included in the cache key and automatically included in requests that CloudFront sends to the origin.

func CacheQueryStringBehavior_DenyList

func CacheQueryStringBehavior_DenyList(queryStrings ...*string) CacheQueryStringBehavior

All query strings except the provided `queryStrings` are included in the cache key and automatically included in requests that CloudFront sends to the origin.

func CacheQueryStringBehavior_None

func CacheQueryStringBehavior_None() CacheQueryStringBehavior

Query strings in viewer requests are not included in the cache key and are not automatically included in requests that CloudFront sends to the origin.

type CachedMethods

type CachedMethods interface {
	// HTTP methods supported.
	Methods() *[]*string
}

The HTTP methods that the Behavior will cache requests on.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cachedMethods := awscdk.Aws_cloudfront.CachedMethods_CACHE_GET_HEAD()

func CachedMethods_CACHE_GET_HEAD

func CachedMethods_CACHE_GET_HEAD() CachedMethods

func CachedMethods_CACHE_GET_HEAD_OPTIONS

func CachedMethods_CACHE_GET_HEAD_OPTIONS() CachedMethods

type CfnCachePolicy

type CfnCachePolicy interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The unique identifier for the cache policy.
	//
	// For example: `2766f7b2-75c5-41c6-8f06-bf4303a2f2f5` .
	AttrId() *string
	// The date and time when the cache policy was last modified.
	AttrLastModifiedTime() *string
	// The cache policy configuration.
	CachePolicyConfig() interface{}
	SetCachePolicyConfig(val interface{})
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A cache policy.

When it's attached to a cache behavior, the cache policy determines the following:

- The values that CloudFront includes in the cache key. These values can include HTTP headers, cookies, and URL query strings. CloudFront uses the cache key to find an object in its cache that it can return to the viewer. - The default, minimum, and maximum time to live (TTL) values that you want objects to stay in the CloudFront cache.

The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can't find a valid object in its cache that matches the request's cache key. If you want to send values to the origin but *not* include them in the cache key, use `OriginRequestPolicy` .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnCachePolicy := awscdk.Aws_cloudfront.NewCfnCachePolicy(this, jsii.String("MyCfnCachePolicy"), &CfnCachePolicyProps{
	CachePolicyConfig: &CachePolicyConfigProperty{
		DefaultTtl: jsii.Number(123),
		MaxTtl: jsii.Number(123),
		MinTtl: jsii.Number(123),
		Name: jsii.String("name"),
		ParametersInCacheKeyAndForwardedToOrigin: &ParametersInCacheKeyAndForwardedToOriginProperty{
			CookiesConfig: &CookiesConfigProperty{
				CookieBehavior: jsii.String("cookieBehavior"),

				// the properties below are optional
				Cookies: []*string{
					jsii.String("cookies"),
				},
			},
			EnableAcceptEncodingGzip: jsii.Boolean(false),
			HeadersConfig: &HeadersConfigProperty{
				HeaderBehavior: jsii.String("headerBehavior"),

				// the properties below are optional
				Headers: []*string{
					jsii.String("headers"),
				},
			},
			QueryStringsConfig: &QueryStringsConfigProperty{
				QueryStringBehavior: jsii.String("queryStringBehavior"),

				// the properties below are optional
				QueryStrings: []*string{
					jsii.String("queryStrings"),
				},
			},

			// the properties below are optional
			EnableAcceptEncodingBrotli: jsii.Boolean(false),
		},

		// the properties below are optional
		Comment: jsii.String("comment"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-cachepolicy.html

func NewCfnCachePolicy

func NewCfnCachePolicy(scope constructs.Construct, id *string, props *CfnCachePolicyProps) CfnCachePolicy

type CfnCachePolicyProps

type CfnCachePolicyProps struct {
	// The cache policy configuration.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-cachepolicy.html#cfn-cloudfront-cachepolicy-cachepolicyconfig
	//
	CachePolicyConfig interface{} `field:"required" json:"cachePolicyConfig" yaml:"cachePolicyConfig"`
}

Properties for defining a `CfnCachePolicy`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnCachePolicyProps := &CfnCachePolicyProps{
	CachePolicyConfig: &CachePolicyConfigProperty{
		DefaultTtl: jsii.Number(123),
		MaxTtl: jsii.Number(123),
		MinTtl: jsii.Number(123),
		Name: jsii.String("name"),
		ParametersInCacheKeyAndForwardedToOrigin: &ParametersInCacheKeyAndForwardedToOriginProperty{
			CookiesConfig: &CookiesConfigProperty{
				CookieBehavior: jsii.String("cookieBehavior"),

				// the properties below are optional
				Cookies: []*string{
					jsii.String("cookies"),
				},
			},
			EnableAcceptEncodingGzip: jsii.Boolean(false),
			HeadersConfig: &HeadersConfigProperty{
				HeaderBehavior: jsii.String("headerBehavior"),

				// the properties below are optional
				Headers: []*string{
					jsii.String("headers"),
				},
			},
			QueryStringsConfig: &QueryStringsConfigProperty{
				QueryStringBehavior: jsii.String("queryStringBehavior"),

				// the properties below are optional
				QueryStrings: []*string{
					jsii.String("queryStrings"),
				},
			},

			// the properties below are optional
			EnableAcceptEncodingBrotli: jsii.Boolean(false),
		},

		// the properties below are optional
		Comment: jsii.String("comment"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-cachepolicy.html

type CfnCachePolicy_CachePolicyConfigProperty

type CfnCachePolicy_CachePolicyConfigProperty struct {
	// The default amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.
	//
	// CloudFront uses this value as the object's time to live (TTL) only when the origin does *not* send `Cache-Control` or `Expires` headers with the object. For more information, see [Managing How Long Content Stays in an Edge Cache (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	//
	// The default value for this field is 86400 seconds (one day). If the value of `MinTTL` is more than 86400 seconds, then the default value for this field is the same as the value of `MinTTL` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-defaultttl
	//
	DefaultTtl *float64 `field:"required" json:"defaultTtl" yaml:"defaultTtl"`
	// The maximum amount of time, in seconds, that objects stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.
	//
	// CloudFront uses this value only when the origin sends `Cache-Control` or `Expires` headers with the object. For more information, see [Managing How Long Content Stays in an Edge Cache (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	//
	// The default value for this field is 31536000 seconds (one year). If the value of `MinTTL` or `DefaultTTL` is more than 31536000 seconds, then the default value for this field is the same as the value of `DefaultTTL` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-maxttl
	//
	MaxTtl *float64 `field:"required" json:"maxTtl" yaml:"maxTtl"`
	// The minimum amount of time, in seconds, that you want objects to stay in the CloudFront cache before CloudFront sends another request to the origin to see if the object has been updated.
	//
	// For more information, see [Managing How Long Content Stays in an Edge Cache (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-minttl
	//
	MinTtl *float64 `field:"required" json:"minTtl" yaml:"minTtl"`
	// A unique name to identify the cache policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// The HTTP headers, cookies, and URL query strings to include in the cache key.
	//
	// The values included in the cache key are also included in requests that CloudFront sends to the origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-parametersincachekeyandforwardedtoorigin
	//
	ParametersInCacheKeyAndForwardedToOrigin interface{} `field:"required" json:"parametersInCacheKeyAndForwardedToOrigin" yaml:"parametersInCacheKeyAndForwardedToOrigin"`
	// A comment to describe the cache policy.
	//
	// The comment cannot be longer than 128 characters.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html#cfn-cloudfront-cachepolicy-cachepolicyconfig-comment
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
}

A cache policy configuration.

This configuration determines the following:

- The values that CloudFront includes in the cache key. These values can include HTTP headers, cookies, and URL query strings. CloudFront uses the cache key to find an object in its cache that it can return to the viewer. - The default, minimum, and maximum time to live (TTL) values that you want objects to stay in the CloudFront cache.

The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can't find a valid object in its cache that matches the request's cache key. If you want to send values to the origin but *not* include them in the cache key, use `OriginRequestPolicy` .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cachePolicyConfigProperty := &CachePolicyConfigProperty{
	DefaultTtl: jsii.Number(123),
	MaxTtl: jsii.Number(123),
	MinTtl: jsii.Number(123),
	Name: jsii.String("name"),
	ParametersInCacheKeyAndForwardedToOrigin: &ParametersInCacheKeyAndForwardedToOriginProperty{
		CookiesConfig: &CookiesConfigProperty{
			CookieBehavior: jsii.String("cookieBehavior"),

			// the properties below are optional
			Cookies: []*string{
				jsii.String("cookies"),
			},
		},
		EnableAcceptEncodingGzip: jsii.Boolean(false),
		HeadersConfig: &HeadersConfigProperty{
			HeaderBehavior: jsii.String("headerBehavior"),

			// the properties below are optional
			Headers: []*string{
				jsii.String("headers"),
			},
		},
		QueryStringsConfig: &QueryStringsConfigProperty{
			QueryStringBehavior: jsii.String("queryStringBehavior"),

			// the properties below are optional
			QueryStrings: []*string{
				jsii.String("queryStrings"),
			},
		},

		// the properties below are optional
		EnableAcceptEncodingBrotli: jsii.Boolean(false),
	},

	// the properties below are optional
	Comment: jsii.String("comment"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cachepolicyconfig.html

type CfnCachePolicy_CookiesConfigProperty

type CfnCachePolicy_CookiesConfigProperty struct {
	// Determines whether any cookies in viewer requests are included in the cache key and in requests that CloudFront sends to the origin.
	//
	// Valid values are:
	//
	// - `none` – No cookies in viewer requests are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to `none` , any cookies that are listed in an `OriginRequestPolicy` *are* included in origin requests.
	// - `whitelist` – Only the cookies in viewer requests that are listed in the `CookieNames` type are included in the cache key and in requests that CloudFront sends to the origin.
	// - `allExcept` – All cookies in viewer requests are included in the cache key and in requests that CloudFront sends to the origin, **except** for those that are listed in the `CookieNames` type, which are not included.
	// - `all` – All cookies in viewer requests are included in the cache key and in requests that CloudFront sends to the origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cookiesconfig.html#cfn-cloudfront-cachepolicy-cookiesconfig-cookiebehavior
	//
	CookieBehavior *string `field:"required" json:"cookieBehavior" yaml:"cookieBehavior"`
	// Contains a list of cookie names.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cookiesconfig.html#cfn-cloudfront-cachepolicy-cookiesconfig-cookies
	//
	Cookies *[]*string `field:"optional" json:"cookies" yaml:"cookies"`
}

An object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the cache key and in requests that CloudFront sends to the origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cookiesConfigProperty := &CookiesConfigProperty{
	CookieBehavior: jsii.String("cookieBehavior"),

	// the properties below are optional
	Cookies: []*string{
		jsii.String("cookies"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-cookiesconfig.html

type CfnCachePolicy_HeadersConfigProperty

type CfnCachePolicy_HeadersConfigProperty struct {
	// Determines whether any HTTP headers are included in the cache key and in requests that CloudFront sends to the origin.
	//
	// Valid values are:
	//
	// - `none` – No HTTP headers are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to `none` , any headers that are listed in an `OriginRequestPolicy` *are* included in origin requests.
	// - `whitelist` – Only the HTTP headers that are listed in the `Headers` type are included in the cache key and in requests that CloudFront sends to the origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-headersconfig.html#cfn-cloudfront-cachepolicy-headersconfig-headerbehavior
	//
	HeaderBehavior *string `field:"required" json:"headerBehavior" yaml:"headerBehavior"`
	// Contains a list of HTTP header names.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-headersconfig.html#cfn-cloudfront-cachepolicy-headersconfig-headers
	//
	Headers *[]*string `field:"optional" json:"headers" yaml:"headers"`
}

An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and in requests that CloudFront sends to the origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

headersConfigProperty := &HeadersConfigProperty{
	HeaderBehavior: jsii.String("headerBehavior"),

	// the properties below are optional
	Headers: []*string{
		jsii.String("headers"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-headersconfig.html

type CfnCachePolicy_ParametersInCacheKeyAndForwardedToOriginProperty

type CfnCachePolicy_ParametersInCacheKeyAndForwardedToOriginProperty struct {
	// An object that determines whether any cookies in viewer requests (and if so, which cookies) are included in the cache key and in requests that CloudFront sends to the origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin.html#cfn-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin-cookiesconfig
	//
	CookiesConfig interface{} `field:"required" json:"cookiesConfig" yaml:"cookiesConfig"`
	// A flag that can affect whether the `Accept-Encoding` HTTP header is included in the cache key and included in requests that CloudFront sends to the origin.
	//
	// This field is related to the `EnableAcceptEncodingBrotli` field. If one or both of these fields is `true` *and* the viewer request includes the `Accept-Encoding` header, then CloudFront does the following:
	//
	// - Normalizes the value of the viewer's `Accept-Encoding` header
	// - Includes the normalized header in the cache key
	// - Includes the normalized header in the request to the origin, if a request is necessary
	//
	// For more information, see [Compression support](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-policy-compressed-objects) in the *Amazon CloudFront Developer Guide* .
	//
	// If you set this value to `true` , and this cache behavior also has an origin request policy attached, do not include the `Accept-Encoding` header in the origin request policy. CloudFront always includes the `Accept-Encoding` header in origin requests when the value of this field is `true` , so including this header in an origin request policy has no effect.
	//
	// If both of these fields are `false` , then CloudFront treats the `Accept-Encoding` header the same as any other HTTP header in the viewer request. By default, it's not included in the cache key and it's not included in origin requests. In this case, you can manually add `Accept-Encoding` to the headers whitelist like any other HTTP header.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin.html#cfn-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin-enableacceptencodinggzip
	//
	EnableAcceptEncodingGzip interface{} `field:"required" json:"enableAcceptEncodingGzip" yaml:"enableAcceptEncodingGzip"`
	// An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and in requests that CloudFront sends to the origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin.html#cfn-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin-headersconfig
	//
	HeadersConfig interface{} `field:"required" json:"headersConfig" yaml:"headersConfig"`
	// An object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the cache key and in requests that CloudFront sends to the origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin.html#cfn-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin-querystringsconfig
	//
	QueryStringsConfig interface{} `field:"required" json:"queryStringsConfig" yaml:"queryStringsConfig"`
	// A flag that can affect whether the `Accept-Encoding` HTTP header is included in the cache key and included in requests that CloudFront sends to the origin.
	//
	// This field is related to the `EnableAcceptEncodingGzip` field. If one or both of these fields is `true` *and* the viewer request includes the `Accept-Encoding` header, then CloudFront does the following:
	//
	// - Normalizes the value of the viewer's `Accept-Encoding` header
	// - Includes the normalized header in the cache key
	// - Includes the normalized header in the request to the origin, if a request is necessary
	//
	// For more information, see [Compression support](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-policy-compressed-objects) in the *Amazon CloudFront Developer Guide* .
	//
	// If you set this value to `true` , and this cache behavior also has an origin request policy attached, do not include the `Accept-Encoding` header in the origin request policy. CloudFront always includes the `Accept-Encoding` header in origin requests when the value of this field is `true` , so including this header in an origin request policy has no effect.
	//
	// If both of these fields are `false` , then CloudFront treats the `Accept-Encoding` header the same as any other HTTP header in the viewer request. By default, it's not included in the cache key and it's not included in origin requests. In this case, you can manually add `Accept-Encoding` to the headers whitelist like any other HTTP header.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin.html#cfn-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin-enableacceptencodingbrotli
	//
	EnableAcceptEncodingBrotli interface{} `field:"optional" json:"enableAcceptEncodingBrotli" yaml:"enableAcceptEncodingBrotli"`
}

This object determines the values that CloudFront includes in the cache key.

These values can include HTTP headers, cookies, and URL query strings. CloudFront uses the cache key to find an object in its cache that it can return to the viewer.

The headers, cookies, and query strings that are included in the cache key are also included in requests that CloudFront sends to the origin. CloudFront sends a request when it can't find an object in its cache that matches the request's cache key. If you want to send values to the origin but *not* include them in the cache key, use `OriginRequestPolicy` .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

parametersInCacheKeyAndForwardedToOriginProperty := &ParametersInCacheKeyAndForwardedToOriginProperty{
	CookiesConfig: &CookiesConfigProperty{
		CookieBehavior: jsii.String("cookieBehavior"),

		// the properties below are optional
		Cookies: []*string{
			jsii.String("cookies"),
		},
	},
	EnableAcceptEncodingGzip: jsii.Boolean(false),
	HeadersConfig: &HeadersConfigProperty{
		HeaderBehavior: jsii.String("headerBehavior"),

		// the properties below are optional
		Headers: []*string{
			jsii.String("headers"),
		},
	},
	QueryStringsConfig: &QueryStringsConfigProperty{
		QueryStringBehavior: jsii.String("queryStringBehavior"),

		// the properties below are optional
		QueryStrings: []*string{
			jsii.String("queryStrings"),
		},
	},

	// the properties below are optional
	EnableAcceptEncodingBrotli: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-parametersincachekeyandforwardedtoorigin.html

type CfnCachePolicy_QueryStringsConfigProperty

type CfnCachePolicy_QueryStringsConfigProperty struct {
	// Determines whether any URL query strings in viewer requests are included in the cache key and in requests that CloudFront sends to the origin.
	//
	// Valid values are:
	//
	// - `none` – No query strings in viewer requests are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to `none` , any query strings that are listed in an `OriginRequestPolicy` *are* included in origin requests.
	// - `whitelist` – Only the query strings in viewer requests that are listed in the `QueryStringNames` type are included in the cache key and in requests that CloudFront sends to the origin.
	// - `allExcept` – All query strings in viewer requests are included in the cache key and in requests that CloudFront sends to the origin, **except** those that are listed in the `QueryStringNames` type, which are not included.
	// - `all` – All query strings in viewer requests are included in the cache key and in requests that CloudFront sends to the origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-querystringsconfig.html#cfn-cloudfront-cachepolicy-querystringsconfig-querystringbehavior
	//
	QueryStringBehavior *string `field:"required" json:"queryStringBehavior" yaml:"queryStringBehavior"`
	// Contains a list of query string names.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-querystringsconfig.html#cfn-cloudfront-cachepolicy-querystringsconfig-querystrings
	//
	QueryStrings *[]*string `field:"optional" json:"queryStrings" yaml:"queryStrings"`
}

An object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in the cache key and in requests that CloudFront sends to the origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

queryStringsConfigProperty := &QueryStringsConfigProperty{
	QueryStringBehavior: jsii.String("queryStringBehavior"),

	// the properties below are optional
	QueryStrings: []*string{
		jsii.String("queryStrings"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cachepolicy-querystringsconfig.html

type CfnCloudFrontOriginAccessIdentity

type CfnCloudFrontOriginAccessIdentity interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The ID for the origin access identity, for example, `E74FTE3AJFJ256A` .
	AttrId() *string
	// The Amazon S3 canonical user ID for the origin access identity, used when giving the origin access identity read permission to an object in Amazon S3.
	//
	// For example: `b970b42360b81c8ddbd79d2f5df0069ba9033c8a79655752abe380cd6d63ba8bcf23384d568fcf89fc49700b5e11a0fd` .
	AttrS3CanonicalUserId() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// The current configuration information for the identity.
	CloudFrontOriginAccessIdentityConfig() interface{}
	SetCloudFrontOriginAccessIdentityConfig(val interface{})
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

The request to create a new origin access identity (OAI).

An origin access identity is a special CloudFront user that you can associate with Amazon S3 origins, so that you can secure all or just some of your Amazon S3 content. For more information, see [Restricting Access to Amazon S3 Content by Using an Origin Access Identity](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html) in the *Amazon CloudFront Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnCloudFrontOriginAccessIdentity := awscdk.Aws_cloudfront.NewCfnCloudFrontOriginAccessIdentity(this, jsii.String("MyCfnCloudFrontOriginAccessIdentity"), &CfnCloudFrontOriginAccessIdentityProps{
	CloudFrontOriginAccessIdentityConfig: &CloudFrontOriginAccessIdentityConfigProperty{
		Comment: jsii.String("comment"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-cloudfrontoriginaccessidentity.html

func NewCfnCloudFrontOriginAccessIdentity

func NewCfnCloudFrontOriginAccessIdentity(scope constructs.Construct, id *string, props *CfnCloudFrontOriginAccessIdentityProps) CfnCloudFrontOriginAccessIdentity

type CfnCloudFrontOriginAccessIdentityProps

type CfnCloudFrontOriginAccessIdentityProps struct {
	// The current configuration information for the identity.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-cloudfrontoriginaccessidentity.html#cfn-cloudfront-cloudfrontoriginaccessidentity-cloudfrontoriginaccessidentityconfig
	//
	CloudFrontOriginAccessIdentityConfig interface{} `field:"required" json:"cloudFrontOriginAccessIdentityConfig" yaml:"cloudFrontOriginAccessIdentityConfig"`
}

Properties for defining a `CfnCloudFrontOriginAccessIdentity`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnCloudFrontOriginAccessIdentityProps := &CfnCloudFrontOriginAccessIdentityProps{
	CloudFrontOriginAccessIdentityConfig: &CloudFrontOriginAccessIdentityConfigProperty{
		Comment: jsii.String("comment"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-cloudfrontoriginaccessidentity.html

type CfnCloudFrontOriginAccessIdentity_CloudFrontOriginAccessIdentityConfigProperty

type CfnCloudFrontOriginAccessIdentity_CloudFrontOriginAccessIdentityConfigProperty struct {
	// A comment to describe the origin access identity.
	//
	// The comment cannot be longer than 128 characters.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cloudfrontoriginaccessidentity-cloudfrontoriginaccessidentityconfig.html#cfn-cloudfront-cloudfrontoriginaccessidentity-cloudfrontoriginaccessidentityconfig-comment
	//
	Comment *string `field:"required" json:"comment" yaml:"comment"`
}

Origin access identity configuration.

Send a `GET` request to the `/ *CloudFront API version* /CloudFront/identity ID/config` resource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cloudFrontOriginAccessIdentityConfigProperty := &CloudFrontOriginAccessIdentityConfigProperty{
	Comment: jsii.String("comment"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-cloudfrontoriginaccessidentity-cloudfrontoriginaccessidentityconfig.html

type CfnContinuousDeploymentPolicy added in v2.54.0

type CfnContinuousDeploymentPolicy interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The identifier of the cotinuous deployment policy.
	AttrId() *string
	// The date and time when the continuous deployment policy was last modified.
	AttrLastModifiedTime() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Contains the configuration for a continuous deployment policy.
	ContinuousDeploymentPolicyConfig() interface{}
	SetContinuousDeploymentPolicyConfig(val interface{})
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

Creates a continuous deployment policy that routes a subset of production traffic from a primary distribution to a staging distribution.

After you create and update a staging distribution, you can use a continuous deployment policy to incrementally move traffic to the staging distribution. This enables you to test changes to a distribution's configuration before moving all of your production traffic to the new configuration.

For more information, see [Using CloudFront continuous deployment to safely test CDN configuration changes](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/continuous-deployment.html) in the *Amazon CloudFront Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnContinuousDeploymentPolicy := awscdk.Aws_cloudfront.NewCfnContinuousDeploymentPolicy(this, jsii.String("MyCfnContinuousDeploymentPolicy"), &CfnContinuousDeploymentPolicyProps{
	ContinuousDeploymentPolicyConfig: &ContinuousDeploymentPolicyConfigProperty{
		Enabled: jsii.Boolean(false),
		StagingDistributionDnsNames: []*string{
			jsii.String("stagingDistributionDnsNames"),
		},

		// the properties below are optional
		SingleHeaderPolicyConfig: &SingleHeaderPolicyConfigProperty{
			Header: jsii.String("header"),
			Value: jsii.String("value"),
		},
		SingleWeightPolicyConfig: &SingleWeightPolicyConfigProperty{
			Weight: jsii.Number(123),

			// the properties below are optional
			SessionStickinessConfig: &SessionStickinessConfigProperty{
				IdleTtl: jsii.Number(123),
				MaximumTtl: jsii.Number(123),
			},
		},
		TrafficConfig: &TrafficConfigProperty{
			Type: jsii.String("type"),

			// the properties below are optional
			SingleHeaderConfig: &SingleHeaderConfigProperty{
				Header: jsii.String("header"),
				Value: jsii.String("value"),
			},
			SingleWeightConfig: &SingleWeightConfigProperty{
				Weight: jsii.Number(123),

				// the properties below are optional
				SessionStickinessConfig: &SessionStickinessConfigProperty{
					IdleTtl: jsii.Number(123),
					MaximumTtl: jsii.Number(123),
				},
			},
		},
		Type: jsii.String("type"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-continuousdeploymentpolicy.html

func NewCfnContinuousDeploymentPolicy added in v2.54.0

func NewCfnContinuousDeploymentPolicy(scope constructs.Construct, id *string, props *CfnContinuousDeploymentPolicyProps) CfnContinuousDeploymentPolicy

type CfnContinuousDeploymentPolicyProps added in v2.54.0

type CfnContinuousDeploymentPolicyProps struct {
	// Contains the configuration for a continuous deployment policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-continuousdeploymentpolicy.html#cfn-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig
	//
	ContinuousDeploymentPolicyConfig interface{} `field:"required" json:"continuousDeploymentPolicyConfig" yaml:"continuousDeploymentPolicyConfig"`
}

Properties for defining a `CfnContinuousDeploymentPolicy`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnContinuousDeploymentPolicyProps := &CfnContinuousDeploymentPolicyProps{
	ContinuousDeploymentPolicyConfig: &ContinuousDeploymentPolicyConfigProperty{
		Enabled: jsii.Boolean(false),
		StagingDistributionDnsNames: []*string{
			jsii.String("stagingDistributionDnsNames"),
		},

		// the properties below are optional
		SingleHeaderPolicyConfig: &SingleHeaderPolicyConfigProperty{
			Header: jsii.String("header"),
			Value: jsii.String("value"),
		},
		SingleWeightPolicyConfig: &SingleWeightPolicyConfigProperty{
			Weight: jsii.Number(123),

			// the properties below are optional
			SessionStickinessConfig: &SessionStickinessConfigProperty{
				IdleTtl: jsii.Number(123),
				MaximumTtl: jsii.Number(123),
			},
		},
		TrafficConfig: &TrafficConfigProperty{
			Type: jsii.String("type"),

			// the properties below are optional
			SingleHeaderConfig: &SingleHeaderConfigProperty{
				Header: jsii.String("header"),
				Value: jsii.String("value"),
			},
			SingleWeightConfig: &SingleWeightConfigProperty{
				Weight: jsii.Number(123),

				// the properties below are optional
				SessionStickinessConfig: &SessionStickinessConfigProperty{
					IdleTtl: jsii.Number(123),
					MaximumTtl: jsii.Number(123),
				},
			},
		},
		Type: jsii.String("type"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-continuousdeploymentpolicy.html

type CfnContinuousDeploymentPolicy_ContinuousDeploymentPolicyConfigProperty added in v2.54.0

type CfnContinuousDeploymentPolicy_ContinuousDeploymentPolicyConfigProperty struct {
	// A Boolean that indicates whether this continuous deployment policy is enabled (in effect).
	//
	// When this value is `true` , this policy is enabled and in effect. When this value is `false` , this policy is not enabled and has no effect.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig.html#cfn-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig-enabled
	//
	Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"`
	// The CloudFront domain name of the staging distribution.
	//
	// For example: `d111111abcdef8.cloudfront.net` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig.html#cfn-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig-stagingdistributiondnsnames
	//
	StagingDistributionDnsNames *[]*string `field:"required" json:"stagingDistributionDnsNames" yaml:"stagingDistributionDnsNames"`
	// This configuration determines which HTTP requests are sent to the staging distribution.
	//
	// If the HTTP request contains a header and value that matches what you specify here, the request is sent to the staging distribution. Otherwise the request is sent to the primary distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig.html#cfn-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig-singleheaderpolicyconfig
	//
	SingleHeaderPolicyConfig interface{} `field:"optional" json:"singleHeaderPolicyConfig" yaml:"singleHeaderPolicyConfig"`
	// This configuration determines the percentage of HTTP requests that are sent to the staging distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig.html#cfn-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig-singleweightpolicyconfig
	//
	SingleWeightPolicyConfig interface{} `field:"optional" json:"singleWeightPolicyConfig" yaml:"singleWeightPolicyConfig"`
	// Contains the parameters for routing production traffic from your primary to staging distributions.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig.html#cfn-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig-trafficconfig
	//
	TrafficConfig interface{} `field:"optional" json:"trafficConfig" yaml:"trafficConfig"`
	// The type of traffic configuration.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig.html#cfn-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig-type
	//
	Type *string `field:"optional" json:"type" yaml:"type"`
}

Contains the configuration for a continuous deployment policy.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

continuousDeploymentPolicyConfigProperty := &ContinuousDeploymentPolicyConfigProperty{
	Enabled: jsii.Boolean(false),
	StagingDistributionDnsNames: []*string{
		jsii.String("stagingDistributionDnsNames"),
	},

	// the properties below are optional
	SingleHeaderPolicyConfig: &SingleHeaderPolicyConfigProperty{
		Header: jsii.String("header"),
		Value: jsii.String("value"),
	},
	SingleWeightPolicyConfig: &SingleWeightPolicyConfigProperty{
		Weight: jsii.Number(123),

		// the properties below are optional
		SessionStickinessConfig: &SessionStickinessConfigProperty{
			IdleTtl: jsii.Number(123),
			MaximumTtl: jsii.Number(123),
		},
	},
	TrafficConfig: &TrafficConfigProperty{
		Type: jsii.String("type"),

		// the properties below are optional
		SingleHeaderConfig: &SingleHeaderConfigProperty{
			Header: jsii.String("header"),
			Value: jsii.String("value"),
		},
		SingleWeightConfig: &SingleWeightConfigProperty{
			Weight: jsii.Number(123),

			// the properties below are optional
			SessionStickinessConfig: &SessionStickinessConfigProperty{
				IdleTtl: jsii.Number(123),
				MaximumTtl: jsii.Number(123),
			},
		},
	},
	Type: jsii.String("type"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-continuousdeploymentpolicyconfig.html

type CfnContinuousDeploymentPolicy_SessionStickinessConfigProperty added in v2.54.0

type CfnContinuousDeploymentPolicy_SessionStickinessConfigProperty struct {
	// The amount of time after which you want sessions to cease if no requests are received.
	//
	// Allowed values are 300–3600 seconds (5–60 minutes).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-sessionstickinessconfig.html#cfn-cloudfront-continuousdeploymentpolicy-sessionstickinessconfig-idlettl
	//
	IdleTtl *float64 `field:"required" json:"idleTtl" yaml:"idleTtl"`
	// The maximum amount of time to consider requests from the viewer as being part of the same session.
	//
	// Allowed values are 300–3600 seconds (5–60 minutes).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-sessionstickinessconfig.html#cfn-cloudfront-continuousdeploymentpolicy-sessionstickinessconfig-maximumttl
	//
	MaximumTtl *float64 `field:"required" json:"maximumTtl" yaml:"maximumTtl"`
}

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 your staging distribution, while others are sent to your primary distribution. Define the session duration using TTL values.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

sessionStickinessConfigProperty := &SessionStickinessConfigProperty{
	IdleTtl: jsii.Number(123),
	MaximumTtl: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-sessionstickinessconfig.html

type CfnContinuousDeploymentPolicy_SingleHeaderConfigProperty added in v2.54.0

type CfnContinuousDeploymentPolicy_SingleHeaderConfigProperty struct {
	// The request header name that you want CloudFront to send to your staging distribution.
	//
	// The header must contain the prefix `aws-cf-cd-` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleheaderconfig.html#cfn-cloudfront-continuousdeploymentpolicy-singleheaderconfig-header
	//
	Header *string `field:"required" json:"header" yaml:"header"`
	// The request header value.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleheaderconfig.html#cfn-cloudfront-continuousdeploymentpolicy-singleheaderconfig-value
	//
	Value *string `field:"required" json:"value" yaml:"value"`
}

Determines which HTTP requests are sent to the staging distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

singleHeaderConfigProperty := &SingleHeaderConfigProperty{
	Header: jsii.String("header"),
	Value: jsii.String("value"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleheaderconfig.html

type CfnContinuousDeploymentPolicy_SingleHeaderPolicyConfigProperty added in v2.101.0

type CfnContinuousDeploymentPolicy_SingleHeaderPolicyConfigProperty struct {
	// The name of the HTTP header that CloudFront uses to configure for the single header policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleheaderpolicyconfig.html#cfn-cloudfront-continuousdeploymentpolicy-singleheaderpolicyconfig-header
	//
	Header *string `field:"required" json:"header" yaml:"header"`
	// Specifies the value to assign to the header for a single header policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleheaderpolicyconfig.html#cfn-cloudfront-continuousdeploymentpolicy-singleheaderpolicyconfig-value
	//
	Value *string `field:"required" json:"value" yaml:"value"`
}

Defines a single header policy for a CloudFront distribution.

> This property is legacy. We recommend that you use [TrafficConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html) and specify the [SingleHeaderConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html#cfn-cloudfront-continuousdeploymentpolicy-trafficconfig-singleheaderconfig) property instead.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

singleHeaderPolicyConfigProperty := &SingleHeaderPolicyConfigProperty{
	Header: jsii.String("header"),
	Value: jsii.String("value"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleheaderpolicyconfig.html

type CfnContinuousDeploymentPolicy_SingleWeightConfigProperty added in v2.54.0

type CfnContinuousDeploymentPolicy_SingleWeightConfigProperty struct {
	// The percentage of traffic to send to a staging distribution, expressed as a decimal number between 0 and 0.15. For example, a value of 0.10 means 10% of traffic is sent to the staging distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleweightconfig.html#cfn-cloudfront-continuousdeploymentpolicy-singleweightconfig-weight
	//
	Weight *float64 `field:"required" json:"weight" yaml:"weight"`
	// 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 your staging distribution, while others are sent to your primary distribution. Define the session duration using TTL values.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleweightconfig.html#cfn-cloudfront-continuousdeploymentpolicy-singleweightconfig-sessionstickinessconfig
	//
	SessionStickinessConfig interface{} `field:"optional" json:"sessionStickinessConfig" yaml:"sessionStickinessConfig"`
}

This configuration determines the percentage of HTTP requests that are sent to the staging distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

singleWeightConfigProperty := &SingleWeightConfigProperty{
	Weight: jsii.Number(123),

	// the properties below are optional
	SessionStickinessConfig: &SessionStickinessConfigProperty{
		IdleTtl: jsii.Number(123),
		MaximumTtl: jsii.Number(123),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleweightconfig.html

type CfnContinuousDeploymentPolicy_SingleWeightPolicyConfigProperty added in v2.101.0

type CfnContinuousDeploymentPolicy_SingleWeightPolicyConfigProperty struct {
	// The percentage of requests that CloudFront will use to send to an associated origin or cache settings.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleweightpolicyconfig.html#cfn-cloudfront-continuousdeploymentpolicy-singleweightpolicyconfig-weight
	//
	Weight *float64 `field:"required" json:"weight" yaml:"weight"`
	// Enable session stickiness for the associated origin or cache settings.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleweightpolicyconfig.html#cfn-cloudfront-continuousdeploymentpolicy-singleweightpolicyconfig-sessionstickinessconfig
	//
	SessionStickinessConfig interface{} `field:"optional" json:"sessionStickinessConfig" yaml:"sessionStickinessConfig"`
}

Configure a policy that CloudFront uses to route requests to different origins or use different cache settings, based on the weight assigned to each option.

> This property is legacy. We recommend that you use [TrafficConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html) and specify the [SingleWeightConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html#cfn-cloudfront-continuousdeploymentpolicy-trafficconfig-singleweightconfig) property instead.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

singleWeightPolicyConfigProperty := &SingleWeightPolicyConfigProperty{
	Weight: jsii.Number(123),

	// the properties below are optional
	SessionStickinessConfig: &SessionStickinessConfigProperty{
		IdleTtl: jsii.Number(123),
		MaximumTtl: jsii.Number(123),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-singleweightpolicyconfig.html

type CfnContinuousDeploymentPolicy_TrafficConfigProperty added in v2.54.0

type CfnContinuousDeploymentPolicy_TrafficConfigProperty struct {
	// The type of traffic configuration.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html#cfn-cloudfront-continuousdeploymentpolicy-trafficconfig-type
	//
	Type *string `field:"required" json:"type" yaml:"type"`
	// Determines which HTTP requests are sent to the staging distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html#cfn-cloudfront-continuousdeploymentpolicy-trafficconfig-singleheaderconfig
	//
	SingleHeaderConfig interface{} `field:"optional" json:"singleHeaderConfig" yaml:"singleHeaderConfig"`
	// Contains the percentage of traffic to send to the staging distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html#cfn-cloudfront-continuousdeploymentpolicy-trafficconfig-singleweightconfig
	//
	SingleWeightConfig interface{} `field:"optional" json:"singleWeightConfig" yaml:"singleWeightConfig"`
}

The traffic configuration of your continuous deployment.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

trafficConfigProperty := &TrafficConfigProperty{
	Type: jsii.String("type"),

	// the properties below are optional
	SingleHeaderConfig: &SingleHeaderConfigProperty{
		Header: jsii.String("header"),
		Value: jsii.String("value"),
	},
	SingleWeightConfig: &SingleWeightConfigProperty{
		Weight: jsii.Number(123),

		// the properties below are optional
		SessionStickinessConfig: &SessionStickinessConfigProperty{
			IdleTtl: jsii.Number(123),
			MaximumTtl: jsii.Number(123),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-continuousdeploymentpolicy-trafficconfig.html

type CfnDistribution

type CfnDistribution interface {
	awscdk.CfnResource
	awscdk.IInspectable
	awscdk.ITaggable
	// The domain name of the resource, such as `d111111abcdef8.cloudfront.net` .
	AttrDomainName() *string
	// The distribution's identifier.
	//
	// For example: `E1U5RQF7T870K0` .
	AttrId() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The distribution's configuration.
	DistributionConfig() interface{}
	SetDistributionConfig(val interface{})
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Tag Manager which manages the tags for this resource.
	Tags() awscdk.TagManager
	// A complex type that contains zero or more `Tag` elements.
	TagsRaw() *[]*awscdk.CfnTag
	SetTagsRaw(val *[]*awscdk.CfnTag)
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A distribution tells CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery.

Example:

var sourceBucket bucket

myDistribution := cloudfront.NewDistribution(this, jsii.String("MyCfWebDistribution"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(sourceBucket),
	},
})
cfnDistribution := myDistribution.Node.defaultChild.(cfnDistribution)
cfnDistribution.OverrideLogicalId(jsii.String("MyDistributionCFDistribution3H55TI9Q"))

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

func NewCfnDistribution

func NewCfnDistribution(scope constructs.Construct, id *string, props *CfnDistributionProps) CfnDistribution

type CfnDistributionProps

type CfnDistributionProps struct {
	// The distribution's configuration.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html#cfn-cloudfront-distribution-distributionconfig
	//
	DistributionConfig interface{} `field:"required" json:"distributionConfig" yaml:"distributionConfig"`
	// A complex type that contains zero or more `Tag` elements.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html#cfn-cloudfront-distribution-tags
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
}

Properties for defining a `CfnDistribution`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnDistributionProps := &CfnDistributionProps{
	DistributionConfig: &DistributionConfigProperty{
		DefaultCacheBehavior: &DefaultCacheBehaviorProperty{
			TargetOriginId: jsii.String("targetOriginId"),
			ViewerProtocolPolicy: jsii.String("viewerProtocolPolicy"),

			// the properties below are optional
			AllowedMethods: []*string{
				jsii.String("allowedMethods"),
			},
			CachedMethods: []*string{
				jsii.String("cachedMethods"),
			},
			CachePolicyId: jsii.String("cachePolicyId"),
			Compress: jsii.Boolean(false),
			DefaultTtl: jsii.Number(123),
			FieldLevelEncryptionId: jsii.String("fieldLevelEncryptionId"),
			ForwardedValues: &ForwardedValuesProperty{
				QueryString: jsii.Boolean(false),

				// the properties below are optional
				Cookies: &CookiesProperty{
					Forward: jsii.String("forward"),

					// the properties below are optional
					WhitelistedNames: []*string{
						jsii.String("whitelistedNames"),
					},
				},
				Headers: []*string{
					jsii.String("headers"),
				},
				QueryStringCacheKeys: []*string{
					jsii.String("queryStringCacheKeys"),
				},
			},
			FunctionAssociations: []interface{}{
				&FunctionAssociationProperty{
					EventType: jsii.String("eventType"),
					FunctionArn: jsii.String("functionArn"),
				},
			},
			LambdaFunctionAssociations: []interface{}{
				&LambdaFunctionAssociationProperty{
					EventType: jsii.String("eventType"),
					IncludeBody: jsii.Boolean(false),
					LambdaFunctionArn: jsii.String("lambdaFunctionArn"),
				},
			},
			MaxTtl: jsii.Number(123),
			MinTtl: jsii.Number(123),
			OriginRequestPolicyId: jsii.String("originRequestPolicyId"),
			RealtimeLogConfigArn: jsii.String("realtimeLogConfigArn"),
			ResponseHeadersPolicyId: jsii.String("responseHeadersPolicyId"),
			SmoothStreaming: jsii.Boolean(false),
			TrustedKeyGroups: []*string{
				jsii.String("trustedKeyGroups"),
			},
			TrustedSigners: []*string{
				jsii.String("trustedSigners"),
			},
		},
		Enabled: jsii.Boolean(false),

		// the properties below are optional
		Aliases: []*string{
			jsii.String("aliases"),
		},
		CacheBehaviors: []interface{}{
			&CacheBehaviorProperty{
				PathPattern: jsii.String("pathPattern"),
				TargetOriginId: jsii.String("targetOriginId"),
				ViewerProtocolPolicy: jsii.String("viewerProtocolPolicy"),

				// the properties below are optional
				AllowedMethods: []*string{
					jsii.String("allowedMethods"),
				},
				CachedMethods: []*string{
					jsii.String("cachedMethods"),
				},
				CachePolicyId: jsii.String("cachePolicyId"),
				Compress: jsii.Boolean(false),
				DefaultTtl: jsii.Number(123),
				FieldLevelEncryptionId: jsii.String("fieldLevelEncryptionId"),
				ForwardedValues: &ForwardedValuesProperty{
					QueryString: jsii.Boolean(false),

					// the properties below are optional
					Cookies: &CookiesProperty{
						Forward: jsii.String("forward"),

						// the properties below are optional
						WhitelistedNames: []*string{
							jsii.String("whitelistedNames"),
						},
					},
					Headers: []*string{
						jsii.String("headers"),
					},
					QueryStringCacheKeys: []*string{
						jsii.String("queryStringCacheKeys"),
					},
				},
				FunctionAssociations: []interface{}{
					&FunctionAssociationProperty{
						EventType: jsii.String("eventType"),
						FunctionArn: jsii.String("functionArn"),
					},
				},
				LambdaFunctionAssociations: []interface{}{
					&LambdaFunctionAssociationProperty{
						EventType: jsii.String("eventType"),
						IncludeBody: jsii.Boolean(false),
						LambdaFunctionArn: jsii.String("lambdaFunctionArn"),
					},
				},
				MaxTtl: jsii.Number(123),
				MinTtl: jsii.Number(123),
				OriginRequestPolicyId: jsii.String("originRequestPolicyId"),
				RealtimeLogConfigArn: jsii.String("realtimeLogConfigArn"),
				ResponseHeadersPolicyId: jsii.String("responseHeadersPolicyId"),
				SmoothStreaming: jsii.Boolean(false),
				TrustedKeyGroups: []*string{
					jsii.String("trustedKeyGroups"),
				},
				TrustedSigners: []*string{
					jsii.String("trustedSigners"),
				},
			},
		},
		CnamEs: []*string{
			jsii.String("cnamEs"),
		},
		Comment: jsii.String("comment"),
		ContinuousDeploymentPolicyId: jsii.String("continuousDeploymentPolicyId"),
		CustomErrorResponses: []interface{}{
			&CustomErrorResponseProperty{
				ErrorCode: jsii.Number(123),

				// the properties below are optional
				ErrorCachingMinTtl: jsii.Number(123),
				ResponseCode: jsii.Number(123),
				ResponsePagePath: jsii.String("responsePagePath"),
			},
		},
		CustomOrigin: &LegacyCustomOriginProperty{
			DnsName: jsii.String("dnsName"),
			OriginProtocolPolicy: jsii.String("originProtocolPolicy"),
			OriginSslProtocols: []*string{
				jsii.String("originSslProtocols"),
			},

			// the properties below are optional
			HttpPort: jsii.Number(123),
			HttpsPort: jsii.Number(123),
		},
		DefaultRootObject: jsii.String("defaultRootObject"),
		HttpVersion: jsii.String("httpVersion"),
		Ipv6Enabled: jsii.Boolean(false),
		Logging: &LoggingProperty{
			Bucket: jsii.String("bucket"),

			// the properties below are optional
			IncludeCookies: jsii.Boolean(false),
			Prefix: jsii.String("prefix"),
		},
		OriginGroups: &OriginGroupsProperty{
			Quantity: jsii.Number(123),

			// the properties below are optional
			Items: []interface{}{
				&OriginGroupProperty{
					FailoverCriteria: &OriginGroupFailoverCriteriaProperty{
						StatusCodes: &StatusCodesProperty{
							Items: []interface{}{
								jsii.Number(123),
							},
							Quantity: jsii.Number(123),
						},
					},
					Id: jsii.String("id"),
					Members: &OriginGroupMembersProperty{
						Items: []interface{}{
							&OriginGroupMemberProperty{
								OriginId: jsii.String("originId"),
							},
						},
						Quantity: jsii.Number(123),
					},
				},
			},
		},
		Origins: []interface{}{
			&OriginProperty{
				DomainName: jsii.String("domainName"),
				Id: jsii.String("id"),

				// the properties below are optional
				ConnectionAttempts: jsii.Number(123),
				ConnectionTimeout: jsii.Number(123),
				CustomOriginConfig: &CustomOriginConfigProperty{
					OriginProtocolPolicy: jsii.String("originProtocolPolicy"),

					// the properties below are optional
					HttpPort: jsii.Number(123),
					HttpsPort: jsii.Number(123),
					OriginKeepaliveTimeout: jsii.Number(123),
					OriginReadTimeout: jsii.Number(123),
					OriginSslProtocols: []*string{
						jsii.String("originSslProtocols"),
					},
				},
				OriginAccessControlId: jsii.String("originAccessControlId"),
				OriginCustomHeaders: []interface{}{
					&OriginCustomHeaderProperty{
						HeaderName: jsii.String("headerName"),
						HeaderValue: jsii.String("headerValue"),
					},
				},
				OriginPath: jsii.String("originPath"),
				OriginShield: &OriginShieldProperty{
					Enabled: jsii.Boolean(false),
					OriginShieldRegion: jsii.String("originShieldRegion"),
				},
				S3OriginConfig: &S3OriginConfigProperty{
					OriginAccessIdentity: jsii.String("originAccessIdentity"),
				},
			},
		},
		PriceClass: jsii.String("priceClass"),
		Restrictions: &RestrictionsProperty{
			GeoRestriction: &GeoRestrictionProperty{
				RestrictionType: jsii.String("restrictionType"),

				// the properties below are optional
				Locations: []*string{
					jsii.String("locations"),
				},
			},
		},
		S3Origin: &LegacyS3OriginProperty{
			DnsName: jsii.String("dnsName"),

			// the properties below are optional
			OriginAccessIdentity: jsii.String("originAccessIdentity"),
		},
		Staging: jsii.Boolean(false),
		ViewerCertificate: &ViewerCertificateProperty{
			AcmCertificateArn: jsii.String("acmCertificateArn"),
			CloudFrontDefaultCertificate: jsii.Boolean(false),
			IamCertificateId: jsii.String("iamCertificateId"),
			MinimumProtocolVersion: jsii.String("minimumProtocolVersion"),
			SslSupportMethod: jsii.String("sslSupportMethod"),
		},
		WebAclId: jsii.String("webAclId"),
	},

	// the properties below are optional
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-distribution.html

type CfnDistribution_CacheBehaviorProperty

type CfnDistribution_CacheBehaviorProperty struct {
	// The pattern (for example, `images/*.jpg` ) that specifies which requests to apply the behavior to. When CloudFront receives a viewer request, the requested path is compared with path patterns in the order in which cache behaviors are listed in the distribution.
	//
	// > You can optionally include a slash ( `/` ) at the beginning of the path pattern. For example, `/images/*.jpg` . CloudFront behavior is the same with or without the leading `/` .
	//
	// The path pattern for the default cache behavior is `*` and cannot be changed. If the request for an object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in the default cache behavior.
	//
	// For more information, see [Path Pattern](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesPathPattern) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-pathpattern
	//
	PathPattern *string `field:"required" json:"pathPattern" yaml:"pathPattern"`
	// The value of `ID` for the origin that you want CloudFront to route requests to when they match this cache behavior.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-targetoriginid
	//
	TargetOriginId *string `field:"required" json:"targetOriginId" yaml:"targetOriginId"`
	// The protocol that viewers can use to access the files in the origin specified by `TargetOriginId` when a request matches the path pattern in `PathPattern` .
	//
	// You can specify the following options:
	//
	// - `allow-all` : Viewers can use HTTP or HTTPS.
	// - `redirect-to-https` : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL.
	// - `https-only` : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden).
	//
	// For more information about requiring the HTTPS protocol, see [Requiring HTTPS Between Viewers and CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront.html) in the *Amazon CloudFront Developer Guide* .
	//
	// > The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see [Managing Cache Expiration](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-viewerprotocolpolicy
	//
	ViewerProtocolPolicy *string `field:"required" json:"viewerProtocolPolicy" yaml:"viewerProtocolPolicy"`
	// A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.
	//
	// There are three choices:
	//
	// - CloudFront forwards only `GET` and `HEAD` requests.
	// - CloudFront forwards only `GET` , `HEAD` , and `OPTIONS` requests.
	// - CloudFront forwards `GET, HEAD, OPTIONS, PUT, PATCH, POST` , and `DELETE` requests.
	//
	// If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-allowedmethods
	//
	AllowedMethods *[]*string `field:"optional" json:"allowedMethods" yaml:"allowedMethods"`
	// A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods.
	//
	// There are two choices:
	//
	// - CloudFront caches responses to `GET` and `HEAD` requests.
	// - CloudFront caches responses to `GET` , `HEAD` , and `OPTIONS` requests.
	//
	// If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-cachedmethods
	//
	CachedMethods *[]*string `field:"optional" json:"cachedMethods" yaml:"cachedMethods"`
	// The unique identifier of the cache policy that is attached to this cache behavior.
	//
	// For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) or [Using the managed cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// A `CacheBehavior` must include either a `CachePolicyId` or `ForwardedValues` . We recommend that you use a `CachePolicyId` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-cachepolicyid
	//
	CachePolicyId *string `field:"optional" json:"cachePolicyId" yaml:"cachePolicyId"`
	// Whether you want CloudFront to automatically compress certain files for this cache behavior.
	//
	// If so, specify true; if not, specify false. For more information, see [Serving Compressed Files](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-compress
	//
	// Default: - false.
	//
	Compress interface{} `field:"optional" json:"compress" yaml:"compress"`
	// This field is deprecated.
	//
	// We recommend that you use the `DefaultTTL` field in a cache policy instead of this field. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) or [Using the managed cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as `Cache-Control max-age` , `Cache-Control s-maxage` , and `Expires` to objects. For more information, see [Managing How Long Content Stays in an Edge Cache (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-defaultttl
	//
	// Default: - 86400.
	//
	DefaultTtl *float64 `field:"optional" json:"defaultTtl" yaml:"defaultTtl"`
	// The value of `ID` for the field-level encryption configuration that you want CloudFront to use for encrypting specific fields of data for this cache behavior.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-fieldlevelencryptionid
	//
	// Default: - "".
	//
	FieldLevelEncryptionId *string `field:"optional" json:"fieldLevelEncryptionId" yaml:"fieldLevelEncryptionId"`
	// This field is deprecated.
	//
	// We recommend that you use a cache policy or an origin request policy instead of this field. For more information, see [Working with policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/working-with-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// If you want to include values in the cache key, use a cache policy. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) or [Using the managed cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// If you want to send values to the origin but not include them in the cache key, use an origin request policy. For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) or [Using the managed origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// A `CacheBehavior` must include either a `CachePolicyId` or `ForwardedValues` . We recommend that you use a `CachePolicyId` .
	//
	// A complex type that specifies how CloudFront handles query strings, cookies, and HTTP headers.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-forwardedvalues
	//
	ForwardedValues interface{} `field:"optional" json:"forwardedValues" yaml:"forwardedValues"`
	// A list of CloudFront functions that are associated with this cache behavior.
	//
	// CloudFront functions must be published to the `LIVE` stage to associate them with a cache behavior.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-functionassociations
	//
	FunctionAssociations interface{} `field:"optional" json:"functionAssociations" yaml:"functionAssociations"`
	// A complex type that contains zero or more Lambda@Edge function associations for a cache behavior.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-lambdafunctionassociations
	//
	LambdaFunctionAssociations interface{} `field:"optional" json:"lambdaFunctionAssociations" yaml:"lambdaFunctionAssociations"`
	// This field is deprecated.
	//
	// We recommend that you use the `MaxTTL` field in a cache policy instead of this field. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) or [Using the managed cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// The maximum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin adds HTTP headers such as `Cache-Control max-age` , `Cache-Control s-maxage` , and `Expires` to objects. For more information, see [Managing How Long Content Stays in an Edge Cache (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-maxttl
	//
	// Default: - 31536000.
	//
	MaxTtl *float64 `field:"optional" json:"maxTtl" yaml:"maxTtl"`
	// This field is deprecated.
	//
	// We recommend that you use the `MinTTL` field in a cache policy instead of this field. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) or [Using the managed cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see [Managing How Long Content Stays in an Edge Cache (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	//
	// You must specify `0` for `MinTTL` if you configure CloudFront to forward all headers to your origin (under `Headers` , if you specify `1` for `Quantity` and `*` for `Name` ).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-minttl
	//
	// Default: - 0.
	//
	MinTtl *float64 `field:"optional" json:"minTtl" yaml:"minTtl"`
	// The unique identifier of the origin request policy that is attached to this cache behavior.
	//
	// For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) or [Using the managed origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-originrequestpolicyid
	//
	OriginRequestPolicyId *string `field:"optional" json:"originRequestPolicyId" yaml:"originRequestPolicyId"`
	// The Amazon Resource Name (ARN) of the real-time log configuration that is attached to this cache behavior.
	//
	// For more information, see [Real-time logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-realtimelogconfigarn
	//
	RealtimeLogConfigArn *string `field:"optional" json:"realtimeLogConfigArn" yaml:"realtimeLogConfigArn"`
	// The identifier for a response headers policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-responseheaderspolicyid
	//
	ResponseHeadersPolicyId *string `field:"optional" json:"responseHeadersPolicyId" yaml:"responseHeadersPolicyId"`
	// Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior.
	//
	// If so, specify `true` ; if not, specify `false` . If you specify `true` for `SmoothStreaming` , you can still distribute other content using this cache behavior if the content matches the value of `PathPattern` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-smoothstreaming
	//
	// Default: - false.
	//
	SmoothStreaming interface{} `field:"optional" json:"smoothStreaming" yaml:"smoothStreaming"`
	// A list of key groups that CloudFront can use to validate signed URLs or signed cookies.
	//
	// When a cache behavior contains trusted key groups, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior. The URLs or cookies must be signed with a private key whose corresponding public key is in the key group. The signed URL or cookie contains information about which public key CloudFront should use to verify the signature. For more information, see [Serving private content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-trustedkeygroups
	//
	TrustedKeyGroups *[]*string `field:"optional" json:"trustedKeyGroups" yaml:"trustedKeyGroups"`
	// > We recommend using `TrustedKeyGroups` instead of `TrustedSigners` .
	//
	// A list of AWS account IDs whose public keys CloudFront can use to validate signed URLs or signed cookies.
	//
	// When a cache behavior contains trusted signers, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior. The URLs or cookies must be signed with the private key of a CloudFront key pair in the trusted signer's AWS account . The signed URL or cookie contains information about which public key CloudFront should use to verify the signature. For more information, see [Serving private content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html#cfn-cloudfront-distribution-cachebehavior-trustedsigners
	//
	TrustedSigners *[]*string `field:"optional" json:"trustedSigners" yaml:"trustedSigners"`
}

A complex type that describes how CloudFront processes requests.

You must create at least as many cache behaviors (including the default cache behavior) as you have origins if you want CloudFront to serve objects from all of the origins. Each cache behavior specifies the one origin from which you want CloudFront to get objects. If you have two origins and only the default cache behavior, the default cache behavior will cause CloudFront to get objects from one of the origins, but the other origin is never used.

For the current quota (formerly known as limit) on the number of cache behaviors that you can add to a distribution, see [Quotas](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-limits.html) in the *Amazon CloudFront Developer Guide* .

If you don't want to specify any cache behaviors, include only an empty `CacheBehaviors` element. Don't specify an empty individual `CacheBehavior` element, because this is invalid. For more information, see [CacheBehaviors](https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CacheBehaviors.html) .

To delete all cache behaviors in an existing distribution, update the distribution configuration and include only an empty `CacheBehaviors` element.

To add, change, or remove one or more cache behaviors, update the distribution configuration and specify all of the cache behaviors that you want to include in the updated distribution.

For more information about cache behaviors, see [Cache Behavior Settings](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesCacheBehavior) in the *Amazon CloudFront Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cacheBehaviorProperty := &CacheBehaviorProperty{
	PathPattern: jsii.String("pathPattern"),
	TargetOriginId: jsii.String("targetOriginId"),
	ViewerProtocolPolicy: jsii.String("viewerProtocolPolicy"),

	// the properties below are optional
	AllowedMethods: []*string{
		jsii.String("allowedMethods"),
	},
	CachedMethods: []*string{
		jsii.String("cachedMethods"),
	},
	CachePolicyId: jsii.String("cachePolicyId"),
	Compress: jsii.Boolean(false),
	DefaultTtl: jsii.Number(123),
	FieldLevelEncryptionId: jsii.String("fieldLevelEncryptionId"),
	ForwardedValues: &ForwardedValuesProperty{
		QueryString: jsii.Boolean(false),

		// the properties below are optional
		Cookies: &CookiesProperty{
			Forward: jsii.String("forward"),

			// the properties below are optional
			WhitelistedNames: []*string{
				jsii.String("whitelistedNames"),
			},
		},
		Headers: []*string{
			jsii.String("headers"),
		},
		QueryStringCacheKeys: []*string{
			jsii.String("queryStringCacheKeys"),
		},
	},
	FunctionAssociations: []interface{}{
		&FunctionAssociationProperty{
			EventType: jsii.String("eventType"),
			FunctionArn: jsii.String("functionArn"),
		},
	},
	LambdaFunctionAssociations: []interface{}{
		&LambdaFunctionAssociationProperty{
			EventType: jsii.String("eventType"),
			IncludeBody: jsii.Boolean(false),
			LambdaFunctionArn: jsii.String("lambdaFunctionArn"),
		},
	},
	MaxTtl: jsii.Number(123),
	MinTtl: jsii.Number(123),
	OriginRequestPolicyId: jsii.String("originRequestPolicyId"),
	RealtimeLogConfigArn: jsii.String("realtimeLogConfigArn"),
	ResponseHeadersPolicyId: jsii.String("responseHeadersPolicyId"),
	SmoothStreaming: jsii.Boolean(false),
	TrustedKeyGroups: []*string{
		jsii.String("trustedKeyGroups"),
	},
	TrustedSigners: []*string{
		jsii.String("trustedSigners"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html

type CfnDistribution_CookiesProperty

type CfnDistribution_CookiesProperty struct {
	// This field is deprecated.
	//
	// We recommend that you use a cache policy or an origin request policy instead of this field.
	//
	// If you want to include cookies in the cache key, use a cache policy. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// If you want to send cookies to the origin but not include them in the cache key, use origin request policy. For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// Specifies which cookies to forward to the origin for this cache behavior: all, none, or the list of cookies specified in the `WhitelistedNames` complex type.
	//
	// Amazon S3 doesn't process cookies. When the cache behavior is forwarding requests to an Amazon S3 origin, specify none for the `Forward` element.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cookies.html#cfn-cloudfront-distribution-cookies-forward
	//
	Forward *string `field:"required" json:"forward" yaml:"forward"`
	// This field is deprecated.
	//
	// We recommend that you use a cache policy or an origin request policy instead of this field.
	//
	// If you want to include cookies in the cache key, use a cache policy. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// If you want to send cookies to the origin but not include them in the cache key, use an origin request policy. For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// Required if you specify `whitelist` for the value of `Forward` . A complex type that specifies how many different cookies you want CloudFront to forward to the origin for this cache behavior and, if you want to forward selected cookies, the names of those cookies.
	//
	// If you specify `all` or `none` for the value of `Forward` , omit `WhitelistedNames` . If you change the value of `Forward` from `whitelist` to `all` or `none` and you don't delete the `WhitelistedNames` element and its child elements, CloudFront deletes them automatically.
	//
	// For the current limit on the number of cookie names that you can whitelist for each cache behavior, see [CloudFront Limits](https://docs.aws.amazon.com/general/latest/gr/xrefaws_service_limits.html#limits_cloudfront) in the *AWS General Reference* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cookies.html#cfn-cloudfront-distribution-cookies-whitelistednames
	//
	WhitelistedNames *[]*string `field:"optional" json:"whitelistedNames" yaml:"whitelistedNames"`
}

This field is deprecated.

We recommend that you use a cache policy or an origin request policy instead of this field.

If you want to include cookies in the cache key, use a cache policy. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) in the *Amazon CloudFront Developer Guide* .

If you want to send cookies to the origin but not include them in the cache key, use an origin request policy. For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide* .

A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see [How CloudFront Forwards, Caches, and Logs Cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) in the *Amazon CloudFront Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cookiesProperty := &CookiesProperty{
	Forward: jsii.String("forward"),

	// the properties below are optional
	WhitelistedNames: []*string{
		jsii.String("whitelistedNames"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cookies.html

type CfnDistribution_CustomErrorResponseProperty

type CfnDistribution_CustomErrorResponseProperty struct {
	// The HTTP status code for which you want to specify a custom error page and/or a caching duration.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html#cfn-cloudfront-distribution-customerrorresponse-errorcode
	//
	ErrorCode *float64 `field:"required" json:"errorCode" yaml:"errorCode"`
	// The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in `ErrorCode` .
	//
	// When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available.
	//
	// For more information, see [Customizing Error Responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html#cfn-cloudfront-distribution-customerrorresponse-errorcachingminttl
	//
	// Default: - 300.
	//
	ErrorCachingMinTtl *float64 `field:"optional" json:"errorCachingMinTtl" yaml:"errorCachingMinTtl"`
	// The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.
	//
	// There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example:
	//
	// - Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you substitute `200` , the response typically won't be intercepted.
	// - If you don't care about distinguishing among different client errors or server errors, you can specify `400` or `500` as the `ResponseCode` for all 4xx or 5xx errors.
	// - You might want to return a `200` status code (OK) and static website so your customers don't know that your website is down.
	//
	// If you specify a value for `ResponseCode` , you must also specify a value for `ResponsePagePath` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html#cfn-cloudfront-distribution-customerrorresponse-responsecode
	//
	ResponseCode *float64 `field:"optional" json:"responseCode" yaml:"responseCode"`
	// The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by `ErrorCode` , for example, `/4xx-errors/403-forbidden.html` . If you want to store your objects and your custom error pages in different locations, your distribution must include a cache behavior for which the following is true:.
	//
	// - The value of `PathPattern` matches the path to your custom error messages. For example, suppose you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named `/4xx-errors` . Your distribution must include a cache behavior for which the path pattern routes requests for your custom error pages to that location, for example, `/4xx-errors/*` .
	// - The value of `TargetOriginId` specifies the value of the `ID` element for the origin that contains your custom error pages.
	//
	// If you specify a value for `ResponsePagePath` , you must also specify a value for `ResponseCode` .
	//
	// We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html#cfn-cloudfront-distribution-customerrorresponse-responsepagepath
	//
	ResponsePagePath *string `field:"optional" json:"responsePagePath" yaml:"responsePagePath"`
}

A complex type that controls:.

- Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer. - How long CloudFront caches HTTP status codes in the 4xx and 5xx range.

For more information about custom error pages, see [Customizing Error Responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the *Amazon CloudFront Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

customErrorResponseProperty := &CustomErrorResponseProperty{
	ErrorCode: jsii.Number(123),

	// the properties below are optional
	ErrorCachingMinTtl: jsii.Number(123),
	ResponseCode: jsii.Number(123),
	ResponsePagePath: jsii.String("responsePagePath"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html

type CfnDistribution_CustomOriginConfigProperty

type CfnDistribution_CustomOriginConfigProperty struct {
	// Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin. Valid values are:.
	//
	// - `http-only` – CloudFront always uses HTTP to connect to the origin.
	// - `match-viewer` – CloudFront connects to the origin using the same protocol that the viewer used to connect to CloudFront.
	// - `https-only` – CloudFront always uses HTTPS to connect to the origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customoriginconfig.html#cfn-cloudfront-distribution-customoriginconfig-originprotocolpolicy
	//
	OriginProtocolPolicy *string `field:"required" json:"originProtocolPolicy" yaml:"originProtocolPolicy"`
	// The HTTP port that CloudFront uses to connect to the origin.
	//
	// Specify the HTTP port that the origin listens on.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customoriginconfig.html#cfn-cloudfront-distribution-customoriginconfig-httpport
	//
	// Default: - 80.
	//
	HttpPort *float64 `field:"optional" json:"httpPort" yaml:"httpPort"`
	// The HTTPS port that CloudFront uses to connect to the origin.
	//
	// Specify the HTTPS port that the origin listens on.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customoriginconfig.html#cfn-cloudfront-distribution-customoriginconfig-httpsport
	//
	// Default: - 443.
	//
	HttpsPort *float64 `field:"optional" json:"httpsPort" yaml:"httpsPort"`
	// Specifies how long, in seconds, CloudFront persists its connection to the origin.
	//
	// The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.
	//
	// For more information, see [Origin Keep-alive Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginKeepaliveTimeout) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customoriginconfig.html#cfn-cloudfront-distribution-customoriginconfig-originkeepalivetimeout
	//
	// Default: - 5.
	//
	OriginKeepaliveTimeout *float64 `field:"optional" json:"originKeepaliveTimeout" yaml:"originKeepaliveTimeout"`
	// Specifies how long, in seconds, CloudFront waits for a response from the origin.
	//
	// This is also known as the *origin response timeout* . The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.
	//
	// For more information, see [Origin Response Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginResponseTimeout) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customoriginconfig.html#cfn-cloudfront-distribution-customoriginconfig-originreadtimeout
	//
	// Default: - 30.
	//
	OriginReadTimeout *float64 `field:"optional" json:"originReadTimeout" yaml:"originReadTimeout"`
	// Specifies the minimum SSL/TLS protocol that CloudFront uses when connecting to your origin over HTTPS.
	//
	// Valid values include `SSLv3` , `TLSv1` , `TLSv1.1` , and `TLSv1.2` .
	//
	// For more information, see [Minimum Origin SSL Protocol](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginSSLProtocols) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customoriginconfig.html#cfn-cloudfront-distribution-customoriginconfig-originsslprotocols
	//
	OriginSslProtocols *[]*string `field:"optional" json:"originSslProtocols" yaml:"originSslProtocols"`
}

A custom origin.

A custom origin is any origin that is *not* an Amazon S3 bucket, with one exception. An Amazon S3 bucket that is [configured with static website hosting](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) *is* a custom origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

customOriginConfigProperty := &CustomOriginConfigProperty{
	OriginProtocolPolicy: jsii.String("originProtocolPolicy"),

	// the properties below are optional
	HttpPort: jsii.Number(123),
	HttpsPort: jsii.Number(123),
	OriginKeepaliveTimeout: jsii.Number(123),
	OriginReadTimeout: jsii.Number(123),
	OriginSslProtocols: []*string{
		jsii.String("originSslProtocols"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customoriginconfig.html

type CfnDistribution_DefaultCacheBehaviorProperty

type CfnDistribution_DefaultCacheBehaviorProperty struct {
	// The value of `ID` for the origin that you want CloudFront to route requests to when they use the default cache behavior.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-targetoriginid
	//
	TargetOriginId *string `field:"required" json:"targetOriginId" yaml:"targetOriginId"`
	// The protocol that viewers can use to access the files in the origin specified by `TargetOriginId` when a request matches the path pattern in `PathPattern` .
	//
	// You can specify the following options:
	//
	// - `allow-all` : Viewers can use HTTP or HTTPS.
	// - `redirect-to-https` : If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL.
	// - `https-only` : If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden).
	//
	// For more information about requiring the HTTPS protocol, see [Requiring HTTPS Between Viewers and CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront.html) in the *Amazon CloudFront Developer Guide* .
	//
	// > The only way to guarantee that viewers retrieve an object that was fetched from the origin using HTTPS is never to use any other protocol to fetch the object. If you have recently changed from HTTP to HTTPS, we recommend that you clear your objects' cache because cached objects are protocol agnostic. That means that an edge location will return an object from the cache regardless of whether the current request protocol matches the protocol used previously. For more information, see [Managing Cache Expiration](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-viewerprotocolpolicy
	//
	ViewerProtocolPolicy *string `field:"required" json:"viewerProtocolPolicy" yaml:"viewerProtocolPolicy"`
	// A complex type that controls which HTTP methods CloudFront processes and forwards to your Amazon S3 bucket or your custom origin.
	//
	// There are three choices:
	//
	// - CloudFront forwards only `GET` and `HEAD` requests.
	// - CloudFront forwards only `GET` , `HEAD` , and `OPTIONS` requests.
	// - CloudFront forwards `GET, HEAD, OPTIONS, PUT, PATCH, POST` , and `DELETE` requests.
	//
	// If you pick the third choice, you may need to restrict access to your Amazon S3 bucket or to your custom origin so users can't perform operations that you don't want them to. For example, you might not want users to have permissions to delete objects from your origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-allowedmethods
	//
	AllowedMethods *[]*string `field:"optional" json:"allowedMethods" yaml:"allowedMethods"`
	// A complex type that controls whether CloudFront caches the response to requests using the specified HTTP methods.
	//
	// There are two choices:
	//
	// - CloudFront caches responses to `GET` and `HEAD` requests.
	// - CloudFront caches responses to `GET` , `HEAD` , and `OPTIONS` requests.
	//
	// If you pick the second choice for your Amazon S3 Origin, you may need to forward Access-Control-Request-Method, Access-Control-Request-Headers, and Origin headers for the responses to be cached correctly.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-cachedmethods
	//
	CachedMethods *[]*string `field:"optional" json:"cachedMethods" yaml:"cachedMethods"`
	// The unique identifier of the cache policy that is attached to the default cache behavior.
	//
	// For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) or [Using the managed cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// A `DefaultCacheBehavior` must include either a `CachePolicyId` or `ForwardedValues` . We recommend that you use a `CachePolicyId` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-cachepolicyid
	//
	// Default: - "".
	//
	CachePolicyId *string `field:"optional" json:"cachePolicyId" yaml:"cachePolicyId"`
	// Whether you want CloudFront to automatically compress certain files for this cache behavior.
	//
	// If so, specify `true` ; if not, specify `false` . For more information, see [Serving Compressed Files](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-compress
	//
	// Default: - false.
	//
	Compress interface{} `field:"optional" json:"compress" yaml:"compress"`
	// This field is deprecated.
	//
	// We recommend that you use the `DefaultTTL` field in a cache policy instead of this field. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) or [Using the managed cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// The default amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin does not add HTTP headers such as `Cache-Control max-age` , `Cache-Control s-maxage` , and `Expires` to objects. For more information, see [Managing How Long Content Stays in an Edge Cache (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-defaultttl
	//
	// Default: - 86400.
	//
	DefaultTtl *float64 `field:"optional" json:"defaultTtl" yaml:"defaultTtl"`
	// The value of `ID` for the field-level encryption configuration that you want CloudFront to use for encrypting specific fields of data for the default cache behavior.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-fieldlevelencryptionid
	//
	// Default: - "".
	//
	FieldLevelEncryptionId *string `field:"optional" json:"fieldLevelEncryptionId" yaml:"fieldLevelEncryptionId"`
	// This field is deprecated.
	//
	// We recommend that you use a cache policy or an origin request policy instead of this field. For more information, see [Working with policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/working-with-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// If you want to include values in the cache key, use a cache policy. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) or [Using the managed cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// If you want to send values to the origin but not include them in the cache key, use an origin request policy. For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) or [Using the managed origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// A `DefaultCacheBehavior` must include either a `CachePolicyId` or `ForwardedValues` . We recommend that you use a `CachePolicyId` .
	//
	// A complex type that specifies how CloudFront handles query strings, cookies, and HTTP headers.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-forwardedvalues
	//
	ForwardedValues interface{} `field:"optional" json:"forwardedValues" yaml:"forwardedValues"`
	// A list of CloudFront functions that are associated with this cache behavior.
	//
	// Your functions must be published to the `LIVE` stage to associate them with a cache behavior.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-functionassociations
	//
	FunctionAssociations interface{} `field:"optional" json:"functionAssociations" yaml:"functionAssociations"`
	// A complex type that contains zero or more Lambda@Edge function associations for a cache behavior.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-lambdafunctionassociations
	//
	LambdaFunctionAssociations interface{} `field:"optional" json:"lambdaFunctionAssociations" yaml:"lambdaFunctionAssociations"`
	// This field is deprecated.
	//
	// We recommend that you use the `MaxTTL` field in a cache policy instead of this field. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) or [Using the managed cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// The maximum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. The value that you specify applies only when your origin adds HTTP headers such as `Cache-Control max-age` , `Cache-Control s-maxage` , and `Expires` to objects. For more information, see [Managing How Long Content Stays in an Edge Cache (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-maxttl
	//
	// Default: - 31536000.
	//
	MaxTtl *float64 `field:"optional" json:"maxTtl" yaml:"maxTtl"`
	// This field is deprecated.
	//
	// We recommend that you use the `MinTTL` field in a cache policy instead of this field. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) or [Using the managed cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html) in the *Amazon CloudFront Developer Guide* .
	//
	// The minimum amount of time that you want objects to stay in CloudFront caches before CloudFront forwards another request to your origin to determine whether the object has been updated. For more information, see [Managing How Long Content Stays in an Edge Cache (Expiration)](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html) in the *Amazon CloudFront Developer Guide* .
	//
	// You must specify `0` for `MinTTL` if you configure CloudFront to forward all headers to your origin (under `Headers` , if you specify `1` for `Quantity` and `*` for `Name` ).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-minttl
	//
	// Default: - 0.
	//
	MinTtl *float64 `field:"optional" json:"minTtl" yaml:"minTtl"`
	// The unique identifier of the origin request policy that is attached to the default cache behavior.
	//
	// For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) or [Using the managed origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-originrequestpolicyid
	//
	// Default: - "".
	//
	OriginRequestPolicyId *string `field:"optional" json:"originRequestPolicyId" yaml:"originRequestPolicyId"`
	// The Amazon Resource Name (ARN) of the real-time log configuration that is attached to this cache behavior.
	//
	// For more information, see [Real-time logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-realtimelogconfigarn
	//
	// Default: - "".
	//
	RealtimeLogConfigArn *string `field:"optional" json:"realtimeLogConfigArn" yaml:"realtimeLogConfigArn"`
	// The identifier for a response headers policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-responseheaderspolicyid
	//
	// Default: - "".
	//
	ResponseHeadersPolicyId *string `field:"optional" json:"responseHeadersPolicyId" yaml:"responseHeadersPolicyId"`
	// Indicates whether you want to distribute media files in the Microsoft Smooth Streaming format using the origin that is associated with this cache behavior.
	//
	// If so, specify `true` ; if not, specify `false` . If you specify `true` for `SmoothStreaming` , you can still distribute other content using this cache behavior if the content matches the value of `PathPattern` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-smoothstreaming
	//
	// Default: - false.
	//
	SmoothStreaming interface{} `field:"optional" json:"smoothStreaming" yaml:"smoothStreaming"`
	// A list of key groups that CloudFront can use to validate signed URLs or signed cookies.
	//
	// When a cache behavior contains trusted key groups, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior. The URLs or cookies must be signed with a private key whose corresponding public key is in the key group. The signed URL or cookie contains information about which public key CloudFront should use to verify the signature. For more information, see [Serving private content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-trustedkeygroups
	//
	TrustedKeyGroups *[]*string `field:"optional" json:"trustedKeyGroups" yaml:"trustedKeyGroups"`
	// > We recommend using `TrustedKeyGroups` instead of `TrustedSigners` .
	//
	// A list of AWS account IDs whose public keys CloudFront can use to validate signed URLs or signed cookies.
	//
	// When a cache behavior contains trusted signers, CloudFront requires signed URLs or signed cookies for all requests that match the cache behavior. The URLs or cookies must be signed with the private key of a CloudFront key pair in a trusted signer's AWS account . The signed URL or cookie contains information about which public key CloudFront should use to verify the signature. For more information, see [Serving private content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html#cfn-cloudfront-distribution-defaultcachebehavior-trustedsigners
	//
	TrustedSigners *[]*string `field:"optional" json:"trustedSigners" yaml:"trustedSigners"`
}

A complex type that describes the default cache behavior if you don't specify a `CacheBehavior` element or if request URLs don't match any of the values of `PathPattern` in `CacheBehavior` elements.

You must create exactly one default cache behavior.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

defaultCacheBehaviorProperty := &DefaultCacheBehaviorProperty{
	TargetOriginId: jsii.String("targetOriginId"),
	ViewerProtocolPolicy: jsii.String("viewerProtocolPolicy"),

	// the properties below are optional
	AllowedMethods: []*string{
		jsii.String("allowedMethods"),
	},
	CachedMethods: []*string{
		jsii.String("cachedMethods"),
	},
	CachePolicyId: jsii.String("cachePolicyId"),
	Compress: jsii.Boolean(false),
	DefaultTtl: jsii.Number(123),
	FieldLevelEncryptionId: jsii.String("fieldLevelEncryptionId"),
	ForwardedValues: &ForwardedValuesProperty{
		QueryString: jsii.Boolean(false),

		// the properties below are optional
		Cookies: &CookiesProperty{
			Forward: jsii.String("forward"),

			// the properties below are optional
			WhitelistedNames: []*string{
				jsii.String("whitelistedNames"),
			},
		},
		Headers: []*string{
			jsii.String("headers"),
		},
		QueryStringCacheKeys: []*string{
			jsii.String("queryStringCacheKeys"),
		},
	},
	FunctionAssociations: []interface{}{
		&FunctionAssociationProperty{
			EventType: jsii.String("eventType"),
			FunctionArn: jsii.String("functionArn"),
		},
	},
	LambdaFunctionAssociations: []interface{}{
		&LambdaFunctionAssociationProperty{
			EventType: jsii.String("eventType"),
			IncludeBody: jsii.Boolean(false),
			LambdaFunctionArn: jsii.String("lambdaFunctionArn"),
		},
	},
	MaxTtl: jsii.Number(123),
	MinTtl: jsii.Number(123),
	OriginRequestPolicyId: jsii.String("originRequestPolicyId"),
	RealtimeLogConfigArn: jsii.String("realtimeLogConfigArn"),
	ResponseHeadersPolicyId: jsii.String("responseHeadersPolicyId"),
	SmoothStreaming: jsii.Boolean(false),
	TrustedKeyGroups: []*string{
		jsii.String("trustedKeyGroups"),
	},
	TrustedSigners: []*string{
		jsii.String("trustedSigners"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html

type CfnDistribution_DistributionConfigProperty

type CfnDistribution_DistributionConfigProperty struct {
	// A complex type that describes the default cache behavior if you don't specify a `CacheBehavior` element or if files don't match any of the values of `PathPattern` in `CacheBehavior` elements.
	//
	// You must create exactly one default cache behavior.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-defaultcachebehavior
	//
	DefaultCacheBehavior interface{} `field:"required" json:"defaultCacheBehavior" yaml:"defaultCacheBehavior"`
	// From this field, you can enable or disable the selected distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-enabled
	//
	Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"`
	// A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-aliases
	//
	Aliases *[]*string `field:"optional" json:"aliases" yaml:"aliases"`
	// A complex type that contains zero or more `CacheBehavior` elements.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-cachebehaviors
	//
	CacheBehaviors interface{} `field:"optional" json:"cacheBehaviors" yaml:"cacheBehaviors"`
	// An alias for the CloudFront distribution's domain name.
	//
	// > This property is legacy. We recommend that you use [Aliases](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-aliases) instead.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-cnames
	//
	CnamEs *[]*string `field:"optional" json:"cnamEs" yaml:"cnamEs"`
	// A comment to describe the distribution.
	//
	// The comment cannot be longer than 128 characters.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-comment
	//
	// Default: - "".
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// The identifier of a continuous deployment policy.
	//
	// For more information, see `CreateContinuousDeploymentPolicy` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-continuousdeploymentpolicyid
	//
	ContinuousDeploymentPolicyId *string `field:"optional" json:"continuousDeploymentPolicyId" yaml:"continuousDeploymentPolicyId"`
	// A complex type that controls the following:.
	//
	// - Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer.
	// - How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
	//
	// For more information about custom error pages, see [Customizing Error Responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-customerrorresponses
	//
	CustomErrorResponses interface{} `field:"optional" json:"customErrorResponses" yaml:"customErrorResponses"`
	// The user-defined HTTP server that serves as the origin for content that CloudFront distributes.
	//
	// > This property is legacy. We recommend that you use [Origin](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html) instead.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-customorigin
	//
	CustomOrigin interface{} `field:"optional" json:"customOrigin" yaml:"customOrigin"`
	// The object that you want CloudFront to request from your origin (for example, `index.html` ) when a viewer requests the root URL for your distribution ( `https://www.example.com` ) instead of an object in your distribution ( `https://www.example.com/product-description.html` ). Specifying a default root object avoids exposing the contents of your distribution.
	//
	// Specify only the object name, for example, `index.html` . Don't add a `/` before the object name.
	//
	// If you don't want to specify a default root object when you create a distribution, include an empty `DefaultRootObject` element.
	//
	// To delete the default root object from an existing distribution, update the distribution configuration and include an empty `DefaultRootObject` element.
	//
	// To replace the default root object, update the distribution configuration and specify the new object.
	//
	// For more information about the default root object, see [Creating a Default Root Object](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-defaultrootobject
	//
	// Default: - "".
	//
	DefaultRootObject *string `field:"optional" json:"defaultRootObject" yaml:"defaultRootObject"`
	// (Optional) Specify the HTTP version(s) that you want viewers to use to communicate with CloudFront .
	//
	// The default value for new distributions is `http1.1` .
	//
	// For viewers and CloudFront to use HTTP/2, viewers must support TLSv1.2 or later, and must support Server Name Indication (SNI).
	//
	// For viewers and CloudFront to use HTTP/3, viewers must support TLSv1.3 and Server Name Indication (SNI). CloudFront supports HTTP/3 connection migration to allow the viewer to switch networks without losing connection. For more information about connection migration, see [Connection Migration](https://docs.aws.amazon.com/https://www.rfc-editor.org/rfc/rfc9000.html#name-connection-migration) at RFC 9000. For more information about supported TLSv1.3 ciphers, see [Supported protocols and ciphers between viewers and CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-httpversion
	//
	// Default: - "http1.1"
	//
	HttpVersion *string `field:"optional" json:"httpVersion" yaml:"httpVersion"`
	// If you want CloudFront to respond to IPv6 DNS requests with an IPv6 address for your distribution, specify `true` .
	//
	// If you specify `false` , CloudFront responds to IPv6 DNS requests with the DNS response code `NOERROR` and with no IP addresses. This allows viewers to submit a second request, for an IPv4 address for your distribution.
	//
	// In general, you should enable IPv6 if you have users on IPv6 networks who want to access your content. However, if you're using signed URLs or signed cookies to restrict access to your content, and if you're using a custom policy that includes the `IpAddress` parameter to restrict the IP addresses that can access your content, don't enable IPv6. If you want to restrict access to some content by IP address and not restrict access to other content (or restrict access but not by IP address), you can create two distributions. For more information, see [Creating a Signed URL Using a Custom Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.html) in the *Amazon CloudFront Developer Guide* .
	//
	// If you're using an Amazon Route 53 AWS Integration alias resource record set to route traffic to your CloudFront distribution, you need to create a second alias resource record set when both of the following are true:
	//
	// - You enable IPv6 for the distribution
	// - You're using alternate domain names in the URLs for your objects
	//
	// For more information, see [Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html) in the *Amazon Route 53 AWS Integration Developer Guide* .
	//
	// If you created a CNAME resource record set, either with Amazon Route 53 AWS Integration or with another DNS service, you don't need to make any changes. A CNAME record will route traffic to your distribution regardless of the IP address format of the viewer request.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-ipv6enabled
	//
	Ipv6Enabled interface{} `field:"optional" json:"ipv6Enabled" yaml:"ipv6Enabled"`
	// A complex type that controls whether access logs are written for the distribution.
	//
	// For more information about logging, see [Access Logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-logging
	//
	Logging interface{} `field:"optional" json:"logging" yaml:"logging"`
	// A complex type that contains information about origin groups for this distribution.
	//
	// Specify a value for either the `Origins` or `OriginGroups` property.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-origingroups
	//
	OriginGroups interface{} `field:"optional" json:"originGroups" yaml:"originGroups"`
	// A complex type that contains information about origins for this distribution.
	//
	// Specify a value for either the `Origins` or `OriginGroups` property.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-origins
	//
	Origins interface{} `field:"optional" json:"origins" yaml:"origins"`
	// The price class that corresponds with the maximum price that you want to pay for CloudFront service.
	//
	// If you specify `PriceClass_All` , CloudFront responds to requests for your objects from all CloudFront edge locations.
	//
	// If you specify a price class other than `PriceClass_All` , CloudFront serves your objects from the CloudFront edge location that has the lowest latency among the edge locations in your price class. Viewers who are in or near regions that are excluded from your specified price class may encounter slower performance.
	//
	// For more information about price classes, see [Choosing the Price Class for a CloudFront Distribution](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html) in the *Amazon CloudFront Developer Guide* . For information about CloudFront pricing, including how price classes (such as Price Class 100) map to CloudFront regions, see [Amazon CloudFront Pricing](https://docs.aws.amazon.com/cloudfront/pricing/) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-priceclass
	//
	// Default: - "PriceClass_All".
	//
	PriceClass *string `field:"optional" json:"priceClass" yaml:"priceClass"`
	// A complex type that identifies ways in which you want to restrict distribution of your content.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-restrictions
	//
	Restrictions interface{} `field:"optional" json:"restrictions" yaml:"restrictions"`
	// The origin as an Amazon S3 bucket.
	//
	// > This property is legacy. We recommend that you use [Origin](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html) instead.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-s3origin
	//
	S3Origin interface{} `field:"optional" json:"s3Origin" yaml:"s3Origin"`
	// A Boolean that indicates whether this is a staging distribution.
	//
	// When this value is `true` , this is a staging distribution. When this value is `false` , this is not a staging distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-staging
	//
	Staging interface{} `field:"optional" json:"staging" yaml:"staging"`
	// A complex type that determines the distribution's SSL/TLS configuration for communicating with viewers.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-viewercertificate
	//
	ViewerCertificate interface{} `field:"optional" json:"viewerCertificate" yaml:"viewerCertificate"`
	// A unique identifier that specifies the AWS WAF web ACL, if any, to associate with this distribution.
	//
	// To specify a web ACL created using the latest version of AWS WAF , use the ACL ARN, for example `arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111` . To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example `a1b2c3d4-5678-90ab-cdef-EXAMPLE11111` .
	//
	// AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to CloudFront, and lets you control access to your content. Based on conditions that you specify, such as the IP addresses that requests originate from or the values of query strings, CloudFront responds to requests either with the requested content or with an HTTP 403 status code (Forbidden). You can also configure CloudFront to return a custom error page when a request is blocked. For more information about AWS WAF , see the [AWS WAF Developer Guide](https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-webaclid
	//
	// Default: - "".
	//
	WebAclId *string `field:"optional" json:"webAclId" yaml:"webAclId"`
}

A distribution configuration.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

distributionConfigProperty := &DistributionConfigProperty{
	DefaultCacheBehavior: &DefaultCacheBehaviorProperty{
		TargetOriginId: jsii.String("targetOriginId"),
		ViewerProtocolPolicy: jsii.String("viewerProtocolPolicy"),

		// the properties below are optional
		AllowedMethods: []*string{
			jsii.String("allowedMethods"),
		},
		CachedMethods: []*string{
			jsii.String("cachedMethods"),
		},
		CachePolicyId: jsii.String("cachePolicyId"),
		Compress: jsii.Boolean(false),
		DefaultTtl: jsii.Number(123),
		FieldLevelEncryptionId: jsii.String("fieldLevelEncryptionId"),
		ForwardedValues: &ForwardedValuesProperty{
			QueryString: jsii.Boolean(false),

			// the properties below are optional
			Cookies: &CookiesProperty{
				Forward: jsii.String("forward"),

				// the properties below are optional
				WhitelistedNames: []*string{
					jsii.String("whitelistedNames"),
				},
			},
			Headers: []*string{
				jsii.String("headers"),
			},
			QueryStringCacheKeys: []*string{
				jsii.String("queryStringCacheKeys"),
			},
		},
		FunctionAssociations: []interface{}{
			&FunctionAssociationProperty{
				EventType: jsii.String("eventType"),
				FunctionArn: jsii.String("functionArn"),
			},
		},
		LambdaFunctionAssociations: []interface{}{
			&LambdaFunctionAssociationProperty{
				EventType: jsii.String("eventType"),
				IncludeBody: jsii.Boolean(false),
				LambdaFunctionArn: jsii.String("lambdaFunctionArn"),
			},
		},
		MaxTtl: jsii.Number(123),
		MinTtl: jsii.Number(123),
		OriginRequestPolicyId: jsii.String("originRequestPolicyId"),
		RealtimeLogConfigArn: jsii.String("realtimeLogConfigArn"),
		ResponseHeadersPolicyId: jsii.String("responseHeadersPolicyId"),
		SmoothStreaming: jsii.Boolean(false),
		TrustedKeyGroups: []*string{
			jsii.String("trustedKeyGroups"),
		},
		TrustedSigners: []*string{
			jsii.String("trustedSigners"),
		},
	},
	Enabled: jsii.Boolean(false),

	// the properties below are optional
	Aliases: []*string{
		jsii.String("aliases"),
	},
	CacheBehaviors: []interface{}{
		&CacheBehaviorProperty{
			PathPattern: jsii.String("pathPattern"),
			TargetOriginId: jsii.String("targetOriginId"),
			ViewerProtocolPolicy: jsii.String("viewerProtocolPolicy"),

			// the properties below are optional
			AllowedMethods: []*string{
				jsii.String("allowedMethods"),
			},
			CachedMethods: []*string{
				jsii.String("cachedMethods"),
			},
			CachePolicyId: jsii.String("cachePolicyId"),
			Compress: jsii.Boolean(false),
			DefaultTtl: jsii.Number(123),
			FieldLevelEncryptionId: jsii.String("fieldLevelEncryptionId"),
			ForwardedValues: &ForwardedValuesProperty{
				QueryString: jsii.Boolean(false),

				// the properties below are optional
				Cookies: &CookiesProperty{
					Forward: jsii.String("forward"),

					// the properties below are optional
					WhitelistedNames: []*string{
						jsii.String("whitelistedNames"),
					},
				},
				Headers: []*string{
					jsii.String("headers"),
				},
				QueryStringCacheKeys: []*string{
					jsii.String("queryStringCacheKeys"),
				},
			},
			FunctionAssociations: []interface{}{
				&FunctionAssociationProperty{
					EventType: jsii.String("eventType"),
					FunctionArn: jsii.String("functionArn"),
				},
			},
			LambdaFunctionAssociations: []interface{}{
				&LambdaFunctionAssociationProperty{
					EventType: jsii.String("eventType"),
					IncludeBody: jsii.Boolean(false),
					LambdaFunctionArn: jsii.String("lambdaFunctionArn"),
				},
			},
			MaxTtl: jsii.Number(123),
			MinTtl: jsii.Number(123),
			OriginRequestPolicyId: jsii.String("originRequestPolicyId"),
			RealtimeLogConfigArn: jsii.String("realtimeLogConfigArn"),
			ResponseHeadersPolicyId: jsii.String("responseHeadersPolicyId"),
			SmoothStreaming: jsii.Boolean(false),
			TrustedKeyGroups: []*string{
				jsii.String("trustedKeyGroups"),
			},
			TrustedSigners: []*string{
				jsii.String("trustedSigners"),
			},
		},
	},
	CnamEs: []*string{
		jsii.String("cnamEs"),
	},
	Comment: jsii.String("comment"),
	ContinuousDeploymentPolicyId: jsii.String("continuousDeploymentPolicyId"),
	CustomErrorResponses: []interface{}{
		&CustomErrorResponseProperty{
			ErrorCode: jsii.Number(123),

			// the properties below are optional
			ErrorCachingMinTtl: jsii.Number(123),
			ResponseCode: jsii.Number(123),
			ResponsePagePath: jsii.String("responsePagePath"),
		},
	},
	CustomOrigin: &LegacyCustomOriginProperty{
		DnsName: jsii.String("dnsName"),
		OriginProtocolPolicy: jsii.String("originProtocolPolicy"),
		OriginSslProtocols: []*string{
			jsii.String("originSslProtocols"),
		},

		// the properties below are optional
		HttpPort: jsii.Number(123),
		HttpsPort: jsii.Number(123),
	},
	DefaultRootObject: jsii.String("defaultRootObject"),
	HttpVersion: jsii.String("httpVersion"),
	Ipv6Enabled: jsii.Boolean(false),
	Logging: &LoggingProperty{
		Bucket: jsii.String("bucket"),

		// the properties below are optional
		IncludeCookies: jsii.Boolean(false),
		Prefix: jsii.String("prefix"),
	},
	OriginGroups: &OriginGroupsProperty{
		Quantity: jsii.Number(123),

		// the properties below are optional
		Items: []interface{}{
			&OriginGroupProperty{
				FailoverCriteria: &OriginGroupFailoverCriteriaProperty{
					StatusCodes: &StatusCodesProperty{
						Items: []interface{}{
							jsii.Number(123),
						},
						Quantity: jsii.Number(123),
					},
				},
				Id: jsii.String("id"),
				Members: &OriginGroupMembersProperty{
					Items: []interface{}{
						&OriginGroupMemberProperty{
							OriginId: jsii.String("originId"),
						},
					},
					Quantity: jsii.Number(123),
				},
			},
		},
	},
	Origins: []interface{}{
		&OriginProperty{
			DomainName: jsii.String("domainName"),
			Id: jsii.String("id"),

			// the properties below are optional
			ConnectionAttempts: jsii.Number(123),
			ConnectionTimeout: jsii.Number(123),
			CustomOriginConfig: &CustomOriginConfigProperty{
				OriginProtocolPolicy: jsii.String("originProtocolPolicy"),

				// the properties below are optional
				HttpPort: jsii.Number(123),
				HttpsPort: jsii.Number(123),
				OriginKeepaliveTimeout: jsii.Number(123),
				OriginReadTimeout: jsii.Number(123),
				OriginSslProtocols: []*string{
					jsii.String("originSslProtocols"),
				},
			},
			OriginAccessControlId: jsii.String("originAccessControlId"),
			OriginCustomHeaders: []interface{}{
				&OriginCustomHeaderProperty{
					HeaderName: jsii.String("headerName"),
					HeaderValue: jsii.String("headerValue"),
				},
			},
			OriginPath: jsii.String("originPath"),
			OriginShield: &OriginShieldProperty{
				Enabled: jsii.Boolean(false),
				OriginShieldRegion: jsii.String("originShieldRegion"),
			},
			S3OriginConfig: &S3OriginConfigProperty{
				OriginAccessIdentity: jsii.String("originAccessIdentity"),
			},
		},
	},
	PriceClass: jsii.String("priceClass"),
	Restrictions: &RestrictionsProperty{
		GeoRestriction: &GeoRestrictionProperty{
			RestrictionType: jsii.String("restrictionType"),

			// the properties below are optional
			Locations: []*string{
				jsii.String("locations"),
			},
		},
	},
	S3Origin: &LegacyS3OriginProperty{
		DnsName: jsii.String("dnsName"),

		// the properties below are optional
		OriginAccessIdentity: jsii.String("originAccessIdentity"),
	},
	Staging: jsii.Boolean(false),
	ViewerCertificate: &ViewerCertificateProperty{
		AcmCertificateArn: jsii.String("acmCertificateArn"),
		CloudFrontDefaultCertificate: jsii.Boolean(false),
		IamCertificateId: jsii.String("iamCertificateId"),
		MinimumProtocolVersion: jsii.String("minimumProtocolVersion"),
		SslSupportMethod: jsii.String("sslSupportMethod"),
	},
	WebAclId: jsii.String("webAclId"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html

type CfnDistribution_ForwardedValuesProperty

type CfnDistribution_ForwardedValuesProperty struct {
	// This field is deprecated.
	//
	// We recommend that you use a cache policy or an origin request policy instead of this field.
	//
	// If you want to include query strings in the cache key, use a cache policy. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// If you want to send query strings to the origin but not include them in the cache key, use an origin request policy. For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// Indicates whether you want CloudFront to forward query strings to the origin that is associated with this cache behavior and cache based on the query string parameters. CloudFront behavior depends on the value of `QueryString` and on the values that you specify for `QueryStringCacheKeys` , if any:
	//
	// If you specify true for `QueryString` and you don't specify any values for `QueryStringCacheKeys` , CloudFront forwards all query string parameters to the origin and caches based on all query string parameters. Depending on how many query string parameters and values you have, this can adversely affect performance because CloudFront must forward more requests to the origin.
	//
	// If you specify true for `QueryString` and you specify one or more values for `QueryStringCacheKeys` , CloudFront forwards all query string parameters to the origin, but it only caches based on the query string parameters that you specify.
	//
	// If you specify false for `QueryString` , CloudFront doesn't forward any query string parameters to the origin, and doesn't cache based on query string parameters.
	//
	// For more information, see [Configuring CloudFront to Cache Based on Query String Parameters](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-forwardedvalues.html#cfn-cloudfront-distribution-forwardedvalues-querystring
	//
	QueryString interface{} `field:"required" json:"queryString" yaml:"queryString"`
	// This field is deprecated.
	//
	// We recommend that you use a cache policy or an origin request policy instead of this field.
	//
	// If you want to include cookies in the cache key, use a cache policy. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// If you want to send cookies to the origin but not include them in the cache key, use an origin request policy. For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// A complex type that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones. For more information about forwarding cookies to the origin, see [How CloudFront Forwards, Caches, and Logs Cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-forwardedvalues.html#cfn-cloudfront-distribution-forwardedvalues-cookies
	//
	Cookies interface{} `field:"optional" json:"cookies" yaml:"cookies"`
	// This field is deprecated.
	//
	// We recommend that you use a cache policy or an origin request policy instead of this field.
	//
	// If you want to include headers in the cache key, use a cache policy. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// If you want to send headers to the origin but not include them in the cache key, use an origin request policy. For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// A complex type that specifies the `Headers` , if any, that you want CloudFront to forward to the origin for this cache behavior (whitelisted headers). For the headers that you specify, CloudFront also caches separate versions of a specified object that is based on the header values in viewer requests.
	//
	// For more information, see [Caching Content Based on Request Headers](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-forwardedvalues.html#cfn-cloudfront-distribution-forwardedvalues-headers
	//
	Headers *[]*string `field:"optional" json:"headers" yaml:"headers"`
	// This field is deprecated.
	//
	// We recommend that you use a cache policy or an origin request policy instead of this field.
	//
	// If you want to include query strings in the cache key, use a cache policy. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// If you want to send query strings to the origin but not include them in the cache key, use an origin request policy. For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide* .
	//
	// A complex type that contains information about the query string parameters that you want CloudFront to use for caching for this cache behavior.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-forwardedvalues.html#cfn-cloudfront-distribution-forwardedvalues-querystringcachekeys
	//
	QueryStringCacheKeys *[]*string `field:"optional" json:"queryStringCacheKeys" yaml:"queryStringCacheKeys"`
}

This field is deprecated.

We recommend that you use a cache policy or an origin request policy instead of this field.

If you want to include values in the cache key, use a cache policy. For more information, see [Creating cache policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html#cache-key-create-cache-policy) in the *Amazon CloudFront Developer Guide* .

If you want to send values to the origin but not include them in the cache key, use an origin request policy. For more information, see [Creating origin request policies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-origin-requests.html#origin-request-create-origin-request-policy) in the *Amazon CloudFront Developer Guide* .

A complex type that specifies how CloudFront handles query strings, cookies, and HTTP headers.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

forwardedValuesProperty := &ForwardedValuesProperty{
	QueryString: jsii.Boolean(false),

	// the properties below are optional
	Cookies: &CookiesProperty{
		Forward: jsii.String("forward"),

		// the properties below are optional
		WhitelistedNames: []*string{
			jsii.String("whitelistedNames"),
		},
	},
	Headers: []*string{
		jsii.String("headers"),
	},
	QueryStringCacheKeys: []*string{
		jsii.String("queryStringCacheKeys"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-forwardedvalues.html

type CfnDistribution_FunctionAssociationProperty

type CfnDistribution_FunctionAssociationProperty struct {
	// The event type of the function, either `viewer-request` or `viewer-response` .
	//
	// You cannot use origin-facing event types ( `origin-request` and `origin-response` ) with a CloudFront function.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-functionassociation.html#cfn-cloudfront-distribution-functionassociation-eventtype
	//
	EventType *string `field:"optional" json:"eventType" yaml:"eventType"`
	// The Amazon Resource Name (ARN) of the function.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-functionassociation.html#cfn-cloudfront-distribution-functionassociation-functionarn
	//
	FunctionArn *string `field:"optional" json:"functionArn" yaml:"functionArn"`
}

A CloudFront function that is associated with a cache behavior in a CloudFront distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

functionAssociationProperty := &FunctionAssociationProperty{
	EventType: jsii.String("eventType"),
	FunctionArn: jsii.String("functionArn"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-functionassociation.html

type CfnDistribution_GeoRestrictionProperty

type CfnDistribution_GeoRestrictionProperty struct {
	// The method that you want to use to restrict distribution of your content by country:.
	//
	// - `none` : No geo restriction is enabled, meaning access to content is not restricted by client geo location.
	// - `blacklist` : The `Location` elements specify the countries in which you don't want CloudFront to distribute your content.
	// - `whitelist` : The `Location` elements specify the countries in which you want CloudFront to distribute your content.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-georestriction.html#cfn-cloudfront-distribution-georestriction-restrictiontype
	//
	RestrictionType *string `field:"required" json:"restrictionType" yaml:"restrictionType"`
	// A complex type that contains a `Location` element for each country in which you want CloudFront either to distribute your content ( `whitelist` ) or not distribute your content ( `blacklist` ).
	//
	// The `Location` element is a two-letter, uppercase country code for a country that you want to include in your `blacklist` or `whitelist` . Include one `Location` element for each country.
	//
	// CloudFront and `MaxMind` both use `ISO 3166` country codes. For the current list of countries and the corresponding codes, see `ISO 3166-1-alpha-2` code on the *International Organization for Standardization* website. You can also refer to the country list on the CloudFront console, which includes both country names and codes.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-georestriction.html#cfn-cloudfront-distribution-georestriction-locations
	//
	Locations *[]*string `field:"optional" json:"locations" yaml:"locations"`
}

A complex type that controls the countries in which your content is distributed.

CloudFront determines the location of your users using `MaxMind` GeoIP databases. To disable geo restriction, remove the [Restrictions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-restrictions) property from your stack template.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

geoRestrictionProperty := &GeoRestrictionProperty{
	RestrictionType: jsii.String("restrictionType"),

	// the properties below are optional
	Locations: []*string{
		jsii.String("locations"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-georestriction.html

type CfnDistribution_LambdaFunctionAssociationProperty

type CfnDistribution_LambdaFunctionAssociationProperty struct {
	// Specifies the event type that triggers a Lambda@Edge function invocation. You can specify the following values:.
	//
	// - `viewer-request` : The function executes when CloudFront receives a request from a viewer and before it checks to see whether the requested object is in the edge cache.
	// - `origin-request` : The function executes only when CloudFront sends a request to your origin. When the requested object is in the edge cache, the function doesn't execute.
	// - `origin-response` : The function executes after CloudFront receives a response from the origin and before it caches the object in the response. When the requested object is in the edge cache, the function doesn't execute.
	// - `viewer-response` : The function executes before CloudFront returns the requested object to the viewer. The function executes regardless of whether the object was already in the edge cache.
	//
	// If the origin returns an HTTP status code other than HTTP 200 (OK), the function doesn't execute.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-lambdafunctionassociation.html#cfn-cloudfront-distribution-lambdafunctionassociation-eventtype
	//
	EventType *string `field:"optional" json:"eventType" yaml:"eventType"`
	// A flag that allows a Lambda@Edge function to have read access to the body content.
	//
	// For more information, see [Accessing the Request Body by Choosing the Include Body Option](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-include-body-access.html) in the Amazon CloudFront Developer Guide.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-lambdafunctionassociation.html#cfn-cloudfront-distribution-lambdafunctionassociation-includebody
	//
	IncludeBody interface{} `field:"optional" json:"includeBody" yaml:"includeBody"`
	// The ARN of the Lambda@Edge function.
	//
	// You must specify the ARN of a function version; you can't specify an alias or $LATEST.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-lambdafunctionassociation.html#cfn-cloudfront-distribution-lambdafunctionassociation-lambdafunctionarn
	//
	LambdaFunctionArn *string `field:"optional" json:"lambdaFunctionArn" yaml:"lambdaFunctionArn"`
}

A complex type that contains a Lambda@Edge function association.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

lambdaFunctionAssociationProperty := &LambdaFunctionAssociationProperty{
	EventType: jsii.String("eventType"),
	IncludeBody: jsii.Boolean(false),
	LambdaFunctionArn: jsii.String("lambdaFunctionArn"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-lambdafunctionassociation.html

type CfnDistribution_LegacyCustomOriginProperty

type CfnDistribution_LegacyCustomOriginProperty struct {
	// The domain name assigned to your CloudFront distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-legacycustomorigin.html#cfn-cloudfront-distribution-legacycustomorigin-dnsname
	//
	DnsName *string `field:"required" json:"dnsName" yaml:"dnsName"`
	// Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-legacycustomorigin.html#cfn-cloudfront-distribution-legacycustomorigin-originprotocolpolicy
	//
	OriginProtocolPolicy *string `field:"required" json:"originProtocolPolicy" yaml:"originProtocolPolicy"`
	// The minimum SSL/TLS protocol version that CloudFront uses when communicating with your origin server over HTTPs.
	//
	// For more information, see [Minimum Origin SSL Protocol](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginSSLProtocols) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-legacycustomorigin.html#cfn-cloudfront-distribution-legacycustomorigin-originsslprotocols
	//
	OriginSslProtocols *[]*string `field:"required" json:"originSslProtocols" yaml:"originSslProtocols"`
	// The HTTP port that CloudFront uses to connect to the origin.
	//
	// Specify the HTTP port that the origin listens on.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-legacycustomorigin.html#cfn-cloudfront-distribution-legacycustomorigin-httpport
	//
	// Default: - 80.
	//
	HttpPort *float64 `field:"optional" json:"httpPort" yaml:"httpPort"`
	// The HTTPS port that CloudFront uses to connect to the origin.
	//
	// Specify the HTTPS port that the origin listens on.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-legacycustomorigin.html#cfn-cloudfront-distribution-legacycustomorigin-httpsport
	//
	// Default: - 443.
	//
	HttpsPort *float64 `field:"optional" json:"httpsPort" yaml:"httpsPort"`
}

A custom origin.

A custom origin is any origin that is *not* an Amazon S3 bucket, with one exception. An Amazon S3 bucket that is [configured with static website hosting](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) *is* a custom origin.

> This property is legacy. We recommend that you use [Origin](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html) instead.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

legacyCustomOriginProperty := &LegacyCustomOriginProperty{
	DnsName: jsii.String("dnsName"),
	OriginProtocolPolicy: jsii.String("originProtocolPolicy"),
	OriginSslProtocols: []*string{
		jsii.String("originSslProtocols"),
	},

	// the properties below are optional
	HttpPort: jsii.Number(123),
	HttpsPort: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-legacycustomorigin.html

type CfnDistribution_LegacyS3OriginProperty

type CfnDistribution_LegacyS3OriginProperty struct {
	// The domain name assigned to your CloudFront distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-legacys3origin.html#cfn-cloudfront-distribution-legacys3origin-dnsname
	//
	DnsName *string `field:"required" json:"dnsName" yaml:"dnsName"`
	// The CloudFront origin access identity to associate with the distribution.
	//
	// Use an origin access identity to configure the distribution so that end users can only access objects in an Amazon S3 through CloudFront .
	//
	// > This property is legacy. We recommend that you use [OriginAccessControl](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-originaccesscontrol.html) instead.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-legacys3origin.html#cfn-cloudfront-distribution-legacys3origin-originaccessidentity
	//
	// Default: - "".
	//
	OriginAccessIdentity *string `field:"optional" json:"originAccessIdentity" yaml:"originAccessIdentity"`
}

The origin as an Amazon S3 bucket.

> This property is legacy. We recommend that you use [Origin](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html) instead.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

legacyS3OriginProperty := &LegacyS3OriginProperty{
	DnsName: jsii.String("dnsName"),

	// the properties below are optional
	OriginAccessIdentity: jsii.String("originAccessIdentity"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-legacys3origin.html

type CfnDistribution_LoggingProperty

type CfnDistribution_LoggingProperty struct {
	// The Amazon S3 bucket to store the access logs in, for example, `myawslogbucket.s3.amazonaws.com` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-logging.html#cfn-cloudfront-distribution-logging-bucket
	//
	Bucket *string `field:"required" json:"bucket" yaml:"bucket"`
	// Specifies whether you want CloudFront to include cookies in access logs, specify `true` for `IncludeCookies` .
	//
	// If you choose to include cookies in logs, CloudFront logs all cookies regardless of how you configure the cache behaviors for this distribution. If you don't want to include cookies when you create a distribution or if you want to disable include cookies for an existing distribution, specify `false` for `IncludeCookies` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-logging.html#cfn-cloudfront-distribution-logging-includecookies
	//
	// Default: - false.
	//
	IncludeCookies interface{} `field:"optional" json:"includeCookies" yaml:"includeCookies"`
	// An optional string that you want CloudFront to prefix to the access log `filenames` for this distribution, for example, `myprefix/` .
	//
	// If you want to enable logging, but you don't want to specify a prefix, you still must include an empty `Prefix` element in the `Logging` element.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-logging.html#cfn-cloudfront-distribution-logging-prefix
	//
	// Default: - "".
	//
	Prefix *string `field:"optional" json:"prefix" yaml:"prefix"`
}

A complex type that controls whether access logs are written for the distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

loggingProperty := &LoggingProperty{
	Bucket: jsii.String("bucket"),

	// the properties below are optional
	IncludeCookies: jsii.Boolean(false),
	Prefix: jsii.String("prefix"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-logging.html

type CfnDistribution_OriginCustomHeaderProperty

type CfnDistribution_OriginCustomHeaderProperty struct {
	// The name of a header that you want CloudFront to send to your origin.
	//
	// For more information, see [Adding Custom Headers to Origin Requests](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/forward-custom-headers.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origincustomheader.html#cfn-cloudfront-distribution-origincustomheader-headername
	//
	HeaderName *string `field:"required" json:"headerName" yaml:"headerName"`
	// The value for the header that you specified in the `HeaderName` field.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origincustomheader.html#cfn-cloudfront-distribution-origincustomheader-headervalue
	//
	HeaderValue *string `field:"required" json:"headerValue" yaml:"headerValue"`
}

A complex type that contains `HeaderName` and `HeaderValue` elements, if any, for this distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originCustomHeaderProperty := &OriginCustomHeaderProperty{
	HeaderName: jsii.String("headerName"),
	HeaderValue: jsii.String("headerValue"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origincustomheader.html

type CfnDistribution_OriginGroupFailoverCriteriaProperty

type CfnDistribution_OriginGroupFailoverCriteriaProperty struct {
	// The status codes that, when returned from the primary origin, will trigger CloudFront to failover to the second origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroupfailovercriteria.html#cfn-cloudfront-distribution-origingroupfailovercriteria-statuscodes
	//
	StatusCodes interface{} `field:"required" json:"statusCodes" yaml:"statusCodes"`
}

A complex data type that includes information about the failover criteria for an origin group, including the status codes for which CloudFront will failover from the primary origin to the second origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originGroupFailoverCriteriaProperty := &OriginGroupFailoverCriteriaProperty{
	StatusCodes: &StatusCodesProperty{
		Items: []interface{}{
			jsii.Number(123),
		},
		Quantity: jsii.Number(123),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroupfailovercriteria.html

type CfnDistribution_OriginGroupMemberProperty

type CfnDistribution_OriginGroupMemberProperty struct {
	// The ID for an origin in an origin group.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroupmember.html#cfn-cloudfront-distribution-origingroupmember-originid
	//
	OriginId *string `field:"required" json:"originId" yaml:"originId"`
}

An origin in an origin group.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originGroupMemberProperty := &OriginGroupMemberProperty{
	OriginId: jsii.String("originId"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroupmember.html

type CfnDistribution_OriginGroupMembersProperty

type CfnDistribution_OriginGroupMembersProperty struct {
	// Items (origins) in an origin group.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroupmembers.html#cfn-cloudfront-distribution-origingroupmembers-items
	//
	Items interface{} `field:"required" json:"items" yaml:"items"`
	// The number of origins in an origin group.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroupmembers.html#cfn-cloudfront-distribution-origingroupmembers-quantity
	//
	Quantity *float64 `field:"required" json:"quantity" yaml:"quantity"`
}

A complex data type for the origins included in an origin group.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originGroupMembersProperty := &OriginGroupMembersProperty{
	Items: []interface{}{
		&OriginGroupMemberProperty{
			OriginId: jsii.String("originId"),
		},
	},
	Quantity: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroupmembers.html

type CfnDistribution_OriginGroupProperty

type CfnDistribution_OriginGroupProperty struct {
	// A complex type that contains information about the failover criteria for an origin group.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroup.html#cfn-cloudfront-distribution-origingroup-failovercriteria
	//
	FailoverCriteria interface{} `field:"required" json:"failoverCriteria" yaml:"failoverCriteria"`
	// The origin group's ID.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroup.html#cfn-cloudfront-distribution-origingroup-id
	//
	Id *string `field:"required" json:"id" yaml:"id"`
	// A complex type that contains information about the origins in an origin group.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroup.html#cfn-cloudfront-distribution-origingroup-members
	//
	Members interface{} `field:"required" json:"members" yaml:"members"`
}

An origin group includes two origins (a primary origin and a second origin to failover to) and a failover criteria that you specify.

You create an origin group to support origin failover in CloudFront. When you create or update a distribution, you can specify the origin group instead of a single origin, and CloudFront will failover from the primary origin to the second origin under the failover conditions that you've chosen.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originGroupProperty := &OriginGroupProperty{
	FailoverCriteria: &OriginGroupFailoverCriteriaProperty{
		StatusCodes: &StatusCodesProperty{
			Items: []interface{}{
				jsii.Number(123),
			},
			Quantity: jsii.Number(123),
		},
	},
	Id: jsii.String("id"),
	Members: &OriginGroupMembersProperty{
		Items: []interface{}{
			&OriginGroupMemberProperty{
				OriginId: jsii.String("originId"),
			},
		},
		Quantity: jsii.Number(123),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroup.html

type CfnDistribution_OriginGroupsProperty

type CfnDistribution_OriginGroupsProperty struct {
	// The number of origin groups.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroups.html#cfn-cloudfront-distribution-origingroups-quantity
	//
	Quantity *float64 `field:"required" json:"quantity" yaml:"quantity"`
	// The items (origin groups) in a distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroups.html#cfn-cloudfront-distribution-origingroups-items
	//
	Items interface{} `field:"optional" json:"items" yaml:"items"`
}

A complex data type for the origin groups specified for a distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originGroupsProperty := &OriginGroupsProperty{
	Quantity: jsii.Number(123),

	// the properties below are optional
	Items: []interface{}{
		&OriginGroupProperty{
			FailoverCriteria: &OriginGroupFailoverCriteriaProperty{
				StatusCodes: &StatusCodesProperty{
					Items: []interface{}{
						jsii.Number(123),
					},
					Quantity: jsii.Number(123),
				},
			},
			Id: jsii.String("id"),
			Members: &OriginGroupMembersProperty{
				Items: []interface{}{
					&OriginGroupMemberProperty{
						OriginId: jsii.String("originId"),
					},
				},
				Quantity: jsii.Number(123),
			},
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroups.html

type CfnDistribution_OriginProperty

type CfnDistribution_OriginProperty struct {
	// The domain name for the origin.
	//
	// For more information, see [Origin Domain Name](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesDomainName) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html#cfn-cloudfront-distribution-origin-domainname
	//
	DomainName *string `field:"required" json:"domainName" yaml:"domainName"`
	// A unique identifier for the origin. This value must be unique within the distribution.
	//
	// Use this value to specify the `TargetOriginId` in a `CacheBehavior` or `DefaultCacheBehavior` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html#cfn-cloudfront-distribution-origin-id
	//
	Id *string `field:"required" json:"id" yaml:"id"`
	// The number of times that CloudFront attempts to connect to the origin.
	//
	// The minimum number is 1, the maximum is 3, and the default (if you don't specify otherwise) is 3.
	//
	// For a custom origin (including an Amazon S3 bucket that's configured with static website hosting), this value also specifies the number of times that CloudFront attempts to get a response from the origin, in the case of an [Origin Response Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginResponseTimeout) .
	//
	// For more information, see [Origin Connection Attempts](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#origin-connection-attempts) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html#cfn-cloudfront-distribution-origin-connectionattempts
	//
	ConnectionAttempts *float64 `field:"optional" json:"connectionAttempts" yaml:"connectionAttempts"`
	// The number of seconds that CloudFront waits when trying to establish a connection to the origin.
	//
	// The minimum timeout is 1 second, the maximum is 10 seconds, and the default (if you don't specify otherwise) is 10 seconds.
	//
	// For more information, see [Origin Connection Timeout](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#origin-connection-timeout) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html#cfn-cloudfront-distribution-origin-connectiontimeout
	//
	ConnectionTimeout *float64 `field:"optional" json:"connectionTimeout" yaml:"connectionTimeout"`
	// Use this type to specify an origin that is not an Amazon S3 bucket, with one exception.
	//
	// If the Amazon S3 bucket is configured with static website hosting, use this type. If the Amazon S3 bucket is not configured with static website hosting, use the `S3OriginConfig` type instead.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html#cfn-cloudfront-distribution-origin-customoriginconfig
	//
	CustomOriginConfig interface{} `field:"optional" json:"customOriginConfig" yaml:"customOriginConfig"`
	// The unique identifier of an origin access control for this origin.
	//
	// For more information, see [Restricting access to an Amazon S3 origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html#cfn-cloudfront-distribution-origin-originaccesscontrolid
	//
	OriginAccessControlId *string `field:"optional" json:"originAccessControlId" yaml:"originAccessControlId"`
	// A list of HTTP header names and values that CloudFront adds to the requests that it sends to the origin.
	//
	// For more information, see [Adding Custom Headers to Origin Requests](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/add-origin-custom-headers.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html#cfn-cloudfront-distribution-origin-origincustomheaders
	//
	OriginCustomHeaders interface{} `field:"optional" json:"originCustomHeaders" yaml:"originCustomHeaders"`
	// An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
	//
	// For more information, see [Origin Path](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginPath) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html#cfn-cloudfront-distribution-origin-originpath
	//
	// Default: - "".
	//
	OriginPath *string `field:"optional" json:"originPath" yaml:"originPath"`
	// CloudFront Origin Shield. Using Origin Shield can help reduce the load on your origin.
	//
	// For more information, see [Using Origin Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html#cfn-cloudfront-distribution-origin-originshield
	//
	OriginShield interface{} `field:"optional" json:"originShield" yaml:"originShield"`
	// Use this type to specify an origin that is an Amazon S3 bucket that is not configured with static website hosting.
	//
	// To specify any other type of origin, including an Amazon S3 bucket that is configured with static website hosting, use the `CustomOriginConfig` type instead.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html#cfn-cloudfront-distribution-origin-s3originconfig
	//
	S3OriginConfig interface{} `field:"optional" json:"s3OriginConfig" yaml:"s3OriginConfig"`
}

An origin.

An origin is the location where content is stored, and from which CloudFront gets content to serve to viewers. To specify an origin:

- Use `S3OriginConfig` to specify an Amazon S3 bucket that is not configured with static website hosting. - Use `CustomOriginConfig` to specify all other kinds of origins, including:

- An Amazon S3 bucket that is configured with static website hosting - An Elastic Load Balancing load balancer - An AWS Elemental MediaPackage endpoint - An AWS Elemental MediaStore container - Any other HTTP server, running on an Amazon EC2 instance or any other kind of host

For the current maximum number of origins that you can specify per distribution, see [General Quotas on Web Distributions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cloudfront-limits.html#limits-web-distributions) in the *Amazon CloudFront Developer Guide* (quotas were formerly referred to as limits).

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originProperty := &OriginProperty{
	DomainName: jsii.String("domainName"),
	Id: jsii.String("id"),

	// the properties below are optional
	ConnectionAttempts: jsii.Number(123),
	ConnectionTimeout: jsii.Number(123),
	CustomOriginConfig: &CustomOriginConfigProperty{
		OriginProtocolPolicy: jsii.String("originProtocolPolicy"),

		// the properties below are optional
		HttpPort: jsii.Number(123),
		HttpsPort: jsii.Number(123),
		OriginKeepaliveTimeout: jsii.Number(123),
		OriginReadTimeout: jsii.Number(123),
		OriginSslProtocols: []*string{
			jsii.String("originSslProtocols"),
		},
	},
	OriginAccessControlId: jsii.String("originAccessControlId"),
	OriginCustomHeaders: []interface{}{
		&OriginCustomHeaderProperty{
			HeaderName: jsii.String("headerName"),
			HeaderValue: jsii.String("headerValue"),
		},
	},
	OriginPath: jsii.String("originPath"),
	OriginShield: &OriginShieldProperty{
		Enabled: jsii.Boolean(false),
		OriginShieldRegion: jsii.String("originShieldRegion"),
	},
	S3OriginConfig: &S3OriginConfigProperty{
		OriginAccessIdentity: jsii.String("originAccessIdentity"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html

type CfnDistribution_OriginShieldProperty

type CfnDistribution_OriginShieldProperty struct {
	// A flag that specifies whether Origin Shield is enabled.
	//
	// When it's enabled, CloudFront routes all requests through Origin Shield, which can help protect your origin. When it's disabled, CloudFront might send requests directly to your origin from multiple edge locations or regional edge caches.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-originshield.html#cfn-cloudfront-distribution-originshield-enabled
	//
	Enabled interface{} `field:"optional" json:"enabled" yaml:"enabled"`
	// The AWS Region for Origin Shield.
	//
	// Specify the AWS Region that has the lowest latency to your origin. To specify a region, use the region code, not the region name. For example, specify the US East (Ohio) region as `us-east-2` .
	//
	// When you enable CloudFront Origin Shield, you must specify the AWS Region for Origin Shield. For the list of AWS Regions that you can specify, and for help choosing the best Region for your origin, see [Choosing the AWS Region for Origin Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html#choose-origin-shield-region) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-originshield.html#cfn-cloudfront-distribution-originshield-originshieldregion
	//
	OriginShieldRegion *string `field:"optional" json:"originShieldRegion" yaml:"originShieldRegion"`
}

CloudFront Origin Shield.

Using Origin Shield can help reduce the load on your origin. For more information, see [Using Origin Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the *Amazon CloudFront Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originShieldProperty := &OriginShieldProperty{
	Enabled: jsii.Boolean(false),
	OriginShieldRegion: jsii.String("originShieldRegion"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-originshield.html

type CfnDistribution_RestrictionsProperty

type CfnDistribution_RestrictionsProperty struct {
	// A complex type that controls the countries in which your content is distributed.
	//
	// CloudFront determines the location of your users using `MaxMind` GeoIP databases. To disable geo restriction, remove the [Restrictions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-distribution-distributionconfig-restrictions) property from your stack template.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-restrictions.html#cfn-cloudfront-distribution-restrictions-georestriction
	//
	GeoRestriction interface{} `field:"required" json:"geoRestriction" yaml:"geoRestriction"`
}

A complex type that identifies ways in which you want to restrict distribution of your content.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

restrictionsProperty := &RestrictionsProperty{
	GeoRestriction: &GeoRestrictionProperty{
		RestrictionType: jsii.String("restrictionType"),

		// the properties below are optional
		Locations: []*string{
			jsii.String("locations"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-restrictions.html

type CfnDistribution_S3OriginConfigProperty

type CfnDistribution_S3OriginConfigProperty struct {
	// > If you're using origin access control (OAC) instead of origin access identity, specify an empty `OriginAccessIdentity` element.
	//
	// For more information, see [Restricting access to an AWS](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-origin.html) in the *Amazon CloudFront Developer Guide* .
	//
	// The CloudFront origin access identity to associate with the origin. Use an origin access identity to configure the origin so that viewers can *only* access objects in an Amazon S3 bucket through CloudFront. The format of the value is:
	//
	// `origin-access-identity/cloudfront/ID-of-origin-access-identity`
	//
	// The `*ID-of-origin-access-identity*` is the value that CloudFront returned in the `ID` element when you created the origin access identity.
	//
	// If you want viewers to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty `OriginAccessIdentity` element.
	//
	// To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty `OriginAccessIdentity` element.
	//
	// To replace the origin access identity, update the distribution configuration and specify the new origin access identity.
	//
	// For more information about the origin access identity, see [Serving Private Content through CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-s3originconfig.html#cfn-cloudfront-distribution-s3originconfig-originaccessidentity
	//
	// Default: - "".
	//
	OriginAccessIdentity *string `field:"optional" json:"originAccessIdentity" yaml:"originAccessIdentity"`
}

A complex type that contains information about the Amazon S3 origin.

If the origin is a custom origin or an S3 bucket that is configured as a website endpoint, use the `CustomOriginConfig` element instead.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

s3OriginConfigProperty := &S3OriginConfigProperty{
	OriginAccessIdentity: jsii.String("originAccessIdentity"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-s3originconfig.html

type CfnDistribution_StatusCodesProperty

type CfnDistribution_StatusCodesProperty struct {
	// The items (status codes) for an origin group.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-statuscodes.html#cfn-cloudfront-distribution-statuscodes-items
	//
	Items interface{} `field:"required" json:"items" yaml:"items"`
	// The number of status codes.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-statuscodes.html#cfn-cloudfront-distribution-statuscodes-quantity
	//
	Quantity *float64 `field:"required" json:"quantity" yaml:"quantity"`
}

A complex data type for the status codes that you specify that, when returned by a primary origin, trigger CloudFront to failover to a second origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

statusCodesProperty := &StatusCodesProperty{
	Items: []interface{}{
		jsii.Number(123),
	},
	Quantity: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-statuscodes.html

type CfnDistribution_ViewerCertificateProperty

type CfnDistribution_ViewerCertificateProperty struct {
	// > In CloudFormation, this field name is `AcmCertificateArn` . Note the different capitalization.
	//
	// If the distribution uses `Aliases` (alternate domain names or CNAMEs) and the SSL/TLS certificate is stored in [AWS Certificate Manager (ACM)](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html) , provide the Amazon Resource Name (ARN) of the ACM certificate. CloudFront only supports ACM certificates in the US East (N. Virginia) Region ( `us-east-1` ).
	//
	// If you specify an ACM certificate ARN, you must also specify values for `MinimumProtocolVersion` and `SSLSupportMethod` . (In CloudFormation, the field name is `SslSupportMethod` . Note the different capitalization.)
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-viewercertificate.html#cfn-cloudfront-distribution-viewercertificate-acmcertificatearn
	//
	AcmCertificateArn *string `field:"optional" json:"acmCertificateArn" yaml:"acmCertificateArn"`
	// If the distribution uses the CloudFront domain name such as `d111111abcdef8.cloudfront.net` , set this field to `true` .
	//
	// If the distribution uses `Aliases` (alternate domain names or CNAMEs), omit this field and specify values for the following fields:
	//
	// - `AcmCertificateArn` or `IamCertificateId` (specify a value for one, not both)
	// - `MinimumProtocolVersion`
	// - `SslSupportMethod`.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-viewercertificate.html#cfn-cloudfront-distribution-viewercertificate-cloudfrontdefaultcertificate
	//
	CloudFrontDefaultCertificate interface{} `field:"optional" json:"cloudFrontDefaultCertificate" yaml:"cloudFrontDefaultCertificate"`
	// > In CloudFormation, this field name is `IamCertificateId` . Note the different capitalization.
	//
	// If the distribution uses `Aliases` (alternate domain names or CNAMEs) and the SSL/TLS certificate is stored in [AWS Identity and Access Management (IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) , provide the ID of the IAM certificate.
	//
	// If you specify an IAM certificate ID, you must also specify values for `MinimumProtocolVersion` and `SSLSupportMethod` . (In CloudFormation, the field name is `SslSupportMethod` . Note the different capitalization.)
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-viewercertificate.html#cfn-cloudfront-distribution-viewercertificate-iamcertificateid
	//
	IamCertificateId *string `field:"optional" json:"iamCertificateId" yaml:"iamCertificateId"`
	// If the distribution uses `Aliases` (alternate domain names or CNAMEs), specify the security policy that you want CloudFront to use for HTTPS connections with viewers.
	//
	// The security policy determines two settings:
	//
	// - The minimum SSL/TLS protocol that CloudFront can use to communicate with viewers.
	// - The ciphers that CloudFront can use to encrypt the content that it returns to viewers.
	//
	// For more information, see [Security Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValues-security-policy) and [Supported Protocols and Ciphers Between Viewers and CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html#secure-connections-supported-ciphers) in the *Amazon CloudFront Developer Guide* .
	//
	// > On the CloudFront console, this setting is called *Security Policy* .
	//
	// When you're using SNI only (you set `SSLSupportMethod` to `sni-only` ), you must specify `TLSv1` or higher. (In CloudFormation, the field name is `SslSupportMethod` . Note the different capitalization.)
	//
	// If the distribution uses the CloudFront domain name such as `d111111abcdef8.cloudfront.net` (you set `CloudFrontDefaultCertificate` to `true` ), CloudFront automatically sets the security policy to `TLSv1` regardless of the value that you set here.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-viewercertificate.html#cfn-cloudfront-distribution-viewercertificate-minimumprotocolversion
	//
	MinimumProtocolVersion *string `field:"optional" json:"minimumProtocolVersion" yaml:"minimumProtocolVersion"`
	// > In CloudFormation, this field name is `SslSupportMethod` . Note the different capitalization.
	//
	// If the distribution uses `Aliases` (alternate domain names or CNAMEs), specify which viewers the distribution accepts HTTPS connections from.
	//
	// - `sni-only` – The distribution accepts HTTPS connections from only viewers that support [server name indication (SNI)](https://docs.aws.amazon.com/https://en.wikipedia.org/wiki/Server_Name_Indication) . This is recommended. Most browsers and clients support SNI.
	// - `vip` – The distribution accepts HTTPS connections from all viewers including those that don't support SNI. This is not recommended, and results in additional monthly charges from CloudFront.
	// - `static-ip` - Do not specify this value unless your distribution has been enabled for this feature by the CloudFront team. If you have a use case that requires static IP addresses for a distribution, contact CloudFront through the [AWS Support Center](https://docs.aws.amazon.com/support/home) .
	//
	// If the distribution uses the CloudFront domain name such as `d111111abcdef8.cloudfront.net` , don't set a value for this field.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-viewercertificate.html#cfn-cloudfront-distribution-viewercertificate-sslsupportmethod
	//
	SslSupportMethod *string `field:"optional" json:"sslSupportMethod" yaml:"sslSupportMethod"`
}

A complex type that determines the distribution's SSL/TLS configuration for communicating with viewers.

If the distribution doesn't use `Aliases` (also known as alternate domain names or CNAMEs)—that is, if the distribution uses the CloudFront domain name such as `d111111abcdef8.cloudfront.net` —set `CloudFrontDefaultCertificate` to `true` and leave all other fields empty.

If the distribution uses `Aliases` (alternate domain names or CNAMEs), use the fields in this type to specify the following settings:

- Which viewers the distribution accepts HTTPS connections from: only viewers that support [server name indication (SNI)](https://docs.aws.amazon.com/https://en.wikipedia.org/wiki/Server_Name_Indication) (recommended), or all viewers including those that don't support SNI.

- To accept HTTPS connections from only viewers that support SNI, set `SSLSupportMethod` to `sni-only` . This is recommended. Most browsers and clients support SNI. (In CloudFormation, the field name is `SslSupportMethod` . Note the different capitalization.) - To accept HTTPS connections from all viewers, including those that don't support SNI, set `SSLSupportMethod` to `vip` . This is not recommended, and results in additional monthly charges from CloudFront. (In CloudFormation, the field name is `SslSupportMethod` . Note the different capitalization.) - The minimum SSL/TLS protocol version that the distribution can use to communicate with viewers. To specify a minimum version, choose a value for `MinimumProtocolVersion` . For more information, see [Security Policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValues-security-policy) in the *Amazon CloudFront Developer Guide* . - The location of the SSL/TLS certificate, [AWS Certificate Manager (ACM)](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html) (recommended) or [AWS Identity and Access Management (IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html) . You specify the location by setting a value in one of the following fields (not both):

- `ACMCertificateArn` (In CloudFormation, this field name is `AcmCertificateArn` . Note the different capitalization.) - `IAMCertificateId` (In CloudFormation, this field name is `IamCertificateId` . Note the different capitalization.)

All distributions support HTTPS connections from viewers. To require viewers to use HTTPS only, or to redirect them from HTTP to HTTPS, use `ViewerProtocolPolicy` in the `CacheBehavior` or `DefaultCacheBehavior` . To specify how CloudFront should use SSL/TLS to communicate with your custom origin, use `CustomOriginConfig` .

For more information, see [Using HTTPS with CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html) and [Using Alternate Domain Names and HTTPS](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-alternate-domain-names.html) in the *Amazon CloudFront Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

viewerCertificateProperty := &ViewerCertificateProperty{
	AcmCertificateArn: jsii.String("acmCertificateArn"),
	CloudFrontDefaultCertificate: jsii.Boolean(false),
	IamCertificateId: jsii.String("iamCertificateId"),
	MinimumProtocolVersion: jsii.String("minimumProtocolVersion"),
	SslSupportMethod: jsii.String("sslSupportMethod"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-viewercertificate.html

type CfnFunction

type CfnFunction interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The ARN of the function. For example:.
	//
	// `arn:aws:cloudfront::123456789012:function/ExampleFunction` .
	//
	// To get the function ARN, use the following syntax:
	//
	// `!GetAtt *Function_Logical_ID* .FunctionMetadata.FunctionARN`
	AttrFunctionArn() *string
	// The Amazon Resource Name (ARN) of the function.
	//
	// The ARN uniquely identifies the function.
	AttrFunctionMetadataFunctionArn() *string
	AttrStage() *string
	// A flag that determines whether to automatically publish the function to the `LIVE` stage when it’s created.
	AutoPublish() interface{}
	SetAutoPublish(val interface{})
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The function code.
	FunctionCode() *string
	SetFunctionCode(val *string)
	// Contains configuration information about a CloudFront function.
	FunctionConfig() interface{}
	SetFunctionConfig(val interface{})
	// Contains metadata about a CloudFront function.
	FunctionMetadata() interface{}
	SetFunctionMetadata(val interface{})
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// A name to identify the function.
	Name() *string
	SetName(val *string)
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

Creates a CloudFront function.

To create a function, you provide the function code and some configuration information about the function. The response contains an Amazon Resource Name (ARN) that uniquely identifies the function, and the function’s stage.

By default, when you create a function, it’s in the `DEVELOPMENT` stage. In this stage, you can [test the function](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/test-function.html) in the CloudFront console (or with `TestFunction` in the CloudFront API).

When you’re ready to use your function with a CloudFront distribution, publish the function to the `LIVE` stage. You can do this in the CloudFront console, with `PublishFunction` in the CloudFront API, or by updating the `AWS::CloudFront::Function` resource with the `AutoPublish` property set to `true` . When the function is published to the `LIVE` stage, you can attach it to a distribution’s cache behavior, using the function’s ARN.

To automatically publish the function to the `LIVE` stage when it’s created, set the `AutoPublish` property to `true` .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnFunction := awscdk.Aws_cloudfront.NewCfnFunction(this, jsii.String("MyCfnFunction"), &CfnFunctionProps{
	FunctionCode: jsii.String("functionCode"),
	FunctionConfig: &FunctionConfigProperty{
		Comment: jsii.String("comment"),
		Runtime: jsii.String("runtime"),

		// the properties below are optional
		KeyValueStoreAssociations: []interface{}{
			&KeyValueStoreAssociationProperty{
				KeyValueStoreArn: jsii.String("keyValueStoreArn"),
			},
		},
	},
	Name: jsii.String("name"),

	// the properties below are optional
	AutoPublish: jsii.Boolean(false),
	FunctionMetadata: &FunctionMetadataProperty{
		FunctionArn: jsii.String("functionArn"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html

func NewCfnFunction

func NewCfnFunction(scope constructs.Construct, id *string, props *CfnFunctionProps) CfnFunction

type CfnFunctionProps

type CfnFunctionProps struct {
	// The function code.
	//
	// For more information about writing a CloudFront function, see [Writing function code for CloudFront Functions](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/writing-function-code.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-functioncode
	//
	FunctionCode *string `field:"required" json:"functionCode" yaml:"functionCode"`
	// Contains configuration information about a CloudFront function.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-functionconfig
	//
	FunctionConfig interface{} `field:"required" json:"functionConfig" yaml:"functionConfig"`
	// A name to identify the function.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// A flag that determines whether to automatically publish the function to the `LIVE` stage when it’s created.
	//
	// To automatically publish to the `LIVE` stage, set this property to `true` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-autopublish
	//
	AutoPublish interface{} `field:"optional" json:"autoPublish" yaml:"autoPublish"`
	// Contains metadata about a CloudFront function.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html#cfn-cloudfront-function-functionmetadata
	//
	FunctionMetadata interface{} `field:"optional" json:"functionMetadata" yaml:"functionMetadata"`
}

Properties for defining a `CfnFunction`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnFunctionProps := &CfnFunctionProps{
	FunctionCode: jsii.String("functionCode"),
	FunctionConfig: &FunctionConfigProperty{
		Comment: jsii.String("comment"),
		Runtime: jsii.String("runtime"),

		// the properties below are optional
		KeyValueStoreAssociations: []interface{}{
			&KeyValueStoreAssociationProperty{
				KeyValueStoreArn: jsii.String("keyValueStoreArn"),
			},
		},
	},
	Name: jsii.String("name"),

	// the properties below are optional
	AutoPublish: jsii.Boolean(false),
	FunctionMetadata: &FunctionMetadataProperty{
		FunctionArn: jsii.String("functionArn"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-function.html

type CfnFunction_FunctionConfigProperty

type CfnFunction_FunctionConfigProperty struct {
	// A comment to describe the function.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html#cfn-cloudfront-function-functionconfig-comment
	//
	Comment *string `field:"required" json:"comment" yaml:"comment"`
	// The function's runtime environment version.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html#cfn-cloudfront-function-functionconfig-runtime
	//
	Runtime *string `field:"required" json:"runtime" yaml:"runtime"`
	// The configuration for the key value store associations.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html#cfn-cloudfront-function-functionconfig-keyvaluestoreassociations
	//
	KeyValueStoreAssociations interface{} `field:"optional" json:"keyValueStoreAssociations" yaml:"keyValueStoreAssociations"`
}

Contains configuration information about a CloudFront function.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

functionConfigProperty := &FunctionConfigProperty{
	Comment: jsii.String("comment"),
	Runtime: jsii.String("runtime"),

	// the properties below are optional
	KeyValueStoreAssociations: []interface{}{
		&KeyValueStoreAssociationProperty{
			KeyValueStoreArn: jsii.String("keyValueStoreArn"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html

type CfnFunction_FunctionMetadataProperty

type CfnFunction_FunctionMetadataProperty struct {
	// The Amazon Resource Name (ARN) of the function.
	//
	// The ARN uniquely identifies the function.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionmetadata.html#cfn-cloudfront-function-functionmetadata-functionarn
	//
	FunctionArn *string `field:"optional" json:"functionArn" yaml:"functionArn"`
}

Contains metadata about a CloudFront function.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

functionMetadataProperty := &FunctionMetadataProperty{
	FunctionArn: jsii.String("functionArn"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionmetadata.html

type CfnFunction_KeyValueStoreAssociationProperty added in v2.119.0

type CfnFunction_KeyValueStoreAssociationProperty struct {
	// The Amazon Resource Name (ARN) of the key value store association.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-keyvaluestoreassociation.html#cfn-cloudfront-function-keyvaluestoreassociation-keyvaluestorearn
	//
	KeyValueStoreArn *string `field:"required" json:"keyValueStoreArn" yaml:"keyValueStoreArn"`
}

The key value store association.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

keyValueStoreAssociationProperty := &KeyValueStoreAssociationProperty{
	KeyValueStoreArn: jsii.String("keyValueStoreArn"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-keyvaluestoreassociation.html

type CfnKeyGroup

type CfnKeyGroup interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The identifier for the key group.
	AttrId() *string
	// The date and time when the key group was last modified.
	AttrLastModifiedTime() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The key group configuration.
	KeyGroupConfig() interface{}
	SetKeyGroupConfig(val interface{})
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A key group.

A key group contains a list of public keys that you can use with [CloudFront signed URLs and signed cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnKeyGroup := awscdk.Aws_cloudfront.NewCfnKeyGroup(this, jsii.String("MyCfnKeyGroup"), &CfnKeyGroupProps{
	KeyGroupConfig: &KeyGroupConfigProperty{
		Items: []*string{
			jsii.String("items"),
		},
		Name: jsii.String("name"),

		// the properties below are optional
		Comment: jsii.String("comment"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-keygroup.html

func NewCfnKeyGroup

func NewCfnKeyGroup(scope constructs.Construct, id *string, props *CfnKeyGroupProps) CfnKeyGroup

type CfnKeyGroupProps

type CfnKeyGroupProps struct {
	// The key group configuration.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-keygroup.html#cfn-cloudfront-keygroup-keygroupconfig
	//
	KeyGroupConfig interface{} `field:"required" json:"keyGroupConfig" yaml:"keyGroupConfig"`
}

Properties for defining a `CfnKeyGroup`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnKeyGroupProps := &CfnKeyGroupProps{
	KeyGroupConfig: &KeyGroupConfigProperty{
		Items: []*string{
			jsii.String("items"),
		},
		Name: jsii.String("name"),

		// the properties below are optional
		Comment: jsii.String("comment"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-keygroup.html

type CfnKeyGroup_KeyGroupConfigProperty

type CfnKeyGroup_KeyGroupConfigProperty struct {
	// A list of the identifiers of the public keys in the key group.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-keygroup-keygroupconfig.html#cfn-cloudfront-keygroup-keygroupconfig-items
	//
	Items *[]*string `field:"required" json:"items" yaml:"items"`
	// A name to identify the key group.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-keygroup-keygroupconfig.html#cfn-cloudfront-keygroup-keygroupconfig-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// A comment to describe the key group.
	//
	// The comment cannot be longer than 128 characters.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-keygroup-keygroupconfig.html#cfn-cloudfront-keygroup-keygroupconfig-comment
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
}

A key group configuration.

A key group contains a list of public keys that you can use with [CloudFront signed URLs and signed cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

keyGroupConfigProperty := &KeyGroupConfigProperty{
	Items: []*string{
		jsii.String("items"),
	},
	Name: jsii.String("name"),

	// the properties below are optional
	Comment: jsii.String("comment"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-keygroup-keygroupconfig.html

type CfnKeyValueStore added in v2.116.0

type CfnKeyValueStore interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The Amazon Resource Name (ARN) of the key value store.
	AttrArn() *string
	// The unique Id for the key value store.
	AttrId() *string
	// The current status of the key value store.
	//
	// For more information, see [Key value store statuses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/kvs-with-functions-create.html#key-value-store-status) in the *.*
	AttrStatus() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// A comment for the key value store.
	Comment() *string
	SetComment(val *string)
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The import source for the key value store.
	ImportSource() interface{}
	SetImportSource(val interface{})
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The name of the key value store.
	Name() *string
	SetName(val *string)
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

The key value store.

Use this to separate data from function code, allowing you to update data without having to publish a new version of a function. The key value store holds keys and their corresponding values.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnKeyValueStore := awscdk.Aws_cloudfront.NewCfnKeyValueStore(this, jsii.String("MyCfnKeyValueStore"), &CfnKeyValueStoreProps{
	Name: jsii.String("name"),

	// the properties below are optional
	Comment: jsii.String("comment"),
	ImportSource: &ImportSourceProperty{
		SourceArn: jsii.String("sourceArn"),
		SourceType: jsii.String("sourceType"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-keyvaluestore.html

func NewCfnKeyValueStore added in v2.116.0

func NewCfnKeyValueStore(scope constructs.Construct, id *string, props *CfnKeyValueStoreProps) CfnKeyValueStore

type CfnKeyValueStoreProps added in v2.116.0

type CfnKeyValueStoreProps struct {
	// The name of the key value store.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-keyvaluestore.html#cfn-cloudfront-keyvaluestore-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// A comment for the key value store.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-keyvaluestore.html#cfn-cloudfront-keyvaluestore-comment
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// The import source for the key value store.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-keyvaluestore.html#cfn-cloudfront-keyvaluestore-importsource
	//
	ImportSource interface{} `field:"optional" json:"importSource" yaml:"importSource"`
}

Properties for defining a `CfnKeyValueStore`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnKeyValueStoreProps := &CfnKeyValueStoreProps{
	Name: jsii.String("name"),

	// the properties below are optional
	Comment: jsii.String("comment"),
	ImportSource: &ImportSourceProperty{
		SourceArn: jsii.String("sourceArn"),
		SourceType: jsii.String("sourceType"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-keyvaluestore.html

type CfnKeyValueStore_ImportSourceProperty added in v2.116.0

type CfnKeyValueStore_ImportSourceProperty struct {
	// The Amazon Resource Name (ARN) of the import source for the key value store.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-keyvaluestore-importsource.html#cfn-cloudfront-keyvaluestore-importsource-sourcearn
	//
	SourceArn *string `field:"required" json:"sourceArn" yaml:"sourceArn"`
	// The source type of the import source for the key value store.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-keyvaluestore-importsource.html#cfn-cloudfront-keyvaluestore-importsource-sourcetype
	//
	SourceType *string `field:"required" json:"sourceType" yaml:"sourceType"`
}

The import source for the key value store.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

importSourceProperty := &ImportSourceProperty{
	SourceArn: jsii.String("sourceArn"),
	SourceType: jsii.String("sourceType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-keyvaluestore-importsource.html

type CfnMonitoringSubscription added in v2.45.0

type CfnMonitoringSubscription interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The ID of the distribution that you are enabling metrics for.
	DistributionId() *string
	SetDistributionId(val *string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// A subscription configuration for additional CloudWatch metrics.
	MonitoringSubscription() interface{}
	SetMonitoringSubscription(val interface{})
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A monitoring subscription.

This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnMonitoringSubscription := awscdk.Aws_cloudfront.NewCfnMonitoringSubscription(this, jsii.String("MyCfnMonitoringSubscription"), &CfnMonitoringSubscriptionProps{
	DistributionId: jsii.String("distributionId"),
	MonitoringSubscription: &MonitoringSubscriptionProperty{
		RealtimeMetricsSubscriptionConfig: &RealtimeMetricsSubscriptionConfigProperty{
			RealtimeMetricsSubscriptionStatus: jsii.String("realtimeMetricsSubscriptionStatus"),
		},
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-monitoringsubscription.html

func NewCfnMonitoringSubscription added in v2.45.0

func NewCfnMonitoringSubscription(scope constructs.Construct, id *string, props *CfnMonitoringSubscriptionProps) CfnMonitoringSubscription

type CfnMonitoringSubscriptionProps added in v2.45.0

type CfnMonitoringSubscriptionProps struct {
	// The ID of the distribution that you are enabling metrics for.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-monitoringsubscription.html#cfn-cloudfront-monitoringsubscription-distributionid
	//
	DistributionId *string `field:"required" json:"distributionId" yaml:"distributionId"`
	// A subscription configuration for additional CloudWatch metrics.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-monitoringsubscription.html#cfn-cloudfront-monitoringsubscription-monitoringsubscription
	//
	MonitoringSubscription interface{} `field:"required" json:"monitoringSubscription" yaml:"monitoringSubscription"`
}

Properties for defining a `CfnMonitoringSubscription`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnMonitoringSubscriptionProps := &CfnMonitoringSubscriptionProps{
	DistributionId: jsii.String("distributionId"),
	MonitoringSubscription: &MonitoringSubscriptionProperty{
		RealtimeMetricsSubscriptionConfig: &RealtimeMetricsSubscriptionConfigProperty{
			RealtimeMetricsSubscriptionStatus: jsii.String("realtimeMetricsSubscriptionStatus"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-monitoringsubscription.html

type CfnMonitoringSubscription_MonitoringSubscriptionProperty added in v2.45.0

type CfnMonitoringSubscription_MonitoringSubscriptionProperty struct {
	// A subscription configuration for additional CloudWatch metrics.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-monitoringsubscription-monitoringsubscription.html#cfn-cloudfront-monitoringsubscription-monitoringsubscription-realtimemetricssubscriptionconfig
	//
	RealtimeMetricsSubscriptionConfig interface{} `field:"optional" json:"realtimeMetricsSubscriptionConfig" yaml:"realtimeMetricsSubscriptionConfig"`
}

A monitoring subscription.

This structure contains information about whether additional CloudWatch metrics are enabled for a given CloudFront distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

monitoringSubscriptionProperty := &MonitoringSubscriptionProperty{
	RealtimeMetricsSubscriptionConfig: &RealtimeMetricsSubscriptionConfigProperty{
		RealtimeMetricsSubscriptionStatus: jsii.String("realtimeMetricsSubscriptionStatus"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-monitoringsubscription-monitoringsubscription.html

type CfnMonitoringSubscription_RealtimeMetricsSubscriptionConfigProperty added in v2.45.0

type CfnMonitoringSubscription_RealtimeMetricsSubscriptionConfigProperty struct {
	// A flag that indicates whether additional CloudWatch metrics are enabled for a given CloudFront distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-monitoringsubscription-realtimemetricssubscriptionconfig.html#cfn-cloudfront-monitoringsubscription-realtimemetricssubscriptionconfig-realtimemetricssubscriptionstatus
	//
	RealtimeMetricsSubscriptionStatus *string `field:"required" json:"realtimeMetricsSubscriptionStatus" yaml:"realtimeMetricsSubscriptionStatus"`
}

A subscription configuration for additional CloudWatch metrics.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

realtimeMetricsSubscriptionConfigProperty := &RealtimeMetricsSubscriptionConfigProperty{
	RealtimeMetricsSubscriptionStatus: jsii.String("realtimeMetricsSubscriptionStatus"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-monitoringsubscription-realtimemetricssubscriptionconfig.html

type CfnOriginAccessControl added in v2.42.0

type CfnOriginAccessControl interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The unique identifier of the origin access control.
	AttrId() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// The origin access control.
	OriginAccessControlConfig() interface{}
	SetOriginAccessControlConfig(val interface{})
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

Creates a new origin access control in CloudFront.

After you create an origin access control, you can add it to an origin in a CloudFront distribution so that CloudFront sends authenticated (signed) requests to the origin.

This makes it possible to block public access to the origin, allowing viewers (users) to access the origin's content only through CloudFront.

For more information about using a CloudFront origin access control, see [Restricting access to an AWS origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-origin.html) in the *Amazon CloudFront Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnOriginAccessControl := awscdk.Aws_cloudfront.NewCfnOriginAccessControl(this, jsii.String("MyCfnOriginAccessControl"), &CfnOriginAccessControlProps{
	OriginAccessControlConfig: &OriginAccessControlConfigProperty{
		Name: jsii.String("name"),
		OriginAccessControlOriginType: jsii.String("originAccessControlOriginType"),
		SigningBehavior: jsii.String("signingBehavior"),
		SigningProtocol: jsii.String("signingProtocol"),

		// the properties below are optional
		Description: jsii.String("description"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-originaccesscontrol.html

func NewCfnOriginAccessControl added in v2.42.0

func NewCfnOriginAccessControl(scope constructs.Construct, id *string, props *CfnOriginAccessControlProps) CfnOriginAccessControl

type CfnOriginAccessControlProps added in v2.42.0

type CfnOriginAccessControlProps struct {
	// The origin access control.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-originaccesscontrol.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig
	//
	OriginAccessControlConfig interface{} `field:"required" json:"originAccessControlConfig" yaml:"originAccessControlConfig"`
}

Properties for defining a `CfnOriginAccessControl`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnOriginAccessControlProps := &CfnOriginAccessControlProps{
	OriginAccessControlConfig: &OriginAccessControlConfigProperty{
		Name: jsii.String("name"),
		OriginAccessControlOriginType: jsii.String("originAccessControlOriginType"),
		SigningBehavior: jsii.String("signingBehavior"),
		SigningProtocol: jsii.String("signingProtocol"),

		// the properties below are optional
		Description: jsii.String("description"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-originaccesscontrol.html

type CfnOriginAccessControl_OriginAccessControlConfigProperty added in v2.42.0

type CfnOriginAccessControl_OriginAccessControlConfigProperty struct {
	// A name to identify the origin access control.
	//
	// You can specify up to 64 characters.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// The type of origin that this origin access control is for.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-originaccesscontrolorigintype
	//
	OriginAccessControlOriginType *string `field:"required" json:"originAccessControlOriginType" yaml:"originAccessControlOriginType"`
	// Specifies which requests CloudFront signs (adds authentication information to).
	//
	// Specify `always` for the most common use case. For more information, see [origin access control advanced settings](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html#oac-advanced-settings) in the *Amazon CloudFront Developer Guide* .
	//
	// This field can have one of the following values:
	//
	// - `always` – CloudFront signs all origin requests, overwriting the `Authorization` header from the viewer request if one exists.
	// - `never` – CloudFront doesn't sign any origin requests. This value turns off origin access control for all origins in all distributions that use this origin access control.
	// - `no-override` – If the viewer request doesn't contain the `Authorization` header, then CloudFront signs the origin request. If the viewer request contains the `Authorization` header, then CloudFront doesn't sign the origin request and instead passes along the `Authorization` header from the viewer request. *WARNING: To pass along the `Authorization` header from the viewer request, you *must* add the `Authorization` header to a [cache policy](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html) for all cache behaviors that use origins associated with this origin access control.*
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-signingbehavior
	//
	SigningBehavior *string `field:"required" json:"signingBehavior" yaml:"signingBehavior"`
	// The signing protocol of the origin access control, which determines how CloudFront signs (authenticates) requests.
	//
	// The only valid value is `sigv4` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-signingprotocol
	//
	SigningProtocol *string `field:"required" json:"signingProtocol" yaml:"signingProtocol"`
	// A description of the origin access control.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-description
	//
	Description *string `field:"optional" json:"description" yaml:"description"`
}

Creates a new origin access control in CloudFront.

After you create an origin access control, you can add it to an origin in a CloudFront distribution so that CloudFront sends authenticated (signed) requests to the origin.

This makes it possible to block public access to the origin, allowing viewers (users) to access the origin's content only through CloudFront.

For more information about using a CloudFront origin access control, see [Restricting access to an AWS origin](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-origin.html) in the *Amazon CloudFront Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originAccessControlConfigProperty := &OriginAccessControlConfigProperty{
	Name: jsii.String("name"),
	OriginAccessControlOriginType: jsii.String("originAccessControlOriginType"),
	SigningBehavior: jsii.String("signingBehavior"),
	SigningProtocol: jsii.String("signingProtocol"),

	// the properties below are optional
	Description: jsii.String("description"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html

type CfnOriginRequestPolicy

type CfnOriginRequestPolicy interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The unique identifier for the origin request policy.
	//
	// For example: `befd7079-9bbc-4ebf-8ade-498a3694176c` .
	AttrId() *string
	// The date and time when the origin request policy was last modified.
	AttrLastModifiedTime() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// The origin request policy configuration.
	OriginRequestPolicyConfig() interface{}
	SetOriginRequestPolicyConfig(val interface{})
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

An origin request policy.

When it's attached to a cache behavior, the origin request policy determines the values that CloudFront includes in requests that it sends to the origin. Each request that CloudFront sends to the origin includes the following:

- The request body and the URL path (without the domain name) from the viewer request. - The headers that CloudFront automatically includes in every origin request, including `Host` , `User-Agent` , and `X-Amz-Cf-Id` . - All HTTP headers, cookies, and URL query strings that are specified in the cache policy or the origin request policy. These can include items from the viewer request and, in the case of headers, additional ones that are added by CloudFront.

CloudFront sends a request when it can't find an object in its cache that matches the request. If you want to send values to the origin and also include them in the cache key, use `CachePolicy` .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnOriginRequestPolicy := awscdk.Aws_cloudfront.NewCfnOriginRequestPolicy(this, jsii.String("MyCfnOriginRequestPolicy"), &CfnOriginRequestPolicyProps{
	OriginRequestPolicyConfig: &OriginRequestPolicyConfigProperty{
		CookiesConfig: &CookiesConfigProperty{
			CookieBehavior: jsii.String("cookieBehavior"),

			// the properties below are optional
			Cookies: []*string{
				jsii.String("cookies"),
			},
		},
		HeadersConfig: &HeadersConfigProperty{
			HeaderBehavior: jsii.String("headerBehavior"),

			// the properties below are optional
			Headers: []*string{
				jsii.String("headers"),
			},
		},
		Name: jsii.String("name"),
		QueryStringsConfig: &QueryStringsConfigProperty{
			QueryStringBehavior: jsii.String("queryStringBehavior"),

			// the properties below are optional
			QueryStrings: []*string{
				jsii.String("queryStrings"),
			},
		},

		// the properties below are optional
		Comment: jsii.String("comment"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-originrequestpolicy.html

func NewCfnOriginRequestPolicy

func NewCfnOriginRequestPolicy(scope constructs.Construct, id *string, props *CfnOriginRequestPolicyProps) CfnOriginRequestPolicy

type CfnOriginRequestPolicyProps

type CfnOriginRequestPolicyProps struct {
	// The origin request policy configuration.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-originrequestpolicy.html#cfn-cloudfront-originrequestpolicy-originrequestpolicyconfig
	//
	OriginRequestPolicyConfig interface{} `field:"required" json:"originRequestPolicyConfig" yaml:"originRequestPolicyConfig"`
}

Properties for defining a `CfnOriginRequestPolicy`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnOriginRequestPolicyProps := &CfnOriginRequestPolicyProps{
	OriginRequestPolicyConfig: &OriginRequestPolicyConfigProperty{
		CookiesConfig: &CookiesConfigProperty{
			CookieBehavior: jsii.String("cookieBehavior"),

			// the properties below are optional
			Cookies: []*string{
				jsii.String("cookies"),
			},
		},
		HeadersConfig: &HeadersConfigProperty{
			HeaderBehavior: jsii.String("headerBehavior"),

			// the properties below are optional
			Headers: []*string{
				jsii.String("headers"),
			},
		},
		Name: jsii.String("name"),
		QueryStringsConfig: &QueryStringsConfigProperty{
			QueryStringBehavior: jsii.String("queryStringBehavior"),

			// the properties below are optional
			QueryStrings: []*string{
				jsii.String("queryStrings"),
			},
		},

		// the properties below are optional
		Comment: jsii.String("comment"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-originrequestpolicy.html

type CfnOriginRequestPolicy_CookiesConfigProperty

type CfnOriginRequestPolicy_CookiesConfigProperty struct {
	// Determines whether cookies in viewer requests are included in requests that CloudFront sends to the origin. Valid values are:.
	//
	// - `none` – No cookies in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set to `none` , any cookies that are listed in a `CachePolicy` *are* included in origin requests.
	// - `whitelist` – Only the cookies in viewer requests that are listed in the `CookieNames` type are included in requests that CloudFront sends to the origin.
	// - `all` – All cookies in viewer requests are included in requests that CloudFront sends to the origin.
	// - `allExcept` – All cookies in viewer requests are included in requests that CloudFront sends to the origin, **except** for those listed in the `CookieNames` type, which are not included.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-cookiesconfig.html#cfn-cloudfront-originrequestpolicy-cookiesconfig-cookiebehavior
	//
	CookieBehavior *string `field:"required" json:"cookieBehavior" yaml:"cookieBehavior"`
	// Contains a list of cookie names.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-cookiesconfig.html#cfn-cloudfront-originrequestpolicy-cookiesconfig-cookies
	//
	Cookies *[]*string `field:"optional" json:"cookies" yaml:"cookies"`
}

An object that determines whether any cookies in viewer requests (and if so, which cookies) are included in requests that CloudFront sends to the origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cookiesConfigProperty := &CookiesConfigProperty{
	CookieBehavior: jsii.String("cookieBehavior"),

	// the properties below are optional
	Cookies: []*string{
		jsii.String("cookies"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-cookiesconfig.html

type CfnOriginRequestPolicy_HeadersConfigProperty

type CfnOriginRequestPolicy_HeadersConfigProperty struct {
	// Determines whether any HTTP headers are included in requests that CloudFront sends to the origin. Valid values are:.
	//
	// - `none` – No HTTP headers in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set to `none` , any headers that are listed in a `CachePolicy` *are* included in origin requests.
	// - `whitelist` – Only the HTTP headers that are listed in the `Headers` type are included in requests that CloudFront sends to the origin.
	// - `allViewer` – All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.
	// - `allViewerAndWhitelistCloudFront` – All HTTP headers in viewer requests and the additional CloudFront headers that are listed in the `Headers` type are included in requests that CloudFront sends to the origin. The additional headers are added by CloudFront.
	// - `allExcept` – All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin, **except** for those listed in the `Headers` type, which are not included.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-headersconfig.html#cfn-cloudfront-originrequestpolicy-headersconfig-headerbehavior
	//
	HeaderBehavior *string `field:"required" json:"headerBehavior" yaml:"headerBehavior"`
	// Contains a list of HTTP header names.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-headersconfig.html#cfn-cloudfront-originrequestpolicy-headersconfig-headers
	//
	Headers *[]*string `field:"optional" json:"headers" yaml:"headers"`
}

An object that determines whether any HTTP headers (and if so, which headers) are included in requests that CloudFront sends to the origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

headersConfigProperty := &HeadersConfigProperty{
	HeaderBehavior: jsii.String("headerBehavior"),

	// the properties below are optional
	Headers: []*string{
		jsii.String("headers"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-headersconfig.html

type CfnOriginRequestPolicy_OriginRequestPolicyConfigProperty

type CfnOriginRequestPolicy_OriginRequestPolicyConfigProperty struct {
	// The cookies from viewer requests to include in origin requests.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-originrequestpolicyconfig.html#cfn-cloudfront-originrequestpolicy-originrequestpolicyconfig-cookiesconfig
	//
	CookiesConfig interface{} `field:"required" json:"cookiesConfig" yaml:"cookiesConfig"`
	// The HTTP headers to include in origin requests.
	//
	// These can include headers from viewer requests and additional headers added by CloudFront.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-originrequestpolicyconfig.html#cfn-cloudfront-originrequestpolicy-originrequestpolicyconfig-headersconfig
	//
	HeadersConfig interface{} `field:"required" json:"headersConfig" yaml:"headersConfig"`
	// A unique name to identify the origin request policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-originrequestpolicyconfig.html#cfn-cloudfront-originrequestpolicy-originrequestpolicyconfig-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// The URL query strings from viewer requests to include in origin requests.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-originrequestpolicyconfig.html#cfn-cloudfront-originrequestpolicy-originrequestpolicyconfig-querystringsconfig
	//
	QueryStringsConfig interface{} `field:"required" json:"queryStringsConfig" yaml:"queryStringsConfig"`
	// A comment to describe the origin request policy.
	//
	// The comment cannot be longer than 128 characters.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-originrequestpolicyconfig.html#cfn-cloudfront-originrequestpolicy-originrequestpolicyconfig-comment
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
}

An origin request policy configuration.

This configuration determines the values that CloudFront includes in requests that it sends to the origin. Each request that CloudFront sends to the origin includes the following:

- The request body and the URL path (without the domain name) from the viewer request. - The headers that CloudFront automatically includes in every origin request, including `Host` , `User-Agent` , and `X-Amz-Cf-Id` . - All HTTP headers, cookies, and URL query strings that are specified in the cache policy or the origin request policy. These can include items from the viewer request and, in the case of headers, additional ones that are added by CloudFront.

CloudFront sends a request when it can't find an object in its cache that matches the request. If you want to send values to the origin and also include them in the cache key, use `CachePolicy` .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originRequestPolicyConfigProperty := &OriginRequestPolicyConfigProperty{
	CookiesConfig: &CookiesConfigProperty{
		CookieBehavior: jsii.String("cookieBehavior"),

		// the properties below are optional
		Cookies: []*string{
			jsii.String("cookies"),
		},
	},
	HeadersConfig: &HeadersConfigProperty{
		HeaderBehavior: jsii.String("headerBehavior"),

		// the properties below are optional
		Headers: []*string{
			jsii.String("headers"),
		},
	},
	Name: jsii.String("name"),
	QueryStringsConfig: &QueryStringsConfigProperty{
		QueryStringBehavior: jsii.String("queryStringBehavior"),

		// the properties below are optional
		QueryStrings: []*string{
			jsii.String("queryStrings"),
		},
	},

	// the properties below are optional
	Comment: jsii.String("comment"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-originrequestpolicyconfig.html

type CfnOriginRequestPolicy_QueryStringsConfigProperty

type CfnOriginRequestPolicy_QueryStringsConfigProperty struct {
	// Determines whether any URL query strings in viewer requests are included in requests that CloudFront sends to the origin.
	//
	// Valid values are:
	//
	// - `none` – No query strings in viewer requests are included in requests that CloudFront sends to the origin. Even when this field is set to `none` , any query strings that are listed in a `CachePolicy` *are* included in origin requests.
	// - `whitelist` – Only the query strings in viewer requests that are listed in the `QueryStringNames` type are included in requests that CloudFront sends to the origin.
	// - `all` – All query strings in viewer requests are included in requests that CloudFront sends to the origin.
	// - `allExcept` – All query strings in viewer requests are included in requests that CloudFront sends to the origin, **except** for those listed in the `QueryStringNames` type, which are not included.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-querystringsconfig.html#cfn-cloudfront-originrequestpolicy-querystringsconfig-querystringbehavior
	//
	QueryStringBehavior *string `field:"required" json:"queryStringBehavior" yaml:"queryStringBehavior"`
	// Contains a list of query string names.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-querystringsconfig.html#cfn-cloudfront-originrequestpolicy-querystringsconfig-querystrings
	//
	QueryStrings *[]*string `field:"optional" json:"queryStrings" yaml:"queryStrings"`
}

An object that determines whether any URL query strings in viewer requests (and if so, which query strings) are included in requests that CloudFront sends to the origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

queryStringsConfigProperty := &QueryStringsConfigProperty{
	QueryStringBehavior: jsii.String("queryStringBehavior"),

	// the properties below are optional
	QueryStrings: []*string{
		jsii.String("queryStrings"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originrequestpolicy-querystringsconfig.html

type CfnPublicKey

type CfnPublicKey interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The date and time when the public key was uploaded.
	AttrCreatedTime() *string
	// The identifier of the public key.
	AttrId() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Configuration information about a public key that you can use with [signed URLs and signed cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) , or with [field-level encryption](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html) .
	PublicKeyConfig() interface{}
	SetPublicKeyConfig(val interface{})
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A public key that you can use with [signed URLs and signed cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) , or with [field-level encryption](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html) .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnPublicKey := awscdk.Aws_cloudfront.NewCfnPublicKey(this, jsii.String("MyCfnPublicKey"), &CfnPublicKeyProps{
	PublicKeyConfig: &PublicKeyConfigProperty{
		CallerReference: jsii.String("callerReference"),
		EncodedKey: jsii.String("encodedKey"),
		Name: jsii.String("name"),

		// the properties below are optional
		Comment: jsii.String("comment"),
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-publickey.html

func NewCfnPublicKey

func NewCfnPublicKey(scope constructs.Construct, id *string, props *CfnPublicKeyProps) CfnPublicKey

type CfnPublicKeyProps

type CfnPublicKeyProps struct {
	// Configuration information about a public key that you can use with [signed URLs and signed cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) , or with [field-level encryption](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-publickey.html#cfn-cloudfront-publickey-publickeyconfig
	//
	PublicKeyConfig interface{} `field:"required" json:"publicKeyConfig" yaml:"publicKeyConfig"`
}

Properties for defining a `CfnPublicKey`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnPublicKeyProps := &CfnPublicKeyProps{
	PublicKeyConfig: &PublicKeyConfigProperty{
		CallerReference: jsii.String("callerReference"),
		EncodedKey: jsii.String("encodedKey"),
		Name: jsii.String("name"),

		// the properties below are optional
		Comment: jsii.String("comment"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-publickey.html

type CfnPublicKey_PublicKeyConfigProperty

type CfnPublicKey_PublicKeyConfigProperty struct {
	// A string included in the request to help make sure that the request can't be replayed.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-publickey-publickeyconfig.html#cfn-cloudfront-publickey-publickeyconfig-callerreference
	//
	CallerReference *string `field:"required" json:"callerReference" yaml:"callerReference"`
	// The public key that you can use with [signed URLs and signed cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) , or with [field-level encryption](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html) .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-publickey-publickeyconfig.html#cfn-cloudfront-publickey-publickeyconfig-encodedkey
	//
	EncodedKey *string `field:"required" json:"encodedKey" yaml:"encodedKey"`
	// A name to help identify the public key.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-publickey-publickeyconfig.html#cfn-cloudfront-publickey-publickeyconfig-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// A comment to describe the public key.
	//
	// The comment cannot be longer than 128 characters.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-publickey-publickeyconfig.html#cfn-cloudfront-publickey-publickeyconfig-comment
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
}

Configuration information about a public key that you can use with [signed URLs and signed cookies](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) , or with [field-level encryption](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html) .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

publicKeyConfigProperty := &PublicKeyConfigProperty{
	CallerReference: jsii.String("callerReference"),
	EncodedKey: jsii.String("encodedKey"),
	Name: jsii.String("name"),

	// the properties below are optional
	Comment: jsii.String("comment"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-publickey-publickeyconfig.html

type CfnRealtimeLogConfig

type CfnRealtimeLogConfig interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The Amazon Resource Name (ARN) of the real-time log configuration.
	//
	// For example: `arn:aws:cloudfront::111122223333:realtime-log-config/ExampleNameForRealtimeLogConfig` .
	AttrArn() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// Contains information about the Amazon Kinesis data stream where you are sending real-time log data for this real-time log configuration.
	EndPoints() interface{}
	SetEndPoints(val interface{})
	// A list of fields that are included in each real-time log record.
	Fields() *[]*string
	SetFields(val *[]*string)
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The unique name of this real-time log configuration.
	Name() *string
	SetName(val *string)
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The sampling rate for this real-time log configuration.
	SamplingRate() *float64
	SetSamplingRate(val *float64)
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A real-time log configuration.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnRealtimeLogConfig := awscdk.Aws_cloudfront.NewCfnRealtimeLogConfig(this, jsii.String("MyCfnRealtimeLogConfig"), &CfnRealtimeLogConfigProps{
	EndPoints: []interface{}{
		&EndPointProperty{
			KinesisStreamConfig: &KinesisStreamConfigProperty{
				RoleArn: jsii.String("roleArn"),
				StreamArn: jsii.String("streamArn"),
			},
			StreamType: jsii.String("streamType"),
		},
	},
	Fields: []*string{
		jsii.String("fields"),
	},
	Name: jsii.String("name"),
	SamplingRate: jsii.Number(123),
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-realtimelogconfig.html

func NewCfnRealtimeLogConfig

func NewCfnRealtimeLogConfig(scope constructs.Construct, id *string, props *CfnRealtimeLogConfigProps) CfnRealtimeLogConfig

type CfnRealtimeLogConfigProps

type CfnRealtimeLogConfigProps struct {
	// Contains information about the Amazon Kinesis data stream where you are sending real-time log data for this real-time log configuration.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-realtimelogconfig.html#cfn-cloudfront-realtimelogconfig-endpoints
	//
	EndPoints interface{} `field:"required" json:"endPoints" yaml:"endPoints"`
	// A list of fields that are included in each real-time log record.
	//
	// In an API response, the fields are provided in the same order in which they are sent to the Amazon Kinesis data stream.
	//
	// For more information about fields, see [Real-time log configuration fields](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-fields) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-realtimelogconfig.html#cfn-cloudfront-realtimelogconfig-fields
	//
	Fields *[]*string `field:"required" json:"fields" yaml:"fields"`
	// The unique name of this real-time log configuration.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-realtimelogconfig.html#cfn-cloudfront-realtimelogconfig-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// The sampling rate for this real-time log configuration.
	//
	// The sampling rate determines the percentage of viewer requests that are represented in the real-time log data. The sampling rate is an integer between 1 and 100, inclusive.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-realtimelogconfig.html#cfn-cloudfront-realtimelogconfig-samplingrate
	//
	SamplingRate *float64 `field:"required" json:"samplingRate" yaml:"samplingRate"`
}

Properties for defining a `CfnRealtimeLogConfig`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnRealtimeLogConfigProps := &CfnRealtimeLogConfigProps{
	EndPoints: []interface{}{
		&EndPointProperty{
			KinesisStreamConfig: &KinesisStreamConfigProperty{
				RoleArn: jsii.String("roleArn"),
				StreamArn: jsii.String("streamArn"),
			},
			StreamType: jsii.String("streamType"),
		},
	},
	Fields: []*string{
		jsii.String("fields"),
	},
	Name: jsii.String("name"),
	SamplingRate: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-realtimelogconfig.html

type CfnRealtimeLogConfig_EndPointProperty

type CfnRealtimeLogConfig_EndPointProperty struct {
	// Contains information about the Amazon Kinesis data stream where you are sending real-time log data.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-realtimelogconfig-endpoint.html#cfn-cloudfront-realtimelogconfig-endpoint-kinesisstreamconfig
	//
	KinesisStreamConfig interface{} `field:"required" json:"kinesisStreamConfig" yaml:"kinesisStreamConfig"`
	// The type of data stream where you are sending real-time log data.
	//
	// The only valid value is `Kinesis` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-realtimelogconfig-endpoint.html#cfn-cloudfront-realtimelogconfig-endpoint-streamtype
	//
	StreamType *string `field:"required" json:"streamType" yaml:"streamType"`
}

Contains information about the Amazon Kinesis data stream where you are sending real-time log data in a real-time log configuration.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

endPointProperty := &EndPointProperty{
	KinesisStreamConfig: &KinesisStreamConfigProperty{
		RoleArn: jsii.String("roleArn"),
		StreamArn: jsii.String("streamArn"),
	},
	StreamType: jsii.String("streamType"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-realtimelogconfig-endpoint.html

type CfnRealtimeLogConfig_KinesisStreamConfigProperty

type CfnRealtimeLogConfig_KinesisStreamConfigProperty struct {
	// The Amazon Resource Name (ARN) of an AWS Identity and Access Management (IAM) role that CloudFront can use to send real-time log data to your Kinesis data stream.
	//
	// For more information the IAM role, see [Real-time log configuration IAM role](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-iam-role) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-realtimelogconfig-kinesisstreamconfig.html#cfn-cloudfront-realtimelogconfig-kinesisstreamconfig-rolearn
	//
	RoleArn *string `field:"required" json:"roleArn" yaml:"roleArn"`
	// The Amazon Resource Name (ARN) of the Kinesis data stream where you are sending real-time log data.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-realtimelogconfig-kinesisstreamconfig.html#cfn-cloudfront-realtimelogconfig-kinesisstreamconfig-streamarn
	//
	StreamArn *string `field:"required" json:"streamArn" yaml:"streamArn"`
}

Contains information about the Amazon Kinesis data stream where you are sending real-time log data.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

kinesisStreamConfigProperty := &KinesisStreamConfigProperty{
	RoleArn: jsii.String("roleArn"),
	StreamArn: jsii.String("streamArn"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-realtimelogconfig-kinesisstreamconfig.html

type CfnResponseHeadersPolicy

type CfnResponseHeadersPolicy interface {
	awscdk.CfnResource
	awscdk.IInspectable
	// The unique identifier for the response headers policy.
	//
	// For example: `57f99797-3b20-4e1b-a728-27972a74082a` .
	AttrId() *string
	// The date and time when the response headers policy was last modified.
	AttrLastModifiedTime() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// A response headers policy configuration.
	ResponseHeadersPolicyConfig() interface{}
	SetResponseHeadersPolicyConfig(val interface{})
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

A response headers policy.

A response headers policy contains information about a set of HTTP response headers.

After you create a response headers policy, you can use its ID to attach it to one or more cache behaviors in a CloudFront distribution. When it's attached to a cache behavior, the response headers policy affects the HTTP headers that CloudFront includes in HTTP responses to requests that match the cache behavior. CloudFront adds or removes response headers according to the configuration of the response headers policy.

For more information, see [Adding or removing HTTP headers in CloudFront responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/modifying-response-headers.html) in the *Amazon CloudFront Developer Guide* .

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnResponseHeadersPolicy := awscdk.Aws_cloudfront.NewCfnResponseHeadersPolicy(this, jsii.String("MyCfnResponseHeadersPolicy"), &CfnResponseHeadersPolicyProps{
	ResponseHeadersPolicyConfig: &ResponseHeadersPolicyConfigProperty{
		Name: jsii.String("name"),

		// the properties below are optional
		Comment: jsii.String("comment"),
		CorsConfig: &CorsConfigProperty{
			AccessControlAllowCredentials: jsii.Boolean(false),
			AccessControlAllowHeaders: &AccessControlAllowHeadersProperty{
				Items: []*string{
					jsii.String("items"),
				},
			},
			AccessControlAllowMethods: &AccessControlAllowMethodsProperty{
				Items: []*string{
					jsii.String("items"),
				},
			},
			AccessControlAllowOrigins: &AccessControlAllowOriginsProperty{
				Items: []*string{
					jsii.String("items"),
				},
			},
			OriginOverride: jsii.Boolean(false),

			// the properties below are optional
			AccessControlExposeHeaders: &AccessControlExposeHeadersProperty{
				Items: []*string{
					jsii.String("items"),
				},
			},
			AccessControlMaxAgeSec: jsii.Number(123),
		},
		CustomHeadersConfig: &CustomHeadersConfigProperty{
			Items: []interface{}{
				&CustomHeaderProperty{
					Header: jsii.String("header"),
					Override: jsii.Boolean(false),
					Value: jsii.String("value"),
				},
			},
		},
		RemoveHeadersConfig: &RemoveHeadersConfigProperty{
			Items: []interface{}{
				&RemoveHeaderProperty{
					Header: jsii.String("header"),
				},
			},
		},
		SecurityHeadersConfig: &SecurityHeadersConfigProperty{
			ContentSecurityPolicy: &ContentSecurityPolicyProperty{
				ContentSecurityPolicy: jsii.String("contentSecurityPolicy"),
				Override: jsii.Boolean(false),
			},
			ContentTypeOptions: &ContentTypeOptionsProperty{
				Override: jsii.Boolean(false),
			},
			FrameOptions: &FrameOptionsProperty{
				FrameOption: jsii.String("frameOption"),
				Override: jsii.Boolean(false),
			},
			ReferrerPolicy: &ReferrerPolicyProperty{
				Override: jsii.Boolean(false),
				ReferrerPolicy: jsii.String("referrerPolicy"),
			},
			StrictTransportSecurity: &StrictTransportSecurityProperty{
				AccessControlMaxAgeSec: jsii.Number(123),
				Override: jsii.Boolean(false),

				// the properties below are optional
				IncludeSubdomains: jsii.Boolean(false),
				Preload: jsii.Boolean(false),
			},
			XssProtection: &XSSProtectionProperty{
				Override: jsii.Boolean(false),
				Protection: jsii.Boolean(false),

				// the properties below are optional
				ModeBlock: jsii.Boolean(false),
				ReportUri: jsii.String("reportUri"),
			},
		},
		ServerTimingHeadersConfig: &ServerTimingHeadersConfigProperty{
			Enabled: jsii.Boolean(false),

			// the properties below are optional
			SamplingRate: jsii.Number(123),
		},
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-responseheaderspolicy.html

func NewCfnResponseHeadersPolicy

func NewCfnResponseHeadersPolicy(scope constructs.Construct, id *string, props *CfnResponseHeadersPolicyProps) CfnResponseHeadersPolicy

type CfnResponseHeadersPolicyProps

type CfnResponseHeadersPolicyProps struct {
	// A response headers policy configuration.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-responseheaderspolicy.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig
	//
	ResponseHeadersPolicyConfig interface{} `field:"required" json:"responseHeadersPolicyConfig" yaml:"responseHeadersPolicyConfig"`
}

Properties for defining a `CfnResponseHeadersPolicy`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnResponseHeadersPolicyProps := &CfnResponseHeadersPolicyProps{
	ResponseHeadersPolicyConfig: &ResponseHeadersPolicyConfigProperty{
		Name: jsii.String("name"),

		// the properties below are optional
		Comment: jsii.String("comment"),
		CorsConfig: &CorsConfigProperty{
			AccessControlAllowCredentials: jsii.Boolean(false),
			AccessControlAllowHeaders: &AccessControlAllowHeadersProperty{
				Items: []*string{
					jsii.String("items"),
				},
			},
			AccessControlAllowMethods: &AccessControlAllowMethodsProperty{
				Items: []*string{
					jsii.String("items"),
				},
			},
			AccessControlAllowOrigins: &AccessControlAllowOriginsProperty{
				Items: []*string{
					jsii.String("items"),
				},
			},
			OriginOverride: jsii.Boolean(false),

			// the properties below are optional
			AccessControlExposeHeaders: &AccessControlExposeHeadersProperty{
				Items: []*string{
					jsii.String("items"),
				},
			},
			AccessControlMaxAgeSec: jsii.Number(123),
		},
		CustomHeadersConfig: &CustomHeadersConfigProperty{
			Items: []interface{}{
				&CustomHeaderProperty{
					Header: jsii.String("header"),
					Override: jsii.Boolean(false),
					Value: jsii.String("value"),
				},
			},
		},
		RemoveHeadersConfig: &RemoveHeadersConfigProperty{
			Items: []interface{}{
				&RemoveHeaderProperty{
					Header: jsii.String("header"),
				},
			},
		},
		SecurityHeadersConfig: &SecurityHeadersConfigProperty{
			ContentSecurityPolicy: &ContentSecurityPolicyProperty{
				ContentSecurityPolicy: jsii.String("contentSecurityPolicy"),
				Override: jsii.Boolean(false),
			},
			ContentTypeOptions: &ContentTypeOptionsProperty{
				Override: jsii.Boolean(false),
			},
			FrameOptions: &FrameOptionsProperty{
				FrameOption: jsii.String("frameOption"),
				Override: jsii.Boolean(false),
			},
			ReferrerPolicy: &ReferrerPolicyProperty{
				Override: jsii.Boolean(false),
				ReferrerPolicy: jsii.String("referrerPolicy"),
			},
			StrictTransportSecurity: &StrictTransportSecurityProperty{
				AccessControlMaxAgeSec: jsii.Number(123),
				Override: jsii.Boolean(false),

				// the properties below are optional
				IncludeSubdomains: jsii.Boolean(false),
				Preload: jsii.Boolean(false),
			},
			XssProtection: &XSSProtectionProperty{
				Override: jsii.Boolean(false),
				Protection: jsii.Boolean(false),

				// the properties below are optional
				ModeBlock: jsii.Boolean(false),
				ReportUri: jsii.String("reportUri"),
			},
		},
		ServerTimingHeadersConfig: &ServerTimingHeadersConfigProperty{
			Enabled: jsii.Boolean(false),

			// the properties below are optional
			SamplingRate: jsii.Number(123),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-responseheaderspolicy.html

type CfnResponseHeadersPolicy_AccessControlAllowHeadersProperty

type CfnResponseHeadersPolicy_AccessControlAllowHeadersProperty struct {
	// The list of HTTP header names.
	//
	// You can specify `*` to allow all headers.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolallowheaders.html#cfn-cloudfront-responseheaderspolicy-accesscontrolallowheaders-items
	//
	Items *[]*string `field:"required" json:"items" yaml:"items"`
}

A list of HTTP header names that CloudFront includes as values for the `Access-Control-Allow-Headers` HTTP response header.

For more information about the `Access-Control-Allow-Headers` HTTP response header, see [Access-Control-Allow-Headers](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

accessControlAllowHeadersProperty := &AccessControlAllowHeadersProperty{
	Items: []*string{
		jsii.String("items"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolallowheaders.html

type CfnResponseHeadersPolicy_AccessControlAllowMethodsProperty

type CfnResponseHeadersPolicy_AccessControlAllowMethodsProperty struct {
	// The list of HTTP methods. Valid values are:.
	//
	// - `GET`
	// - `DELETE`
	// - `HEAD`
	// - `OPTIONS`
	// - `PATCH`
	// - `POST`
	// - `PUT`
	// - `ALL`
	//
	// `ALL` is a special value that includes all of the listed HTTP methods.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolallowmethods.html#cfn-cloudfront-responseheaderspolicy-accesscontrolallowmethods-items
	//
	Items *[]*string `field:"required" json:"items" yaml:"items"`
}

A list of HTTP methods that CloudFront includes as values for the `Access-Control-Allow-Methods` HTTP response header.

For more information about the `Access-Control-Allow-Methods` HTTP response header, see [Access-Control-Allow-Methods](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

accessControlAllowMethodsProperty := &AccessControlAllowMethodsProperty{
	Items: []*string{
		jsii.String("items"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolallowmethods.html

type CfnResponseHeadersPolicy_AccessControlAllowOriginsProperty

type CfnResponseHeadersPolicy_AccessControlAllowOriginsProperty struct {
	// The list of origins (domain names).
	//
	// You can specify `*` to allow all origins.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolalloworigins.html#cfn-cloudfront-responseheaderspolicy-accesscontrolalloworigins-items
	//
	Items *[]*string `field:"required" json:"items" yaml:"items"`
}

A list of origins (domain names) that CloudFront can use as the value for the `Access-Control-Allow-Origin` HTTP response header.

For more information about the `Access-Control-Allow-Origin` HTTP response header, see [Access-Control-Allow-Origin](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

accessControlAllowOriginsProperty := &AccessControlAllowOriginsProperty{
	Items: []*string{
		jsii.String("items"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolalloworigins.html

type CfnResponseHeadersPolicy_AccessControlExposeHeadersProperty

type CfnResponseHeadersPolicy_AccessControlExposeHeadersProperty struct {
	// The list of HTTP headers.
	//
	// You can specify `*` to expose all headers.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolexposeheaders.html#cfn-cloudfront-responseheaderspolicy-accesscontrolexposeheaders-items
	//
	Items *[]*string `field:"required" json:"items" yaml:"items"`
}

A list of HTTP headers that CloudFront includes as values for the `Access-Control-Expose-Headers` HTTP response header.

For more information about the `Access-Control-Expose-Headers` HTTP response header, see [Access-Control-Expose-Headers](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

accessControlExposeHeadersProperty := &AccessControlExposeHeadersProperty{
	Items: []*string{
		jsii.String("items"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-accesscontrolexposeheaders.html

type CfnResponseHeadersPolicy_ContentSecurityPolicyProperty

type CfnResponseHeadersPolicy_ContentSecurityPolicyProperty struct {
	// The policy directives and their values that CloudFront includes as values for the `Content-Security-Policy` HTTP response header.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-contentsecuritypolicy.html#cfn-cloudfront-responseheaderspolicy-contentsecuritypolicy-contentsecuritypolicy
	//
	ContentSecurityPolicy *string `field:"required" json:"contentSecurityPolicy" yaml:"contentSecurityPolicy"`
	// A Boolean that determines whether CloudFront overrides the `Content-Security-Policy` HTTP response header received from the origin with the one specified in this response headers policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-contentsecuritypolicy.html#cfn-cloudfront-responseheaderspolicy-contentsecuritypolicy-override
	//
	Override interface{} `field:"required" json:"override" yaml:"override"`
}

The policy directives and their values that CloudFront includes as values for the `Content-Security-Policy` HTTP response header.

For more information about the `Content-Security-Policy` HTTP response header, see [Content-Security-Policy](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

contentSecurityPolicyProperty := &ContentSecurityPolicyProperty{
	ContentSecurityPolicy: jsii.String("contentSecurityPolicy"),
	Override: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-contentsecuritypolicy.html

type CfnResponseHeadersPolicy_ContentTypeOptionsProperty

type CfnResponseHeadersPolicy_ContentTypeOptionsProperty struct {
	// A Boolean that determines whether CloudFront overrides the `X-Content-Type-Options` HTTP response header received from the origin with the one specified in this response headers policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-contenttypeoptions.html#cfn-cloudfront-responseheaderspolicy-contenttypeoptions-override
	//
	Override interface{} `field:"required" json:"override" yaml:"override"`
}

Determines whether CloudFront includes the `X-Content-Type-Options` HTTP response header with its value set to `nosniff` .

For more information about the `X-Content-Type-Options` HTTP response header, see [X-Content-Type-Options](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

contentTypeOptionsProperty := &ContentTypeOptionsProperty{
	Override: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-contenttypeoptions.html

type CfnResponseHeadersPolicy_CorsConfigProperty

type CfnResponseHeadersPolicy_CorsConfigProperty struct {
	// A Boolean that CloudFront uses as the value for the `Access-Control-Allow-Credentials` HTTP response header.
	//
	// For more information about the `Access-Control-Allow-Credentials` HTTP response header, see [Access-Control-Allow-Credentials](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolallowcredentials
	//
	AccessControlAllowCredentials interface{} `field:"required" json:"accessControlAllowCredentials" yaml:"accessControlAllowCredentials"`
	// A list of HTTP header names that CloudFront includes as values for the `Access-Control-Allow-Headers` HTTP response header.
	//
	// For more information about the `Access-Control-Allow-Headers` HTTP response header, see [Access-Control-Allow-Headers](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolallowheaders
	//
	AccessControlAllowHeaders interface{} `field:"required" json:"accessControlAllowHeaders" yaml:"accessControlAllowHeaders"`
	// A list of HTTP methods that CloudFront includes as values for the `Access-Control-Allow-Methods` HTTP response header.
	//
	// For more information about the `Access-Control-Allow-Methods` HTTP response header, see [Access-Control-Allow-Methods](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolallowmethods
	//
	AccessControlAllowMethods interface{} `field:"required" json:"accessControlAllowMethods" yaml:"accessControlAllowMethods"`
	// A list of origins (domain names) that CloudFront can use as the value for the `Access-Control-Allow-Origin` HTTP response header.
	//
	// For more information about the `Access-Control-Allow-Origin` HTTP response header, see [Access-Control-Allow-Origin](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolalloworigins
	//
	AccessControlAllowOrigins interface{} `field:"required" json:"accessControlAllowOrigins" yaml:"accessControlAllowOrigins"`
	// A Boolean that determines whether CloudFront overrides HTTP response headers received from the origin with the ones specified in this response headers policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-originoverride
	//
	OriginOverride interface{} `field:"required" json:"originOverride" yaml:"originOverride"`
	// A list of HTTP headers that CloudFront includes as values for the `Access-Control-Expose-Headers` HTTP response header.
	//
	// For more information about the `Access-Control-Expose-Headers` HTTP response header, see [Access-Control-Expose-Headers](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolexposeheaders
	//
	AccessControlExposeHeaders interface{} `field:"optional" json:"accessControlExposeHeaders" yaml:"accessControlExposeHeaders"`
	// A number that CloudFront uses as the value for the `Access-Control-Max-Age` HTTP response header.
	//
	// For more information about the `Access-Control-Max-Age` HTTP response header, see [Access-Control-Max-Age](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html#cfn-cloudfront-responseheaderspolicy-corsconfig-accesscontrolmaxagesec
	//
	AccessControlMaxAgeSec *float64 `field:"optional" json:"accessControlMaxAgeSec" yaml:"accessControlMaxAgeSec"`
}

A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).

CloudFront adds these headers to HTTP responses that it sends for CORS requests that match a cache behavior associated with this response headers policy.

For more information about CORS, see [Cross-Origin Resource Sharing (CORS)](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

corsConfigProperty := &CorsConfigProperty{
	AccessControlAllowCredentials: jsii.Boolean(false),
	AccessControlAllowHeaders: &AccessControlAllowHeadersProperty{
		Items: []*string{
			jsii.String("items"),
		},
	},
	AccessControlAllowMethods: &AccessControlAllowMethodsProperty{
		Items: []*string{
			jsii.String("items"),
		},
	},
	AccessControlAllowOrigins: &AccessControlAllowOriginsProperty{
		Items: []*string{
			jsii.String("items"),
		},
	},
	OriginOverride: jsii.Boolean(false),

	// the properties below are optional
	AccessControlExposeHeaders: &AccessControlExposeHeadersProperty{
		Items: []*string{
			jsii.String("items"),
		},
	},
	AccessControlMaxAgeSec: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-corsconfig.html

type CfnResponseHeadersPolicy_CustomHeaderProperty

type CfnResponseHeadersPolicy_CustomHeaderProperty struct {
	// The HTTP response header name.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheader.html#cfn-cloudfront-responseheaderspolicy-customheader-header
	//
	Header *string `field:"required" json:"header" yaml:"header"`
	// A Boolean that determines whether CloudFront overrides a response header with the same name received from the origin with the header specified here.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheader.html#cfn-cloudfront-responseheaderspolicy-customheader-override
	//
	Override interface{} `field:"required" json:"override" yaml:"override"`
	// The value for the HTTP response header.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheader.html#cfn-cloudfront-responseheaderspolicy-customheader-value
	//
	Value *string `field:"required" json:"value" yaml:"value"`
}

An HTTP response header name and its value.

CloudFront includes this header in HTTP responses that it sends for requests that match a cache behavior that's associated with this response headers policy.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

customHeaderProperty := &CustomHeaderProperty{
	Header: jsii.String("header"),
	Override: jsii.Boolean(false),
	Value: jsii.String("value"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheader.html

type CfnResponseHeadersPolicy_CustomHeadersConfigProperty

type CfnResponseHeadersPolicy_CustomHeadersConfigProperty struct {
	// The list of HTTP response headers and their values.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheadersconfig.html#cfn-cloudfront-responseheaderspolicy-customheadersconfig-items
	//
	Items interface{} `field:"required" json:"items" yaml:"items"`
}

A list of HTTP response header names and their values.

CloudFront includes these headers in HTTP responses that it sends for requests that match a cache behavior that's associated with this response headers policy.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

customHeadersConfigProperty := &CustomHeadersConfigProperty{
	Items: []interface{}{
		&CustomHeaderProperty{
			Header: jsii.String("header"),
			Override: jsii.Boolean(false),
			Value: jsii.String("value"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-customheadersconfig.html

type CfnResponseHeadersPolicy_FrameOptionsProperty

type CfnResponseHeadersPolicy_FrameOptionsProperty struct {
	// The value of the `X-Frame-Options` HTTP response header. Valid values are `DENY` and `SAMEORIGIN` .
	//
	// For more information about these values, see [X-Frame-Options](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-frameoptions.html#cfn-cloudfront-responseheaderspolicy-frameoptions-frameoption
	//
	FrameOption *string `field:"required" json:"frameOption" yaml:"frameOption"`
	// A Boolean that determines whether CloudFront overrides the `X-Frame-Options` HTTP response header received from the origin with the one specified in this response headers policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-frameoptions.html#cfn-cloudfront-responseheaderspolicy-frameoptions-override
	//
	Override interface{} `field:"required" json:"override" yaml:"override"`
}

Determines whether CloudFront includes the `X-Frame-Options` HTTP response header and the header's value.

For more information about the `X-Frame-Options` HTTP response header, see [X-Frame-Options](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

frameOptionsProperty := &FrameOptionsProperty{
	FrameOption: jsii.String("frameOption"),
	Override: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-frameoptions.html

type CfnResponseHeadersPolicy_ReferrerPolicyProperty

type CfnResponseHeadersPolicy_ReferrerPolicyProperty struct {
	// A Boolean that determines whether CloudFront overrides the `Referrer-Policy` HTTP response header received from the origin with the one specified in this response headers policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-referrerpolicy.html#cfn-cloudfront-responseheaderspolicy-referrerpolicy-override
	//
	Override interface{} `field:"required" json:"override" yaml:"override"`
	// The value of the `Referrer-Policy` HTTP response header. Valid values are:.
	//
	// - `no-referrer`
	// - `no-referrer-when-downgrade`
	// - `origin`
	// - `origin-when-cross-origin`
	// - `same-origin`
	// - `strict-origin`
	// - `strict-origin-when-cross-origin`
	// - `unsafe-url`
	//
	// For more information about these values, see [Referrer-Policy](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-referrerpolicy.html#cfn-cloudfront-responseheaderspolicy-referrerpolicy-referrerpolicy
	//
	ReferrerPolicy *string `field:"required" json:"referrerPolicy" yaml:"referrerPolicy"`
}

Determines whether CloudFront includes the `Referrer-Policy` HTTP response header and the header's value.

For more information about the `Referrer-Policy` HTTP response header, see [Referrer-Policy](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

referrerPolicyProperty := &ReferrerPolicyProperty{
	Override: jsii.Boolean(false),
	ReferrerPolicy: jsii.String("referrerPolicy"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-referrerpolicy.html

type CfnResponseHeadersPolicy_RemoveHeaderProperty added in v2.58.1

type CfnResponseHeadersPolicy_RemoveHeaderProperty struct {
	// The HTTP header name.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-removeheader.html#cfn-cloudfront-responseheaderspolicy-removeheader-header
	//
	Header *string `field:"required" json:"header" yaml:"header"`
}

The name of an HTTP header that CloudFront removes from HTTP responses to requests that match the cache behavior that this response headers policy is attached to.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

removeHeaderProperty := &RemoveHeaderProperty{
	Header: jsii.String("header"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-removeheader.html

type CfnResponseHeadersPolicy_RemoveHeadersConfigProperty added in v2.58.1

type CfnResponseHeadersPolicy_RemoveHeadersConfigProperty struct {
	// The list of HTTP header names.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-removeheadersconfig.html#cfn-cloudfront-responseheaderspolicy-removeheadersconfig-items
	//
	Items interface{} `field:"required" json:"items" yaml:"items"`
}

A list of HTTP header names that CloudFront removes from HTTP responses to requests that match the cache behavior that this response headers policy is attached to.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

removeHeadersConfigProperty := &RemoveHeadersConfigProperty{
	Items: []interface{}{
		&RemoveHeaderProperty{
			Header: jsii.String("header"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-removeheadersconfig.html

type CfnResponseHeadersPolicy_ResponseHeadersPolicyConfigProperty

type CfnResponseHeadersPolicy_ResponseHeadersPolicyConfigProperty struct {
	// A name to identify the response headers policy.
	//
	// The name must be unique for response headers policies in this AWS account .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-name
	//
	Name *string `field:"required" json:"name" yaml:"name"`
	// A comment to describe the response headers policy.
	//
	// The comment cannot be longer than 128 characters.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-comment
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-corsconfig
	//
	CorsConfig interface{} `field:"optional" json:"corsConfig" yaml:"corsConfig"`
	// A configuration for a set of custom HTTP response headers.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-customheadersconfig
	//
	CustomHeadersConfig interface{} `field:"optional" json:"customHeadersConfig" yaml:"customHeadersConfig"`
	// A configuration for a set of HTTP headers to remove from the HTTP response.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-removeheadersconfig
	//
	RemoveHeadersConfig interface{} `field:"optional" json:"removeHeadersConfig" yaml:"removeHeadersConfig"`
	// A configuration for a set of security-related HTTP response headers.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-securityheadersconfig
	//
	SecurityHeadersConfig interface{} `field:"optional" json:"securityHeadersConfig" yaml:"securityHeadersConfig"`
	// A configuration for enabling the `Server-Timing` header in HTTP responses sent from CloudFront.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html#cfn-cloudfront-responseheaderspolicy-responseheaderspolicyconfig-servertimingheadersconfig
	//
	ServerTimingHeadersConfig interface{} `field:"optional" json:"serverTimingHeadersConfig" yaml:"serverTimingHeadersConfig"`
}

A response headers policy configuration.

A response headers policy configuration contains metadata about the response headers policy, and configurations for sets of HTTP response headers.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

responseHeadersPolicyConfigProperty := &ResponseHeadersPolicyConfigProperty{
	Name: jsii.String("name"),

	// the properties below are optional
	Comment: jsii.String("comment"),
	CorsConfig: &CorsConfigProperty{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: &AccessControlAllowHeadersProperty{
			Items: []*string{
				jsii.String("items"),
			},
		},
		AccessControlAllowMethods: &AccessControlAllowMethodsProperty{
			Items: []*string{
				jsii.String("items"),
			},
		},
		AccessControlAllowOrigins: &AccessControlAllowOriginsProperty{
			Items: []*string{
				jsii.String("items"),
			},
		},
		OriginOverride: jsii.Boolean(false),

		// the properties below are optional
		AccessControlExposeHeaders: &AccessControlExposeHeadersProperty{
			Items: []*string{
				jsii.String("items"),
			},
		},
		AccessControlMaxAgeSec: jsii.Number(123),
	},
	CustomHeadersConfig: &CustomHeadersConfigProperty{
		Items: []interface{}{
			&CustomHeaderProperty{
				Header: jsii.String("header"),
				Override: jsii.Boolean(false),
				Value: jsii.String("value"),
			},
		},
	},
	RemoveHeadersConfig: &RemoveHeadersConfigProperty{
		Items: []interface{}{
			&RemoveHeaderProperty{
				Header: jsii.String("header"),
			},
		},
	},
	SecurityHeadersConfig: &SecurityHeadersConfigProperty{
		ContentSecurityPolicy: &ContentSecurityPolicyProperty{
			ContentSecurityPolicy: jsii.String("contentSecurityPolicy"),
			Override: jsii.Boolean(false),
		},
		ContentTypeOptions: &ContentTypeOptionsProperty{
			Override: jsii.Boolean(false),
		},
		FrameOptions: &FrameOptionsProperty{
			FrameOption: jsii.String("frameOption"),
			Override: jsii.Boolean(false),
		},
		ReferrerPolicy: &ReferrerPolicyProperty{
			Override: jsii.Boolean(false),
			ReferrerPolicy: jsii.String("referrerPolicy"),
		},
		StrictTransportSecurity: &StrictTransportSecurityProperty{
			AccessControlMaxAgeSec: jsii.Number(123),
			Override: jsii.Boolean(false),

			// the properties below are optional
			IncludeSubdomains: jsii.Boolean(false),
			Preload: jsii.Boolean(false),
		},
		XssProtection: &XSSProtectionProperty{
			Override: jsii.Boolean(false),
			Protection: jsii.Boolean(false),

			// the properties below are optional
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("reportUri"),
		},
	},
	ServerTimingHeadersConfig: &ServerTimingHeadersConfigProperty{
		Enabled: jsii.Boolean(false),

		// the properties below are optional
		SamplingRate: jsii.Number(123),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html

type CfnResponseHeadersPolicy_SecurityHeadersConfigProperty

type CfnResponseHeadersPolicy_SecurityHeadersConfigProperty struct {
	// The policy directives and their values that CloudFront includes as values for the `Content-Security-Policy` HTTP response header.
	//
	// For more information about the `Content-Security-Policy` HTTP response header, see [Content-Security-Policy](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-contentsecuritypolicy
	//
	ContentSecurityPolicy interface{} `field:"optional" json:"contentSecurityPolicy" yaml:"contentSecurityPolicy"`
	// Determines whether CloudFront includes the `X-Content-Type-Options` HTTP response header with its value set to `nosniff` .
	//
	// For more information about the `X-Content-Type-Options` HTTP response header, see [X-Content-Type-Options](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-contenttypeoptions
	//
	ContentTypeOptions interface{} `field:"optional" json:"contentTypeOptions" yaml:"contentTypeOptions"`
	// Determines whether CloudFront includes the `X-Frame-Options` HTTP response header and the header's value.
	//
	// For more information about the `X-Frame-Options` HTTP response header, see [X-Frame-Options](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-frameoptions
	//
	FrameOptions interface{} `field:"optional" json:"frameOptions" yaml:"frameOptions"`
	// Determines whether CloudFront includes the `Referrer-Policy` HTTP response header and the header's value.
	//
	// For more information about the `Referrer-Policy` HTTP response header, see [Referrer-Policy](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-referrerpolicy
	//
	ReferrerPolicy interface{} `field:"optional" json:"referrerPolicy" yaml:"referrerPolicy"`
	// Determines whether CloudFront includes the `Strict-Transport-Security` HTTP response header and the header's value.
	//
	// For more information about the `Strict-Transport-Security` HTTP response header, see [Security headers](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/understanding-response-headers-policies.html#understanding-response-headers-policies-security) in the *Amazon CloudFront Developer Guide* and [Strict-Transport-Security](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-stricttransportsecurity
	//
	StrictTransportSecurity interface{} `field:"optional" json:"strictTransportSecurity" yaml:"strictTransportSecurity"`
	// Determines whether CloudFront includes the `X-XSS-Protection` HTTP response header and the header's value.
	//
	// For more information about the `X-XSS-Protection` HTTP response header, see [X-XSS-Protection](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html#cfn-cloudfront-responseheaderspolicy-securityheadersconfig-xssprotection
	//
	XssProtection interface{} `field:"optional" json:"xssProtection" yaml:"xssProtection"`
}

A configuration for a set of security-related HTTP response headers.

CloudFront adds these headers to HTTP responses that it sends for requests that match a cache behavior associated with this response headers policy.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

securityHeadersConfigProperty := &SecurityHeadersConfigProperty{
	ContentSecurityPolicy: &ContentSecurityPolicyProperty{
		ContentSecurityPolicy: jsii.String("contentSecurityPolicy"),
		Override: jsii.Boolean(false),
	},
	ContentTypeOptions: &ContentTypeOptionsProperty{
		Override: jsii.Boolean(false),
	},
	FrameOptions: &FrameOptionsProperty{
		FrameOption: jsii.String("frameOption"),
		Override: jsii.Boolean(false),
	},
	ReferrerPolicy: &ReferrerPolicyProperty{
		Override: jsii.Boolean(false),
		ReferrerPolicy: jsii.String("referrerPolicy"),
	},
	StrictTransportSecurity: &StrictTransportSecurityProperty{
		AccessControlMaxAgeSec: jsii.Number(123),
		Override: jsii.Boolean(false),

		// the properties below are optional
		IncludeSubdomains: jsii.Boolean(false),
		Preload: jsii.Boolean(false),
	},
	XssProtection: &XSSProtectionProperty{
		Override: jsii.Boolean(false),
		Protection: jsii.Boolean(false),

		// the properties below are optional
		ModeBlock: jsii.Boolean(false),
		ReportUri: jsii.String("reportUri"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-securityheadersconfig.html

type CfnResponseHeadersPolicy_ServerTimingHeadersConfigProperty added in v2.42.0

type CfnResponseHeadersPolicy_ServerTimingHeadersConfigProperty struct {
	// A Boolean that determines whether CloudFront adds the `Server-Timing` header to HTTP responses that it sends in response to requests that match a cache behavior that's associated with this response headers policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-servertimingheadersconfig.html#cfn-cloudfront-responseheaderspolicy-servertimingheadersconfig-enabled
	//
	Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"`
	// A number 0–100 (inclusive) that specifies the percentage of responses that you want CloudFront to add the `Server-Timing` header to.
	//
	// When you set the sampling rate to 100, CloudFront adds the `Server-Timing` header to the HTTP response for every request that matches the cache behavior that this response headers policy is attached to. When you set it to 50, CloudFront adds the header to 50% of the responses for requests that match the cache behavior. You can set the sampling rate to any number 0–100 with up to four decimal places.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-servertimingheadersconfig.html#cfn-cloudfront-responseheaderspolicy-servertimingheadersconfig-samplingrate
	//
	SamplingRate *float64 `field:"optional" json:"samplingRate" yaml:"samplingRate"`
}

A configuration for enabling the `Server-Timing` header in HTTP responses sent from CloudFront.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

serverTimingHeadersConfigProperty := &ServerTimingHeadersConfigProperty{
	Enabled: jsii.Boolean(false),

	// the properties below are optional
	SamplingRate: jsii.Number(123),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-servertimingheadersconfig.html

type CfnResponseHeadersPolicy_StrictTransportSecurityProperty

type CfnResponseHeadersPolicy_StrictTransportSecurityProperty struct {
	// A number that CloudFront uses as the value for the `max-age` directive in the `Strict-Transport-Security` HTTP response header.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-stricttransportsecurity.html#cfn-cloudfront-responseheaderspolicy-stricttransportsecurity-accesscontrolmaxagesec
	//
	AccessControlMaxAgeSec *float64 `field:"required" json:"accessControlMaxAgeSec" yaml:"accessControlMaxAgeSec"`
	// A Boolean that determines whether CloudFront overrides the `Strict-Transport-Security` HTTP response header received from the origin with the one specified in this response headers policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-stricttransportsecurity.html#cfn-cloudfront-responseheaderspolicy-stricttransportsecurity-override
	//
	Override interface{} `field:"required" json:"override" yaml:"override"`
	// A Boolean that determines whether CloudFront includes the `includeSubDomains` directive in the `Strict-Transport-Security` HTTP response header.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-stricttransportsecurity.html#cfn-cloudfront-responseheaderspolicy-stricttransportsecurity-includesubdomains
	//
	IncludeSubdomains interface{} `field:"optional" json:"includeSubdomains" yaml:"includeSubdomains"`
	// A Boolean that determines whether CloudFront includes the `preload` directive in the `Strict-Transport-Security` HTTP response header.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-stricttransportsecurity.html#cfn-cloudfront-responseheaderspolicy-stricttransportsecurity-preload
	//
	Preload interface{} `field:"optional" json:"preload" yaml:"preload"`
}

Determines whether CloudFront includes the `Strict-Transport-Security` HTTP response header and the header's value.

For more information about the `Strict-Transport-Security` HTTP response header, see [Strict-Transport-Security](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

strictTransportSecurityProperty := &StrictTransportSecurityProperty{
	AccessControlMaxAgeSec: jsii.Number(123),
	Override: jsii.Boolean(false),

	// the properties below are optional
	IncludeSubdomains: jsii.Boolean(false),
	Preload: jsii.Boolean(false),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-stricttransportsecurity.html

type CfnResponseHeadersPolicy_XSSProtectionProperty

type CfnResponseHeadersPolicy_XSSProtectionProperty struct {
	// A Boolean that determines whether CloudFront overrides the `X-XSS-Protection` HTTP response header received from the origin with the one specified in this response headers policy.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-xssprotection.html#cfn-cloudfront-responseheaderspolicy-xssprotection-override
	//
	Override interface{} `field:"required" json:"override" yaml:"override"`
	// A Boolean that determines the value of the `X-XSS-Protection` HTTP response header.
	//
	// When this setting is `true` , the value of the `X-XSS-Protection` header is `1` . When this setting is `false` , the value of the `X-XSS-Protection` header is `0` .
	//
	// For more information about these settings, see [X-XSS-Protection](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-xssprotection.html#cfn-cloudfront-responseheaderspolicy-xssprotection-protection
	//
	Protection interface{} `field:"required" json:"protection" yaml:"protection"`
	// A Boolean that determines whether CloudFront includes the `mode=block` directive in the `X-XSS-Protection` header.
	//
	// For more information about this directive, see [X-XSS-Protection](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-xssprotection.html#cfn-cloudfront-responseheaderspolicy-xssprotection-modeblock
	//
	ModeBlock interface{} `field:"optional" json:"modeBlock" yaml:"modeBlock"`
	// A reporting URI, which CloudFront uses as the value of the `report` directive in the `X-XSS-Protection` header.
	//
	// You cannot specify a `ReportUri` when `ModeBlock` is `true` .
	//
	// For more information about using a reporting URL, see [X-XSS-Protection](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection) in the MDN Web Docs.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-xssprotection.html#cfn-cloudfront-responseheaderspolicy-xssprotection-reporturi
	//
	ReportUri *string `field:"optional" json:"reportUri" yaml:"reportUri"`
}

Determines whether CloudFront includes the `X-XSS-Protection` HTTP response header and the header's value.

For more information about the `X-XSS-Protection` HTTP response header, see [X-XSS-Protection](https://docs.aws.amazon.com/https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection) in the MDN Web Docs.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

xSSProtectionProperty := &XSSProtectionProperty{
	Override: jsii.Boolean(false),
	Protection: jsii.Boolean(false),

	// the properties below are optional
	ModeBlock: jsii.Boolean(false),
	ReportUri: jsii.String("reportUri"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-xssprotection.html

type CfnStreamingDistribution

type CfnStreamingDistribution interface {
	awscdk.CfnResource
	awscdk.IInspectable
	awscdk.ITaggable
	// The domain name of the resource, such as `d111111abcdef8.cloudfront.net` .
	AttrDomainName() *string
	AttrId() *string
	// Options for this resource, such as condition, update policy etc.
	CfnOptions() awscdk.ICfnResourceOptions
	CfnProperties() *map[string]interface{}
	// AWS resource type.
	CfnResourceType() *string
	// Returns: the stack trace of the point where this Resource was created from, sourced
	// from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most
	// node +internal+ entries filtered.
	CreationStack() *[]*string
	// The logical ID for this CloudFormation stack element.
	//
	// The logical ID of the element
	// is calculated from the path of the resource node in the construct tree.
	//
	// To override this value, use `overrideLogicalId(newLogicalId)`.
	//
	// Returns: the logical ID as a stringified token. This value will only get
	// resolved during synthesis.
	LogicalId() *string
	// The tree node.
	Node() constructs.Node
	// Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.
	//
	// If, by any chance, the intrinsic reference of a resource is not a string, you could
	// coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`.
	Ref() *string
	// The stack in which this element is defined.
	//
	// CfnElements must be defined within a stack scope (directly or indirectly).
	Stack() awscdk.Stack
	// The current configuration information for the RTMP distribution.
	StreamingDistributionConfig() interface{}
	SetStreamingDistributionConfig(val interface{})
	// Tag Manager which manages the tags for this resource.
	Tags() awscdk.TagManager
	// A complex type that contains zero or more `Tag` elements.
	TagsRaw() *[]*awscdk.CfnTag
	SetTagsRaw(val *[]*awscdk.CfnTag)
	// Deprecated.
	// Deprecated: use `updatedProperties`
	//
	// Return properties modified after initiation
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperites() *map[string]interface{}
	// Return properties modified after initiation.
	//
	// Resources that expose mutable properties should override this function to
	// collect and return the properties object for this resource.
	UpdatedProperties() *map[string]interface{}
	// Syntactic sugar for `addOverride(path, undefined)`.
	AddDeletionOverride(path *string)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	//
	// This can be used for resources across stacks (or nested stack) boundaries
	// and the dependency will automatically be transferred to the relevant scope.
	AddDependency(target awscdk.CfnResource)
	// Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
	// Deprecated: use addDependency.
	AddDependsOn(target awscdk.CfnResource)
	// Add a value to the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	AddMetadata(key *string, value interface{})
	// Adds an override to the synthesized CloudFormation resource.
	//
	// To add a
	// property override, either use `addPropertyOverride` or prefix `path` with
	// "Properties." (i.e. `Properties.TopicName`).
	//
	// If the override is nested, separate each nested level using a dot (.) in the path parameter.
	// If there is an array as part of the nesting, specify the index in the path.
	//
	// To include a literal `.` in the property name, prefix with a `\`. In most
	// programming languages you will need to write this as `"\\."` because the
	// `\` itself will need to be escaped.
	//
	// For example,
	// “`typescript
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
	// cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
	// “`
	// would add the overrides
	// “`json
	// "Properties": {
	//   "GlobalSecondaryIndexes": [
	//     {
	//       "Projection": {
	//         "NonKeyAttributes": [ "myattribute" ]
	//         ...
	//       }
	//       ...
	//     },
	//     {
	//       "ProjectionType": "INCLUDE"
	//       ...
	//     },
	//   ]
	//   ...
	// }
	// “`
	//
	// The `value` argument to `addOverride` will not be processed or translated
	// in any way. Pass raw JSON values in here with the correct capitalization
	// for CloudFormation. If you pass CDK classes or structs, they will be
	// rendered with lowercased key names, and CloudFormation will reject the
	// template.
	AddOverride(path *string, value interface{})
	// Adds an override that deletes the value of a property from the resource definition.
	AddPropertyDeletionOverride(propertyPath *string)
	// Adds an override to a resource property.
	//
	// Syntactic sugar for `addOverride("Properties.<...>", value)`.
	AddPropertyOverride(propertyPath *string, value interface{})
	// Sets the deletion policy of the resource based on the removal policy specified.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some
	// cases, a snapshot can be taken of the resource prior to deletion
	// (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy
	// can be found in the following link:.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options
	//
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions)
	// Returns a token for an runtime attribute of this resource.
	//
	// Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility
	// in case there is no generated attribute.
	GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference
	// Retrieve a value value from the CloudFormation Resource Metadata.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
	//
	// Note that this is a different set of metadata from CDK node metadata; this
	// metadata ends up in the stack template under the resource, whereas CDK
	// node metadata ends up in the Cloud Assembly.
	//
	GetMetadata(key *string) interface{}
	// Examines the CloudFormation resource and discloses attributes.
	Inspect(inspector awscdk.TreeInspector)
	// Retrieves an array of resources this resource depends on.
	//
	// This assembles dependencies on resources across stacks (including nested stacks)
	// automatically.
	ObtainDependencies() *[]interface{}
	// Get a shallow copy of dependencies between this resource and other resources in the same stack.
	ObtainResourceDependencies() *[]awscdk.CfnResource
	// Overrides the auto-generated logical ID with a specific ID.
	OverrideLogicalId(newLogicalId *string)
	// Indicates that this resource no longer depends on another resource.
	//
	// This can be used for resources across stacks (including nested stacks)
	// and the dependency will automatically be removed from the relevant scope.
	RemoveDependency(target awscdk.CfnResource)
	RenderProperties(props *map[string]interface{}) *map[string]interface{}
	// Replaces one dependency with another.
	ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource)
	// Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template.
	//
	// Returns: `true` if the resource should be included or `false` is the resource
	// should be omitted.
	ShouldSynthesize() *bool
	// Returns a string representation of this construct.
	//
	// Returns: a string representation of this resource.
	ToString() *string
	ValidateProperties(_properties interface{})
}

This resource is deprecated.

Amazon CloudFront is deprecating real-time messaging protocol (RTMP) distributions on December 31, 2020. For more information, [read the announcement](https://docs.aws.amazon.com/ann.jspa?annID=7356) on the Amazon CloudFront discussion forum.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnStreamingDistribution := awscdk.Aws_cloudfront.NewCfnStreamingDistribution(this, jsii.String("MyCfnStreamingDistribution"), &CfnStreamingDistributionProps{
	StreamingDistributionConfig: &StreamingDistributionConfigProperty{
		Comment: jsii.String("comment"),
		Enabled: jsii.Boolean(false),
		S3Origin: &S3OriginProperty{
			DomainName: jsii.String("domainName"),
			OriginAccessIdentity: jsii.String("originAccessIdentity"),
		},
		TrustedSigners: &TrustedSignersProperty{
			Enabled: jsii.Boolean(false),

			// the properties below are optional
			AwsAccountNumbers: []*string{
				jsii.String("awsAccountNumbers"),
			},
		},

		// the properties below are optional
		Aliases: []*string{
			jsii.String("aliases"),
		},
		Logging: &LoggingProperty{
			Bucket: jsii.String("bucket"),
			Enabled: jsii.Boolean(false),
			Prefix: jsii.String("prefix"),
		},
		PriceClass: jsii.String("priceClass"),
	},

	// the properties below are optional
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
})

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-streamingdistribution.html

func NewCfnStreamingDistribution

func NewCfnStreamingDistribution(scope constructs.Construct, id *string, props *CfnStreamingDistributionProps) CfnStreamingDistribution

type CfnStreamingDistributionProps

type CfnStreamingDistributionProps struct {
	// The current configuration information for the RTMP distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-streamingdistribution.html#cfn-cloudfront-streamingdistribution-streamingdistributionconfig
	//
	StreamingDistributionConfig interface{} `field:"required" json:"streamingDistributionConfig" yaml:"streamingDistributionConfig"`
	// A complex type that contains zero or more `Tag` elements.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-streamingdistribution.html#cfn-cloudfront-streamingdistribution-tags
	//
	Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"`
}

Properties for defining a `CfnStreamingDistribution`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnStreamingDistributionProps := &CfnStreamingDistributionProps{
	StreamingDistributionConfig: &StreamingDistributionConfigProperty{
		Comment: jsii.String("comment"),
		Enabled: jsii.Boolean(false),
		S3Origin: &S3OriginProperty{
			DomainName: jsii.String("domainName"),
			OriginAccessIdentity: jsii.String("originAccessIdentity"),
		},
		TrustedSigners: &TrustedSignersProperty{
			Enabled: jsii.Boolean(false),

			// the properties below are optional
			AwsAccountNumbers: []*string{
				jsii.String("awsAccountNumbers"),
			},
		},

		// the properties below are optional
		Aliases: []*string{
			jsii.String("aliases"),
		},
		Logging: &LoggingProperty{
			Bucket: jsii.String("bucket"),
			Enabled: jsii.Boolean(false),
			Prefix: jsii.String("prefix"),
		},
		PriceClass: jsii.String("priceClass"),
	},

	// the properties below are optional
	Tags: []cfnTag{
		&cfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-streamingdistribution.html

type CfnStreamingDistribution_LoggingProperty

type CfnStreamingDistribution_LoggingProperty struct {
	// The Amazon S3 bucket to store the access logs in, for example, `myawslogbucket.s3.amazonaws.com` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-logging.html#cfn-cloudfront-streamingdistribution-logging-bucket
	//
	Bucket *string `field:"required" json:"bucket" yaml:"bucket"`
	// Specifies whether you want CloudFront to save access logs to an Amazon S3 bucket.
	//
	// If you don't want to enable logging when you create a streaming distribution or if you want to disable logging for an existing streaming distribution, specify `false` for `Enabled` , and specify `empty Bucket` and `Prefix` elements. If you specify `false` for `Enabled` but you specify values for `Bucket` and `Prefix` , the values are automatically deleted.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-logging.html#cfn-cloudfront-streamingdistribution-logging-enabled
	//
	Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"`
	// An optional string that you want CloudFront to prefix to the access log filenames for this streaming distribution, for example, `myprefix/` .
	//
	// If you want to enable logging, but you don't want to specify a prefix, you still must include an empty `Prefix` element in the `Logging` element.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-logging.html#cfn-cloudfront-streamingdistribution-logging-prefix
	//
	Prefix *string `field:"required" json:"prefix" yaml:"prefix"`
}

A complex type that controls whether access logs are written for the streaming distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

loggingProperty := &LoggingProperty{
	Bucket: jsii.String("bucket"),
	Enabled: jsii.Boolean(false),
	Prefix: jsii.String("prefix"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-logging.html

type CfnStreamingDistribution_S3OriginProperty

type CfnStreamingDistribution_S3OriginProperty struct {
	// The DNS name of the Amazon S3 origin.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-s3origin.html#cfn-cloudfront-streamingdistribution-s3origin-domainname
	//
	DomainName *string `field:"required" json:"domainName" yaml:"domainName"`
	// The CloudFront origin access identity to associate with the distribution.
	//
	// Use an origin access identity to configure the distribution so that end users can only access objects in an Amazon S3 bucket through CloudFront.
	//
	// If you want end users to be able to access objects using either the CloudFront URL or the Amazon S3 URL, specify an empty `OriginAccessIdentity` element.
	//
	// To delete the origin access identity from an existing distribution, update the distribution configuration and include an empty `OriginAccessIdentity` element.
	//
	// To replace the origin access identity, update the distribution configuration and specify the new origin access identity.
	//
	// For more information, see [Using an Origin Access Identity to Restrict Access to Your Amazon S3 Content](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-s3origin.html#cfn-cloudfront-streamingdistribution-s3origin-originaccessidentity
	//
	OriginAccessIdentity *string `field:"required" json:"originAccessIdentity" yaml:"originAccessIdentity"`
}

A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your media files for distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

s3OriginProperty := &S3OriginProperty{
	DomainName: jsii.String("domainName"),
	OriginAccessIdentity: jsii.String("originAccessIdentity"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-s3origin.html

type CfnStreamingDistribution_StreamingDistributionConfigProperty

type CfnStreamingDistribution_StreamingDistributionConfigProperty struct {
	// Any comments you want to include about the streaming distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-streamingdistributionconfig.html#cfn-cloudfront-streamingdistribution-streamingdistributionconfig-comment
	//
	Comment *string `field:"required" json:"comment" yaml:"comment"`
	// Whether the streaming distribution is enabled to accept user requests for content.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-streamingdistributionconfig.html#cfn-cloudfront-streamingdistribution-streamingdistributionconfig-enabled
	//
	Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"`
	// A complex type that contains information about the Amazon S3 bucket from which you want CloudFront to get your media files for distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-streamingdistributionconfig.html#cfn-cloudfront-streamingdistribution-streamingdistributionconfig-s3origin
	//
	S3Origin interface{} `field:"required" json:"s3Origin" yaml:"s3Origin"`
	// A complex type that specifies any AWS accounts that you want to permit to create signed URLs for private content.
	//
	// If you want the distribution to use signed URLs, include this element; if you want the distribution to use public URLs, remove this element. For more information, see [Serving Private Content through CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html) in the *Amazon CloudFront Developer Guide* .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-streamingdistributionconfig.html#cfn-cloudfront-streamingdistribution-streamingdistributionconfig-trustedsigners
	//
	TrustedSigners interface{} `field:"required" json:"trustedSigners" yaml:"trustedSigners"`
	// A complex type that contains information about CNAMEs (alternate domain names), if any, for this streaming distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-streamingdistributionconfig.html#cfn-cloudfront-streamingdistribution-streamingdistributionconfig-aliases
	//
	Aliases *[]*string `field:"optional" json:"aliases" yaml:"aliases"`
	// A complex type that controls whether access logs are written for the streaming distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-streamingdistributionconfig.html#cfn-cloudfront-streamingdistribution-streamingdistributionconfig-logging
	//
	Logging interface{} `field:"optional" json:"logging" yaml:"logging"`
	// A complex type that contains information about price class for this streaming distribution.
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-streamingdistributionconfig.html#cfn-cloudfront-streamingdistribution-streamingdistributionconfig-priceclass
	//
	PriceClass *string `field:"optional" json:"priceClass" yaml:"priceClass"`
}

The RTMP distribution's configuration information.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

streamingDistributionConfigProperty := &StreamingDistributionConfigProperty{
	Comment: jsii.String("comment"),
	Enabled: jsii.Boolean(false),
	S3Origin: &S3OriginProperty{
		DomainName: jsii.String("domainName"),
		OriginAccessIdentity: jsii.String("originAccessIdentity"),
	},
	TrustedSigners: &TrustedSignersProperty{
		Enabled: jsii.Boolean(false),

		// the properties below are optional
		AwsAccountNumbers: []*string{
			jsii.String("awsAccountNumbers"),
		},
	},

	// the properties below are optional
	Aliases: []*string{
		jsii.String("aliases"),
	},
	Logging: &LoggingProperty{
		Bucket: jsii.String("bucket"),
		Enabled: jsii.Boolean(false),
		Prefix: jsii.String("prefix"),
	},
	PriceClass: jsii.String("priceClass"),
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-streamingdistributionconfig.html

type CfnStreamingDistribution_TrustedSignersProperty

type CfnStreamingDistribution_TrustedSignersProperty struct {
	// This field is `true` if any of the AWS accounts in the list are configured as trusted signers.
	//
	// If not, this field is `false` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-trustedsigners.html#cfn-cloudfront-streamingdistribution-trustedsigners-enabled
	//
	Enabled interface{} `field:"required" json:"enabled" yaml:"enabled"`
	// An AWS account number that contains active CloudFront key pairs that CloudFront can use to verify the signatures of signed URLs and signed cookies.
	//
	// If the AWS account that owns the key pairs is the same account that owns the CloudFront distribution, the value of this field is `self` .
	// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-trustedsigners.html#cfn-cloudfront-streamingdistribution-trustedsigners-awsaccountnumbers
	//
	AwsAccountNumbers *[]*string `field:"optional" json:"awsAccountNumbers" yaml:"awsAccountNumbers"`
}

A list of AWS accounts whose public keys CloudFront can use to verify the signatures of signed URLs and signed cookies.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

trustedSignersProperty := &TrustedSignersProperty{
	Enabled: jsii.Boolean(false),

	// the properties below are optional
	AwsAccountNumbers: []*string{
		jsii.String("awsAccountNumbers"),
	},
}

See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-streamingdistribution-trustedsigners.html

type CloudFrontAllowedCachedMethods

type CloudFrontAllowedCachedMethods string

Enums for the methods CloudFront can cache.

const (
	CloudFrontAllowedCachedMethods_GET_HEAD         CloudFrontAllowedCachedMethods = "GET_HEAD"
	CloudFrontAllowedCachedMethods_GET_HEAD_OPTIONS CloudFrontAllowedCachedMethods = "GET_HEAD_OPTIONS"
)

type CloudFrontAllowedMethods

type CloudFrontAllowedMethods string

An enum for the supported methods to a CloudFront distribution.

const (
	CloudFrontAllowedMethods_GET_HEAD         CloudFrontAllowedMethods = "GET_HEAD"
	CloudFrontAllowedMethods_GET_HEAD_OPTIONS CloudFrontAllowedMethods = "GET_HEAD_OPTIONS"
	CloudFrontAllowedMethods_ALL              CloudFrontAllowedMethods = "ALL"
)

type CloudFrontWebDistribution deprecated

type CloudFrontWebDistribution interface {
	awscdk.Resource
	IDistribution
	// The domain name created by CloudFront for this distribution.
	//
	// If you are using aliases for your distribution, this is the domainName your DNS records should point to.
	// (In Route53, you could create an ALIAS record to this value, for example.)
	// Deprecated: Use `Distribution` instead.
	DistributionDomainName() *string
	// The distribution ID for this distribution.
	// Deprecated: Use `Distribution` instead.
	DistributionId() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Deprecated: Use `Distribution` instead.
	Env() *awscdk.ResourceEnvironment
	// The logging bucket for this CloudFront distribution.
	//
	// If logging is not enabled for this distribution - this property will be undefined.
	// Deprecated: Use `Distribution` instead.
	LoggingBucket() awss3.IBucket
	// The tree node.
	// Deprecated: Use `Distribution` instead.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	// Deprecated: Use `Distribution` instead.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Deprecated: Use `Distribution` instead.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	// Deprecated: Use `Distribution` instead.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Deprecated: Use `Distribution` instead.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Deprecated: Use `Distribution` instead.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Deprecated: Use `Distribution` instead.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds an IAM policy statement associated with this distribution to an IAM principal's policy.
	// Deprecated: Use `Distribution` instead.
	Grant(identity awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant to create invalidations for this bucket to an IAM principal (Role/Group/User).
	// Deprecated: Use `Distribution` instead.
	GrantCreateInvalidation(identity awsiam.IGrantable) awsiam.Grant
	// Returns a string representation of this construct.
	// Deprecated: Use `Distribution` instead.
	ToString() *string
}

Amazon CloudFront is a global content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to your viewers with low latency and high transfer speeds.

CloudFront fronts user provided content and caches it at edge locations across the world.

Here's how you can use this construct:

```ts const sourceBucket = new s3.Bucket(this, 'Bucket');

const distribution = new cloudfront.CloudFrontWebDistribution(this, 'MyDistribution', {
  originConfigs: [
    {
      s3OriginSource: {
      s3BucketSource: sourceBucket,
      },
      behaviors : [ {isDefaultBehavior: true}],
    },
  ],
});

```

This will create a CloudFront distribution that uses your S3Bucket as its origin.

You can customize the distribution using additional properties from the CloudFrontWebDistributionProps interface.

Example:

var sourceBucket bucket

viewerCertificate := cloudfront.ViewerCertificate_FromIamCertificate(jsii.String("MYIAMROLEIDENTIFIER"), &ViewerCertificateOptions{
	Aliases: []*string{
		jsii.String("MYALIAS"),
	},
})

cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyCfWebDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: viewerCertificate,
})

Deprecated: Use `Distribution` instead.

func NewCloudFrontWebDistribution deprecated

func NewCloudFrontWebDistribution(scope constructs.Construct, id *string, props *CloudFrontWebDistributionProps) CloudFrontWebDistribution

Deprecated: Use `Distribution` instead.

type CloudFrontWebDistributionAttributes

type CloudFrontWebDistributionAttributes struct {
	// The distribution ID for this distribution.
	DistributionId *string `field:"required" json:"distributionId" yaml:"distributionId"`
	// The generated domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
	DomainName *string `field:"required" json:"domainName" yaml:"domainName"`
}

Attributes used to import a Distribution.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cloudFrontWebDistributionAttributes := &CloudFrontWebDistributionAttributes{
	DistributionId: jsii.String("distributionId"),
	DomainName: jsii.String("domainName"),
}

type CloudFrontWebDistributionProps

type CloudFrontWebDistributionProps struct {
	// The origin configurations for this distribution.
	//
	// Behaviors are a part of the origin.
	OriginConfigs *[]*SourceConfiguration `field:"required" json:"originConfigs" yaml:"originConfigs"`
	// A comment for this distribution in the CloudFront console.
	// Default: - No comment is added to distribution.
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// The default object to serve.
	// Default: - "index.html" is served.
	//
	DefaultRootObject *string `field:"optional" json:"defaultRootObject" yaml:"defaultRootObject"`
	// Enable or disable the distribution.
	// Default: true.
	//
	Enabled *bool `field:"optional" json:"enabled" yaml:"enabled"`
	// If your distribution should have IPv6 enabled.
	// Default: true.
	//
	EnableIpV6 *bool `field:"optional" json:"enableIpV6" yaml:"enableIpV6"`
	// How CloudFront should handle requests that are not successful (eg PageNotFound).
	//
	// By default, CloudFront does not replace HTTP status codes in the 4xx and 5xx range
	// with custom error messages. CloudFront does not cache HTTP status codes.
	// Default: - No custom error configuration.
	//
	ErrorConfigurations *[]*CfnDistribution_CustomErrorResponseProperty `field:"optional" json:"errorConfigurations" yaml:"errorConfigurations"`
	// Controls the countries in which your content is distributed.
	// Default: No geo restriction.
	//
	GeoRestriction GeoRestriction `field:"optional" json:"geoRestriction" yaml:"geoRestriction"`
	// The max supported HTTP Versions.
	// Default: HttpVersion.HTTP2
	//
	HttpVersion HttpVersion `field:"optional" json:"httpVersion" yaml:"httpVersion"`
	// Optional - if we should enable logging.
	//
	// You can pass an empty object ({}) to have us auto create a bucket for logging.
	// Omission of this property indicates no logging is to be enabled.
	// Default: - no logging is enabled by default.
	//
	LoggingConfig *LoggingConfiguration `field:"optional" json:"loggingConfig" yaml:"loggingConfig"`
	// The price class for the distribution (this impacts how many locations CloudFront uses for your distribution, and billing).
	// Default: PriceClass.PRICE_CLASS_100 the cheapest option for CloudFront is picked by default.
	//
	PriceClass PriceClass `field:"optional" json:"priceClass" yaml:"priceClass"`
	// Specifies whether you want viewers to use HTTP or HTTPS to request your objects, whether you're using an alternate domain name with HTTPS, and if so, if you're using AWS Certificate Manager (ACM) or a third-party certificate authority.
	// See: https://aws.amazon.com/premiumsupport/knowledge-center/custom-ssl-certificate-cloudfront/
	//
	// Default: ViewerCertificate.fromCloudFrontDefaultCertificate()
	//
	ViewerCertificate ViewerCertificate `field:"optional" json:"viewerCertificate" yaml:"viewerCertificate"`
	// The default viewer policy for incoming clients.
	// Default: RedirectToHTTPs.
	//
	ViewerProtocolPolicy ViewerProtocolPolicy `field:"optional" json:"viewerProtocolPolicy" yaml:"viewerProtocolPolicy"`
	// Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution.
	//
	// To specify a web ACL created using the latest version of AWS WAF, use the ACL ARN, for example
	// `arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a`.
	//
	// To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example `473e64fd-f30b-4765-81a0-62ad96dd167a`.
	// See: https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CreateDistribution.html#API_CreateDistribution_RequestParameters.
	//
	// Default: - No AWS Web Application Firewall web access control list (web ACL).
	//
	WebACLId *string `field:"optional" json:"webACLId" yaml:"webACLId"`
}

Example:

var sourceBucket bucket

viewerCertificate := cloudfront.ViewerCertificate_FromIamCertificate(jsii.String("MYIAMROLEIDENTIFIER"), &ViewerCertificateOptions{
	Aliases: []*string{
		jsii.String("MYALIAS"),
	},
})

cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyCfWebDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: viewerCertificate,
})

type CustomOriginConfig

type CustomOriginConfig struct {
	// The domain name of the custom origin.
	//
	// Should not include the path - that should be in the parent SourceConfiguration.
	DomainName *string `field:"required" json:"domainName" yaml:"domainName"`
	// The SSL versions to use when interacting with the origin.
	// Default: OriginSslPolicy.TLS_V1_2
	//
	AllowedOriginSSLVersions *[]OriginSslPolicy `field:"optional" json:"allowedOriginSSLVersions" yaml:"allowedOriginSSLVersions"`
	// The origin HTTP port.
	// Default: 80.
	//
	HttpPort *float64 `field:"optional" json:"httpPort" yaml:"httpPort"`
	// The origin HTTPS port.
	// Default: 443.
	//
	HttpsPort *float64 `field:"optional" json:"httpsPort" yaml:"httpsPort"`
	// Any additional headers to pass to the origin.
	// Default: - No additional headers are passed.
	//
	OriginHeaders *map[string]*string `field:"optional" json:"originHeaders" yaml:"originHeaders"`
	// The keep alive timeout when making calls in seconds.
	// Default: Duration.seconds(5)
	//
	OriginKeepaliveTimeout awscdk.Duration `field:"optional" json:"originKeepaliveTimeout" yaml:"originKeepaliveTimeout"`
	// The relative path to the origin root to use for sources.
	// Default: /.
	//
	OriginPath *string `field:"optional" json:"originPath" yaml:"originPath"`
	// The protocol (http or https) policy to use when interacting with the origin.
	// Default: OriginProtocolPolicy.HttpsOnly
	//
	OriginProtocolPolicy OriginProtocolPolicy `field:"optional" json:"originProtocolPolicy" yaml:"originProtocolPolicy"`
	// The read timeout when calling the origin in seconds.
	// Default: Duration.seconds(30)
	//
	OriginReadTimeout awscdk.Duration `field:"optional" json:"originReadTimeout" yaml:"originReadTimeout"`
	// When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
	// Default: - origin shield not enabled.
	//
	OriginShieldRegion *string `field:"optional" json:"originShieldRegion" yaml:"originShieldRegion"`
}

A custom origin configuration.

Example:

var sourceBucket bucket
var oai originAccessIdentity

cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyCfWebDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
				OriginAccessIdentity: oai,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
		&sourceConfiguration{
			CustomOriginSource: &CustomOriginConfig{
				DomainName: jsii.String("MYALIAS"),
			},
			Behaviors: []*behavior{
				&behavior{
					PathPattern: jsii.String("/somewhere"),
				},
			},
		},
	},
})

type Distribution

type Distribution interface {
	awscdk.Resource
	IDistribution
	// The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
	DistributionDomainName() *string
	// The distribution ID for this distribution.
	DistributionId() *string
	// The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
	DomainName() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Adds a new behavior to this distribution for the given pathPattern.
	AddBehavior(pathPattern *string, origin IOrigin, behaviorOptions *AddBehaviorOptions)
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Adds an IAM policy statement associated with this distribution to an IAM principal's policy.
	Grant(identity awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant to create invalidations for this bucket to an IAM principal (Role/Group/User).
	GrantCreateInvalidation(identity awsiam.IGrantable) awsiam.Grant
	// Return the given named metric for this Distribution.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the percentage of all viewer requests for which the response's HTTP status code is 401.
	//
	// To obtain this metric, you need to set `publishAdditionalMetrics` to `true`.
	// Default: - average over 5 minutes.
	//
	Metric401ErrorRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the percentage of all viewer requests for which the response's HTTP status code is 403.
	//
	// To obtain this metric, you need to set `publishAdditionalMetrics` to `true`.
	// Default: - average over 5 minutes.
	//
	Metric403ErrorRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the percentage of all viewer requests for which the response's HTTP status code is 404.
	//
	// To obtain this metric, you need to set `publishAdditionalMetrics` to `true`.
	// Default: - average over 5 minutes.
	//
	Metric404ErrorRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the percentage of all viewer requests for which the response's HTTP status code is 4xx.
	// Default: - average over 5 minutes.
	//
	Metric4xxErrorRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the percentage of all viewer requests for which the response's HTTP status code is 502.
	//
	// To obtain this metric, you need to set `publishAdditionalMetrics` to `true`.
	// Default: - average over 5 minutes.
	//
	Metric502ErrorRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the percentage of all viewer requests for which the response's HTTP status code is 503.
	//
	// To obtain this metric, you need to set `publishAdditionalMetrics` to `true`.
	// Default: - average over 5 minutes.
	//
	Metric503ErrorRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the percentage of all viewer requests for which the response's HTTP status code is 504.
	//
	// To obtain this metric, you need to set `publishAdditionalMetrics` to `true`.
	// Default: - average over 5 minutes.
	//
	Metric504ErrorRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the percentage of all viewer requests for which the response's HTTP status code is 5xx.
	// Default: - average over 5 minutes.
	//
	Metric5xxErrorRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the total number of bytes downloaded by viewers for GET, HEAD, and OPTIONS requests.
	// Default: - sum over 5 minutes.
	//
	MetricBytesDownloaded(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the total number of bytes that viewers uploaded to your origin with CloudFront, using POST and PUT requests.
	// Default: - sum over 5 minutes.
	//
	MetricBytesUploaded(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the percentage of all cacheable requests for which CloudFront served the content from its cache.
	//
	// HTTP POST and PUT requests, and errors, are not considered cacheable requests.
	//
	// To obtain this metric, you need to set `publishAdditionalMetrics` to `true`.
	// Default: - average over 5 minutes.
	//
	MetricCacheHitRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the total time spent from when CloudFront receives a request to when it starts providing a response to the network (not the viewer), for requests that are served from the origin, not the CloudFront cache.
	//
	// This is also known as first byte latency, or time-to-first-byte.
	//
	// To obtain this metric, you need to set `publishAdditionalMetrics` to `true`.
	// Default: - average over 5 minutes.
	//
	MetricOriginLatency(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the total number of viewer requests received by CloudFront, for all HTTP methods and for both HTTP and HTTPS requests.
	// Default: - sum over 5 minutes.
	//
	MetricRequests(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Metric for the percentage of all viewer requests for which the response's HTTP status code is 4xx or 5xx.
	// Default: - average over 5 minutes.
	//
	MetricTotalErrorRate(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Returns a string representation of this construct.
	ToString() *string
}

A CloudFront distribution with associated origin(s) and caching behavior(s).

Example:

// Adding an existing Lambda@Edge function created in a different stack
// to a CloudFront distribution.
var s3Bucket bucket

functionVersion := lambda.Version_FromVersionArn(this, jsii.String("Version"), jsii.String("arn:aws:lambda:us-east-1:123456789012:function:functionName:1"))

cloudfront.NewDistribution(this, jsii.String("distro"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(s3Bucket),
		EdgeLambdas: []edgeLambda{
			&edgeLambda{
				FunctionVersion: *FunctionVersion,
				EventType: cloudfront.LambdaEdgeEventType_VIEWER_REQUEST,
			},
		},
	},
})

func NewDistribution

func NewDistribution(scope constructs.Construct, id *string, props *DistributionProps) Distribution

type DistributionAttributes

type DistributionAttributes struct {
	// The distribution ID for this distribution.
	DistributionId *string `field:"required" json:"distributionId" yaml:"distributionId"`
	// The generated domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
	DomainName *string `field:"required" json:"domainName" yaml:"domainName"`
}

Attributes used to import a Distribution.

Example:

// Using a reference to an imported Distribution
distribution := cloudfront.Distribution_FromDistributionAttributes(this, jsii.String("ImportedDist"), &DistributionAttributes{
	DomainName: jsii.String("d111111abcdef8.cloudfront.net"),
	DistributionId: jsii.String("012345ABCDEF"),
})

type DistributionProps

type DistributionProps struct {
	// The default behavior for the distribution.
	DefaultBehavior *BehaviorOptions `field:"required" json:"defaultBehavior" yaml:"defaultBehavior"`
	// Additional behaviors for the distribution, mapped by the pathPattern that specifies which requests to apply the behavior to.
	// Default: - no additional behaviors are added.
	//
	AdditionalBehaviors *map[string]*BehaviorOptions `field:"optional" json:"additionalBehaviors" yaml:"additionalBehaviors"`
	// A certificate to associate with the distribution.
	//
	// The certificate must be located in N. Virginia (us-east-1).
	// Default: - the CloudFront wildcard certificate (*.cloudfront.net) will be used.
	//
	Certificate awscertificatemanager.ICertificate `field:"optional" json:"certificate" yaml:"certificate"`
	// Any comments you want to include about the distribution.
	// Default: - no comment.
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// The object that you want CloudFront to request from your origin (for example, index.html) when a viewer requests the root URL for your distribution. If no default object is set, the request goes to the origin's root (e.g., example.com/).
	// Default: - no default root object.
	//
	DefaultRootObject *string `field:"optional" json:"defaultRootObject" yaml:"defaultRootObject"`
	// Alternative domain names for this distribution.
	//
	// If you want to use your own domain name, such as www.example.com, instead of the cloudfront.net domain name,
	// you can add an alternate domain name to your distribution. If you attach a certificate to the distribution,
	// you should add (at least one of) the domain names of the certificate to this list.
	//
	// When you want to move a domain name between distributions, you can associate a certificate without specifying any domain names.
	// For more information, see the _Moving an alternate domain name to a different distribution_ section in the README.
	// Default: - The distribution will only support the default generated name (e.g., d111111abcdef8.cloudfront.net)
	//
	DomainNames *[]*string `field:"optional" json:"domainNames" yaml:"domainNames"`
	// Enable or disable the distribution.
	// Default: true.
	//
	Enabled *bool `field:"optional" json:"enabled" yaml:"enabled"`
	// Whether CloudFront will respond to IPv6 DNS requests with an IPv6 address.
	//
	// If you specify false, CloudFront responds to IPv6 DNS requests with the DNS response code NOERROR and with no IP addresses.
	// This allows viewers to submit a second request, for an IPv4 address for your distribution.
	// Default: true.
	//
	EnableIpv6 *bool `field:"optional" json:"enableIpv6" yaml:"enableIpv6"`
	// Enable access logging for the distribution.
	// Default: - false, unless `logBucket` is specified.
	//
	EnableLogging *bool `field:"optional" json:"enableLogging" yaml:"enableLogging"`
	// How CloudFront should handle requests that are not successful (e.g., PageNotFound).
	// Default: - No custom error responses.
	//
	ErrorResponses *[]*ErrorResponse `field:"optional" json:"errorResponses" yaml:"errorResponses"`
	// Controls the countries in which your content is distributed.
	// Default: - No geographic restrictions.
	//
	GeoRestriction GeoRestriction `field:"optional" json:"geoRestriction" yaml:"geoRestriction"`
	// Specify the maximum HTTP version that you want viewers to use to communicate with CloudFront.
	//
	// For viewers and CloudFront to use HTTP/2, viewers must support TLS 1.2 or later, and must support server name identification (SNI).
	// Default: HttpVersion.HTTP2
	//
	HttpVersion HttpVersion `field:"optional" json:"httpVersion" yaml:"httpVersion"`
	// The Amazon S3 bucket to store the access logs in.
	//
	// Make sure to set `objectOwnership` to `s3.ObjectOwnership.OBJECT_WRITER` in your custom bucket.
	// Default: - A bucket is created if `enableLogging` is true.
	//
	LogBucket awss3.IBucket `field:"optional" json:"logBucket" yaml:"logBucket"`
	// An optional string that you want CloudFront to prefix to the access log filenames for this distribution.
	// Default: - no prefix.
	//
	LogFilePrefix *string `field:"optional" json:"logFilePrefix" yaml:"logFilePrefix"`
	// Specifies whether you want CloudFront to include cookies in access logs.
	// Default: false.
	//
	LogIncludesCookies *bool `field:"optional" json:"logIncludesCookies" yaml:"logIncludesCookies"`
	// The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections.
	//
	// CloudFront serves your objects only to browsers or devices that support at
	// least the SSL version that you specify.
	// Default: - SecurityPolicyProtocol.TLS_V1_2_2021 if the '@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021' feature flag is set; otherwise, SecurityPolicyProtocol.TLS_V1_2_2019.
	//
	MinimumProtocolVersion SecurityPolicyProtocol `field:"optional" json:"minimumProtocolVersion" yaml:"minimumProtocolVersion"`
	// The price class that corresponds with the maximum price that you want to pay for CloudFront service.
	//
	// If you specify PriceClass_All, CloudFront responds to requests for your objects from all CloudFront edge locations.
	// If you specify a price class other than PriceClass_All, CloudFront serves your objects from the CloudFront edge location
	// that has the lowest latency among the edge locations in your price class.
	// Default: PriceClass.PRICE_CLASS_ALL
	//
	PriceClass PriceClass `field:"optional" json:"priceClass" yaml:"priceClass"`
	// Whether to enable additional CloudWatch metrics.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/viewing-cloudfront-metrics.html
	//
	// Default: false.
	//
	PublishAdditionalMetrics *bool `field:"optional" json:"publishAdditionalMetrics" yaml:"publishAdditionalMetrics"`
	// The SSL method CloudFront will use for your distribution.
	//
	// Server Name Indication (SNI) - is an extension to the TLS computer networking protocol by which a client indicates
	// which hostname it is attempting to connect to at the start of the handshaking process. This allows a server to present
	// multiple certificates on the same IP address and TCP port number and hence allows multiple secure (HTTPS) websites
	// (or any other service over TLS) to be served by the same IP address without requiring all those sites to use the same certificate.
	//
	// CloudFront can use SNI to host multiple distributions on the same IP - which a large majority of clients will support.
	//
	// If your clients cannot support SNI however - CloudFront can use dedicated IPs for your distribution - but there is a prorated monthly charge for
	// using this feature. By default, we use SNI - but you can optionally enable dedicated IPs (VIP).
	//
	// See the CloudFront SSL for more details about pricing : https://aws.amazon.com/cloudfront/custom-ssl-domains/
	// Default: SSLMethod.SNI
	//
	SslSupportMethod SSLMethod `field:"optional" json:"sslSupportMethod" yaml:"sslSupportMethod"`
	// Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution.
	//
	// To specify a web ACL created using the latest version of AWS WAF, use the ACL ARN, for example
	// `arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a`.
	// To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example `473e64fd-f30b-4765-81a0-62ad96dd167a`.
	// See: https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CreateDistribution.html#API_CreateDistribution_RequestParameters.
	//
	// Default: - No AWS Web Application Firewall web access control list (web ACL).
	//
	WebAclId *string `field:"optional" json:"webAclId" yaml:"webAclId"`
}

Properties for a Distribution.

Example:

// Adding an existing Lambda@Edge function created in a different stack
// to a CloudFront distribution.
var s3Bucket bucket

functionVersion := lambda.Version_FromVersionArn(this, jsii.String("Version"), jsii.String("arn:aws:lambda:us-east-1:123456789012:function:functionName:1"))

cloudfront.NewDistribution(this, jsii.String("distro"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(s3Bucket),
		EdgeLambdas: []edgeLambda{
			&edgeLambda{
				FunctionVersion: *FunctionVersion,
				EventType: cloudfront.LambdaEdgeEventType_VIEWER_REQUEST,
			},
		},
	},
})

type EdgeLambda

type EdgeLambda struct {
	// The type of event in response to which should the function be invoked.
	EventType LambdaEdgeEventType `field:"required" json:"eventType" yaml:"eventType"`
	// The version of the Lambda function that will be invoked.
	//
	// **Note**: it's not possible to use the '$LATEST' function version for Lambda@Edge!
	FunctionVersion awslambda.IVersion `field:"required" json:"functionVersion" yaml:"functionVersion"`
	// Allows a Lambda function to have read access to the body content.
	//
	// Only valid for "request" event types (`ORIGIN_REQUEST` or `VIEWER_REQUEST`).
	// See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-include-body-access.html
	// Default: false.
	//
	IncludeBody *bool `field:"optional" json:"includeBody" yaml:"includeBody"`
}

Represents a Lambda function version and event type when using Lambda@Edge.

The type of the `AddBehaviorOptions.edgeLambdas` property.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var version version

edgeLambda := &EdgeLambda{
	EventType: awscdk.Aws_cloudfront.LambdaEdgeEventType_ORIGIN_REQUEST,
	FunctionVersion: version,

	// the properties below are optional
	IncludeBody: jsii.Boolean(false),
}

type Endpoint added in v2.94.0

type Endpoint interface {
}

Represents the endpoints available for targetting within a realtime log config resource.

Example:

// Adding realtime logs config to a Cloudfront Distribution on default behavior.
import kinesis "github.com/aws/aws-cdk-go/awscdk"

var stream stream

realTimeConfig := cloudfront.NewRealtimeLogConfig(this, jsii.String("realtimeLog"), &RealtimeLogConfigProps{
	EndPoints: []endpoint{
		cloudfront.*endpoint_FromKinesisStream(stream),
	},
	Fields: []*string{
		jsii.String("timestamp"),
		jsii.String("c-ip"),
		jsii.String("time-to-first-byte"),
		jsii.String("sc-status"),
	},
	RealtimeLogConfigName: jsii.String("my-delivery-stream"),
	SamplingRate: jsii.Number(100),
})

cloudfront.NewDistribution(this, jsii.String("myCdn"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
		RealtimeLogConfig: realTimeConfig,
	},
})

func Endpoint_FromKinesisStream added in v2.94.0

func Endpoint_FromKinesisStream(stream awskinesis.IStream, role awsiam.IRole) Endpoint

Configure a Kinesis Stream Endpoint for Realtime Log Config. Default: - a role will be created and used across your endpoints.

type ErrorResponse

type ErrorResponse struct {
	// The HTTP status code for which you want to specify a custom error page and/or a caching duration.
	HttpStatus *float64 `field:"required" json:"httpStatus" yaml:"httpStatus"`
	// The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.
	//
	// If you specify a value for `responseHttpStatus`, you must also specify a value for `responsePagePath`.
	// Default: - the error code will be returned as the response code.
	//
	ResponseHttpStatus *float64 `field:"optional" json:"responseHttpStatus" yaml:"responseHttpStatus"`
	// The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the `httpStatus`, for example, /4xx-errors/403-forbidden.html.
	// Default: - the default CloudFront response is shown.
	//
	ResponsePagePath *string `field:"optional" json:"responsePagePath" yaml:"responsePagePath"`
	// The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode.
	// Default: - the default caching TTL behavior applies.
	//
	Ttl awscdk.Duration `field:"optional" json:"ttl" yaml:"ttl"`
}

Options for configuring custom error responses.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

errorResponse := &ErrorResponse{
	HttpStatus: jsii.Number(123),

	// the properties below are optional
	ResponseHttpStatus: jsii.Number(123),
	ResponsePagePath: jsii.String("responsePagePath"),
	Ttl: cdk.Duration_Minutes(jsii.Number(30)),
}

type FailoverStatusCode

type FailoverStatusCode string

HTTP status code to failover to second origin.

Example:

// Configuring origin fallback options for the CloudFrontWebDistribution
// Configuring origin fallback options for the CloudFrontWebDistribution
cloudfront.NewCloudFrontWebDistribution(this, jsii.String("ADistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: s3.Bucket_FromBucketName(this, jsii.String("aBucket"), jsii.String("myoriginbucket")),
				OriginPath: jsii.String("/"),
				OriginHeaders: map[string]*string{
					"myHeader": jsii.String("42"),
				},
				OriginShieldRegion: jsii.String("us-west-2"),
			},
			FailoverS3OriginSource: &S3OriginConfig{
				S3BucketSource: s3.Bucket_*FromBucketName(this, jsii.String("aBucketFallback"), jsii.String("myoriginbucketfallback")),
				OriginPath: jsii.String("/somewhere"),
				OriginHeaders: map[string]*string{
					"myHeader2": jsii.String("21"),
				},
				OriginShieldRegion: jsii.String("us-east-1"),
			},
			FailoverCriteriaStatusCodes: []failoverStatusCode{
				cloudfront.*failoverStatusCode_INTERNAL_SERVER_ERROR,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
})
const (
	// Forbidden (403).
	FailoverStatusCode_FORBIDDEN FailoverStatusCode = "FORBIDDEN"
	// Not found (404).
	FailoverStatusCode_NOT_FOUND FailoverStatusCode = "NOT_FOUND"
	// Internal Server Error (500).
	FailoverStatusCode_INTERNAL_SERVER_ERROR FailoverStatusCode = "INTERNAL_SERVER_ERROR"
	// Bad Gateway (502).
	FailoverStatusCode_BAD_GATEWAY FailoverStatusCode = "BAD_GATEWAY"
	// Service Unavailable (503).
	FailoverStatusCode_SERVICE_UNAVAILABLE FailoverStatusCode = "SERVICE_UNAVAILABLE"
	// Gateway Timeout (504).
	FailoverStatusCode_GATEWAY_TIMEOUT FailoverStatusCode = "GATEWAY_TIMEOUT"
)

type FileCodeOptions

type FileCodeOptions struct {
	// The path of the file to read the code from.
	FilePath *string `field:"required" json:"filePath" yaml:"filePath"`
}

Options when reading the function's code from an external file.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

fileCodeOptions := &FileCodeOptions{
	FilePath: jsii.String("filePath"),
}

type Function

type Function interface {
	awscdk.Resource
	IFunction
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// the ARN of the CloudFront function.
	FunctionArn() *string
	// the name of the CloudFront function.
	FunctionName() *string
	// the runtime of the CloudFront function.
	FunctionRuntime() *string
	// the deployment stage of the CloudFront function.
	FunctionStage() *string
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

A CloudFront Function.

Example:

store := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStore"))
cloudfront.NewFunction(this, jsii.String("Function"), &FunctionProps{
	Code: cloudfront.FunctionCode_FromInline(jsii.String("function handler(event) { return event.request }")),
	// Note that JS_2_0 must be used for Key Value Store support
	Runtime: cloudfront.FunctionRuntime_JS_2_0(),
	KeyValueStore: store,
})

func NewFunction

func NewFunction(scope constructs.Construct, id *string, props *FunctionProps) Function

type FunctionAssociation

type FunctionAssociation struct {
	// The type of event which should invoke the function.
	EventType FunctionEventType `field:"required" json:"eventType" yaml:"eventType"`
	// The CloudFront function that will be invoked.
	Function IFunction `field:"required" json:"function" yaml:"function"`
}

Represents a CloudFront function and event type when using CF Functions.

The type of the `AddBehaviorOptions.functionAssociations` property.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var function_ function

functionAssociation := &FunctionAssociation{
	EventType: awscdk.Aws_cloudfront.FunctionEventType_VIEWER_REQUEST,
	Function: function_,
}

type FunctionAttributes

type FunctionAttributes struct {
	// The ARN of the function.
	FunctionArn *string `field:"required" json:"functionArn" yaml:"functionArn"`
	// The name of the function.
	FunctionName *string `field:"required" json:"functionName" yaml:"functionName"`
	// The Runtime of the function.
	// Default: FunctionRuntime.JS_1_0
	//
	FunctionRuntime *string `field:"optional" json:"functionRuntime" yaml:"functionRuntime"`
}

Attributes of an existing CloudFront Function to import it.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

functionAttributes := &FunctionAttributes{
	FunctionArn: jsii.String("functionArn"),
	FunctionName: jsii.String("functionName"),

	// the properties below are optional
	FunctionRuntime: jsii.String("functionRuntime"),
}

type FunctionCode

type FunctionCode interface {
	// renders the function code.
	Render() *string
}

Represents the function's source code.

Example:

store := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStore"))
cloudfront.NewFunction(this, jsii.String("Function"), &FunctionProps{
	Code: cloudfront.FunctionCode_FromInline(jsii.String("function handler(event) { return event.request }")),
	// Note that JS_2_0 must be used for Key Value Store support
	Runtime: cloudfront.FunctionRuntime_JS_2_0(),
	KeyValueStore: store,
})

func FunctionCode_FromFile

func FunctionCode_FromFile(options *FileCodeOptions) FunctionCode

Code from external file for function.

Returns: code object with contents from file.

func FunctionCode_FromInline

func FunctionCode_FromInline(code *string) FunctionCode

Inline code for function.

Returns: code object with inline code.

type FunctionEventType

type FunctionEventType string

The type of events that a CloudFront function can be invoked in response to.

Example:

var s3Bucket bucket
// Add a cloudfront Function to a Distribution
cfFunction := cloudfront.NewFunction(this, jsii.String("Function"), &FunctionProps{
	Code: cloudfront.FunctionCode_FromInline(jsii.String("function handler(event) { return event.request }")),
	Runtime: cloudfront.FunctionRuntime_JS_2_0(),
})
cloudfront.NewDistribution(this, jsii.String("distro"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(s3Bucket),
		FunctionAssociations: []functionAssociation{
			&functionAssociation{
				Function: cfFunction,
				EventType: cloudfront.FunctionEventType_VIEWER_REQUEST,
			},
		},
	},
})
const (
	// The viewer-request specifies the incoming request.
	FunctionEventType_VIEWER_REQUEST FunctionEventType = "VIEWER_REQUEST"
	// The viewer-response specifies the outgoing response.
	FunctionEventType_VIEWER_RESPONSE FunctionEventType = "VIEWER_RESPONSE"
)

type FunctionProps

type FunctionProps struct {
	// The source code of the function.
	Code FunctionCode `field:"required" json:"code" yaml:"code"`
	// A flag that determines whether to automatically publish the function to the LIVE stage when it’s created.
	// Default: - true.
	//
	AutoPublish *bool `field:"optional" json:"autoPublish" yaml:"autoPublish"`
	// A comment to describe the function.
	// Default: - same as `functionName`.
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// A name to identify the function.
	// Default: - generated from the `id`.
	//
	FunctionName *string `field:"optional" json:"functionName" yaml:"functionName"`
	// The Key Value Store to associate with this function.
	//
	// In order to associate a Key Value Store, the `runtime` must be
	// `cloudfront-js-2.0` or newer.
	// Default: - no key value store is associated.
	//
	KeyValueStore IKeyValueStore `field:"optional" json:"keyValueStore" yaml:"keyValueStore"`
	// The runtime environment for the function.
	// Default: FunctionRuntime.JS_1_0 (unless `keyValueStore` is specified, then `FunctionRuntime.JS_2_0`)
	//
	Runtime FunctionRuntime `field:"optional" json:"runtime" yaml:"runtime"`
}

Properties for creating a CloudFront Function.

Example:

store := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStore"))
cloudfront.NewFunction(this, jsii.String("Function"), &FunctionProps{
	Code: cloudfront.FunctionCode_FromInline(jsii.String("function handler(event) { return event.request }")),
	// Note that JS_2_0 must be used for Key Value Store support
	Runtime: cloudfront.FunctionRuntime_JS_2_0(),
	KeyValueStore: store,
})

type FunctionRuntime added in v2.118.0

type FunctionRuntime interface {
	Value() *string
}

The function's runtime environment version.

Example:

store := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStore"))
cloudfront.NewFunction(this, jsii.String("Function"), &FunctionProps{
	Code: cloudfront.FunctionCode_FromInline(jsii.String("function handler(event) { return event.request }")),
	// Note that JS_2_0 must be used for Key Value Store support
	Runtime: cloudfront.FunctionRuntime_JS_2_0(),
	KeyValueStore: store,
})

func FunctionRuntime_Custom added in v2.118.0

func FunctionRuntime_Custom(runtimeString *string) FunctionRuntime

A custom runtime string.

Gives full control over the runtime string fragment.

func FunctionRuntime_JS_1_0 added in v2.118.0

func FunctionRuntime_JS_1_0() FunctionRuntime

func FunctionRuntime_JS_2_0 added in v2.118.0

func FunctionRuntime_JS_2_0() FunctionRuntime

type GeoRestriction

type GeoRestriction interface {
	// Two-letter, uppercase country code for a country that you want to allow/deny.
	//
	// Include one element for each country.
	// See ISO 3166-1-alpha-2 code on the *International Organization for Standardization* website.
	Locations() *[]*string
	// Specifies the restriction type to impose.
	RestrictionType() *string
}

Controls the countries in which content is distributed.

Example:

// Adding restrictions to a Cloudfront Web Distribution.
var sourceBucket bucket

cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	GeoRestriction: cloudfront.GeoRestriction_Allowlist(jsii.String("US"), jsii.String("GB")),
})

func GeoRestriction_Allowlist

func GeoRestriction_Allowlist(locations ...*string) GeoRestriction

Allow specific countries which you want CloudFront to distribute your content.

func GeoRestriction_Denylist

func GeoRestriction_Denylist(locations ...*string) GeoRestriction

Deny specific countries which you don't want CloudFront to distribute your content.

type HeadersFrameOption added in v2.1.0

type HeadersFrameOption string

Enum representing possible values of the X-Frame-Options HTTP response header.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})
const (
	// The page can only be displayed in a frame on the same origin as the page itself.
	HeadersFrameOption_DENY HeadersFrameOption = "DENY"
	// The page can only be displayed in a frame on the specified origin.
	HeadersFrameOption_SAMEORIGIN HeadersFrameOption = "SAMEORIGIN"
)

type HeadersReferrerPolicy added in v2.1.0

type HeadersReferrerPolicy string

Enum representing possible values of the Referrer-Policy HTTP response header.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})
const (
	// The referrer policy is not set.
	HeadersReferrerPolicy_NO_REFERRER HeadersReferrerPolicy = "NO_REFERRER"
	// The referrer policy is no-referrer-when-downgrade.
	HeadersReferrerPolicy_NO_REFERRER_WHEN_DOWNGRADE HeadersReferrerPolicy = "NO_REFERRER_WHEN_DOWNGRADE"
	// The referrer policy is origin.
	HeadersReferrerPolicy_ORIGIN HeadersReferrerPolicy = "ORIGIN"
	// The referrer policy is origin-when-cross-origin.
	HeadersReferrerPolicy_ORIGIN_WHEN_CROSS_ORIGIN HeadersReferrerPolicy = "ORIGIN_WHEN_CROSS_ORIGIN"
	// The referrer policy is same-origin.
	HeadersReferrerPolicy_SAME_ORIGIN HeadersReferrerPolicy = "SAME_ORIGIN"
	// The referrer policy is strict-origin.
	HeadersReferrerPolicy_STRICT_ORIGIN HeadersReferrerPolicy = "STRICT_ORIGIN"
	// The referrer policy is strict-origin-when-cross-origin.
	HeadersReferrerPolicy_STRICT_ORIGIN_WHEN_CROSS_ORIGIN HeadersReferrerPolicy = "STRICT_ORIGIN_WHEN_CROSS_ORIGIN"
	// The referrer policy is unsafe-url.
	HeadersReferrerPolicy_UNSAFE_URL HeadersReferrerPolicy = "UNSAFE_URL"
)

type HttpVersion

type HttpVersion string

Maximum HTTP version to support.

Example:

// Configure a distribution to use HTTP/2 and HTTP/3
// Configure a distribution to use HTTP/2 and HTTP/3
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
	},
	HttpVersion: cloudfront.HttpVersion_HTTP2_AND_3,
})
const (
	// HTTP 1.1.
	HttpVersion_HTTP1_1 HttpVersion = "HTTP1_1"
	// HTTP 2.
	HttpVersion_HTTP2 HttpVersion = "HTTP2"
	// HTTP 2 and HTTP 3.
	HttpVersion_HTTP2_AND_3 HttpVersion = "HTTP2_AND_3"
	// HTTP 3.
	HttpVersion_HTTP3 HttpVersion = "HTTP3"
)

type ICachePolicy

type ICachePolicy interface {
	// The ID of the cache policy.
	CachePolicyId() *string
}

Represents a Cache Policy.

func CachePolicy_AMPLIFY

func CachePolicy_AMPLIFY() ICachePolicy

func CachePolicy_CACHING_DISABLED

func CachePolicy_CACHING_DISABLED() ICachePolicy

func CachePolicy_CACHING_OPTIMIZED

func CachePolicy_CACHING_OPTIMIZED() ICachePolicy

func CachePolicy_CACHING_OPTIMIZED_FOR_UNCOMPRESSED_OBJECTS

func CachePolicy_CACHING_OPTIMIZED_FOR_UNCOMPRESSED_OBJECTS() ICachePolicy

func CachePolicy_ELEMENTAL_MEDIA_PACKAGE

func CachePolicy_ELEMENTAL_MEDIA_PACKAGE() ICachePolicy

func CachePolicy_FromCachePolicyId

func CachePolicy_FromCachePolicyId(scope constructs.Construct, id *string, cachePolicyId *string) ICachePolicy

Imports a Cache Policy from its id.

func CachePolicy_USE_ORIGIN_CACHE_CONTROL_HEADERS added in v2.151.0

func CachePolicy_USE_ORIGIN_CACHE_CONTROL_HEADERS() ICachePolicy

func CachePolicy_USE_ORIGIN_CACHE_CONTROL_HEADERS_QUERY_STRINGS added in v2.151.0

func CachePolicy_USE_ORIGIN_CACHE_CONTROL_HEADERS_QUERY_STRINGS() ICachePolicy

type IDistribution

type IDistribution interface {
	awscdk.IResource
	// Adds an IAM policy statement associated with this distribution to an IAM principal's policy.
	Grant(identity awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Grant to create invalidations for this bucket to an IAM principal (Role/Group/User).
	GrantCreateInvalidation(identity awsiam.IGrantable) awsiam.Grant
	// The domain name of the Distribution, such as d111111abcdef8.cloudfront.net.
	DistributionDomainName() *string
	// The distribution ID for this distribution.
	DistributionId() *string
}

Interface for CloudFront distributions.

func CloudFrontWebDistribution_FromDistributionAttributes

func CloudFrontWebDistribution_FromDistributionAttributes(scope constructs.Construct, id *string, attrs *CloudFrontWebDistributionAttributes) IDistribution

Creates a construct that represents an external (imported) distribution. Deprecated: Use `Distribution` instead.

func Distribution_FromDistributionAttributes

func Distribution_FromDistributionAttributes(scope constructs.Construct, id *string, attrs *DistributionAttributes) IDistribution

Creates a Distribution construct that represents an external (imported) distribution.

type IFunction

type IFunction interface {
	awscdk.IResource
	// The ARN of the function.
	FunctionArn() *string
	// The name of the function.
	FunctionName() *string
}

Represents a CloudFront Function.

func Function_FromFunctionAttributes

func Function_FromFunctionAttributes(scope constructs.Construct, id *string, attrs *FunctionAttributes) IFunction

Imports a function by its name and ARN.

type IKeyGroup

type IKeyGroup interface {
	awscdk.IResource
	// The ID of the key group.
	KeyGroupId() *string
}

Represents a Key Group.

func KeyGroup_FromKeyGroupId

func KeyGroup_FromKeyGroupId(scope constructs.Construct, id *string, keyGroupId *string) IKeyGroup

Imports a Key Group from its id.

type IKeyValueStore added in v2.118.0

type IKeyValueStore interface {
	awscdk.IResource
	// The ARN of the Key Value Store.
	KeyValueStoreArn() *string
	// The Unique ID of the Key Value Store.
	KeyValueStoreId() *string
	// The status of the Key Value Store.
	KeyValueStoreStatus() *string
}

A CloudFront Key Value Store.

func KeyValueStore_FromKeyValueStoreArn added in v2.118.0

func KeyValueStore_FromKeyValueStoreArn(scope constructs.Construct, id *string, keyValueStoreArn *string) IKeyValueStore

Import a Key Value Store using its ARN.

type IOrigin

type IOrigin interface {
	// The method called when a given Origin is added (for the first time) to a Distribution.
	Bind(scope constructs.Construct, options *OriginBindOptions) *OriginBindConfig
}

Represents the concept of a CloudFront Origin.

You provide one or more origins when creating a Distribution.

type IOriginAccessControl added in v2.156.0

type IOriginAccessControl interface {
	awscdk.IResource
	// The unique identifier of the origin access control.
	OriginAccessControlId() *string
}

Represents a CloudFront Origin Access Control.

func S3OriginAccessControl_FromOriginAccessControlId added in v2.156.0

func S3OriginAccessControl_FromOriginAccessControlId(scope constructs.Construct, id *string, originAccessControlId *string) IOriginAccessControl

Imports an S3 origin access control from its id.

type IOriginAccessIdentity

type IOriginAccessIdentity interface {
	awsiam.IGrantable
	awscdk.IResource
	// The Origin Access Identity Id (physical id) This was called originAccessIdentityName before.
	OriginAccessIdentityId() *string
	// The Origin Access Identity Id (physical id) It is misnamed and superseded by the correctly named originAccessIdentityId.
	// Deprecated: use originAccessIdentityId instead.
	OriginAccessIdentityName() *string
}

Interface for CloudFront OriginAccessIdentity.

func OriginAccessIdentity_FromOriginAccessIdentityId added in v2.31.0

func OriginAccessIdentity_FromOriginAccessIdentityId(scope constructs.Construct, id *string, originAccessIdentityId *string) IOriginAccessIdentity

Creates a OriginAccessIdentity by providing the OriginAccessIdentityId.

func OriginAccessIdentity_FromOriginAccessIdentityName

func OriginAccessIdentity_FromOriginAccessIdentityName(scope constructs.Construct, id *string, originAccessIdentityName *string) IOriginAccessIdentity

Creates a OriginAccessIdentity by providing the OriginAccessIdentityId.

It is misnamed and superseded by the correctly named fromOriginAccessIdentityId. Deprecated: use `fromOriginAccessIdentityId`.

type IOriginRequestPolicy

type IOriginRequestPolicy interface {
	// The ID of the origin request policy.
	OriginRequestPolicyId() *string
}

Represents a Origin Request Policy.

func OriginRequestPolicy_ALL_VIEWER

func OriginRequestPolicy_ALL_VIEWER() IOriginRequestPolicy

func OriginRequestPolicy_ALL_VIEWER_AND_CLOUDFRONT_2022 added in v2.56.0

func OriginRequestPolicy_ALL_VIEWER_AND_CLOUDFRONT_2022() IOriginRequestPolicy

func OriginRequestPolicy_ALL_VIEWER_EXCEPT_HOST_HEADER added in v2.72.0

func OriginRequestPolicy_ALL_VIEWER_EXCEPT_HOST_HEADER() IOriginRequestPolicy

func OriginRequestPolicy_CORS_CUSTOM_ORIGIN

func OriginRequestPolicy_CORS_CUSTOM_ORIGIN() IOriginRequestPolicy

func OriginRequestPolicy_CORS_S3_ORIGIN

func OriginRequestPolicy_CORS_S3_ORIGIN() IOriginRequestPolicy

func OriginRequestPolicy_ELEMENTAL_MEDIA_TAILOR

func OriginRequestPolicy_ELEMENTAL_MEDIA_TAILOR() IOriginRequestPolicy

func OriginRequestPolicy_FromOriginRequestPolicyId

func OriginRequestPolicy_FromOriginRequestPolicyId(scope constructs.Construct, id *string, originRequestPolicyId *string) IOriginRequestPolicy

Imports a Origin Request Policy from its id.

func OriginRequestPolicy_USER_AGENT_REFERER_HEADERS

func OriginRequestPolicy_USER_AGENT_REFERER_HEADERS() IOriginRequestPolicy

type IPublicKey

type IPublicKey interface {
	awscdk.IResource
	// The ID of the key group.
	PublicKeyId() *string
}

Represents a Public Key.

func PublicKey_FromPublicKeyId

func PublicKey_FromPublicKeyId(scope constructs.Construct, id *string, publicKeyId *string) IPublicKey

Imports a Public Key from its id.

type IRealtimeLogConfig added in v2.94.0

type IRealtimeLogConfig interface {
	awscdk.IResource
	// The arn of the realtime log config.
	RealtimeLogConfigArn() *string
	// The name of the realtime log config.
	RealtimeLogConfigName() *string
}

Represents Realtime Log Configuration.

type IResponseHeadersPolicy added in v2.1.0

type IResponseHeadersPolicy interface {
	// The ID of the response headers policy.
	ResponseHeadersPolicyId() *string
}

Represents a response headers policy.

func ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS added in v2.1.0

func ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS() IResponseHeadersPolicy

func ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS_AND_SECURITY_HEADERS added in v2.1.0

func ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS_AND_SECURITY_HEADERS() IResponseHeadersPolicy

func ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS_WITH_PREFLIGHT added in v2.1.0

func ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS_WITH_PREFLIGHT() IResponseHeadersPolicy

func ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS_WITH_PREFLIGHT_AND_SECURITY_HEADERS added in v2.1.0

func ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS_WITH_PREFLIGHT_AND_SECURITY_HEADERS() IResponseHeadersPolicy

func ResponseHeadersPolicy_FromResponseHeadersPolicyId added in v2.1.0

func ResponseHeadersPolicy_FromResponseHeadersPolicyId(scope constructs.Construct, id *string, responseHeadersPolicyId *string) IResponseHeadersPolicy

Import an existing Response Headers Policy from its ID.

func ResponseHeadersPolicy_SECURITY_HEADERS added in v2.1.0

func ResponseHeadersPolicy_SECURITY_HEADERS() IResponseHeadersPolicy

type ImportSource added in v2.118.0

type ImportSource interface {
}

The data to be imported to the key value store.

Example:

storeAsset := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStoreAsset"), &KeyValueStoreProps{
	KeyValueStoreName: jsii.String("KeyValueStoreAsset"),
	Source: cloudfront.ImportSource_FromAsset(jsii.String("path-to-data.json")),
})

storeInline := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStoreInline"), &KeyValueStoreProps{
	KeyValueStoreName: jsii.String("KeyValueStoreInline"),
	Source: cloudfront.ImportSource_FromInline(jSON.stringify(map[string][]map[string]*string{
		"data": []map[string]*string{
			map[string]*string{
				"key": jsii.String("key1"),
				"value": jsii.String("value1"),
			},
			map[string]*string{
				"key": jsii.String("key2"),
				"value": jsii.String("value2"),
			},
		},
	})),
})

func AssetImportSource_FromAsset added in v2.118.0

func AssetImportSource_FromAsset(path *string, options *awss3assets.AssetOptions) ImportSource

An import source that exists as a local file.

func AssetImportSource_FromBucket added in v2.118.0

func AssetImportSource_FromBucket(bucket awss3.IBucket, key *string) ImportSource

An import source that exists as an object in an S3 bucket.

func AssetImportSource_FromInline added in v2.137.0

func AssetImportSource_FromInline(data *string) ImportSource

An import source that uses an inline string.

func ImportSource_FromAsset added in v2.118.0

func ImportSource_FromAsset(path *string, options *awss3assets.AssetOptions) ImportSource

An import source that exists as a local file.

func ImportSource_FromBucket added in v2.118.0

func ImportSource_FromBucket(bucket awss3.IBucket, key *string) ImportSource

An import source that exists as an object in an S3 bucket.

func ImportSource_FromInline added in v2.137.0

func ImportSource_FromInline(data *string) ImportSource

An import source that uses an inline string.

func InlineImportSource_FromAsset added in v2.137.0

func InlineImportSource_FromAsset(path *string, options *awss3assets.AssetOptions) ImportSource

An import source that exists as a local file.

func InlineImportSource_FromBucket added in v2.137.0

func InlineImportSource_FromBucket(bucket awss3.IBucket, key *string) ImportSource

An import source that exists as an object in an S3 bucket.

func InlineImportSource_FromInline added in v2.137.0

func InlineImportSource_FromInline(data *string) ImportSource

An import source that uses an inline string.

func S3ImportSource_FromAsset added in v2.118.0

func S3ImportSource_FromAsset(path *string, options *awss3assets.AssetOptions) ImportSource

An import source that exists as a local file.

func S3ImportSource_FromBucket added in v2.118.0

func S3ImportSource_FromBucket(bucket awss3.IBucket, key *string) ImportSource

An import source that exists as an object in an S3 bucket.

func S3ImportSource_FromInline added in v2.137.0

func S3ImportSource_FromInline(data *string) ImportSource

An import source that uses an inline string.

type InlineImportSource added in v2.137.0

type InlineImportSource interface {
	ImportSource
	// the contents of the KeyValueStore.
	Data() *string
}

An import source from an inline string.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var dockerImage dockerImage
var grantable iGrantable
var localBundling iLocalBundling

inlineImportSource := awscdk.Aws_cloudfront.InlineImportSource_FromAsset(jsii.String("path"), &AssetOptions{
	AssetHash: jsii.String("assetHash"),
	AssetHashType: cdk.AssetHashType_SOURCE,
	Bundling: &BundlingOptions{
		Image: dockerImage,

		// the properties below are optional
		BundlingFileAccess: cdk.BundlingFileAccess_VOLUME_COPY,
		Command: []*string{
			jsii.String("command"),
		},
		Entrypoint: []*string{
			jsii.String("entrypoint"),
		},
		Environment: map[string]*string{
			"environmentKey": jsii.String("environment"),
		},
		Local: localBundling,
		Network: jsii.String("network"),
		OutputType: cdk.BundlingOutput_ARCHIVED,
		Platform: jsii.String("platform"),
		SecurityOpt: jsii.String("securityOpt"),
		User: jsii.String("user"),
		Volumes: []dockerVolume{
			&dockerVolume{
				ContainerPath: jsii.String("containerPath"),
				HostPath: jsii.String("hostPath"),

				// the properties below are optional
				Consistency: cdk.DockerVolumeConsistency_CONSISTENT,
			},
		},
		VolumesFrom: []*string{
			jsii.String("volumesFrom"),
		},
		WorkingDirectory: jsii.String("workingDirectory"),
	},
	DeployTime: jsii.Boolean(false),
	Exclude: []*string{
		jsii.String("exclude"),
	},
	FollowSymlinks: cdk.SymlinkFollowMode_NEVER,
	IgnoreMode: cdk.IgnoreMode_GLOB,
	Readers: []*iGrantable{
		grantable,
	},
})

func NewInlineImportSource added in v2.137.0

func NewInlineImportSource(data *string) InlineImportSource

type KeyGroup

type KeyGroup interface {
	awscdk.Resource
	IKeyGroup
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The ID of the key group.
	KeyGroupId() *string
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

A Key Group configuration.

Example:

// Validating signed URLs or signed cookies with Trusted Key Groups

// public key in PEM format
var publicKey string

pubKey := cloudfront.NewPublicKey(this, jsii.String("MyPubKey"), &PublicKeyProps{
	EncodedKey: publicKey,
})

keyGroup := cloudfront.NewKeyGroup(this, jsii.String("MyKeyGroup"), &KeyGroupProps{
	Items: []iPublicKey{
		pubKey,
	},
})

cloudfront.NewDistribution(this, jsii.String("Dist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
		TrustedKeyGroups: []iKeyGroup{
			keyGroup,
		},
	},
})

func NewKeyGroup

func NewKeyGroup(scope constructs.Construct, id *string, props *KeyGroupProps) KeyGroup

type KeyGroupProps

type KeyGroupProps struct {
	// A list of public keys to add to the key group.
	Items *[]IPublicKey `field:"required" json:"items" yaml:"items"`
	// A comment to describe the key group.
	// Default: - no comment.
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// A name to identify the key group.
	// Default: - generated from the `id`.
	//
	KeyGroupName *string `field:"optional" json:"keyGroupName" yaml:"keyGroupName"`
}

Properties for creating a Public Key.

Example:

// Validating signed URLs or signed cookies with Trusted Key Groups

// public key in PEM format
var publicKey string

pubKey := cloudfront.NewPublicKey(this, jsii.String("MyPubKey"), &PublicKeyProps{
	EncodedKey: publicKey,
})

keyGroup := cloudfront.NewKeyGroup(this, jsii.String("MyKeyGroup"), &KeyGroupProps{
	Items: []iPublicKey{
		pubKey,
	},
})

cloudfront.NewDistribution(this, jsii.String("Dist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
		TrustedKeyGroups: []iKeyGroup{
			keyGroup,
		},
	},
})

type KeyValueStore added in v2.118.0

type KeyValueStore interface {
	awscdk.Resource
	IKeyValueStore
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The ARN of the Key Value Store.
	KeyValueStoreArn() *string
	// The Unique ID of the Key Value Store.
	KeyValueStoreId() *string
	// The status of the Key Value Store.
	KeyValueStoreStatus() *string
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

A CloudFront Key Value Store.

Example:

store := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStore"))
cloudfront.NewFunction(this, jsii.String("Function"), &FunctionProps{
	Code: cloudfront.FunctionCode_FromInline(jsii.String("function handler(event) { return event.request }")),
	// Note that JS_2_0 must be used for Key Value Store support
	Runtime: cloudfront.FunctionRuntime_JS_2_0(),
	KeyValueStore: store,
})

func NewKeyValueStore added in v2.118.0

func NewKeyValueStore(scope constructs.Construct, id *string, props *KeyValueStoreProps) KeyValueStore

type KeyValueStoreProps added in v2.118.0

type KeyValueStoreProps struct {
	// A comment for the Key Value Store.
	// Default: No comment will be specified.
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// The unique name of the Key Value Store.
	// Default: A generated name.
	//
	KeyValueStoreName *string `field:"optional" json:"keyValueStoreName" yaml:"keyValueStoreName"`
	// The import source for the Key Value Store.
	//
	// This will populate the initial items in the Key Value Store. The
	// source data must be in a valid JSON format.
	// Default: No data will be imported to the store.
	//
	Source ImportSource `field:"optional" json:"source" yaml:"source"`
}

The properties to create a Key Value Store.

Example:

storeAsset := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStoreAsset"), &KeyValueStoreProps{
	KeyValueStoreName: jsii.String("KeyValueStoreAsset"),
	Source: cloudfront.ImportSource_FromAsset(jsii.String("path-to-data.json")),
})

storeInline := cloudfront.NewKeyValueStore(this, jsii.String("KeyValueStoreInline"), &KeyValueStoreProps{
	KeyValueStoreName: jsii.String("KeyValueStoreInline"),
	Source: cloudfront.ImportSource_FromInline(jSON.stringify(map[string][]map[string]*string{
		"data": []map[string]*string{
			map[string]*string{
				"key": jsii.String("key1"),
				"value": jsii.String("value1"),
			},
			map[string]*string{
				"key": jsii.String("key2"),
				"value": jsii.String("value2"),
			},
		},
	})),
})

type LambdaEdgeEventType

type LambdaEdgeEventType string

The type of events that a Lambda@Edge function can be invoked in response to.

Example:

var myBucket bucket
// A Lambda@Edge function added to default behavior of a Distribution
// and triggered on every request
myFunc := experimental.NewEdgeFunction(this, jsii.String("MyFunction"), &EdgeFunctionProps{
	Runtime: lambda.Runtime_NODEJS_LATEST(),
	Handler: jsii.String("index.handler"),
	Code: lambda.Code_FromAsset(path.join(__dirname, jsii.String("lambda-handler"))),
})
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(myBucket),
		EdgeLambdas: []edgeLambda{
			&edgeLambda{
				FunctionVersion: myFunc.currentVersion,
				EventType: cloudfront.LambdaEdgeEventType_VIEWER_REQUEST,
			},
		},
	},
})
const (
	// The origin-request specifies the request to the origin location (e.g. S3).
	LambdaEdgeEventType_ORIGIN_REQUEST LambdaEdgeEventType = "ORIGIN_REQUEST"
	// The origin-response specifies the response from the origin location (e.g. S3).
	LambdaEdgeEventType_ORIGIN_RESPONSE LambdaEdgeEventType = "ORIGIN_RESPONSE"
	// The viewer-request specifies the incoming request.
	LambdaEdgeEventType_VIEWER_REQUEST LambdaEdgeEventType = "VIEWER_REQUEST"
	// The viewer-response specifies the outgoing response.
	LambdaEdgeEventType_VIEWER_RESPONSE LambdaEdgeEventType = "VIEWER_RESPONSE"
)

type LambdaFunctionAssociation

type LambdaFunctionAssociation struct {
	// The lambda event type defines at which event the lambda is called during the request lifecycle.
	EventType LambdaEdgeEventType `field:"required" json:"eventType" yaml:"eventType"`
	// A version of the lambda to associate.
	LambdaFunction awslambda.IVersion `field:"required" json:"lambdaFunction" yaml:"lambdaFunction"`
	// Allows a Lambda function to have read access to the body content.
	//
	// Only valid for "request" event types (`ORIGIN_REQUEST` or `VIEWER_REQUEST`).
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-include-body-access.html
	//
	// Default: false.
	//
	IncludeBody *bool `field:"optional" json:"includeBody" yaml:"includeBody"`
}

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var version version

lambdaFunctionAssociation := &LambdaFunctionAssociation{
	EventType: awscdk.Aws_cloudfront.LambdaEdgeEventType_ORIGIN_REQUEST,
	LambdaFunction: version,

	// the properties below are optional
	IncludeBody: jsii.Boolean(false),
}

type LoggingConfiguration

type LoggingConfiguration struct {
	// Bucket to log requests to.
	// Default: - A logging bucket is automatically created.
	//
	Bucket awss3.IBucket `field:"optional" json:"bucket" yaml:"bucket"`
	// Whether to include the cookies in the logs.
	// Default: false.
	//
	IncludeCookies *bool `field:"optional" json:"includeCookies" yaml:"includeCookies"`
	// Where in the bucket to store logs.
	// Default: - No prefix.
	//
	Prefix *string `field:"optional" json:"prefix" yaml:"prefix"`
}

Logging configuration for incoming requests.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var bucket bucket

loggingConfiguration := &LoggingConfiguration{
	Bucket: bucket,
	IncludeCookies: jsii.Boolean(false),
	Prefix: jsii.String("prefix"),
}

type OriginAccessControlBaseProps added in v2.156.0

type OriginAccessControlBaseProps struct {
	// A description of the origin access control.
	// Default: - no description.
	//
	Description *string `field:"optional" json:"description" yaml:"description"`
	// A name to identify the origin access control, with a maximum length of 64 characters.
	// Default: - a generated name.
	//
	OriginAccessControlName *string `field:"optional" json:"originAccessControlName" yaml:"originAccessControlName"`
	// Specifies which requests CloudFront signs and the signing protocol.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-signingbehavior
	//
	// Default: SIGV4_ALWAYS.
	//
	Signing Signing `field:"optional" json:"signing" yaml:"signing"`
}

Common properties for creating a Origin Access Control resource.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var signing signing

originAccessControlBaseProps := &OriginAccessControlBaseProps{
	Description: jsii.String("description"),
	OriginAccessControlName: jsii.String("originAccessControlName"),
	Signing: signing,
}

type OriginAccessControlOriginType added in v2.156.0

type OriginAccessControlOriginType string

Origin types supported by Origin Access Control.

const (
	// Uses an Amazon S3 bucket origin.
	OriginAccessControlOriginType_S3 OriginAccessControlOriginType = "S3"
	// Uses a Lambda function URL origin.
	OriginAccessControlOriginType_LAMBDA OriginAccessControlOriginType = "LAMBDA"
	// Uses an AWS Elemental MediaStore origin.
	OriginAccessControlOriginType_MEDIASTORE OriginAccessControlOriginType = "MEDIASTORE"
	// Uses an AWS Elemental MediaPackage v2 origin.
	OriginAccessControlOriginType_MEDIAPACKAGEV2 OriginAccessControlOriginType = "MEDIAPACKAGEV2"
)

type OriginAccessIdentity

type OriginAccessIdentity interface {
	awscdk.Resource
	IOriginAccessIdentity
	// The Amazon S3 canonical user ID for the origin access identity, used when giving the origin access identity read permission to an object in Amazon S3.
	CloudFrontOriginAccessIdentityS3CanonicalUserId() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// Derived principal value for bucket access.
	GrantPrincipal() awsiam.IPrincipal
	// The tree node.
	Node() constructs.Node
	// The Origin Access Identity Id (physical id) This was called originAccessIdentityName before.
	OriginAccessIdentityId() *string
	// The Origin Access Identity Id (physical id) It is misnamed and superseded by the correctly named originAccessIdentityId.
	// Deprecated: use originAccessIdentityId instead.
	OriginAccessIdentityName() *string
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// The ARN to include in S3 bucket policy to allow CloudFront access.
	Arn() *string
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

An origin access identity is a special CloudFront user that you can associate with Amazon S3 origins, so that you can secure all or just some of your Amazon S3 content.

Example:

myBucket := s3.NewBucket(this, jsii.String("myBucket"))
myOai := cloudfront.NewOriginAccessIdentity(this, jsii.String("myOAI"), &OriginAccessIdentityProps{
	Comment: jsii.String("My custom OAI"),
})
s3Origin := origins.S3BucketOrigin_WithOriginAccessIdentity(myBucket, &S3BucketOriginWithOAIProps{
	OriginAccessIdentity: myOai,
})
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: s3Origin,
	},
})

func NewOriginAccessIdentity

func NewOriginAccessIdentity(scope constructs.Construct, id *string, props *OriginAccessIdentityProps) OriginAccessIdentity

type OriginAccessIdentityProps

type OriginAccessIdentityProps struct {
	// Any comments you want to include about the origin access identity.
	// Default: "Allows CloudFront to reach the bucket".
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
}

Properties of CloudFront OriginAccessIdentity.

Example:

myBucket := s3.NewBucket(this, jsii.String("myBucket"))
myOai := cloudfront.NewOriginAccessIdentity(this, jsii.String("myOAI"), &OriginAccessIdentityProps{
	Comment: jsii.String("My custom OAI"),
})
s3Origin := origins.S3BucketOrigin_WithOriginAccessIdentity(myBucket, &S3BucketOriginWithOAIProps{
	OriginAccessIdentity: myOai,
})
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: s3Origin,
	},
})

type OriginBase

type OriginBase interface {
	IOrigin
	// Binds the origin to the associated Distribution.
	//
	// Can be used to grant permissions, create dependent resources, etc.
	Bind(_scope constructs.Construct, options *OriginBindOptions) *OriginBindConfig
	RenderCustomOriginConfig() *CfnDistribution_CustomOriginConfigProperty
	RenderS3OriginConfig() *CfnDistribution_S3OriginConfigProperty
}

Represents a distribution origin, that describes the Amazon S3 bucket, HTTP server (for example, a web server), Amazon MediaStore, or other server from which CloudFront gets your files.

type OriginBindConfig

type OriginBindConfig struct {
	// The failover configuration for this Origin.
	// Default: - nothing is returned.
	//
	FailoverConfig *OriginFailoverConfig `field:"optional" json:"failoverConfig" yaml:"failoverConfig"`
	// The CloudFormation OriginProperty configuration for this Origin.
	// Default: - nothing is returned.
	//
	OriginProperty *CfnDistribution_OriginProperty `field:"optional" json:"originProperty" yaml:"originProperty"`
}

The struct returned from `IOrigin.bind`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var origin iOrigin

originBindConfig := &OriginBindConfig{
	FailoverConfig: &OriginFailoverConfig{
		FailoverOrigin: origin,

		// the properties below are optional
		StatusCodes: []*f64{
			jsii.Number(123),
		},
	},
	OriginProperty: &OriginProperty{
		DomainName: jsii.String("domainName"),
		Id: jsii.String("id"),

		// the properties below are optional
		ConnectionAttempts: jsii.Number(123),
		ConnectionTimeout: jsii.Number(123),
		CustomOriginConfig: &CustomOriginConfigProperty{
			OriginProtocolPolicy: jsii.String("originProtocolPolicy"),

			// the properties below are optional
			HttpPort: jsii.Number(123),
			HttpsPort: jsii.Number(123),
			OriginKeepaliveTimeout: jsii.Number(123),
			OriginReadTimeout: jsii.Number(123),
			OriginSslProtocols: []*string{
				jsii.String("originSslProtocols"),
			},
		},
		OriginAccessControlId: jsii.String("originAccessControlId"),
		OriginCustomHeaders: []interface{}{
			&OriginCustomHeaderProperty{
				HeaderName: jsii.String("headerName"),
				HeaderValue: jsii.String("headerValue"),
			},
		},
		OriginPath: jsii.String("originPath"),
		OriginShield: &OriginShieldProperty{
			Enabled: jsii.Boolean(false),
			OriginShieldRegion: jsii.String("originShieldRegion"),
		},
		S3OriginConfig: &S3OriginConfigProperty{
			OriginAccessIdentity: jsii.String("originAccessIdentity"),
		},
	},
}

type OriginBindOptions

type OriginBindOptions struct {
	// The identifier of this Origin, as assigned by the Distribution this Origin has been used added to.
	OriginId *string `field:"required" json:"originId" yaml:"originId"`
	// The identifier of the Distribution this Origin is used for.
	//
	// This is used to grant origin access permissions to the distribution for origin access control.
	// Default: - no distribution id.
	//
	DistributionId *string `field:"optional" json:"distributionId" yaml:"distributionId"`
}

Options passed to Origin.bind().

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

originBindOptions := &OriginBindOptions{
	OriginId: jsii.String("originId"),

	// the properties below are optional
	DistributionId: jsii.String("distributionId"),
}

type OriginFailoverConfig

type OriginFailoverConfig struct {
	// The origin to use as the fallback origin.
	FailoverOrigin IOrigin `field:"required" json:"failoverOrigin" yaml:"failoverOrigin"`
	// The HTTP status codes of the response that trigger querying the failover Origin.
	// Default: - 500, 502, 503 and 504.
	//
	StatusCodes *[]*float64 `field:"optional" json:"statusCodes" yaml:"statusCodes"`
}

The failover configuration used for Origin Groups, returned in `OriginBindConfig.failoverConfig`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var origin iOrigin

originFailoverConfig := &OriginFailoverConfig{
	FailoverOrigin: origin,

	// the properties below are optional
	StatusCodes: []*f64{
		jsii.Number(123),
	},
}

type OriginOptions added in v2.25.0

type OriginOptions struct {
	// The number of times that CloudFront attempts to connect to the origin;
	//
	// valid values are 1, 2, or 3 attempts.
	// Default: 3.
	//
	ConnectionAttempts *float64 `field:"optional" json:"connectionAttempts" yaml:"connectionAttempts"`
	// The number of seconds that CloudFront waits when trying to establish a connection to the origin.
	//
	// Valid values are 1-10 seconds, inclusive.
	// Default: Duration.seconds(10)
	//
	ConnectionTimeout awscdk.Duration `field:"optional" json:"connectionTimeout" yaml:"connectionTimeout"`
	// A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
	// Default: {}.
	//
	CustomHeaders *map[string]*string `field:"optional" json:"customHeaders" yaml:"customHeaders"`
	// The unique identifier of an origin access control for this origin.
	// Default: - no origin access control.
	//
	OriginAccessControlId *string `field:"optional" json:"originAccessControlId" yaml:"originAccessControlId"`
	// A unique identifier for the origin.
	//
	// This value must be unique within the distribution.
	// Default: - an originid will be generated for you.
	//
	OriginId *string `field:"optional" json:"originId" yaml:"originId"`
	// Origin Shield is enabled by setting originShieldRegion to a valid region, after this to disable Origin Shield again you must set this flag to false.
	// Default: - true.
	//
	OriginShieldEnabled *bool `field:"optional" json:"originShieldEnabled" yaml:"originShieldEnabled"`
	// When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html
	//
	// Default: - origin shield not enabled.
	//
	OriginShieldRegion *string `field:"optional" json:"originShieldRegion" yaml:"originShieldRegion"`
}

Options to define an Origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

originOptions := &OriginOptions{
	ConnectionAttempts: jsii.Number(123),
	ConnectionTimeout: cdk.Duration_Minutes(jsii.Number(30)),
	CustomHeaders: map[string]*string{
		"customHeadersKey": jsii.String("customHeaders"),
	},
	OriginAccessControlId: jsii.String("originAccessControlId"),
	OriginId: jsii.String("originId"),
	OriginShieldEnabled: jsii.Boolean(false),
	OriginShieldRegion: jsii.String("originShieldRegion"),
}

type OriginProps

type OriginProps struct {
	// The number of times that CloudFront attempts to connect to the origin;
	//
	// valid values are 1, 2, or 3 attempts.
	// Default: 3.
	//
	ConnectionAttempts *float64 `field:"optional" json:"connectionAttempts" yaml:"connectionAttempts"`
	// The number of seconds that CloudFront waits when trying to establish a connection to the origin.
	//
	// Valid values are 1-10 seconds, inclusive.
	// Default: Duration.seconds(10)
	//
	ConnectionTimeout awscdk.Duration `field:"optional" json:"connectionTimeout" yaml:"connectionTimeout"`
	// A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
	// Default: {}.
	//
	CustomHeaders *map[string]*string `field:"optional" json:"customHeaders" yaml:"customHeaders"`
	// The unique identifier of an origin access control for this origin.
	// Default: - no origin access control.
	//
	OriginAccessControlId *string `field:"optional" json:"originAccessControlId" yaml:"originAccessControlId"`
	// A unique identifier for the origin.
	//
	// This value must be unique within the distribution.
	// Default: - an originid will be generated for you.
	//
	OriginId *string `field:"optional" json:"originId" yaml:"originId"`
	// Origin Shield is enabled by setting originShieldRegion to a valid region, after this to disable Origin Shield again you must set this flag to false.
	// Default: - true.
	//
	OriginShieldEnabled *bool `field:"optional" json:"originShieldEnabled" yaml:"originShieldEnabled"`
	// When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html
	//
	// Default: - origin shield not enabled.
	//
	OriginShieldRegion *string `field:"optional" json:"originShieldRegion" yaml:"originShieldRegion"`
	// An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
	//
	// Must begin, but not end, with '/' (e.g., '/production/images').
	// Default: '/'.
	//
	OriginPath *string `field:"optional" json:"originPath" yaml:"originPath"`
}

Properties to define an Origin.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

originProps := &OriginProps{
	ConnectionAttempts: jsii.Number(123),
	ConnectionTimeout: cdk.Duration_Minutes(jsii.Number(30)),
	CustomHeaders: map[string]*string{
		"customHeadersKey": jsii.String("customHeaders"),
	},
	OriginAccessControlId: jsii.String("originAccessControlId"),
	OriginId: jsii.String("originId"),
	OriginPath: jsii.String("originPath"),
	OriginShieldEnabled: jsii.Boolean(false),
	OriginShieldRegion: jsii.String("originShieldRegion"),
}

type OriginProtocolPolicy

type OriginProtocolPolicy string

Defines what protocols CloudFront will use to connect to an origin.

Example:

import elbv2 "github.com/aws/aws-cdk-go/awscdk"

var loadBalancer applicationLoadBalancer

origin := origins.NewLoadBalancerV2Origin(loadBalancer, &LoadBalancerV2OriginProps{
	ConnectionAttempts: jsii.Number(3),
	ConnectionTimeout: awscdk.Duration_Seconds(jsii.Number(5)),
	ReadTimeout: awscdk.Duration_*Seconds(jsii.Number(45)),
	KeepaliveTimeout: awscdk.Duration_*Seconds(jsii.Number(45)),
	ProtocolPolicy: cloudfront.OriginProtocolPolicy_MATCH_VIEWER,
})
const (
	// Connect on HTTP only.
	OriginProtocolPolicy_HTTP_ONLY OriginProtocolPolicy = "HTTP_ONLY"
	// Connect with the same protocol as the viewer.
	OriginProtocolPolicy_MATCH_VIEWER OriginProtocolPolicy = "MATCH_VIEWER"
	// Connect on HTTPS only.
	OriginProtocolPolicy_HTTPS_ONLY OriginProtocolPolicy = "HTTPS_ONLY"
)

type OriginRequestCookieBehavior

type OriginRequestCookieBehavior interface {
	// The behavior of cookies: allow all, none or an allow list.
	Behavior() *string
	// The cookies to allow, if the behavior is an allow list.
	Cookies() *[]*string
}

Determines whether any cookies in viewer requests (and if so, which cookies) are included in requests that CloudFront sends to the origin.

Example:

// Creating a custom origin request policy for a Distribution -- all parameters optional
var bucketOrigin s3Origin

myOriginRequestPolicy := cloudfront.NewOriginRequestPolicy(this, jsii.String("OriginRequestPolicy"), &OriginRequestPolicyProps{
	OriginRequestPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CookieBehavior: cloudfront.OriginRequestCookieBehavior_None(),
	HeaderBehavior: cloudfront.OriginRequestHeaderBehavior_All(jsii.String("CloudFront-Is-Android-Viewer")),
	QueryStringBehavior: cloudfront.OriginRequestQueryStringBehavior_AllowList(jsii.String("username")),
})

cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		OriginRequestPolicy: myOriginRequestPolicy,
	},
})

func OriginRequestCookieBehavior_All

func OriginRequestCookieBehavior_All() OriginRequestCookieBehavior

All cookies in viewer requests are included in requests that CloudFront sends to the origin.

func OriginRequestCookieBehavior_AllowList

func OriginRequestCookieBehavior_AllowList(cookies ...*string) OriginRequestCookieBehavior

Only the provided `cookies` are included in requests that CloudFront sends to the origin.

func OriginRequestCookieBehavior_DenyList added in v2.88.0

func OriginRequestCookieBehavior_DenyList(cookies ...*string) OriginRequestCookieBehavior

All cookies except the provided `cookies` are included in requests that CloudFront sends to the origin.

func OriginRequestCookieBehavior_None

func OriginRequestCookieBehavior_None() OriginRequestCookieBehavior

Cookies in viewer requests are not included in requests that CloudFront sends to the origin.

Any cookies that are listed in a CachePolicy are still included in origin requests.

type OriginRequestHeaderBehavior

type OriginRequestHeaderBehavior interface {
	// The behavior of headers: allow all, none or an allow list.
	Behavior() *string
	// The headers for the allow list or the included CloudFront headers, if applicable.
	Headers() *[]*string
}

Determines whether any HTTP headers (and if so, which headers) are included in requests that CloudFront sends to the origin.

Example:

// Creating a custom origin request policy for a Distribution -- all parameters optional
var bucketOrigin s3Origin

myOriginRequestPolicy := cloudfront.NewOriginRequestPolicy(this, jsii.String("OriginRequestPolicy"), &OriginRequestPolicyProps{
	OriginRequestPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CookieBehavior: cloudfront.OriginRequestCookieBehavior_None(),
	HeaderBehavior: cloudfront.OriginRequestHeaderBehavior_All(jsii.String("CloudFront-Is-Android-Viewer")),
	QueryStringBehavior: cloudfront.OriginRequestQueryStringBehavior_AllowList(jsii.String("username")),
})

cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		OriginRequestPolicy: myOriginRequestPolicy,
	},
})

func OriginRequestHeaderBehavior_All

func OriginRequestHeaderBehavior_All(cloudfrontHeaders ...*string) OriginRequestHeaderBehavior

All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.

Additionally, any additional CloudFront headers provided are included; the additional headers are added by CloudFront. See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-cloudfront-headers.html

func OriginRequestHeaderBehavior_AllowList

func OriginRequestHeaderBehavior_AllowList(headers ...*string) OriginRequestHeaderBehavior

Listed headers are included in requests that CloudFront sends to the origin.

func OriginRequestHeaderBehavior_DenyList added in v2.88.0

func OriginRequestHeaderBehavior_DenyList(headers ...*string) OriginRequestHeaderBehavior

All headers except the provided `headers` are included in requests that CloudFront sends to the origin.

func OriginRequestHeaderBehavior_None

func OriginRequestHeaderBehavior_None() OriginRequestHeaderBehavior

HTTP headers are not included in requests that CloudFront sends to the origin.

Any headers that are listed in a CachePolicy are still included in origin requests.

type OriginRequestPolicy

type OriginRequestPolicy interface {
	awscdk.Resource
	IOriginRequestPolicy
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	Node() constructs.Node
	// The ID of the origin request policy.
	OriginRequestPolicyId() *string
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

A Origin Request Policy configuration.

Example:

// Using an existing origin request policy for a Distribution
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		OriginRequestPolicy: cloudfront.OriginRequestPolicy_CORS_S3_ORIGIN(),
	},
})

func NewOriginRequestPolicy

func NewOriginRequestPolicy(scope constructs.Construct, id *string, props *OriginRequestPolicyProps) OriginRequestPolicy

type OriginRequestPolicyProps

type OriginRequestPolicyProps struct {
	// A comment to describe the origin request policy.
	// Default: - no comment.
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// The cookies from viewer requests to include in origin requests.
	// Default: OriginRequestCookieBehavior.none()
	//
	CookieBehavior OriginRequestCookieBehavior `field:"optional" json:"cookieBehavior" yaml:"cookieBehavior"`
	// The HTTP headers to include in origin requests.
	//
	// These can include headers from viewer requests and additional headers added by CloudFront.
	// Default: OriginRequestHeaderBehavior.none()
	//
	HeaderBehavior OriginRequestHeaderBehavior `field:"optional" json:"headerBehavior" yaml:"headerBehavior"`
	// A unique name to identify the origin request policy.
	//
	// The name must only include '-', '_', or alphanumeric characters.
	// Default: - generated from the `id`.
	//
	OriginRequestPolicyName *string `field:"optional" json:"originRequestPolicyName" yaml:"originRequestPolicyName"`
	// The URL query strings from viewer requests to include in origin requests.
	// Default: OriginRequestQueryStringBehavior.none()
	//
	QueryStringBehavior OriginRequestQueryStringBehavior `field:"optional" json:"queryStringBehavior" yaml:"queryStringBehavior"`
}

Properties for creating a Origin Request Policy.

Example:

// Creating a custom origin request policy for a Distribution -- all parameters optional
var bucketOrigin s3Origin

myOriginRequestPolicy := cloudfront.NewOriginRequestPolicy(this, jsii.String("OriginRequestPolicy"), &OriginRequestPolicyProps{
	OriginRequestPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CookieBehavior: cloudfront.OriginRequestCookieBehavior_None(),
	HeaderBehavior: cloudfront.OriginRequestHeaderBehavior_All(jsii.String("CloudFront-Is-Android-Viewer")),
	QueryStringBehavior: cloudfront.OriginRequestQueryStringBehavior_AllowList(jsii.String("username")),
})

cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		OriginRequestPolicy: myOriginRequestPolicy,
	},
})

type OriginRequestQueryStringBehavior

type OriginRequestQueryStringBehavior interface {
	// The behavior of query strings -- allow all, none, or only an allow list.
	Behavior() *string
	// The query strings to allow, if the behavior is an allow list.
	QueryStrings() *[]*string
}

Determines whether any URL query strings in viewer requests (and if so, which query strings) are included in requests that CloudFront sends to the origin.

Example:

// Creating a custom origin request policy for a Distribution -- all parameters optional
var bucketOrigin s3Origin

myOriginRequestPolicy := cloudfront.NewOriginRequestPolicy(this, jsii.String("OriginRequestPolicy"), &OriginRequestPolicyProps{
	OriginRequestPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CookieBehavior: cloudfront.OriginRequestCookieBehavior_None(),
	HeaderBehavior: cloudfront.OriginRequestHeaderBehavior_All(jsii.String("CloudFront-Is-Android-Viewer")),
	QueryStringBehavior: cloudfront.OriginRequestQueryStringBehavior_AllowList(jsii.String("username")),
})

cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		OriginRequestPolicy: myOriginRequestPolicy,
	},
})

func OriginRequestQueryStringBehavior_All

func OriginRequestQueryStringBehavior_All() OriginRequestQueryStringBehavior

All query strings in viewer requests are included in requests that CloudFront sends to the origin.

func OriginRequestQueryStringBehavior_AllowList

func OriginRequestQueryStringBehavior_AllowList(queryStrings ...*string) OriginRequestQueryStringBehavior

Only the provided `queryStrings` are included in requests that CloudFront sends to the origin.

func OriginRequestQueryStringBehavior_DenyList added in v2.88.0

func OriginRequestQueryStringBehavior_DenyList(queryStrings ...*string) OriginRequestQueryStringBehavior

All query strings except the provided `queryStrings` are included in requests that CloudFront sends to the origin.

func OriginRequestQueryStringBehavior_None

func OriginRequestQueryStringBehavior_None() OriginRequestQueryStringBehavior

Query strings in viewer requests are not included in requests that CloudFront sends to the origin.

Any query strings that are listed in a CachePolicy are still included in origin requests.

type OriginSslPolicy

type OriginSslPolicy string
const (
	OriginSslPolicy_SSL_V3   OriginSslPolicy = "SSL_V3"
	OriginSslPolicy_TLS_V1   OriginSslPolicy = "TLS_V1"
	OriginSslPolicy_TLS_V1_1 OriginSslPolicy = "TLS_V1_1"
	OriginSslPolicy_TLS_V1_2 OriginSslPolicy = "TLS_V1_2"
)

type PriceClass

type PriceClass string

The price class determines how many edge locations CloudFront will use for your distribution.

See https://aws.amazon.com/cloudfront/pricing/ for full list of supported regions.

const (
	// USA, Canada, Europe, & Israel.
	PriceClass_PRICE_CLASS_100 PriceClass = "PRICE_CLASS_100"
	// PRICE_CLASS_100 + South Africa, Kenya, Middle East, Japan, Singapore, South Korea, Taiwan, Hong Kong, & Philippines.
	PriceClass_PRICE_CLASS_200 PriceClass = "PRICE_CLASS_200"
	// All locations.
	PriceClass_PRICE_CLASS_ALL PriceClass = "PRICE_CLASS_ALL"
)

type PublicKey

type PublicKey interface {
	awscdk.Resource
	IPublicKey
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The ID of the key group.
	PublicKeyId() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

A Public Key Configuration.

Example:

// Validating signed URLs or signed cookies with Trusted Key Groups

// public key in PEM format
var publicKey string

pubKey := cloudfront.NewPublicKey(this, jsii.String("MyPubKey"), &PublicKeyProps{
	EncodedKey: publicKey,
})

keyGroup := cloudfront.NewKeyGroup(this, jsii.String("MyKeyGroup"), &KeyGroupProps{
	Items: []iPublicKey{
		pubKey,
	},
})

cloudfront.NewDistribution(this, jsii.String("Dist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
		TrustedKeyGroups: []iKeyGroup{
			keyGroup,
		},
	},
})

func NewPublicKey

func NewPublicKey(scope constructs.Construct, id *string, props *PublicKeyProps) PublicKey

type PublicKeyProps

type PublicKeyProps struct {
	// The public key that you can use with signed URLs and signed cookies, or with field-level encryption.
	//
	// The `encodedKey` parameter must include `-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----` lines.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/field-level-encryption.html
	//
	EncodedKey *string `field:"required" json:"encodedKey" yaml:"encodedKey"`
	// A comment to describe the public key.
	// Default: - no comment.
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// A name to identify the public key.
	// Default: - generated from the `id`.
	//
	PublicKeyName *string `field:"optional" json:"publicKeyName" yaml:"publicKeyName"`
}

Properties for creating a Public Key.

Example:

// Validating signed URLs or signed cookies with Trusted Key Groups

// public key in PEM format
var publicKey string

pubKey := cloudfront.NewPublicKey(this, jsii.String("MyPubKey"), &PublicKeyProps{
	EncodedKey: publicKey,
})

keyGroup := cloudfront.NewKeyGroup(this, jsii.String("MyKeyGroup"), &KeyGroupProps{
	Items: []iPublicKey{
		pubKey,
	},
})

cloudfront.NewDistribution(this, jsii.String("Dist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
		TrustedKeyGroups: []iKeyGroup{
			keyGroup,
		},
	},
})

type RealtimeLogConfig added in v2.94.0

type RealtimeLogConfig interface {
	awscdk.Resource
	IRealtimeLogConfig
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The arn of the realtime log config.
	RealtimeLogConfigArn() *string
	// The name of the realtime log config.
	RealtimeLogConfigName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

A Realtime Log Config configuration.

Example:

// Adding realtime logs config to a Cloudfront Distribution on default behavior.
import kinesis "github.com/aws/aws-cdk-go/awscdk"

var stream stream

realTimeConfig := cloudfront.NewRealtimeLogConfig(this, jsii.String("realtimeLog"), &RealtimeLogConfigProps{
	EndPoints: []endpoint{
		cloudfront.*endpoint_FromKinesisStream(stream),
	},
	Fields: []*string{
		jsii.String("timestamp"),
		jsii.String("c-ip"),
		jsii.String("time-to-first-byte"),
		jsii.String("sc-status"),
	},
	RealtimeLogConfigName: jsii.String("my-delivery-stream"),
	SamplingRate: jsii.Number(100),
})

cloudfront.NewDistribution(this, jsii.String("myCdn"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
		RealtimeLogConfig: realTimeConfig,
	},
})

func NewRealtimeLogConfig added in v2.94.0

func NewRealtimeLogConfig(scope constructs.Construct, id *string, props *RealtimeLogConfigProps) RealtimeLogConfig

type RealtimeLogConfigProps added in v2.94.0

type RealtimeLogConfigProps struct {
	// Contains information about the Amazon Kinesis data stream where you are sending real-time log data for this real-time log configuration.
	EndPoints *[]Endpoint `field:"required" json:"endPoints" yaml:"endPoints"`
	// A list of fields that are included in each real-time log record.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-fields
	//
	Fields *[]*string `field:"required" json:"fields" yaml:"fields"`
	// The sampling rate for this real-time log configuration.
	SamplingRate *float64 `field:"required" json:"samplingRate" yaml:"samplingRate"`
	// The unique name of this real-time log configuration.
	// Default: - the unique construct ID.
	//
	RealtimeLogConfigName *string `field:"optional" json:"realtimeLogConfigName" yaml:"realtimeLogConfigName"`
}

Properties for defining a RealtimeLogConfig resource.

Example:

// Adding realtime logs config to a Cloudfront Distribution on default behavior.
import kinesis "github.com/aws/aws-cdk-go/awscdk"

var stream stream

realTimeConfig := cloudfront.NewRealtimeLogConfig(this, jsii.String("realtimeLog"), &RealtimeLogConfigProps{
	EndPoints: []endpoint{
		cloudfront.*endpoint_FromKinesisStream(stream),
	},
	Fields: []*string{
		jsii.String("timestamp"),
		jsii.String("c-ip"),
		jsii.String("time-to-first-byte"),
		jsii.String("sc-status"),
	},
	RealtimeLogConfigName: jsii.String("my-delivery-stream"),
	SamplingRate: jsii.Number(100),
})

cloudfront.NewDistribution(this, jsii.String("myCdn"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewHttpOrigin(jsii.String("www.example.com")),
		RealtimeLogConfig: realTimeConfig,
	},
})

type ResponseCustomHeader added in v2.1.0

type ResponseCustomHeader struct {
	// The HTTP response header name.
	Header *string `field:"required" json:"header" yaml:"header"`
	// A Boolean that determines whether CloudFront overrides a response header with the same name received from the origin with the header specified here.
	Override *bool `field:"required" json:"override" yaml:"override"`
	// The value for the HTTP response header.
	Value *string `field:"required" json:"value" yaml:"value"`
}

An HTTP response header name and its value.

CloudFront includes this header in HTTP responses that it sends for requests that match a cache behavior that’s associated with this response headers policy.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

responseCustomHeader := &ResponseCustomHeader{
	Header: jsii.String("header"),
	Override: jsii.Boolean(false),
	Value: jsii.String("value"),
}

type ResponseCustomHeadersBehavior added in v2.1.0

type ResponseCustomHeadersBehavior struct {
	// The list of HTTP response headers and their values.
	CustomHeaders *[]*ResponseCustomHeader `field:"required" json:"customHeaders" yaml:"customHeaders"`
}

Configuration for a set of HTTP response headers that are sent for requests that match a cache behavior that’s associated with this response headers policy.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

type ResponseHeadersContentSecurityPolicy added in v2.1.0

type ResponseHeadersContentSecurityPolicy struct {
	// The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.
	ContentSecurityPolicy *string `field:"required" json:"contentSecurityPolicy" yaml:"contentSecurityPolicy"`
	// A Boolean that determines whether CloudFront overrides the Content-Security-Policy HTTP response header received from the origin with the one specified in this response headers policy.
	Override *bool `field:"required" json:"override" yaml:"override"`
}

The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

type ResponseHeadersContentTypeOptions added in v2.1.0

type ResponseHeadersContentTypeOptions struct {
	// A Boolean that determines whether CloudFront overrides the X-Content-Type-Options HTTP response header received from the origin with the one specified in this response headers policy.
	Override *bool `field:"required" json:"override" yaml:"override"`
}

Determines whether CloudFront includes the X-Content-Type-Options HTTP response header with its value set to nosniff.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

type ResponseHeadersCorsBehavior added in v2.1.0

type ResponseHeadersCorsBehavior struct {
	// A Boolean that CloudFront uses as the value for the Access-Control-Allow-Credentials HTTP response header.
	AccessControlAllowCredentials *bool `field:"required" json:"accessControlAllowCredentials" yaml:"accessControlAllowCredentials"`
	// A list of HTTP header names that CloudFront includes as values for the Access-Control-Allow-Headers HTTP response header.
	//
	// You can specify `['*']` to allow all headers.
	AccessControlAllowHeaders *[]*string `field:"required" json:"accessControlAllowHeaders" yaml:"accessControlAllowHeaders"`
	// A list of HTTP methods that CloudFront includes as values for the Access-Control-Allow-Methods HTTP response header.
	AccessControlAllowMethods *[]*string `field:"required" json:"accessControlAllowMethods" yaml:"accessControlAllowMethods"`
	// A list of origins (domain names) that CloudFront can use as the value for the Access-Control-Allow-Origin HTTP response header.
	//
	// You can specify `['*']` to allow all origins.
	AccessControlAllowOrigins *[]*string `field:"required" json:"accessControlAllowOrigins" yaml:"accessControlAllowOrigins"`
	// A Boolean that determines whether CloudFront overrides HTTP response headers received from the origin with the ones specified in this response headers policy.
	OriginOverride *bool `field:"required" json:"originOverride" yaml:"originOverride"`
	// A list of HTTP headers that CloudFront includes as values for the Access-Control-Expose-Headers HTTP response header.
	//
	// You can specify `['*']` to expose all headers.
	// Default: - no headers exposed.
	//
	AccessControlExposeHeaders *[]*string `field:"optional" json:"accessControlExposeHeaders" yaml:"accessControlExposeHeaders"`
	// A number that CloudFront uses as the value for the Access-Control-Max-Age HTTP response header.
	// Default: - no max age.
	//
	AccessControlMaxAge awscdk.Duration `field:"optional" json:"accessControlMaxAge" yaml:"accessControlMaxAge"`
}

Configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).

CloudFront adds these headers to HTTP responses that it sends for CORS requests that match a cache behavior associated with this response headers policy.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

type ResponseHeadersFrameOptions added in v2.1.0

type ResponseHeadersFrameOptions struct {
	// The value of the X-Frame-Options HTTP response header.
	FrameOption HeadersFrameOption `field:"required" json:"frameOption" yaml:"frameOption"`
	// A Boolean that determines whether CloudFront overrides the X-Frame-Options HTTP response header received from the origin with the one specified in this response headers policy.
	Override *bool `field:"required" json:"override" yaml:"override"`
}

Determines whether CloudFront includes the X-Frame-Options HTTP response header and the header’s value.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

type ResponseHeadersPolicy added in v2.1.0

type ResponseHeadersPolicy interface {
	awscdk.Resource
	IResponseHeadersPolicy
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The ID of the response headers policy.
	ResponseHeadersPolicyId() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

A Response Headers Policy configuration.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

func NewResponseHeadersPolicy added in v2.1.0

func NewResponseHeadersPolicy(scope constructs.Construct, id *string, props *ResponseHeadersPolicyProps) ResponseHeadersPolicy

type ResponseHeadersPolicyProps added in v2.1.0

type ResponseHeadersPolicyProps struct {
	// A comment to describe the response headers policy.
	// Default: - no comment.
	//
	Comment *string `field:"optional" json:"comment" yaml:"comment"`
	// A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).
	// Default: - no cors behavior.
	//
	CorsBehavior *ResponseHeadersCorsBehavior `field:"optional" json:"corsBehavior" yaml:"corsBehavior"`
	// A configuration for a set of custom HTTP response headers.
	// Default: - no custom headers behavior.
	//
	CustomHeadersBehavior *ResponseCustomHeadersBehavior `field:"optional" json:"customHeadersBehavior" yaml:"customHeadersBehavior"`
	// A list of HTTP response headers that CloudFront removes from HTTP responses that it sends to viewers.
	// Default: - no headers are removed.
	//
	RemoveHeaders *[]*string `field:"optional" json:"removeHeaders" yaml:"removeHeaders"`
	// A unique name to identify the response headers policy.
	// Default: - generated from the `id`.
	//
	ResponseHeadersPolicyName *string `field:"optional" json:"responseHeadersPolicyName" yaml:"responseHeadersPolicyName"`
	// A configuration for a set of security-related HTTP response headers.
	// Default: - no security headers behavior.
	//
	SecurityHeadersBehavior *ResponseSecurityHeadersBehavior `field:"optional" json:"securityHeadersBehavior" yaml:"securityHeadersBehavior"`
	// The percentage of responses that you want CloudFront to add the Server-Timing header to.
	// Default: - no Server-Timing header is added to HTTP responses.
	//
	ServerTimingSamplingRate *float64 `field:"optional" json:"serverTimingSamplingRate" yaml:"serverTimingSamplingRate"`
}

Properties for creating a Response Headers Policy.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

type ResponseHeadersReferrerPolicy added in v2.1.0

type ResponseHeadersReferrerPolicy struct {
	// A Boolean that determines whether CloudFront overrides the Referrer-Policy HTTP response header received from the origin with the one specified in this response headers policy.
	Override *bool `field:"required" json:"override" yaml:"override"`
	// The value of the Referrer-Policy HTTP response header.
	ReferrerPolicy HeadersReferrerPolicy `field:"required" json:"referrerPolicy" yaml:"referrerPolicy"`
}

Determines whether CloudFront includes the Referrer-Policy HTTP response header and the header’s value.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

type ResponseHeadersStrictTransportSecurity added in v2.1.0

type ResponseHeadersStrictTransportSecurity struct {
	// A number that CloudFront uses as the value for the max-age directive in the Strict-Transport-Security HTTP response header.
	AccessControlMaxAge awscdk.Duration `field:"required" json:"accessControlMaxAge" yaml:"accessControlMaxAge"`
	// A Boolean that determines whether CloudFront overrides the Strict-Transport-Security HTTP response header received from the origin with the one specified in this response headers policy.
	Override *bool `field:"required" json:"override" yaml:"override"`
	// A Boolean that determines whether CloudFront includes the includeSubDomains directive in the Strict-Transport-Security HTTP response header.
	// Default: false.
	//
	IncludeSubdomains *bool `field:"optional" json:"includeSubdomains" yaml:"includeSubdomains"`
	// A Boolean that determines whether CloudFront includes the preload directive in the Strict-Transport-Security HTTP response header.
	// Default: false.
	//
	Preload *bool `field:"optional" json:"preload" yaml:"preload"`
}

Determines whether CloudFront includes the Strict-Transport-Security HTTP response header and the header’s value.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

type ResponseHeadersXSSProtection added in v2.1.0

type ResponseHeadersXSSProtection struct {
	// A Boolean that determines whether CloudFront overrides the X-XSS-Protection HTTP response header received from the origin with the one specified in this response headers policy.
	Override *bool `field:"required" json:"override" yaml:"override"`
	// A Boolean that determines the value of the X-XSS-Protection HTTP response header.
	//
	// When this setting is true, the value of the X-XSS-Protection header is 1.
	// When this setting is false, the value of the X-XSS-Protection header is 0.
	Protection *bool `field:"required" json:"protection" yaml:"protection"`
	// A Boolean that determines whether CloudFront includes the mode=block directive in the X-XSS-Protection header.
	// Default: false.
	//
	ModeBlock *bool `field:"optional" json:"modeBlock" yaml:"modeBlock"`
	// A reporting URI, which CloudFront uses as the value of the report directive in the X-XSS-Protection header.
	//
	// You cannot specify a ReportUri when ModeBlock is true.
	// Default: - no report uri.
	//
	ReportUri *string `field:"optional" json:"reportUri" yaml:"reportUri"`
}

Determines whether CloudFront includes the X-XSS-Protection HTTP response header and the header’s value.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

type ResponseSecurityHeadersBehavior added in v2.1.0

type ResponseSecurityHeadersBehavior struct {
	// The policy directives and their values that CloudFront includes as values for the Content-Security-Policy HTTP response header.
	// Default: - no content security policy.
	//
	ContentSecurityPolicy *ResponseHeadersContentSecurityPolicy `field:"optional" json:"contentSecurityPolicy" yaml:"contentSecurityPolicy"`
	// Determines whether CloudFront includes the X-Content-Type-Options HTTP response header with its value set to nosniff.
	// Default: - no content type options.
	//
	ContentTypeOptions *ResponseHeadersContentTypeOptions `field:"optional" json:"contentTypeOptions" yaml:"contentTypeOptions"`
	// Determines whether CloudFront includes the X-Frame-Options HTTP response header and the header’s value.
	// Default: - no frame options.
	//
	FrameOptions *ResponseHeadersFrameOptions `field:"optional" json:"frameOptions" yaml:"frameOptions"`
	// Determines whether CloudFront includes the Referrer-Policy HTTP response header and the header’s value.
	// Default: - no referrer policy.
	//
	ReferrerPolicy *ResponseHeadersReferrerPolicy `field:"optional" json:"referrerPolicy" yaml:"referrerPolicy"`
	// Determines whether CloudFront includes the Strict-Transport-Security HTTP response header and the header’s value.
	// Default: - no strict transport security.
	//
	StrictTransportSecurity *ResponseHeadersStrictTransportSecurity `field:"optional" json:"strictTransportSecurity" yaml:"strictTransportSecurity"`
	// Determines whether CloudFront includes the X-XSS-Protection HTTP response header and the header’s value.
	// Default: - no xss protection.
	//
	XssProtection *ResponseHeadersXSSProtection `field:"optional" json:"xssProtection" yaml:"xssProtection"`
}

Configuration for a set of security-related HTTP response headers.

CloudFront adds these headers to HTTP responses that it sends for requests that match a cache behavior associated with this response headers policy.

Example:

// Using an existing managed response headers policy
var bucketOrigin s3Origin

cloudfront.NewDistribution(this, jsii.String("myDistManagedPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: cloudfront.ResponseHeadersPolicy_CORS_ALLOW_ALL_ORIGINS(),
	},
})

// Creating a custom response headers policy -- all parameters optional
myResponseHeadersPolicy := cloudfront.NewResponseHeadersPolicy(this, jsii.String("ResponseHeadersPolicy"), &ResponseHeadersPolicyProps{
	ResponseHeadersPolicyName: jsii.String("MyPolicy"),
	Comment: jsii.String("A default policy"),
	CorsBehavior: &ResponseHeadersCorsBehavior{
		AccessControlAllowCredentials: jsii.Boolean(false),
		AccessControlAllowHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlAllowMethods: []*string{
			jsii.String("GET"),
			jsii.String("POST"),
		},
		AccessControlAllowOrigins: []*string{
			jsii.String("*"),
		},
		AccessControlExposeHeaders: []*string{
			jsii.String("X-Custom-Header-1"),
			jsii.String("X-Custom-Header-2"),
		},
		AccessControlMaxAge: awscdk.Duration_Seconds(jsii.Number(600)),
		OriginOverride: jsii.Boolean(true),
	},
	CustomHeadersBehavior: &ResponseCustomHeadersBehavior{
		CustomHeaders: []responseCustomHeader{
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Date"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(true),
			},
			&responseCustomHeader{
				Header: jsii.String("X-Amz-Security-Token"),
				Value: jsii.String("some-value"),
				Override: jsii.Boolean(false),
			},
		},
	},
	SecurityHeadersBehavior: &ResponseSecurityHeadersBehavior{
		ContentSecurityPolicy: &ResponseHeadersContentSecurityPolicy{
			ContentSecurityPolicy: jsii.String("default-src https:;"),
			Override: jsii.Boolean(true),
		},
		ContentTypeOptions: &ResponseHeadersContentTypeOptions{
			Override: jsii.Boolean(true),
		},
		FrameOptions: &ResponseHeadersFrameOptions{
			FrameOption: cloudfront.HeadersFrameOption_DENY,
			Override: jsii.Boolean(true),
		},
		ReferrerPolicy: &ResponseHeadersReferrerPolicy{
			ReferrerPolicy: cloudfront.HeadersReferrerPolicy_NO_REFERRER,
			Override: jsii.Boolean(true),
		},
		StrictTransportSecurity: &ResponseHeadersStrictTransportSecurity{
			AccessControlMaxAge: awscdk.Duration_*Seconds(jsii.Number(600)),
			IncludeSubdomains: jsii.Boolean(true),
			Override: jsii.Boolean(true),
		},
		XssProtection: &ResponseHeadersXSSProtection{
			Protection: jsii.Boolean(true),
			ModeBlock: jsii.Boolean(false),
			ReportUri: jsii.String("https://example.com/csp-report"),
			Override: jsii.Boolean(true),
		},
	},
	RemoveHeaders: []*string{
		jsii.String("Server"),
	},
	ServerTimingSamplingRate: jsii.Number(50),
})
cloudfront.NewDistribution(this, jsii.String("myDistCustomPolicy"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: bucketOrigin,
		ResponseHeadersPolicy: myResponseHeadersPolicy,
	},
})

type S3ImportSource added in v2.118.0

type S3ImportSource interface {
	ImportSource
	// the S3 bucket that contains the data.
	Bucket() awss3.IBucket
	// the key within the S3 bucket that contains the data.
	Key() *string
}

An import source from an S3 object.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var dockerImage dockerImage
var grantable iGrantable
var localBundling iLocalBundling

s3ImportSource := awscdk.Aws_cloudfront.S3ImportSource_FromAsset(jsii.String("path"), &AssetOptions{
	AssetHash: jsii.String("assetHash"),
	AssetHashType: cdk.AssetHashType_SOURCE,
	Bundling: &BundlingOptions{
		Image: dockerImage,

		// the properties below are optional
		BundlingFileAccess: cdk.BundlingFileAccess_VOLUME_COPY,
		Command: []*string{
			jsii.String("command"),
		},
		Entrypoint: []*string{
			jsii.String("entrypoint"),
		},
		Environment: map[string]*string{
			"environmentKey": jsii.String("environment"),
		},
		Local: localBundling,
		Network: jsii.String("network"),
		OutputType: cdk.BundlingOutput_ARCHIVED,
		Platform: jsii.String("platform"),
		SecurityOpt: jsii.String("securityOpt"),
		User: jsii.String("user"),
		Volumes: []dockerVolume{
			&dockerVolume{
				ContainerPath: jsii.String("containerPath"),
				HostPath: jsii.String("hostPath"),

				// the properties below are optional
				Consistency: cdk.DockerVolumeConsistency_CONSISTENT,
			},
		},
		VolumesFrom: []*string{
			jsii.String("volumesFrom"),
		},
		WorkingDirectory: jsii.String("workingDirectory"),
	},
	DeployTime: jsii.Boolean(false),
	Exclude: []*string{
		jsii.String("exclude"),
	},
	FollowSymlinks: cdk.SymlinkFollowMode_NEVER,
	IgnoreMode: cdk.IgnoreMode_GLOB,
	Readers: []*iGrantable{
		grantable,
	},
})

func NewS3ImportSource added in v2.118.0

func NewS3ImportSource(bucket awss3.IBucket, key *string) S3ImportSource

type S3OriginAccessControl added in v2.156.0

type S3OriginAccessControl interface {
	awscdk.Resource
	IOriginAccessControl
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	Env() *awscdk.ResourceEnvironment
	// The tree node.
	Node() constructs.Node
	// The unique identifier of this Origin Access Control.
	OriginAccessControlId() *string
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//   cross-environment scenarios.
	PhysicalName() *string
	// The stack in which this resource is defined.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// The Removal Policy controls what happens to this resource when it stops
	// being managed by CloudFormation, either because you've removed it from the
	// CDK application or because you've made a change that requires the resource
	// to be replaced.
	//
	// The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
	// account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	ToString() *string
}

An Origin Access Control for Amazon S3 origins.

Example:

myBucket := s3.NewBucket(this, jsii.String("myBucket"))
oac := cloudfront.NewS3OriginAccessControl(this, jsii.String("MyOAC"), &S3OriginAccessControlProps{
	Signing: cloudfront.Signing_SIGV4_NO_OVERRIDE(),
})
s3Origin := origins.S3BucketOrigin_WithOriginAccessControl(myBucket, &S3BucketOriginWithOACProps{
	OriginAccessControl: oac,
})
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: s3Origin,
	},
})

See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-originaccesscontrol.html

func NewS3OriginAccessControl added in v2.156.0

func NewS3OriginAccessControl(scope constructs.Construct, id *string, props *S3OriginAccessControlProps) S3OriginAccessControl

type S3OriginAccessControlProps added in v2.156.0

type S3OriginAccessControlProps struct {
	// A description of the origin access control.
	// Default: - no description.
	//
	Description *string `field:"optional" json:"description" yaml:"description"`
	// A name to identify the origin access control, with a maximum length of 64 characters.
	// Default: - a generated name.
	//
	OriginAccessControlName *string `field:"optional" json:"originAccessControlName" yaml:"originAccessControlName"`
	// Specifies which requests CloudFront signs and the signing protocol.
	// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-signingbehavior
	//
	// Default: SIGV4_ALWAYS.
	//
	Signing Signing `field:"optional" json:"signing" yaml:"signing"`
}

Properties for creating a S3 Origin Access Control resource.

Example:

myBucket := s3.NewBucket(this, jsii.String("myBucket"))
oac := cloudfront.NewS3OriginAccessControl(this, jsii.String("MyOAC"), &S3OriginAccessControlProps{
	Signing: cloudfront.Signing_SIGV4_NO_OVERRIDE(),
})
s3Origin := origins.S3BucketOrigin_WithOriginAccessControl(myBucket, &S3BucketOriginWithOACProps{
	OriginAccessControl: oac,
})
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: s3Origin,
	},
})

type S3OriginConfig

type S3OriginConfig struct {
	// The source bucket to serve content from.
	S3BucketSource awss3.IBucket `field:"required" json:"s3BucketSource" yaml:"s3BucketSource"`
	// The optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket.
	// Default: No Origin Access Identity which requires the S3 bucket to be public accessible.
	//
	OriginAccessIdentity IOriginAccessIdentity `field:"optional" json:"originAccessIdentity" yaml:"originAccessIdentity"`
	// Any additional headers to pass to the origin.
	// Default: - No additional headers are passed.
	//
	OriginHeaders *map[string]*string `field:"optional" json:"originHeaders" yaml:"originHeaders"`
	// The relative path to the origin root to use for sources.
	// Default: /.
	//
	OriginPath *string `field:"optional" json:"originPath" yaml:"originPath"`
	// When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
	// Default: - origin shield not enabled.
	//
	OriginShieldRegion *string `field:"optional" json:"originShieldRegion" yaml:"originShieldRegion"`
}

S3 origin configuration for CloudFront.

Example:

var sourceBucket bucket

viewerCertificate := cloudfront.ViewerCertificate_FromIamCertificate(jsii.String("MYIAMROLEIDENTIFIER"), &ViewerCertificateOptions{
	Aliases: []*string{
		jsii.String("MYALIAS"),
	},
})

cloudfront.NewCloudFrontWebDistribution(this, jsii.String("MyCfWebDistribution"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: sourceBucket,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: viewerCertificate,
})

type SSLMethod

type SSLMethod string

The SSL method CloudFront will use for your distribution.

Server Name Indication (SNI) - is an extension to the TLS computer networking protocol by which a client indicates

which hostname it is attempting to connect to at the start of the handshaking process. This allows a server to present
multiple certificates on the same IP address and TCP port number and hence allows multiple secure (HTTPS) websites

(or any other service over TLS) to be served by the same IP address without requiring all those sites to use the same certificate.

CloudFront can use SNI to host multiple distributions on the same IP - which a large majority of clients will support.

If your clients cannot support SNI however - CloudFront can use dedicated IPs for your distribution - but there is a prorated monthly charge for using this feature. By default, we use SNI - but you can optionally enable dedicated IPs (VIP).

See the CloudFront SSL for more details about pricing : https://aws.amazon.com/cloudfront/custom-ssl-domains/

Example:

s3BucketSource := s3.NewBucket(this, jsii.String("Bucket"))

distribution := cloudfront.NewCloudFrontWebDistribution(this, jsii.String("AnAmazingWebsiteProbably"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: *S3BucketSource,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: cloudfront.ViewerCertificate_FromIamCertificate(jsii.String("certificateId"), &ViewerCertificateOptions{
		Aliases: []*string{
			jsii.String("example.com"),
		},
		SecurityPolicy: cloudfront.SecurityPolicyProtocol_SSL_V3,
		 // default
		SslMethod: cloudfront.SSLMethod_SNI,
	}),
})
const (
	SSLMethod_SNI SSLMethod = "SNI"
	SSLMethod_VIP SSLMethod = "VIP"
)

type SecurityPolicyProtocol

type SecurityPolicyProtocol string

The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections.

CloudFront serves your objects only to browsers or devices that support at least the SSL version that you specify.

Example:

s3BucketSource := s3.NewBucket(this, jsii.String("Bucket"))

distribution := cloudfront.NewCloudFrontWebDistribution(this, jsii.String("AnAmazingWebsiteProbably"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: *S3BucketSource,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: cloudfront.ViewerCertificate_FromIamCertificate(jsii.String("certificateId"), &ViewerCertificateOptions{
		Aliases: []*string{
			jsii.String("example.com"),
		},
		SecurityPolicy: cloudfront.SecurityPolicyProtocol_SSL_V3,
		 // default
		SslMethod: cloudfront.SSLMethod_SNI,
	}),
})
const (
	SecurityPolicyProtocol_SSL_V3        SecurityPolicyProtocol = "SSL_V3"
	SecurityPolicyProtocol_TLS_V1        SecurityPolicyProtocol = "TLS_V1"
	SecurityPolicyProtocol_TLS_V1_2016   SecurityPolicyProtocol = "TLS_V1_2016"
	SecurityPolicyProtocol_TLS_V1_1_2016 SecurityPolicyProtocol = "TLS_V1_1_2016"
	SecurityPolicyProtocol_TLS_V1_2_2018 SecurityPolicyProtocol = "TLS_V1_2_2018"
	SecurityPolicyProtocol_TLS_V1_2_2019 SecurityPolicyProtocol = "TLS_V1_2_2019"
	SecurityPolicyProtocol_TLS_V1_2_2021 SecurityPolicyProtocol = "TLS_V1_2_2021"
)

type Signing added in v2.156.0

type Signing interface {
	// Which requests CloudFront signs.
	Behavior() SigningBehavior
	// The signing protocol.
	Protocol() SigningProtocol
}

Options for how CloudFront signs requests.

Example:

myBucket := s3.NewBucket(this, jsii.String("myBucket"))
oac := cloudfront.NewS3OriginAccessControl(this, jsii.String("MyOAC"), &S3OriginAccessControlProps{
	Signing: cloudfront.Signing_SIGV4_NO_OVERRIDE(),
})
s3Origin := origins.S3BucketOrigin_WithOriginAccessControl(myBucket, &S3BucketOriginWithOACProps{
	OriginAccessControl: oac,
})
cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: s3Origin,
	},
})

func NewSigning added in v2.156.0

func NewSigning(protocol SigningProtocol, behavior SigningBehavior) Signing

func Signing_NEVER added in v2.156.0

func Signing_NEVER() Signing

func Signing_SIGV4_ALWAYS added in v2.156.0

func Signing_SIGV4_ALWAYS() Signing

func Signing_SIGV4_NO_OVERRIDE added in v2.156.0

func Signing_SIGV4_NO_OVERRIDE() Signing

type SigningBehavior added in v2.156.0

type SigningBehavior string

Options for which requests CloudFront signs.

The recommended setting is `always`.

const (
	// Sign all origin requests, overwriting the Authorization header from the viewer request if one exists.
	SigningBehavior_ALWAYS SigningBehavior = "ALWAYS"
	// Do not sign any origin requests.
	//
	// This value turns off origin access control for all origins in all
	// distributions that use this origin access control.
	SigningBehavior_NEVER SigningBehavior = "NEVER"
	// Sign origin requests only if the viewer request doesn't contain the Authorization header.
	SigningBehavior_NO_OVERRIDE SigningBehavior = "NO_OVERRIDE"
)

type SigningProtocol added in v2.156.0

type SigningProtocol string

The signing protocol of the Origin Access Control.

const (
	// The AWS Signature Version 4 signing protocol.
	SigningProtocol_SIGV4 SigningProtocol = "SIGV4"
)

type SourceConfiguration

type SourceConfiguration struct {
	// The behaviors associated with this source.
	//
	// At least one (default) behavior must be included.
	Behaviors *[]*Behavior `field:"required" json:"behaviors" yaml:"behaviors"`
	// The number of times that CloudFront attempts to connect to the origin.
	//
	// You can specify 1, 2, or 3 as the number of attempts.
	// Default: 3.
	//
	ConnectionAttempts *float64 `field:"optional" json:"connectionAttempts" yaml:"connectionAttempts"`
	// The number of seconds that CloudFront waits when trying to establish a connection to the origin.
	//
	// You can specify a number of seconds between 1 and 10 (inclusive).
	// Default: cdk.Duration.seconds(10)
	//
	ConnectionTimeout awscdk.Duration `field:"optional" json:"connectionTimeout" yaml:"connectionTimeout"`
	// A custom origin source - for all non-s3 sources.
	CustomOriginSource *CustomOriginConfig `field:"optional" json:"customOriginSource" yaml:"customOriginSource"`
	// HTTP status code to failover to second origin.
	// Default: [500, 502, 503, 504].
	//
	FailoverCriteriaStatusCodes *[]FailoverStatusCode `field:"optional" json:"failoverCriteriaStatusCodes" yaml:"failoverCriteriaStatusCodes"`
	// A custom origin source for failover in case the s3OriginSource returns invalid status code.
	// Default: - no failover configuration.
	//
	FailoverCustomOriginSource *CustomOriginConfig `field:"optional" json:"failoverCustomOriginSource" yaml:"failoverCustomOriginSource"`
	// An s3 origin source for failover in case the s3OriginSource returns invalid status code.
	// Default: - no failover configuration.
	//
	FailoverS3OriginSource *S3OriginConfig `field:"optional" json:"failoverS3OriginSource" yaml:"failoverS3OriginSource"`
	// When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
	// See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html
	//
	// Default: - origin shield not enabled.
	//
	OriginShieldRegion *string `field:"optional" json:"originShieldRegion" yaml:"originShieldRegion"`
	// An s3 origin source - if you're using s3 for your assets.
	S3OriginSource *S3OriginConfig `field:"optional" json:"s3OriginSource" yaml:"s3OriginSource"`
}

A source configuration is a wrapper for CloudFront origins and behaviors.

An origin is what CloudFront will "be in front of" - that is, CloudFront will pull its assets from an origin.

If you're using s3 as a source - pass the `s3Origin` property, otherwise, pass the `customOriginSource` property.

One or the other must be passed, and it is invalid to pass both in the same SourceConfiguration.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var bucket bucket
var function_ function
var keyGroup keyGroup
var originAccessIdentity originAccessIdentity
var version version

sourceConfiguration := &SourceConfiguration{
	Behaviors: []behavior{
		&behavior{
			AllowedMethods: awscdk.Aws_cloudfront.CloudFrontAllowedMethods_GET_HEAD,
			CachedMethods: awscdk.*Aws_cloudfront.CloudFrontAllowedCachedMethods_GET_HEAD,
			Compress: jsii.Boolean(false),
			DefaultTtl: cdk.Duration_Minutes(jsii.Number(30)),
			ForwardedValues: &ForwardedValuesProperty{
				QueryString: jsii.Boolean(false),

				// the properties below are optional
				Cookies: &CookiesProperty{
					Forward: jsii.String("forward"),

					// the properties below are optional
					WhitelistedNames: []*string{
						jsii.String("whitelistedNames"),
					},
				},
				Headers: []*string{
					jsii.String("headers"),
				},
				QueryStringCacheKeys: []*string{
					jsii.String("queryStringCacheKeys"),
				},
			},
			FunctionAssociations: []functionAssociation{
				&functionAssociation{
					EventType: awscdk.*Aws_cloudfront.FunctionEventType_VIEWER_REQUEST,
					Function: function_,
				},
			},
			IsDefaultBehavior: jsii.Boolean(false),
			LambdaFunctionAssociations: []lambdaFunctionAssociation{
				&lambdaFunctionAssociation{
					EventType: awscdk.*Aws_cloudfront.LambdaEdgeEventType_ORIGIN_REQUEST,
					LambdaFunction: version,

					// the properties below are optional
					IncludeBody: jsii.Boolean(false),
				},
			},
			MaxTtl: cdk.Duration_*Minutes(jsii.Number(30)),
			MinTtl: cdk.Duration_*Minutes(jsii.Number(30)),
			PathPattern: jsii.String("pathPattern"),
			TrustedKeyGroups: []iKeyGroup{
				keyGroup,
			},
			TrustedSigners: []*string{
				jsii.String("trustedSigners"),
			},
			ViewerProtocolPolicy: awscdk.*Aws_cloudfront.ViewerProtocolPolicy_HTTPS_ONLY,
		},
	},

	// the properties below are optional
	ConnectionAttempts: jsii.Number(123),
	ConnectionTimeout: cdk.Duration_*Minutes(jsii.Number(30)),
	CustomOriginSource: &CustomOriginConfig{
		DomainName: jsii.String("domainName"),

		// the properties below are optional
		AllowedOriginSSLVersions: []originSslPolicy{
			awscdk.*Aws_cloudfront.*originSslPolicy_SSL_V3,
		},
		HttpPort: jsii.Number(123),
		HttpsPort: jsii.Number(123),
		OriginHeaders: map[string]*string{
			"originHeadersKey": jsii.String("originHeaders"),
		},
		OriginKeepaliveTimeout: cdk.Duration_*Minutes(jsii.Number(30)),
		OriginPath: jsii.String("originPath"),
		OriginProtocolPolicy: awscdk.*Aws_cloudfront.OriginProtocolPolicy_HTTP_ONLY,
		OriginReadTimeout: cdk.Duration_*Minutes(jsii.Number(30)),
		OriginShieldRegion: jsii.String("originShieldRegion"),
	},
	FailoverCriteriaStatusCodes: []failoverStatusCode{
		awscdk.*Aws_cloudfront.*failoverStatusCode_FORBIDDEN,
	},
	FailoverCustomOriginSource: &CustomOriginConfig{
		DomainName: jsii.String("domainName"),

		// the properties below are optional
		AllowedOriginSSLVersions: []*originSslPolicy{
			awscdk.*Aws_cloudfront.*originSslPolicy_SSL_V3,
		},
		HttpPort: jsii.Number(123),
		HttpsPort: jsii.Number(123),
		OriginHeaders: map[string]*string{
			"originHeadersKey": jsii.String("originHeaders"),
		},
		OriginKeepaliveTimeout: cdk.Duration_*Minutes(jsii.Number(30)),
		OriginPath: jsii.String("originPath"),
		OriginProtocolPolicy: awscdk.*Aws_cloudfront.OriginProtocolPolicy_HTTP_ONLY,
		OriginReadTimeout: cdk.Duration_*Minutes(jsii.Number(30)),
		OriginShieldRegion: jsii.String("originShieldRegion"),
	},
	FailoverS3OriginSource: &S3OriginConfig{
		S3BucketSource: bucket,

		// the properties below are optional
		OriginAccessIdentity: originAccessIdentity,
		OriginHeaders: map[string]*string{
			"originHeadersKey": jsii.String("originHeaders"),
		},
		OriginPath: jsii.String("originPath"),
		OriginShieldRegion: jsii.String("originShieldRegion"),
	},
	OriginShieldRegion: jsii.String("originShieldRegion"),
	S3OriginSource: &S3OriginConfig{
		S3BucketSource: bucket,

		// the properties below are optional
		OriginAccessIdentity: originAccessIdentity,
		OriginHeaders: map[string]*string{
			"originHeadersKey": jsii.String("originHeaders"),
		},
		OriginPath: jsii.String("originPath"),
		OriginShieldRegion: jsii.String("originShieldRegion"),
	},
}

type ViewerCertificate

type ViewerCertificate interface {
	Aliases() *[]*string
	Props() *CfnDistribution_ViewerCertificateProperty
}

Viewer certificate configuration class.

Example:

s3BucketSource := s3.NewBucket(this, jsii.String("Bucket"))

distribution := cloudfront.NewCloudFrontWebDistribution(this, jsii.String("AnAmazingWebsiteProbably"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: *S3BucketSource,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: cloudfront.ViewerCertificate_FromIamCertificate(jsii.String("certificateId"), &ViewerCertificateOptions{
		Aliases: []*string{
			jsii.String("example.com"),
		},
		SecurityPolicy: cloudfront.SecurityPolicyProtocol_SSL_V3,
		 // default
		SslMethod: cloudfront.SSLMethod_SNI,
	}),
})

func ViewerCertificate_FromAcmCertificate

func ViewerCertificate_FromAcmCertificate(certificate awscertificatemanager.ICertificate, options *ViewerCertificateOptions) ViewerCertificate

Generate an AWS Certificate Manager (ACM) viewer certificate configuration.

func ViewerCertificate_FromCloudFrontDefaultCertificate

func ViewerCertificate_FromCloudFrontDefaultCertificate(aliases ...*string) ViewerCertificate

Generate a viewer certificate configuration using the CloudFront default certificate (e.g. d111111abcdef8.cloudfront.net) and a `SecurityPolicyProtocol.TLS_V1` security policy.

func ViewerCertificate_FromIamCertificate

func ViewerCertificate_FromIamCertificate(iamCertificateId *string, options *ViewerCertificateOptions) ViewerCertificate

Generate an IAM viewer certificate configuration.

type ViewerCertificateOptions

type ViewerCertificateOptions struct {
	// Domain names on the certificate (both main domain name and Subject Alternative names).
	Aliases *[]*string `field:"optional" json:"aliases" yaml:"aliases"`
	// The minimum version of the SSL protocol that you want CloudFront to use for HTTPS connections.
	//
	// CloudFront serves your objects only to browsers or devices that support at
	// least the SSL version that you specify.
	// Default: - SSLv3 if sslMethod VIP, TLSv1 if sslMethod SNI.
	//
	SecurityPolicy SecurityPolicyProtocol `field:"optional" json:"securityPolicy" yaml:"securityPolicy"`
	// How CloudFront should serve HTTPS requests.
	//
	// See the notes on SSLMethod if you wish to use other SSL termination types.
	// See: https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html
	//
	// Default: SSLMethod.SNI
	//
	SslMethod SSLMethod `field:"optional" json:"sslMethod" yaml:"sslMethod"`
}

Example:

s3BucketSource := s3.NewBucket(this, jsii.String("Bucket"))

distribution := cloudfront.NewCloudFrontWebDistribution(this, jsii.String("AnAmazingWebsiteProbably"), &CloudFrontWebDistributionProps{
	OriginConfigs: []sourceConfiguration{
		&sourceConfiguration{
			S3OriginSource: &S3OriginConfig{
				S3BucketSource: *S3BucketSource,
			},
			Behaviors: []behavior{
				&behavior{
					IsDefaultBehavior: jsii.Boolean(true),
				},
			},
		},
	},
	ViewerCertificate: cloudfront.ViewerCertificate_FromIamCertificate(jsii.String("certificateId"), &ViewerCertificateOptions{
		Aliases: []*string{
			jsii.String("example.com"),
		},
		SecurityPolicy: cloudfront.SecurityPolicyProtocol_SSL_V3,
		 // default
		SslMethod: cloudfront.SSLMethod_SNI,
	}),
})

type ViewerProtocolPolicy

type ViewerProtocolPolicy string

How HTTPs should be handled with your distribution.

Example:

// Create a Distribution with configured HTTP methods and viewer protocol policy of the cache.
var myBucket bucket

myWebDistribution := cloudfront.NewDistribution(this, jsii.String("myDist"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: origins.NewS3Origin(myBucket),
		AllowedMethods: cloudfront.AllowedMethods_ALLOW_ALL(),
		ViewerProtocolPolicy: cloudfront.ViewerProtocolPolicy_REDIRECT_TO_HTTPS,
	},
})
const (
	// HTTPS only.
	ViewerProtocolPolicy_HTTPS_ONLY ViewerProtocolPolicy = "HTTPS_ONLY"
	// Will redirect HTTP requests to HTTPS.
	ViewerProtocolPolicy_REDIRECT_TO_HTTPS ViewerProtocolPolicy = "REDIRECT_TO_HTTPS"
	// Both HTTP and HTTPS supported.
	ViewerProtocolPolicy_ALLOW_ALL ViewerProtocolPolicy = "ALLOW_ALL"
)

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL