diff --git a/lib/plugins/awsCompileS3Events/awsCompileS3Events.js b/lib/plugins/awsCompileS3Events/awsCompileS3Events.js index c5fccb32a..797015a49 100644 --- a/lib/plugins/awsCompileS3Events/awsCompileS3Events.js +++ b/lib/plugins/awsCompileS3Events/awsCompileS3Events.js @@ -65,7 +65,7 @@ class AwsCompileS3Events { const bucketResourceKey = bucketName.replace(/-/g, ''); const newBucketObject = { - [bucketResourceKey]: newS3Bucket, + [`${bucketResourceKey}S3Event`]: newS3Bucket, }; // 2. create the corresponding Lambda permissions @@ -78,7 +78,7 @@ class AwsCompileS3Events { }; const newPermissionObject = { - [`${bucketResourceKey}Permission`]: newPermission, + [`${bucketResourceKey}S3EventPermission`]: newPermission, }; // merge the new bucket and permission objects into the Resources section diff --git a/lib/plugins/awsCompileS3Events/tests/awsCompileS3Events.js b/lib/plugins/awsCompileS3Events/tests/awsCompileS3Events.js index 145697c15..7fc00eeab 100644 --- a/lib/plugins/awsCompileS3Events/tests/awsCompileS3Events.js +++ b/lib/plugins/awsCompileS3Events/tests/awsCompileS3Events.js @@ -48,7 +48,7 @@ describe('awsCompileS3Events', () => { const serviceResourcesAwsResourcesObjectMock = { Resources: { - firstfunctionbucket1: { + firstfunctionbucket1S3Event: { Type: 'AWS::S3::Bucket', Properties: { BucketName: 'first-function-bucket1', @@ -67,7 +67,7 @@ describe('awsCompileS3Events', () => { }, }, }, - firstfunctionbucket1Permission: { + firstfunctionbucket1S3EventPermission: { Type: 'AWS::Lambda::Permission', Properties: { FunctionName: { @@ -81,7 +81,7 @@ describe('awsCompileS3Events', () => { }, }, - firstfunctionbucket2: { + firstfunctionbucket2S3Event: { Type: 'AWS::S3::Bucket', Properties: { BucketName: 'first-function-bucket2', @@ -100,7 +100,7 @@ describe('awsCompileS3Events', () => { }, }, }, - firstfunctionbucket2Permission: { + firstfunctionbucket2S3EventPermission: { Type: 'AWS::Lambda::Permission', Properties: { FunctionName: { @@ -114,7 +114,7 @@ describe('awsCompileS3Events', () => { }, }, - secondfunctionbucket1: { + secondfunctionbucket1S3Event: { Type: 'AWS::S3::Bucket', Properties: { BucketName: 'second-function-bucket1', @@ -133,7 +133,7 @@ describe('awsCompileS3Events', () => { }, }, }, - secondfunctionbucket1Permission: { + secondfunctionbucket1S3EventPermission: { Type: 'AWS::Lambda::Permission', Properties: { FunctionName: { @@ -147,7 +147,7 @@ describe('awsCompileS3Events', () => { }, }, - secondfunctionbucket2: { + secondfunctionbucket2S3Event: { Type: 'AWS::S3::Bucket', Properties: { BucketName: 'second-function-bucket2', @@ -166,7 +166,7 @@ describe('awsCompileS3Events', () => { }, }, }, - secondfunctionbucket2Permission: { + secondfunctionbucket2S3EventPermission: { Type: 'AWS::Lambda::Permission', Properties: { FunctionName: {