Skip to content

Commit

Permalink
fix: explicitly set ObjectOwnership on logs bucket due to changes in …
Browse files Browse the repository at this point in the history
…S3 defaults (#812)

Related to aws/aws-cdk#25358
Resolves #806

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
dontirun authored Apr 30, 2023
1 parent 20ea026 commit 3dfbf49
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ import {
} from 'aws-cdk-lib/aws-iam';
import {
Code, DockerImageCode,
DockerImageFunction, FileSystem as LambdaFileSystem, Function,
IDestination, Runtime,
DockerImageFunction,
Function,
IDestination,
FileSystem as LambdaFileSystem,
Runtime,
} from 'aws-cdk-lib/aws-lambda';
import {
EventBridgeDestination,
SqsDestination,
} from 'aws-cdk-lib/aws-lambda-destinations';
import { Bucket, BucketEncryption, EventType, IBucket } from 'aws-cdk-lib/aws-s3';
import { Bucket, BucketEncryption, EventType, IBucket, ObjectOwnership } from 'aws-cdk-lib/aws-s3';
import { LambdaDestination } from 'aws-cdk-lib/aws-s3-notifications';
import { Queue, QueueEncryption } from 'aws-cdk-lib/aws-sqs';
import { Construct } from 'constructs';
Expand Down Expand Up @@ -305,6 +308,7 @@ export class ServerlessClamscan extends Construct {
ignorePublicAcls: true,
restrictPublicBuckets: true,
},
objectOwnership: ObjectOwnership.OBJECT_WRITER,
},
);
this.defsAccessLogsBucket.addToResourcePolicy(
Expand Down

0 comments on commit 3dfbf49

Please sign in to comment.