aws-cdk-lib.aws_cloudfront_origins.HttpOrigin

class HttpOrigin

LanguageType name
.NETAmazon.CDK.AWS.CloudFront.Origins.HttpOrigin
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudfrontorigins#HttpOrigin
Javasoftware.amazon.awscdk.services.cloudfront.origins.HttpOrigin
Pythonaws_cdk.aws_cloudfront_origins.HttpOrigin
TypeScript (source)aws-cdk-lib » aws_cloudfront_origins » HttpOrigin

Implements IOrigin

Extends OriginBase

An Origin for an HTTP server or S3 bucket configured for website hosting.

Example

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

// public key in PEM format
declare const publicKey: string;
const pubKey = new cloudfront.PublicKey(this, 'MyPubKey', {
  encodedKey: publicKey,
});

const keyGroup = new cloudfront.KeyGroup(this, 'MyKeyGroup', {
  items: [
    pubKey,
  ],
});

new cloudfront.Distribution(this, 'Dist', {
  defaultBehavior: {
    origin: new origins.HttpOrigin('www.example.com'),
    trustedKeyGroups: [
      keyGroup,
    ],
  },
});

Initializer

new HttpOrigin(domainName: string, props?: HttpOriginProps)

Parameters

  • domainName string
  • props HttpOriginProps

Methods

NameDescription
bind(_scope, options)Binds the origin to the associated Distribution.
protected renderCustomOriginConfig()

bind(_scope, options)

public bind(_scope: Construct, options: OriginBindOptions): OriginBindConfig

Parameters

  • _scope Construct
  • options OriginBindOptions

Returns

  • OriginBindConfig

Binds the origin to the associated Distribution.

Can be used to grant permissions, create dependent resources, etc.


protected renderCustomOriginConfig()

protected renderCustomOriginConfig(): CustomOriginConfigProperty

Returns

  • CustomOriginConfigProperty