Skip to content

BAU: Add permissions for _staging queue #3030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions deploy/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Conditions:
IsDev01: !Equals [ !Ref AWS::AccountId, "130355686670" ]
IsNotDevelopment: !Not [ !Condition IsDevelopment ]
IsBuild: !Equals [ !Ref Environment, "build" ]
IsStaging: !Equals [ !Ref Environment, staging ]
IsProduction: !Equals [ !Ref Environment, "production" ]
IsSubscriptionEnviroment: !Or
- !Equals [ !Ref Environment, staging ]
Expand Down Expand Up @@ -2107,6 +2108,24 @@ Resources:
Action:
- kms:Decrypt
Resource: !FindInMap [ EnvironmentConfiguration, !Ref AWS::AccountId, asyncCriResponseQueueKmsKeyArn ]
- !If
- IsStaging
- Sid: stagingAsyncCriResponseQueuePermission
Effect: Allow
Action:
- sqs:DeleteMessage
- sqs:GetQueueAttributes
- sqs:ReceiveMessage
Resource: "arn:aws:sqs:eu-west-2:388905755587:stubQueue_criResponseQueue_staging"
- !Ref AWS::NoValue
- !If
- IsStaging
- Sid: stagingAsyncCriResponseQueueKmsKeyPermission
Effect: Allow
Action:
- kms:Decrypt
Resource: "arn:aws:kms:eu-west-2:388905755587:key/60feaacf-271c-4cba-81d3-17df3952e605"
- !Ref AWS::NoValue
Events:
AsyncCriResponse:
Type: SQS
Expand All @@ -2122,6 +2141,15 @@ Resources:
BatchSize: 1
FunctionResponseTypes:
- ReportBatchItemFailures
AsyncCriResponseStagingStub:
Type: SQS
Condition: IsStaging
Properties:
Enabled: true
Queue: "arn:aws:sqs:eu-west-2:388905755587:stubQueue_criResponseQueue_staging"
BatchSize: 1
FunctionResponseTypes:
- ReportBatchItemFailures
AutoPublishAlias: live

ProcessAsyncCriCredentialFunctionLogGroup:
Expand Down