Skip to content

Commit

Permalink
Merge pull request #3 from serverless-components/policy-statement-merge
Browse files Browse the repository at this point in the history
fix merging of statements in policy
  • Loading branch information
eahefnawy authored Sep 24, 2019
2 parents 9752f99 + f729364 commit a935dc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serverless/aws-sns-topic",
"version": "1.1.0",
"version": "1.1.1",
"main": "./serverless.js",
"publishConfig": {
"access": "public"
Expand Down
6 changes: 5 additions & 1 deletion serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ class AwsSnsTopic extends Component {
region: inputs.region || defaults.region
})

const config = mergeDeepRight(getDefaults({ accountId, arn, defaults }), inputs)
const populatedDefaults = getDefaults({ accountId, arn, defaults })
const config = mergeDeepRight(populatedDefaults, inputs)
for (const i in config.policy.Statement) {
config.policy.Statement[i] = mergeDeepRight(populatedDefaults.policy.Statement[0], config.policy.Statement[i])
}
config.arn = arn

this.context.status(`Deploying`)
Expand Down

0 comments on commit a935dc6

Please sign in to comment.