Skip to content

Commit

Permalink
update setAutoDeleteObjectsLogGroup to take a Stack instead of a Cons…
Browse files Browse the repository at this point in the history
…truct scope
  • Loading branch information
samson-keung committed Jun 11, 2024
1 parent f47255a commit 43718d5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/aws-cdk-lib/aws-s3/lib/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1887,18 +1887,17 @@ export class Bucket extends BucketBase {
}

/**
* Set the log group on the singleton AutoDeleteObjects provider lambda.
* Note: Calling this multiple times will override the previously set log group
* Set the log group on the stack wide singleton AutoDeleteObjects provider lambda.
*
* In the case of no buckets with `autoDeleteObjects: true` exist in the stack,
* this will throw an exception as no AutoDeleteObjects provider lambda will exist
* in the stack.
*
* @param scope the stack with bucket(s) with `autoDeleteObjects: true`.
* @param stack the stack with the singleton AutoDeleteObjects provider lambda.
* @param logGroup the log group to use on the lambda.
*/
public static setAutoDeleteObjectsLogGroup(scope: Construct, logGroup: logs.ILogGroup): void {
AutoDeleteObjectsProvider.useLogGroup(scope, AUTO_DELETE_OBJECTS_RESOURCE_TYPE, logGroup.logGroupName);
public static setAutoDeleteObjectsLogGroup(stack: Stack, logGroup: logs.ILogGroup): void {
AutoDeleteObjectsProvider.useLogGroup(stack, AUTO_DELETE_OBJECTS_RESOURCE_TYPE, logGroup.logGroupName);
}

public readonly bucketArn: string;
Expand Down

0 comments on commit 43718d5

Please sign in to comment.