Skip to content

Commit

Permalink
remove legacy behaviour from s3 bucket unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Niranjan Jayakar committed Feb 9, 2021
1 parent 09d87d0 commit 2845514
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/@aws-cdk/aws-s3/test/bucket.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1474,18 +1474,17 @@ describe('bucket', () => {

});

// testing this only in legacy mode. see https://github.com/aws/aws-cdk/issues/12921
testLegacyBehavior('in different accounts, with a KMS Key', cdk.App, (app) => {
test('in different accounts, with a KMS Key', () => {
// given
const stackA = new cdk.Stack(app, 'StackA', { env: { account: '123456789012' } });
const stackA = new cdk.Stack(undefined, 'StackA', { env: { account: '123456789012' } });
const key = new kms.Key(stackA, 'MyKey');
const bucketFromStackA = new s3.Bucket(stackA, 'MyBucket', {
bucketName: 'my-bucket-physical-name',
encryptionKey: key,
encryption: s3.BucketEncryption.KMS,
});

const stackB = new cdk.Stack(app, 'StackB', { env: { account: '234567890123' } });
const stackB = new cdk.Stack(undefined, 'StackB', { env: { account: '234567890123' } });
const roleFromStackB = new iam.Role(stackB, 'MyRole', {
assumedBy: new iam.AccountPrincipal('234567890123'),
roleName: 'MyRolePhysicalName',
Expand Down

0 comments on commit 2845514

Please sign in to comment.