Skip to content

Commit

Permalink
Merge pull request #6684 from guardian/payment-api-supporter-product-…
Browse files Browse the repository at this point in the history
…data-permissions

PROD payment api needs to be able to write to CODE SupporterProductData dynamo table for test users
  • Loading branch information
rupertbates authored Jan 13, 2025
2 parents 9e76176 + 00c0c72 commit 8061374
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion cdk/lib/__snapshots__/payment-api.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions cdk/lib/payment-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,13 @@ export class PaymentApi extends GuStack {
"dynamodb:Query",
"dynamodb:DescribeTable",
],
resources: [
`arn:aws:dynamodb:*:*:table/SupporterProductData-${this.stage}`,
],
resources:
this.stage === "PROD"
? [
"arn:aws:dynamodb:*:*:table/SupporterProductData-PROD",
"arn:aws:dynamodb:*:*:table/SupporterProductData-CODE",
]
: ["arn:aws:dynamodb:*:*:table/SupporterProductData-CODE"],
}),

new GuAllowPolicy(this, "CloudwatchLogs", {
Expand Down

0 comments on commit 8061374

Please sign in to comment.