@aws-solutions-constructs/core
Version:
Core CDK Construct for patterns library
80 lines (79 loc) • 3.58 kB
TypeScript
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
* with the License. A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
export interface BuildS3BucketProps {
/**
* User provided props to override the default props for the S3 Bucket.
*
* @default - Default props are used
*/
readonly bucketProps?: s3.BucketProps;
/**
* User provided props to override the default props for the S3 Logging Bucket.
*
* @default - Default props are used
*/
readonly loggingBucketProps?: s3.BucketProps;
/**
* Whether to turn on Access Logs for S3. Uses an S3 bucket with associated storage costs.
* Enabling Access Logging is a best practice.
*
* @default - true
*/
readonly logS3AccessLogs?: boolean;
}
/**
* @internal This is an internal core function and should not be called directly by Solutions Constructs clients.
*/
export declare function createS3AccessLoggingBucket(scope: Construct, bucketId: string, loggingBucketProps: s3.BucketProps): s3.Bucket;
export interface CreateCloudFrontLoggingBucketRequest {
readonly loggingBucketProps: s3.BucketProps;
readonly s3AccessLogBucketProps?: s3.BucketProps;
readonly enableS3AccessLogs?: boolean;
}
export interface CreateCloudFrontLoggingBucketResponse {
readonly logBucket: s3.Bucket;
readonly s3AccessLogBucket?: s3.Bucket;
}
/**
* @internal This is an internal core function and should not be called directly by Solutions Constructs clients.
*/
export declare function createCloudFrontLoggingBucket(scope: Construct, bucketId: string, props: CreateCloudFrontLoggingBucketRequest): CreateCloudFrontLoggingBucketResponse;
/**
* @internal This is an internal core function and should not be called directly by Solutions Constructs clients.
*/
export declare function createAlbLoggingBucket(scope: Construct, bucketId: string, loggingBucketProps: s3.BucketProps): s3.Bucket;
export interface BuildS3BucketResponse {
readonly bucket: s3.Bucket;
readonly loggingBucket?: s3.Bucket;
}
/**
* @internal This is an internal core function and should not be called directly by Solutions Constructs clients.
* @internal This functionality is exposed externally through aws-constructs-factories
*/
export declare function buildS3Bucket(scope: Construct, props: BuildS3BucketProps, bucketId?: string): BuildS3BucketResponse;
/**
* @internal This is an internal core function and should not be called directly by Solutions Constructs clients.
*/
export declare function addCfnNagS3BucketNotificationRulesToSuppress(stackRoot: cdk.Stack, logicalId: string): void;
export interface S3Props {
readonly existingBucketObj?: s3.Bucket;
readonly existingBucketInterface?: s3.IBucket;
readonly bucketProps?: s3.BucketProps;
readonly existingLoggingBucketObj?: s3.IBucket;
readonly loggingBucketProps?: s3.BucketProps;
readonly logS3AccessLogs?: boolean;
}
export declare function CheckS3Props(propsObject: S3Props | any): void;