20482: Don't create S3 endpoint if using a preexisting VPC.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Mon, 15 May 2023 13:21:29 +0000 (10:21 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Mon, 15 May 2023 13:21:29 +0000 (10:21 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/terraform/aws/vpc/main.tf

index f0779d4fc596fa0d3f5af096a637ef81baa3158e..da98f1ac8357af95ba6bed2f8aa61027ed8a5783 100644 (file)
@@ -66,12 +66,13 @@ resource "aws_subnet" "private_subnet" {
 # VPC S3 access
 #
 resource "aws_vpc_endpoint" "s3" {
+  count = var.vpc_id == "" ? 1 : 0
   vpc_id = local.arvados_vpc_id
   service_name = "com.amazonaws.${var.region_name}.s3"
 }
 resource "aws_vpc_endpoint_route_table_association" "compute_s3_route" {
   count = var.private_subnet_id == "" ? 1 : 0
-  vpc_endpoint_id = aws_vpc_endpoint.s3.id
+  vpc_endpoint_id = aws_vpc_endpoint.s3[0].id
   route_table_id = aws_route_table.private_subnet_rt[0].id
 }