public static interface CfnOriginAccessControl.OriginAccessControlConfigProperty
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.
For an Amazon S3 origin, this makes it possible to block public access to the Amazon S3 bucket so that viewers (users) can access the content in the bucket only through CloudFront.
For more information about using a CloudFront origin access control, see Restricting access to an Amazon S3 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 software.amazon.awscdk.services.cloudfront.*; OriginAccessControlConfigProperty originAccessControlConfigProperty = OriginAccessControlConfigProperty.builder() .name("name") .originAccessControlOriginType("originAccessControlOriginType") .signingBehavior("signingBehavior") .signingProtocol("signingProtocol") // the properties below are optional .description("description") .build();
Modifier and Type | Interface and Description |
---|---|
static class |
CfnOriginAccessControl.OriginAccessControlConfigProperty.Builder
A builder for
CfnOriginAccessControl.OriginAccessControlConfigProperty |
static class |
CfnOriginAccessControl.OriginAccessControlConfigProperty.Jsii$Proxy
An implementation for
CfnOriginAccessControl.OriginAccessControlConfigProperty |
Modifier and Type | Method and Description |
---|---|
static CfnOriginAccessControl.OriginAccessControlConfigProperty.Builder |
builder() |
default java.lang.String |
getDescription()
A description of the origin access control.
|
java.lang.String |
getName()
A name to identify the origin access control.
|
java.lang.String |
getOriginAccessControlOriginType()
The type of origin that this origin access control is for.
|
java.lang.String |
getSigningBehavior()
Specifies which requests CloudFront signs (adds authentication information to).
|
java.lang.String |
getSigningProtocol()
The signing protocol of the origin access control, which determines how CloudFront signs (authenticates) requests.
|
java.lang.String getName()
java.lang.String getOriginAccessControlOriginType()
The only valid value is s3
.
java.lang.String getSigningBehavior()
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.java.lang.String getSigningProtocol()
The only valid value is sigv4
.
default java.lang.String getDescription()