mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Check if default policy is available when merging PolicyDocument statements for streams
This commit is contained in:
parent
5ad10516d2
commit
e76706fb6e
@ -113,20 +113,23 @@ class AwsCompileStreamEvents {
|
||||
};
|
||||
}
|
||||
|
||||
// update the PolicyDocument statements
|
||||
const statement = this.serverless.service.provider.compiledCloudFormationTemplate
|
||||
.Resources
|
||||
.IamPolicyLambdaExecution
|
||||
.Properties
|
||||
.PolicyDocument
|
||||
.Statement;
|
||||
// update the PolicyDocument statements (if default policy is used)
|
||||
if (this.serverless.service.provider.compiledCloudFormationTemplate
|
||||
.Resources.IamPolicyLambdaExecution) {
|
||||
const statement = this.serverless.service.provider.compiledCloudFormationTemplate
|
||||
.Resources
|
||||
.IamPolicyLambdaExecution
|
||||
.Properties
|
||||
.PolicyDocument
|
||||
.Statement;
|
||||
|
||||
this.serverless.service.provider.compiledCloudFormationTemplate
|
||||
.Resources
|
||||
.IamPolicyLambdaExecution
|
||||
.Properties
|
||||
.PolicyDocument
|
||||
.Statement = statement.concat([streamStatement]);
|
||||
this.serverless.service.provider.compiledCloudFormationTemplate
|
||||
.Resources
|
||||
.IamPolicyLambdaExecution
|
||||
.Properties
|
||||
.PolicyDocument
|
||||
.Statement = statement.concat([streamStatement]);
|
||||
}
|
||||
|
||||
const newStreamObject = {
|
||||
[`${normalizedFunctionName}EventSourceMapping${
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user