class HttpOrigin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.CloudFront.Origins.HttpOrigin |
Java | software.amazon.awscdk.services.cloudfront.origins.HttpOrigin |
Python | aws_cdk.aws_cloudfront_origins.HttpOrigin |
TypeScript (source) | @aws-cdk/aws-cloudfront-origins » HttpOrigin |
Implements
IOrigin
Extends
Origin
An Origin for an HTTP server or S3 bucket configured for website hosting.
Example
const myBucket = new s3.Bucket(this, 'myBucket');
new cloudfront.Distribution(this, 'myDist', {
defaultBehavior: {
origin: new origins.OriginGroup({
primaryOrigin: new origins.S3Origin(myBucket),
fallbackOrigin: new origins.HttpOrigin('www.example.com'),
// optional, defaults to: 500, 502, 503 and 504
fallbackStatusCodes: [404],
}),
},
});
Initializer
new HttpOrigin(domainName: string, props?: HttpOriginProps)
Parameters
- domainName
string - props
HttpOrigin Props
Methods
| Name | Description |
|---|---|
| bind(_scope, options) | Binds the origin to the associated Distribution. |
| protected render |
bind(_scope, options)
public bind(_scope: Construct, options: OriginBindOptions): OriginBindConfig
Parameters
- _scope
Construct - options
OriginBind Options
Returns
Binds the origin to the associated Distribution.
Can be used to grant permissions, create dependent resources, etc.
protected renderCustomOriginConfig()
protected renderCustomOriginConfig(): CustomOriginConfigProperty
Returns

.NET
Java
Python
TypeScript (