Skip to content

Commit 2d66ae7

Browse files
authored
added loggingBucketProps for aws-lambda-s3 (#422)
1 parent 743c874 commit 2d66ae7

File tree

5 files changed

+484
-8
lines changed

5 files changed

+484
-8
lines changed

source/patterns/@aws-solutions-constructs/aws-lambda-s3/README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ _Parameters_
5252
| **Name** | **Type** | **Description** |
5353
|:-------------|:----------------|-----------------|
5454
|existingLambdaObj?|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.Function.html)|Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.|
55-
|lambdaFunctionProps?|[`lambda.FunctionProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.FunctionProps.html)|User provided props to override the default props for the Lambda function.|
55+
|lambdaFunctionProps?|[`lambda.FunctionProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.FunctionProps.html)|Optional user provided props to override the default props for the Lambda function.|
5656
|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. |
57-
|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.|
57+
|bucketProps?|[`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 Bucket.|
5858
|bucketPermissions?|`string[]`|Optional bucket permissions to grant to the Lambda function. One or more of the following may be specified: `Delete`, `Put`, `Read`, `ReadWrite`, `Write`.|
5959
|existingVpc?|[`ec2.IVpc`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.IVpc.html)|An optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources and an Interface Endpoint will be created in the VPC for Amazon SQS. If an existing VPC is provided, the `deployVpc` property cannot be `true`. This uses `ec2.IVpc` to allow clients to supply VPCs that exist outside the stack using the [`ec2.Vpc.fromLookup()`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Vpc.html#static-fromwbrlookupscope-id-options) method.|
60-
|vpcProps?|[`ec2.VpcProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.VpcProps.html)|Optional user-provided properties to override the default properties for the new VPC. `enableDnsHostnames`, `enableDnsSupport`, `natGateways` and `subnetConfiguration` are set by the pattern, so any values for those properties supplied here will be overrriden. If `deployVpc` is not `true` then this property will be ignored.|
60+
|vpcProps?|[`ec2.VpcProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.VpcProps.html)|Optional user provided properties to override the default properties for the new VPC. `enableDnsHostnames`, `enableDnsSupport`, `natGateways` and `subnetConfiguration` are set by the pattern, so any values for those properties supplied here will be overrriden. If `deployVpc` is not `true` then this property will be ignored.|
6161
|deployVpc?|`boolean`|Whether to create a new VPC based on `vpcProps` into which to deploy this pattern. Setting this to true will deploy the minimal, most private VPC to run the pattern:<ul><li> One isolated subnet in each Availability Zone used by the CDK program</li><li>`enableDnsHostnames` and `enableDnsSupport` will both be set to true</li></ul>If this property is `true` then `existingVpc` cannot be specified. Defaults to `false`.|
62-
|bucketEnvironmentVariableName?|`string`|Optional Name for the S3 bucket environment variable set for the Lambda function.|
62+
|bucketEnvironmentVariableName?|`string`|Optional name for the S3 bucket environment variable set for the Lambda function.|
63+
|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.|
6364

6465
## Pattern Properties
6566

source/patterns/@aws-solutions-constructs/aws-lambda-s3/lib/index.ts

+11-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface LambdaToS3Props {
3030
*/
3131
readonly existingLambdaObj?: lambda.Function;
3232
/**
33-
* User provided props to override the default props for the Lambda function.
33+
* Optional user provided props to override the default props for the Lambda function.
3434
*
3535
* @default - Default properties are used.
3636
*/
@@ -42,7 +42,7 @@ export interface LambdaToS3Props {
4242
*/
4343
readonly existingBucketObj?: s3.IBucket;
4444
/**
45-
* User provided props to override the default props for the S3 Bucket.
45+
* Optional user provided props to override the default props for the S3 Bucket.
4646
*
4747
* @default - Default props are used
4848
*/
@@ -69,11 +69,17 @@ export interface LambdaToS3Props {
6969
*/
7070
readonly deployVpc?: boolean;
7171
/**
72-
* Optional Name for the S3 bucket environment variable set for the Lambda function.
72+
* Optional name for the S3 bucket environment variable set for the Lambda function.
7373
*
7474
* @default - None
7575
*/
7676
readonly bucketEnvironmentVariableName?: string;
77+
/**
78+
* Optional user provided props to override the default props for the S3 Logging Bucket.
79+
*
80+
* @default - Default props are used
81+
*/
82+
readonly loggingBucketProps?: s3.BucketProps
7783
}
7884

7985
/**
@@ -131,7 +137,8 @@ export class LambdaToS3 extends Construct {
131137
// Setup S3 Bucket
132138
if (!props.existingBucketObj) {
133139
[this.s3Bucket, this.s3LoggingBucket] = defaults.buildS3Bucket(this, {
134-
bucketProps: props.bucketProps
140+
bucketProps: props.bucketProps,
141+
loggingBucketProps: props.loggingBucketProps
135142
});
136143
bucket = this.s3Bucket;
137144
} else {

0 commit comments

Comments
 (0)