CfnOriginAccessControlPropsMixin

class aws_cdk.mixins_preview.aws_cloudfront.mixins.CfnOriginAccessControlPropsMixin(props, *, strategy=None)

Bases: Mixin

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudfront-originaccesscontrol.html

CloudformationResource:

AWS::CloudFront::OriginAccessControl

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

cfn_origin_access_control_props_mixin = cloudfront_mixins.CfnOriginAccessControlPropsMixin(cloudfront_mixins.CfnOriginAccessControlMixinProps(
    origin_access_control_config=cloudfront_mixins.CfnOriginAccessControlPropsMixin.OriginAccessControlConfigProperty(
        description="description",
        name="name",
        origin_access_control_origin_type="originAccessControlOriginType",
        signing_behavior="signingBehavior",
        signing_protocol="signingProtocol"
    )
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::CloudFront::OriginAccessControl.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['originAccessControlConfig']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

OriginAccessControlConfigProperty

class CfnOriginAccessControlPropsMixin.OriginAccessControlConfigProperty(*, description=None, name=None, origin_access_control_origin_type=None, signing_behavior=None, signing_protocol=None)

Bases: object

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 .

Parameters:
  • description (Optional[str]) – A description of the origin access control.

  • name (Optional[str]) – A name to identify the origin access control. You can specify up to 64 characters.

  • origin_access_control_origin_type (Optional[str]) – The type of origin that this origin access control is for.

  • signing_behavior (Optional[str]) – 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.*

  • signing_protocol (Optional[str]) – The signing protocol of the origin access control, which determines how CloudFront signs (authenticates) requests. The only valid value is sigv4 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_cloudfront import mixins as cloudfront_mixins

origin_access_control_config_property = cloudfront_mixins.CfnOriginAccessControlPropsMixin.OriginAccessControlConfigProperty(
    description="description",
    name="name",
    origin_access_control_origin_type="originAccessControlOriginType",
    signing_behavior="signingBehavior",
    signing_protocol="signingProtocol"
)

Attributes

description

A description of the origin access control.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-description

name

A name to identify the origin access control.

You can specify up to 64 characters.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-name

origin_access_control_origin_type

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-originaccesscontrolorigintype

signing_behavior

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.*

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-signingbehavior

signing_protocol

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

The only valid value is sigv4 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-originaccesscontrol-originaccesscontrolconfig.html#cfn-cloudfront-originaccesscontrol-originaccesscontrolconfig-signingprotocol