Class S3BucketOriginWithOAIProps
Properties for configuring a S3 origin with OAI.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront.Origins
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class S3BucketOriginWithOAIProps : IS3BucketOriginWithOAIProps, IS3BucketOriginBaseProps, IOriginProps, IOriginOptions
Syntax (vb)
Public Class S3BucketOriginWithOAIProps Implements IS3BucketOriginWithOAIProps, IS3BucketOriginBaseProps, IOriginProps, IOriginOptions
Remarks
ExampleMetadata: infused
Examples
var myBucket = new Bucket(this, "myBucket");
var myOai = new OriginAccessIdentity(this, "myOAI", new OriginAccessIdentityProps {
Comment = "My custom OAI"
});
var s3Origin = S3BucketOrigin.WithOriginAccessIdentity(myBucket, new S3BucketOriginWithOAIProps {
OriginAccessIdentity = myOai
});
new Distribution(this, "myDist", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = s3Origin
}
});
Synopsis
Constructors
S3BucketOriginWithOAIProps() | Properties for configuring a S3 origin with OAI. |
Properties
ConnectionAttempts | The number of times that CloudFront attempts to connect to the origin; |
ConnectionTimeout | The number of seconds that CloudFront waits when trying to establish a connection to the origin. |
CustomHeaders | A list of HTTP header names and values that CloudFront adds to requests it sends to the origin. |
OriginAccessControlId | The unique identifier of an origin access control for this origin. |
OriginAccessIdentity | An optional Origin Access Identity. |
OriginId | A unique identifier for the origin. |
OriginPath | An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin. |
OriginShieldEnabled | 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. |
OriginShieldRegion | When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance. |
Constructors
S3BucketOriginWithOAIProps()
Properties for configuring a S3 origin with OAI.
public S3BucketOriginWithOAIProps()
Remarks
ExampleMetadata: infused
Examples
var myBucket = new Bucket(this, "myBucket");
var myOai = new OriginAccessIdentity(this, "myOAI", new OriginAccessIdentityProps {
Comment = "My custom OAI"
});
var s3Origin = S3BucketOrigin.WithOriginAccessIdentity(myBucket, new S3BucketOriginWithOAIProps {
OriginAccessIdentity = myOai
});
new Distribution(this, "myDist", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = s3Origin
}
});
Properties
ConnectionAttempts
The number of times that CloudFront attempts to connect to the origin;
public double? ConnectionAttempts { get; set; }
Property Value
Remarks
valid values are 1, 2, or 3 attempts.
Default: 3
ConnectionTimeout
The number of seconds that CloudFront waits when trying to establish a connection to the origin.
public Duration? ConnectionTimeout { get; set; }
Property Value
Remarks
Valid values are 1-10 seconds, inclusive.
Default: Duration.seconds(10)
CustomHeaders
A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.
public IDictionary<string, string>? CustomHeaders { get; set; }
Property Value
Remarks
Default: {}
OriginAccessControlId
The unique identifier of an origin access control for this origin.
public string? OriginAccessControlId { get; set; }
Property Value
Remarks
Default: - no origin access control
OriginAccessIdentity
An optional Origin Access Identity.
public IOriginAccessIdentity? OriginAccessIdentity { get; set; }
Property Value
Remarks
Default: - an Origin Access Identity will be created.
OriginId
A unique identifier for the origin.
public string? OriginId { get; set; }
Property Value
Remarks
This value must be unique within the distribution.
Default: - an originid will be generated for you
OriginPath
An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
public string? OriginPath { get; set; }
Property Value
Remarks
Must begin, but not end, with '/' (e.g., '/production/images').
Default: '/'
OriginShieldEnabled
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.
public bool? OriginShieldEnabled { get; set; }
Property Value
bool?
Remarks
Default: - true
OriginShieldRegion
When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.
public string? OriginShieldRegion { get; set; }
Property Value
Remarks
Default: - origin shield not enabled