Skip to content

Commit

Permalink
Merge pull request #83 from nhsconnect/PRMT-4703
Browse files Browse the repository at this point in the history
[PRMT-4703] Allow outbound TCP traffic to DynamoDB
  • Loading branch information
chrisbloe-nhse authored Mar 28, 2024
2 parents c7fefad + 4c3417f commit 34aa41e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion terraform/ecs-task.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ resource "aws_security_group" "ecs-tasks-sg" {
cidr_blocks = [data.aws_vpc.mhs.cidr_block]
}

egress {
description = "Allow outbound HTTPS traffic to dynamodb"
protocol = "tcp"
from_port = 443
to_port = 443
prefix_list_ids = [data.aws_ssm_parameter.dynamodb_prefix_list_id.value]
}

egress {
description = "Allow outbound HTTPS traffic to s3"
protocol = "tcp"
Expand Down Expand Up @@ -117,11 +125,14 @@ data "aws_vpc" "mhs" {
}
}

data "aws_ssm_parameter" "dynamodb_prefix_list_id" {
name = "/repo/${var.environment}/output/prm-deductions-infra/deductions-core/dynamodb_prefix_list_id"
}

data "aws_ssm_parameter" "s3_prefix_list_id" {
name = "/repo/${var.environment}/output/prm-deductions-infra/deductions-core/s3-prefix-list-id"
}


resource "aws_security_group" "vpn_to_ehr_repo_ecs" {
count = var.allow_vpn_to_ecs_tasks ? 1 : 0
name = "${var.environment}-vpn-to-${var.component_name}-ecs"
Expand Down

0 comments on commit 34aa41e

Please sign in to comment.