From 51218ed106333ad7c624d3b320d553f155627317 Mon Sep 17 00:00:00 2001 From: Ganeshrockz Date: Fri, 8 Dec 2023 19:00:32 +0530 Subject: [PATCH] Try fix flakiness --- examples/api-gateway/controller.tf | 1 - examples/api-gateway/echo-service/variables.tf | 2 +- examples/api-gateway/gateway.tf | 2 -- .../acceptance/tests/basic/terraform/basic-install/main.tf | 7 ++++++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/api-gateway/controller.tf b/examples/api-gateway/controller.tf index 10537d5b..45aece3c 100644 --- a/examples/api-gateway/controller.tf +++ b/examples/api-gateway/controller.tf @@ -12,7 +12,6 @@ module "ecs_controller" { consul_server_hosts = module.dc1.dev_consul_server.server_dns consul_ca_cert_arn = module.dc1.dev_consul_server.ca_cert_arn launch_type = "FARGATE" - consul_ecs_image = "ganeshrockz/api-gateway" consul_bootstrap_token_secret_arn = module.dc1.dev_consul_server.bootstrap_token_secret_arn diff --git a/examples/api-gateway/echo-service/variables.tf b/examples/api-gateway/echo-service/variables.tf index 653545cc..9312bc6c 100644 --- a/examples/api-gateway/echo-service/variables.tf +++ b/examples/api-gateway/echo-service/variables.tf @@ -24,7 +24,7 @@ variable "consul_ca_cert_arn" { variable "consul_ecs_image" { description = "Consul ECS image to used for the controller task." type = string - default = "ganeshrockz/api-gateway" + default = "hashicorppreview/consul-ecs:0.8.0-dev" } variable "private_subnets" { diff --git a/examples/api-gateway/gateway.tf b/examples/api-gateway/gateway.tf index ee7cdcd1..8bfa9062 100644 --- a/examples/api-gateway/gateway.tf +++ b/examples/api-gateway/gateway.tf @@ -34,8 +34,6 @@ module "api_gateway" { container_port = 8443 target_group_arn = aws_lb_target_group.this.arn }] - - consul_ecs_image = "ganeshrockz/api-gateway" } # Ingress rule for the API Gateway task that accepts traffic from the API gateway's LB diff --git a/test/acceptance/tests/basic/terraform/basic-install/main.tf b/test/acceptance/tests/basic/terraform/basic-install/main.tf index 29ad1daf..93aa8c7c 100644 --- a/test/acceptance/tests/basic/terraform/basic-install/main.tf +++ b/test/acceptance/tests/basic/terraform/basic-install/main.tf @@ -87,11 +87,13 @@ locals { module "consul_server" { source = "../../../../../../modules/dev-server" - lb_enabled = false + lb_enabled = true ecs_cluster_arn = var.ecs_cluster_arn subnet_ids = var.subnets vpc_id = var.vpc_id name = "consul_server_${var.suffix}" + lb_subnets = var.subnets + lb_ingress_rule_cidr_blocks = ["0.0.0.0/0"] log_configuration = { logDriver = "awslogs" options = { @@ -134,6 +136,7 @@ resource "aws_security_group_rule" "consul_server_ingress" { module "ecs_controller" { count = var.secure ? 1 : 0 + depends_on = [module.consul_server] source = "../../../../../../modules/controller" log_configuration = { logDriver = "awslogs" @@ -173,6 +176,7 @@ resource "aws_ecs_service" "test_client" { } module "test_client" { + depends_on = [module.consul_server] source = "../../../../../../modules/mesh-task" // mesh-task will lower case this to `test_client_` for the service name. family = "Test_Client_${var.suffix}" @@ -265,6 +269,7 @@ resource "aws_ecs_service" "test_server" { } module "test_server" { + depends_on = [module.consul_server] source = "../../../../../../modules/mesh-task" family = "test_server_${var.suffix}" consul_service_name = "${var.server_service_name}_${var.suffix}"