@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-25T18:29:07.255Z") public class CfnOriginAccessControl extends CfnResource implements IInspectable
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.
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.*; CfnOriginAccessControl cfnOriginAccessControl = CfnOriginAccessControl.Builder.create(this, "MyCfnOriginAccessControl") .originAccessControlConfig(OriginAccessControlConfigProperty.builder() .name("name") .originAccessControlOriginType("originAccessControlOriginType") .signingBehavior("signingBehavior") .signingProtocol("signingProtocol") // the properties below are optional .description("description") .build()) .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnOriginAccessControl.Builder
A fluent builder for
CfnOriginAccessControl . |
static interface |
CfnOriginAccessControl.OriginAccessControlConfigProperty
Creates a new origin access control in CloudFront.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnOriginAccessControl(Construct scope,
java.lang.String id,
CfnOriginAccessControlProps props)
Create a new `AWS::CloudFront::OriginAccessControl`.
|
protected |
CfnOriginAccessControl(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnOriginAccessControl(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrId()
The unique identifier of the origin access control.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.Object |
getOriginAccessControlConfig()
The origin access control.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setOriginAccessControlConfig(CfnOriginAccessControl.OriginAccessControlConfigProperty value)
The origin access control.
|
void |
setOriginAccessControlConfig(IResolvable value)
The origin access control.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnOriginAccessControl(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnOriginAccessControl(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnOriginAccessControl(Construct scope, java.lang.String id, CfnOriginAccessControlProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrId()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public java.lang.Object getOriginAccessControlConfig()
public void setOriginAccessControlConfig(IResolvable value)
public void setOriginAccessControlConfig(CfnOriginAccessControl.OriginAccessControlConfigProperty value)