aws-cdk-lib.aws_cloudfront.CfnOriginAccessControl.OriginAccessControlConfigProperty

interface OriginAccessControlConfigProperty

LanguageType name
.NETAmazon.CDK.AWS.CloudFront.CfnOriginAccessControl.OriginAccessControlConfigProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#CfnOriginAccessControl_OriginAccessControlConfigProperty
Javasoftware.amazon.awscdk.services.cloudfront.CfnOriginAccessControl.OriginAccessControlConfigProperty
Pythonaws_cdk.aws_cloudfront.CfnOriginAccessControl.OriginAccessControlConfigProperty
TypeScript aws-cdk-lib » aws_cloudfront » CfnOriginAccessControl » OriginAccessControlConfigProperty

Creates a new origin access control in CloudFront.

After you create an origin access control, you can add it to an origin in a CloudFront distribution so that CloudFront sends authenticated (signed) requests to the origin.

This makes it possible to block public access to the origin, allowing viewers (users) to access the origin's content only through CloudFront.

For more information about using a CloudFront origin access control, see Restricting access to an AWS origin in the Amazon CloudFront Developer Guide .

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
const originAccessControlConfigProperty: cloudfront.CfnOriginAccessControl.OriginAccessControlConfigProperty = {
  name: 'name',
  originAccessControlOriginType: 'originAccessControlOriginType',
  signingBehavior: 'signingBehavior',
  signingProtocol: 'signingProtocol',

  // the properties below are optional
  description: 'description',
};

Properties

NameTypeDescription
namestringA name to identify the origin access control.
originAccessControlOriginTypestringThe type of origin that this origin access control is for.
signingBehaviorstringSpecifies which requests CloudFront signs (adds authentication information to).
signingProtocolstringThe signing protocol of the origin access control, which determines how CloudFront signs (authenticates) requests.
description?stringA description of the origin access control.

name

Type: string

A name to identify the origin access control.


originAccessControlOriginType

Type: string

The type of origin that this origin access control is for.


signingBehavior

Type: string

Specifies which requests CloudFront signs (adds authentication information to).

Specify always for the most common use case. For more information, see origin access control advanced settings in the Amazon CloudFront Developer Guide .

This field can have one of the following values:

  • always – CloudFront signs all origin requests, overwriting the Authorization header from the viewer request if one exists.
  • never – CloudFront doesn't sign any origin requests. This value turns off origin access control for all origins in all distributions that use this origin access control.
  • no-override – If the viewer request doesn't contain the Authorization header, then CloudFront signs the origin request. If the viewer request contains the Authorization header, then CloudFront doesn't sign the origin request and instead passes along the Authorization header from the viewer request. WARNING: To pass along the Authorization header from the viewer request, you must add the Authorization header to a cache policy for all cache behaviors that use origins associated with this origin access control.

signingProtocol

Type: string

The signing protocol of the origin access control, which determines how CloudFront signs (authenticates) requests.

The only valid value is sigv4 .


description?

Type: string (optional)

A description of the origin access control.