Skip to content

Commit

Permalink
Make import statememts style consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
samson-keung committed May 25, 2024
1 parent e554487 commit 5a201cb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha';
import { Construct } from 'constructs';
import * as s3 from 'aws-cdk-lib/aws-s3';
import * as logs from 'aws-cdk-lib/aws-logs';
import { RetentionDays } from 'aws-cdk-lib/aws-logs';
import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from 'aws-cdk-lib/custom-resources';
import { STANDARD_CUSTOM_RESOURCE_PROVIDER_RUNTIME } from '../../config';

Expand Down Expand Up @@ -42,7 +41,7 @@ class TestStack extends Stack {
autoDeleteObjects: true,
autoDeleteObjectsLogGroup: new logs.LogGroup(this, 'LogGroup', {
logGroupName: 'AutoDeleteObjectsLambdaLogs',
retention: RetentionDays.THREE_DAYS,
retention: logs.RetentionDays.THREE_DAYS,
}),
});

Expand Down
9 changes: 4 additions & 5 deletions packages/aws-cdk-lib/aws-s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,15 +627,14 @@ When `autoDeleteObjects` is enabled, `s3:PutBucketPolicy` is added to the bucket
Pass a custom log group via the `autoDeleteObjectsLogGroup` option, which will be used by the custom resource lambda.

```ts
import { LogGroup, RetentionDays } from 'aws-cdk-lib/aws-logs';
import { ILogGroup } from 'aws-cdk-lib/aws-logs';

declare const logGroup: ILogGroup;

const bucket = new s3.Bucket(this, 'MyTempFileBucket', {
removalPolicy: cdk.RemovalPolicy.DESTROY,
autoDeleteObjects: true,
autoDeleteObjectsLogGroup: new LogGroup(this, 'LogGroup', {
logGroupName: 'MyLogGroup',
retention: RetentionDays.TWO_YEARS
})
autoDeleteObjectsLogGroup: logGroup
});
```

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-s3/lib/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { parseBucketArn, parseBucketName } from './util';
import * as events from '../../aws-events';
import * as iam from '../../aws-iam';
import * as kms from '../../aws-kms';
import * as logs from '../../aws-logs/index';
import * as logs from '../../aws-logs';
import {
CustomResource,
Duration,
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-s3/test/bucket.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { testDeprecated } from '@aws-cdk/cdk-build-tools';
import { Annotations, Match, Template } from '../../assertions';
import * as iam from '../../aws-iam';
import * as kms from '../../aws-kms';
import { LogGroup } from '../../aws-logs';
import * as logs from '../../aws-logs';
import * as cdk from '../../core';
import * as s3 from '../lib';

Expand Down Expand Up @@ -3470,7 +3470,7 @@ describe('bucket', () => {
new s3.Bucket(stack, 'MyBucket', {
removalPolicy: cdk.RemovalPolicy.DESTROY,
autoDeleteObjects: true,
autoDeleteObjectsLogGroup: new LogGroup(stack, 'LogGroup1', {
autoDeleteObjectsLogGroup: new logs.LogGroup(stack, 'LogGroup1', {
logGroupName: 'MyLogGroup',
}),
});
Expand Down

0 comments on commit 5a201cb

Please sign in to comment.