Skip to content

Commit

Permalink
Merge pull request #3011 from uktrade/feat/only-peer-with-paas-if-con…
Browse files Browse the repository at this point in the history
…figured

feat: only configure with PaaS if configured
  • Loading branch information
michalc authored Feb 8, 2024
2 parents 84b0392 + 2ee0cf6 commit 1edd391
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions infra/security_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1578,6 +1578,7 @@ resource "aws_security_group_rule" "datasets_db_ingress_postgres_from_notebooks"
}

resource "aws_security_group_rule" "datasets_db_ingress_postgres_from_paas" {
count = var.paas_cidr_block != "" ? 1 : 0
description = "ingress-postgres-from-paas"

security_group_id = "${aws_security_group.datasets.id}"
Expand Down Expand Up @@ -1639,6 +1640,7 @@ resource "aws_security_group_rule" "elasticsearch_ingress_from_admin" {
}

resource "aws_security_group_rule" "elasticsearch_ingress_from_paas" {
count = var.paas_cidr_block != "" ? 1 : 0
description = "ingress-elasticsearch-https-from-paas-ie-data-flow"

security_group_id = "${aws_security_group.datasets.id}"
Expand Down
1 change: 1 addition & 0 deletions infra/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ resource "aws_main_route_table_association" "datasets" {
}

resource "aws_route" "pcx_datasets_to_paas" {
count = var.paas_cidr_block != "" ? 1 : 0
route_table_id = "${aws_route_table.datasets.id}"
destination_cidr_block = "${var.paas_cidr_block}"
vpc_peering_connection_id = "${aws_vpc_peering_connection.datasets_to_paas.id}"
Expand Down

0 comments on commit 1edd391

Please sign in to comment.