aws-cdk-lib.aws_cloudfront_origins.RestApiOrigin

class RestApiOrigin

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

Implements IOrigin

Extends OriginBase

An Origin for an API Gateway REST API.

Example

declare const api: apigateway.RestApi;
new cloudfront.Distribution(this, 'Distribution', {
  defaultBehavior: { origin: new origins.RestApiOrigin(api) },
});

Initializer

new RestApiOrigin(restApi: RestApi, props?: RestApiOriginProps)

Parameters

  • restApi RestApi
  • props RestApiOriginProps

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