From e550657aab6b0c66f4142cc82a97700e11f15fa5 Mon Sep 17 00:00:00 2001 From: Jonathon Herbert Date: Wed, 31 Jul 2024 10:33:22 +0100 Subject: [PATCH] Update snapshot --- .../recipes-backend.test.ts.snap | 27 ++++++++++++++++++- cdk/lib/facia-connection.ts | 3 ++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/cdk/lib/__snapshots__/recipes-backend.test.ts.snap b/cdk/lib/__snapshots__/recipes-backend.test.ts.snap index 0428af1e..b76ef33a 100644 --- a/cdk/lib/__snapshots__/recipes-backend.test.ts.snap +++ b/cdk/lib/__snapshots__/recipes-backend.test.ts.snap @@ -11,6 +11,8 @@ exports[`The RecipesBackend stack matches the snapshot 1`] = ` "GuParameter", "GuParameter", "GuParameter", + "GuParameter", + "GuParameter", "GuLambdaFunction", "GuLambdaFunction", "GuLambdaErrorPercentageAlarm", @@ -75,6 +77,16 @@ exports[`The RecipesBackend stack matches the snapshot 1`] = ` "Default": "/account/content-api-common/alarms/urgent-alarm-topic", "Type": "AWS::SSM::Parameter::Value", }, + "faciaPublishStatusSNSTopicParam": { + "Default": "/TEST/content-api/recipes-responder/facia-status-sns-topic-arn", + "Description": "Topic ARN for publication status messages", + "Type": "String", + }, + "faciaPublishStatusSNSTopicRoleParam": { + "Default": "/TEST/content-api/recipes-responder/facia-status-sns-topic-role-arn", + "Description": "Topic role ARN for publication status messages", + "Type": "String", + }, "faciaSNSTopicParam": { "Default": "/TEST/content-api/recipes-responder/facia-sns-topic-arn", "Description": "The ARN of the facia-tool SNS topic that emits curation notifications", @@ -1560,7 +1572,7 @@ def submit_response(event: dict, context, response_status: str, error_message: s }, "Type": "AWS::SQS::QueuePolicy", }, - "RecipesFaciaConnectionRecipesBackendRecipesFaciafaciaSNSTopic4A8496A449BAE420": { + "RecipesFaciaConnectionRecipesBackendRecipesFaciafaciaPublishSNSTopicA854730B0579B71E": { "DependsOn": [ "RecipesFaciaConnectionPolicyC7CB124D", ], @@ -1635,6 +1647,12 @@ def submit_response(event: dict, context, response_status: str, error_message: s "Variables": { "APP": "recipes-facia-responder", "CONTENT_URL_BASE": "recipes.guardianapis.com", + "FACIA_PUBLISH_STATUS_ROLE_ARN": { + "Ref": "faciaPublishStatusSNSTopicRoleParam", + }, + "FACIA_PUBLISH_STATUS_TOPIC_ARN": { + "Ref": "faciaSNSTopicParam", + }, "FASTLY_API_KEY": { "Ref": "fastlyKey", }, @@ -1904,6 +1922,13 @@ def submit_response(event: dict, context, response_status: str, error_message: s ], }, }, + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Resource": { + "Ref": "faciaPublishStatusSNSTopicRoleParam", + }, + }, { "Action": [ "sqs:ReceiveMessage", diff --git a/cdk/lib/facia-connection.ts b/cdk/lib/facia-connection.ts index 96e84d6e..bbd76740 100644 --- a/cdk/lib/facia-connection.ts +++ b/cdk/lib/facia-connection.ts @@ -83,7 +83,8 @@ export class FaciaConnection extends Construct { FASTLY_API_KEY: fastlyKeyParam.valueAsString, STATIC_BUCKET: serving.staticBucket.bucketName, CONTENT_URL_BASE: contentUrlBase, - FACIA_PUBLISH_STATUS_TOPIC_ARN: faciaPublishStatusSNSTopic.topicArn + FACIA_PUBLISH_STATUS_TOPIC_ARN: faciaPublishStatusSNSTopic.topicArn, + FACIA_PUBLISH_STATUS_ROLE_ARN: faciaPublishStatusSNSRole.roleArn }, fileName: 'facia-responder.zip', functionName: `RecipesFaciaResponder-${scope.stage}`,