Skip to content

Commit 6fc6b3e

Browse files
committed
added logS3AccessLogs and LoggingBucket props
1 parent 6fab3e5 commit 6fc6b3e

File tree

7 files changed

+1147
-7
lines changed

7 files changed

+1147
-7
lines changed

Diff for: source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3-and-kinesisanalytics/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,20 @@ _Parameters_
8383
|existingBucketObj?|[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.IBucket.html)|Existing instance of S3 Bucket object. If this is provided, then also providing bucketProps is an error. |
8484
|bucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketProps.html)|User provided props to override the default props for the S3 Bucket.|
8585
|logGroupProps?|[`logs.LogGroupProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-logs.LogGroupProps.html)|User provided props to override the default props for for the CloudWatchLogs LogGroup.|
86+
|loggingBucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.BucketProps.html)|Optional user provided props to override the default props for the S3 Logging Bucket.|
87+
|logS3AccessLogs?| boolean|Whether to turn on Access Logging for the S3 bucket. Creates an S3 bucket with associated storage costs for the logs. Enabling Access Logging is a best practice. default - true|
8688

8789
## Pattern Properties
8890

8991
| **Name** | **Type** | **Description** |
9092
|:-------------|:----------------|-----------------|
9193
|kinesisAnalytics|[`kinesisAnalytics.CfnApplication`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kinesisanalytics.CfnApplication.html)|Returns an instance of the Kinesis Analytics application created by the pattern.|
9294
|kinesisFirehose|[`kinesisFirehose.CfnDeliveryStream`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kinesisfirehose.CfnDeliveryStream.html)|Returns an instance of the Kinesis Firehose delivery stream created by the pattern.|
93-
|kinesisFirehoseRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-iam.Role.html)|Returns an instance of the iam.Role created by the construct for Kinesis Data Firehose delivery stream|
95+
|kinesisFirehoseRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-iam.Role.html)|Returns an instance of the iam.Role created by the construct for Kinesis Data Firehose delivery stream.|
9496
|kinesisFirehoseLogGroup|[`logs.LogGroup`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-logs.LogGroup.html)|Returns an instance of the LogGroup created by the construct for Kinesis Data Firehose delivery stream|
9597
|s3Bucket?|[`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.Bucket.html)|Returns an instance of the S3 bucket created by the pattern.|
9698
|s3LoggingBucket?|[`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.Bucket.html)|Returns an instance of s3.Bucket created by the construct as the logging bucket for the primary bucket.|
99+
|s3BucketInterface|[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-s3.IBucket.html)|Returns an instance of s3.IBucket created by the construct.|
97100

98101
## Default settings
99102

Diff for: source/patterns/@aws-solutions-constructs/aws-kinesisfirehose-s3-and-kinesisanalytics/lib/index.ts

+18-5
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ export interface KinesisFirehoseToAnalyticsAndS3Props {
5656
* @default - Default props are used
5757
*/
5858
readonly logGroupProps?: logs.LogGroupProps
59+
/**
60+
* Optional user provided props to override the default props for the S3 Logging Bucket.
61+
*
62+
* @default - Default props are used
63+
*/
64+
readonly loggingBucketProps?: s3.BucketProps;
65+
/**
66+
* Whether to turn on Access Logs for the S3 bucket with the associated storage costs.
67+
* Enabling Access Logging is a best practice.
68+
*
69+
* @default - true
70+
*/
71+
readonly logS3AccessLogs?: boolean;
5972
}
6073

6174
/**
@@ -68,6 +81,7 @@ export class KinesisFirehoseToAnalyticsAndS3 extends Construct {
6881
public readonly kinesisFirehoseLogGroup: logs.LogGroup;
6982
public readonly s3Bucket?: s3.Bucket;
7083
public readonly s3LoggingBucket?: s3.Bucket;
84+
public readonly s3BucketInterface: s3.IBucket;
7185

7286
/**
7387
* @summary Constructs a new instance of the KinesisFirehoseToAnalyticsAndS3 class.
@@ -81,16 +95,14 @@ export class KinesisFirehoseToAnalyticsAndS3 extends Construct {
8195
super(scope, id);
8296
defaults.CheckProps(props);
8397

84-
if (props.existingBucketObj && props.bucketProps) {
85-
throw new Error('Cannot specify both bucket properties and an existing bucket');
86-
}
87-
8898
// Setup the kinesisfirehose-s3 pattern
8999
const kinesisFirehoseToS3Props: KinesisFirehoseToS3Props = {
90100
kinesisFirehoseProps: props.kinesisFirehoseProps,
91101
existingBucketObj: props.existingBucketObj,
92102
bucketProps: props.bucketProps,
93-
logGroupProps: props.logGroupProps
103+
logGroupProps: props.logGroupProps,
104+
loggingBucketProps: props.loggingBucketProps,
105+
logS3AccessLogs: props.logS3AccessLogs
94106
};
95107

96108
// Add the kinesisfirehose-s3 pattern
@@ -107,5 +119,6 @@ export class KinesisFirehoseToAnalyticsAndS3 extends Construct {
107119
this.kinesisFirehoseRole = kfs.kinesisFirehoseRole;
108120
this.s3Bucket = kfs.s3Bucket;
109121
this.s3LoggingBucket = kfs.s3LoggingBucket;
122+
this.s3BucketInterface = kfs.s3BucketInterface;
110123
}
111124
}

0 commit comments

Comments
 (0)