Class HttpOriginProps
Properties for an Origin backed by an S3 website-configured bucket, load balancer, or custom HTTP server.
Inheritance
Namespace: Amazon.CDK.AWS.CloudFront.Origins
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class HttpOriginProps : Object, IHttpOriginProps, IOriginProps, IOriginOptions
Syntax (vb)
Public Class HttpOriginProps
Inherits Object
Implements IHttpOriginProps, IOriginProps, IOriginOptions
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.CloudFront;
using Amazon.CDK.AWS.CloudFront.Origins;
var httpOriginProps = new HttpOriginProps {
ConnectionAttempts = 123,
ConnectionTimeout = Duration.Minutes(30),
CustomHeaders = new Dictionary<string, string> {
{ "customHeadersKey", "customHeaders" }
},
HttpPort = 123,
HttpsPort = 123,
KeepaliveTimeout = Duration.Minutes(30),
OriginId = "originId",
OriginPath = "originPath",
OriginShieldEnabled = false,
OriginShieldRegion = "originShieldRegion",
OriginSslProtocols = new [] { OriginSslPolicy.SSL_V3 },
ProtocolPolicy = OriginProtocolPolicy.HTTP_ONLY,
ReadTimeout = Duration.Minutes(30)
};
Synopsis
Constructors
HttpOriginProps() |
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. |
HttpPort | The HTTP port that CloudFront uses to connect to the origin. |
HttpsPort | The HTTPS port that CloudFront uses to connect to the origin. |
KeepaliveTimeout | Specifies how long, in seconds, CloudFront persists its connection to the origin. |
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. |
OriginSslProtocols | The SSL versions to use when interacting with the origin. |
ProtocolPolicy | Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin. |
ReadTimeout | Specifies how long, in seconds, CloudFront waits for a response from the origin, also known as the origin response timeout. |
Constructors
HttpOriginProps()
public HttpOriginProps()
Properties
ConnectionAttempts
The number of times that CloudFront attempts to connect to the origin;
public Nullable<double> ConnectionAttempts { get; set; }
Property Value
System.Nullable<System.Double>
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
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: {}
HttpPort
The HTTP port that CloudFront uses to connect to the origin.
public Nullable<double> HttpPort { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: 80
HttpsPort
The HTTPS port that CloudFront uses to connect to the origin.
public Nullable<double> HttpsPort { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: 443
KeepaliveTimeout
Specifies how long, in seconds, CloudFront persists its connection to the origin.
public Duration KeepaliveTimeout { get; set; }
Property Value
Remarks
The valid range is from 1 to 180 seconds, inclusive.
Note that values over 60 seconds are possible only after a limit increase request for the origin response timeout quota has been approved in the target account; otherwise, values over 60 seconds will produce an error at deploy time.
Default: Duration.seconds(5)
OriginId
A unique identifier for the origin.
public string OriginId { get; set; }
Property Value
System.String
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
System.String
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 Nullable<bool> OriginShieldEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
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
System.String
Remarks
Default: - origin shield not enabled
See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html
OriginSslProtocols
The SSL versions to use when interacting with the origin.
public OriginSslPolicy[] OriginSslProtocols { get; set; }
Property Value
Remarks
Default: OriginSslPolicy.TLS_V1_2
ProtocolPolicy
Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin.
public Nullable<OriginProtocolPolicy> ProtocolPolicy { get; set; }
Property Value
System.Nullable<OriginProtocolPolicy>
Remarks
Default: OriginProtocolPolicy.HTTPS_ONLY
ReadTimeout
Specifies how long, in seconds, CloudFront waits for a response from the origin, also known as the origin response timeout.
public Duration ReadTimeout { get; set; }
Property Value
Remarks
The valid range is from 1 to 180 seconds, inclusive.
Note that values over 60 seconds are possible only after a limit increase request for the origin response timeout quota has been approved in the target account; otherwise, values over 60 seconds will produce an error at deploy time.
Default: Duration.seconds(30)