Class CloudFrontWebDistributionProps
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CloudFrontWebDistributionProps : ICloudFrontWebDistributionProps
Syntax (vb)
Public Class CloudFrontWebDistributionProps Implements ICloudFrontWebDistributionProps
Remarks
ExampleMetadata: infused
Examples
Bucket sourceBucket;
var viewerCertificate = ViewerCertificate.FromIamCertificate("MYIAMROLEIDENTIFIER", new ViewerCertificateOptions {
Aliases = new [] { "MYALIAS" }
});
new CloudFrontWebDistribution(this, "MyCfWebDistribution", new CloudFrontWebDistributionProps {
OriginConfigs = new [] { new SourceConfiguration {
S3OriginSource = new S3OriginConfig {
S3BucketSource = sourceBucket
},
Behaviors = new [] { new Behavior { IsDefaultBehavior = true } }
} },
ViewerCertificate = viewerCertificate
});
Synopsis
Constructors
| CloudFrontWebDistributionProps() |
Properties
| Comment | A comment for this distribution in the CloudFront console. |
| DefaultRootObject | The default object to serve. |
| EnableIpV6 | If your distribution should have IPv6 enabled. |
| Enabled | Enable or disable the distribution. |
| ErrorConfigurations | How CloudFront should handle requests that are not successful (eg PageNotFound). |
| GeoRestriction | Controls the countries in which your content is distributed. |
| HttpVersion | The max supported HTTP Versions. |
| LoggingConfig | Optional - if we should enable logging. |
| OriginConfigs | The origin configurations for this distribution. |
| PriceClass | The price class for the distribution (this impacts how many locations CloudFront uses for your distribution, and billing). |
| ViewerCertificate | 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. |
| ViewerProtocolPolicy | The default viewer policy for incoming clients. |
| WebACLId | Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution. |
Constructors
CloudFrontWebDistributionProps()
public CloudFrontWebDistributionProps()
Remarks
ExampleMetadata: infused
Examples
Bucket sourceBucket;
var viewerCertificate = ViewerCertificate.FromIamCertificate("MYIAMROLEIDENTIFIER", new ViewerCertificateOptions {
Aliases = new [] { "MYALIAS" }
});
new CloudFrontWebDistribution(this, "MyCfWebDistribution", new CloudFrontWebDistributionProps {
OriginConfigs = new [] { new SourceConfiguration {
S3OriginSource = new S3OriginConfig {
S3BucketSource = sourceBucket
},
Behaviors = new [] { new Behavior { IsDefaultBehavior = true } }
} },
ViewerCertificate = viewerCertificate
});
Properties
Comment
A comment for this distribution in the CloudFront console.
public string? Comment { get; set; }
Property Value
Remarks
Default: - No comment is added to distribution.
DefaultRootObject
The default object to serve.
public string? DefaultRootObject { get; set; }
Property Value
Remarks
Default: - "index.html" is served.
EnableIpV6
If your distribution should have IPv6 enabled.
public bool? EnableIpV6 { get; set; }
Property Value
bool?
Remarks
Default: true
Enabled
Enable or disable the distribution.
public bool? Enabled { get; set; }
Property Value
bool?
Remarks
Default: true
ErrorConfigurations
How CloudFront should handle requests that are not successful (eg PageNotFound).
public CfnDistribution.ICustomErrorResponseProperty[]? ErrorConfigurations { get; set; }
Property Value
ICustomErrorResponseProperty[]
Remarks
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.
GeoRestriction
Controls the countries in which your content is distributed.
public GeoRestriction? GeoRestriction { get; set; }
Property Value
Remarks
Default: No geo restriction
HttpVersion
The max supported HTTP Versions.
public HttpVersion? HttpVersion { get; set; }
Property Value
Remarks
Default: HttpVersion.HTTP2
LoggingConfig
Optional - if we should enable logging.
public ILoggingConfiguration? LoggingConfig { get; set; }
Property Value
Remarks
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.
OriginConfigs
The origin configurations for this distribution.
public ISourceConfiguration[] OriginConfigs { get; set; }
Property Value
Remarks
Behaviors are a part of the origin.
PriceClass
The price class for the distribution (this impacts how many locations CloudFront uses for your distribution, and billing).
public PriceClass? PriceClass { get; set; }
Property Value
Remarks
Default: PriceClass.PRICE_CLASS_100 the cheapest option for CloudFront is picked by default.
ViewerCertificate
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.
public ViewerCertificate? ViewerCertificate { get; set; }
Property Value
Remarks
Default: ViewerCertificate.fromCloudFrontDefaultCertificate()
See: https://aws.amazon.com/premiumsupport/knowledge-center/custom-ssl-certificate-cloudfront/
ViewerProtocolPolicy
The default viewer policy for incoming clients.
public ViewerProtocolPolicy? ViewerProtocolPolicy { get; set; }
Property Value
Remarks
Default: RedirectToHTTPs
WebACLId
Unique identifier that specifies the AWS WAF web ACL to associate with this CloudFront distribution.
public string? WebACLId { get; set; }
Property Value
Remarks
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.
Default: - No AWS Web Application Firewall web access control list (web ACL).