Skip to content

Commit

Permalink
Set loggingBucket in response
Browse files Browse the repository at this point in the history
  • Loading branch information
biffgaut committed Mar 27, 2023
1 parent 66a4266 commit fd5a4f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ export function buildS3Bucket(scope: Construct,
}

loggingBucket = createLoggingBucket(scope, _loggingBucketId, loggingBucketProps);
} else if (props.bucketProps?.serverAccessLogsBucket) {
loggingBucket = props.bucketProps?.serverAccessLogsBucket as s3.Bucket;
}

// Attach the Default Life Cycle policy ONLY IF the versioning is ENABLED
if (props.bucketProps?.versioned === undefined || props.bucketProps.versioned) {
customBucketProps = DefaultS3Props(loggingBucket, lifecycleRules);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ test('s3 bucket with LoggingBucket and versioning turned off', () => {

expect(buildS3BucketResponse.bucket).toBeDefined();
// The line below fails, this appears to be a bug. Entered Issue 906
// expect(response.loggingBucket).toBeDefined();
expect(buildS3BucketResponse.loggingBucket).toBeDefined();

const template = Template.fromStack(stack);
template.hasResourceProperties("AWS::S3::Bucket", {
Expand Down

0 comments on commit fd5a4f1

Please sign in to comment.