software.amazon.awsconstructs.services.cloudfronts3.CloudFrontToS3 Maven / Gradle / Ivy
Show all versions of cloudfronts3 Show documentation
package software.amazon.awsconstructs.services.cloudfronts3;
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-10-22T17:52:59.463Z")
@software.amazon.jsii.Jsii(module = software.amazon.awsconstructs.services.cloudfronts3.$Module.class, fqn = "@aws-solutions-constructs/aws-cloudfront-s3.CloudFrontToS3")
public class CloudFrontToS3 extends software.constructs.Construct {
protected CloudFrontToS3(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected CloudFrontToS3(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope - represents the scope for all the resources.
This parameter is required.
* @param id - this is a a scope-unique id.
This parameter is required.
* @param props - user provided props for the construct.
This parameter is required.
*/
public CloudFrontToS3(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awsconstructs.services.cloudfronts3.CloudFrontToS3Props props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.cloudfront.Distribution getCloudFrontWebDistribution() {
return software.amazon.jsii.Kernel.get(this, "cloudFrontWebDistribution", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloudfront.Distribution.class));
}
public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.s3.IBucket getS3BucketInterface() {
return software.amazon.jsii.Kernel.get(this, "s3BucketInterface", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.IBucket.class));
}
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.cloudfront.Function getCloudFrontFunction() {
return software.amazon.jsii.Kernel.get(this, "cloudFrontFunction", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloudfront.Function.class));
}
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.s3.Bucket getCloudFrontLoggingBucket() {
return software.amazon.jsii.Kernel.get(this, "cloudFrontLoggingBucket", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.Bucket.class));
}
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.s3.Bucket getCloudFrontLoggingBucketAccessLogBucket() {
return software.amazon.jsii.Kernel.get(this, "cloudFrontLoggingBucketAccessLogBucket", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.Bucket.class));
}
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.cloudfront.CfnOriginAccessControl getOriginAccessControl() {
return software.amazon.jsii.Kernel.get(this, "originAccessControl", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloudfront.CfnOriginAccessControl.class));
}
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.s3.Bucket getS3Bucket() {
return software.amazon.jsii.Kernel.get(this, "s3Bucket", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.Bucket.class));
}
public @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.s3.Bucket getS3LoggingBucket() {
return software.amazon.jsii.Kernel.get(this, "s3LoggingBucket", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.s3.Bucket.class));
}
/**
* A fluent builder for {@link software.amazon.awsconstructs.services.cloudfronts3.CloudFrontToS3}.
*/
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope - represents the scope for all the resources.
This parameter is required.
* @param id - this is a a scope-unique id.
This parameter is required.
*/
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final software.amazon.awsconstructs.services.cloudfronts3.CloudFrontToS3Props.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new software.amazon.awsconstructs.services.cloudfronts3.CloudFrontToS3Props.Builder();
}
/**
* Optional user provided props to override the default props for the S3 Content Bucket.
*
* Default: - Default props are used
*
* @return {@code this}
* @param bucketProps Optional user provided props to override the default props for the S3 Content Bucket. This parameter is required.
*/
public Builder bucketProps(final software.amazon.awscdk.services.s3.BucketProps bucketProps) {
this.props.bucketProps(bucketProps);
return this;
}
/**
* Optional user provided props to override the default props.
*
* Default: - Default props are used
*
* @return {@code this}
* @param cloudFrontDistributionProps Optional user provided props to override the default props. This parameter is required.
*/
public Builder cloudFrontDistributionProps(final java.lang.Object cloudFrontDistributionProps) {
this.props.cloudFrontDistributionProps(cloudFrontDistributionProps);
return this;
}
/**
* Optional user provided props to override the default props for the CloudFront Log Bucket Access Log bucket.
*
* Providing both this and existingcloudFrontLoggingBucketAccessLogBucket
will cause an error
*
* Default: - Default props are used
*
* @return {@code this}
* @param cloudFrontLoggingBucketAccessLogBucketProps Optional user provided props to override the default props for the CloudFront Log Bucket Access Log bucket. This parameter is required.
*/
public Builder cloudFrontLoggingBucketAccessLogBucketProps(final software.amazon.awscdk.services.s3.BucketProps cloudFrontLoggingBucketAccessLogBucketProps) {
this.props.cloudFrontLoggingBucketAccessLogBucketProps(cloudFrontLoggingBucketAccessLogBucketProps);
return this;
}
/**
* Optional user provided props to override the default props for the CloudFront Log Bucket.
*
* Default: - Default props are used
*
* @return {@code this}
* @param cloudFrontLoggingBucketProps Optional user provided props to override the default props for the CloudFront Log Bucket. This parameter is required.
*/
public Builder cloudFrontLoggingBucketProps(final software.amazon.awscdk.services.s3.BucketProps cloudFrontLoggingBucketProps) {
this.props.cloudFrontLoggingBucketProps(cloudFrontLoggingBucketProps);
return this;
}
/**
* Existing instance of S3 Content Bucket object, providing both this and bucketProps
will cause an error.
*
* Default: - None
*
* @return {@code this}
* @param existingBucketObj Existing instance of S3 Content Bucket object, providing both this and bucketProps
will cause an error. This parameter is required.
*/
public Builder existingBucketObj(final software.amazon.awscdk.services.s3.IBucket existingBucketObj) {
this.props.existingBucketObj(existingBucketObj);
return this;
}
/**
* Optional user provided props to turn on/off the automatic injection of best practice HTTP security headers in all responses from cloudfront.
*
* Turning this on will inject default headers and is mutually exclusive with passing custom security headers
* via the responseHeadersPolicyProps parameter.
*
* Default: - true
*
* @return {@code this}
* @param insertHttpSecurityHeaders Optional user provided props to turn on/off the automatic injection of best practice HTTP security headers in all responses from cloudfront. This parameter is required.
*/
public Builder insertHttpSecurityHeaders(final java.lang.Boolean insertHttpSecurityHeaders) {
this.props.insertHttpSecurityHeaders(insertHttpSecurityHeaders);
return this;
}
/**
* Optional - Whether to maintain access logs for the CloudFront Logging bucket.
*
* Specifying false for this
* while providing info about the log bucket will cause an error.
*
* Default: - true
*
* @return {@code this}
* @param logCloudFrontAccessLog Optional - Whether to maintain access logs for the CloudFront Logging bucket. This parameter is required.
*/
public Builder logCloudFrontAccessLog(final java.lang.Boolean logCloudFrontAccessLog) {
this.props.logCloudFrontAccessLog(logCloudFrontAccessLog);
return this;
}
/**
* Optional user provided props to override the default props for the S3 Content Bucket Access Log Bucket.
*
* Default: - Default props are used
*
* @return {@code this}
* @param loggingBucketProps Optional user provided props to override the default props for the S3 Content Bucket Access Log Bucket. This parameter is required.
*/
public Builder loggingBucketProps(final software.amazon.awscdk.services.s3.BucketProps loggingBucketProps) {
this.props.loggingBucketProps(loggingBucketProps);
return this;
}
/**
* Optional - Whether to maintain access logs for the S3 Content bucket.
*
* Default: - true
*
* @return {@code this}
* @param logS3AccessLogs Optional - Whether to maintain access logs for the S3 Content bucket. This parameter is required.
*/
public Builder logS3AccessLogs(final java.lang.Boolean logS3AccessLogs) {
this.props.logS3AccessLogs(logS3AccessLogs);
return this;
}
/**
* Optional user provided props to provide an originPath that CloudFront appends to the origin domain name when CloudFront requests content from the origin.
*
* The string should start with a /
, for example /production
.
*
* Default: = '/'
*
* @return {@code this}
* @param originPath Optional user provided props to provide an originPath that CloudFront appends to the origin domain name when CloudFront requests content from the origin. This parameter is required.
*/
public Builder originPath(final java.lang.String originPath) {
this.props.originPath(originPath);
return this;
}
/**
* Optional user provided configuration that cloudfront applies to all http responses.
*
* Can be used to pass a custom ResponseSecurityHeadersBehavior, ResponseCustomHeadersBehavior or
* ResponseHeadersCorsBehavior to the cloudfront distribution.
*
* Passing a custom ResponseSecurityHeadersBehavior is mutually exclusive with turning on the default security headers
* via insertHttpSecurityHeaders
prop. Will throw an error if both insertHttpSecurityHeaders
is set to true
* and ResponseSecurityHeadersBehavior is passed.
*
* Default: - undefined
*
* @return {@code this}
* @param responseHeadersPolicyProps Optional user provided configuration that cloudfront applies to all http responses. This parameter is required.
*/
public Builder responseHeadersPolicyProps(final software.amazon.awscdk.services.cloudfront.ResponseHeadersPolicyProps responseHeadersPolicyProps) {
this.props.responseHeadersPolicyProps(responseHeadersPolicyProps);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awsconstructs.services.cloudfronts3.CloudFrontToS3}.
*/
@Override
public software.amazon.awsconstructs.services.cloudfronts3.CloudFrontToS3 build() {
return new software.amazon.awsconstructs.services.cloudfronts3.CloudFrontToS3(
this.scope,
this.id,
this.props.build()
);
}
}
}