mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Merge pull request #1302 from serverless/append-namespaces-to-s3-event-resources
Append namespaces to s3 event resources
This commit is contained in:
commit
59e815089a
@ -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
|
||||
|
||||
@ -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: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user