diff --git a/terraform/common/outputs.tf b/terraform/common/outputs.tf index 3ceff269f..8f030a2a6 100644 --- a/terraform/common/outputs.tf +++ b/terraform/common/outputs.tf @@ -72,3 +72,7 @@ output "sample_app_listen_address_ip" { output "sample_app_listen_address_port" { value = "4567" } + +output "sample_app_lb_port" { + value = "8080" +} diff --git a/terraform/ec2/main.tf b/terraform/ec2/main.tf index 8ad3f3413..55ea3217e 100644 --- a/terraform/ec2/main.tf +++ b/terraform/ec2/main.tf @@ -120,6 +120,7 @@ data "template_file" "docker_compose" { vars = { data_emitter_image = var.data_emitter_image + sample_app_external_port = module.common.sample_app_lb_port sample_app_listen_address_port = module.common.sample_app_listen_address_port listen_address = "${module.common.sample_app_listen_address_ip}:${module.common.sample_app_listen_address_port}" otel_resource_attributes = "service.namespace=${module.common.otel_service_namespace},service.name=${module.common.otel_service_name}" @@ -158,7 +159,7 @@ resource "null_resource" "sample-app-validator" { } provisioner "local-exec" { - command = "${module.common.validator_path} --args='-c ${var.validation_config} -t ${module.common.testing_id} --region ${var.region} --metric-namespace ${module.common.otel_service_namespace}/${module.common.otel_service_name} --endpoint http://${aws_instance.emitter.public_ip}:80'" + command = "${module.common.validator_path} --args='-c ${var.validation_config} -t ${module.common.testing_id} --region ${var.region} --metric-namespace ${module.common.otel_service_namespace}/${module.common.otel_service_name} --endpoint http://${aws_instance.emitter.public_ip}:${module.common.sample_app_lb_port}'" working_dir = "../../" } } diff --git a/terraform/ecs/main.tf b/terraform/ecs/main.tf index 42a13e18d..d95aaafab 100644 --- a/terraform/ecs/main.tf +++ b/terraform/ecs/main.tf @@ -138,7 +138,7 @@ resource "aws_lb_listener" "aoc_lb_listener" { count = var.sample_app_callable ? 1 : 0 load_balancer_arn = aws_lb.aoc_lb[0].arn - port = 80 + port = module.common.sample_app_lb_port protocol = "HTTP" default_action { @@ -170,7 +170,7 @@ resource "aws_ecs_service" "aoc" { provisioner "local-exec" { working_dir = "../../" - command = "${module.common.validator_path} --args='-c ${var.validation_config} -t ${module.common.testing_id} --region ${var.region} --metric-namespace ${module.common.otel_service_namespace}/${module.common.otel_service_name} --endpoint http://${aws_lb.aoc_lb[0].dns_name}:80'" + command = "${module.common.validator_path} --args='-c ${var.validation_config} -t ${module.common.testing_id} --region ${var.region} --metric-namespace ${module.common.otel_service_namespace}/${module.common.otel_service_name} --endpoint http://${aws_lb.aoc_lb[0].dns_name}:${module.common.sample_app_lb_port}'" } } diff --git a/terraform/ecs/variables.tf b/terraform/ecs/variables.tf index ec818c9bf..82111ba30 100644 --- a/terraform/ecs/variables.tf +++ b/terraform/ecs/variables.tf @@ -38,7 +38,7 @@ variable "aoc_image_repo" { } variable "aoc_version" { - default = "v0.1.12-296689894" + default = "v0.1.0-324996423" } variable "validation_config" { diff --git a/terraform/eks/main.tf b/terraform/eks/main.tf index 8188abb3c..39e8c00a7 100644 --- a/terraform/eks/main.tf +++ b/terraform/eks/main.tf @@ -211,7 +211,7 @@ resource "kubernetes_service" "sample_app_service" { type = "LoadBalancer" port { - port = 80 + port = module.common.sample_app_lb_port target_port = module.common.sample_app_listen_address_port } } @@ -297,7 +297,7 @@ resource "kubernetes_pod" "aoc_pod" { resource "null_resource" "callable_sample_app_validator" { count = var.sample_app_callable ? 1 : 0 provisioner "local-exec" { - command = "${module.common.validator_path} --args='-c ${var.validation_config} -t ${module.common.testing_id} --region ${var.region} --metric-namespace ${module.common.otel_service_namespace}/${module.common.otel_service_name} --endpoint http://${kubernetes_service.sample_app_service[0].load_balancer_ingress.0.hostname}:80'" + command = "${module.common.validator_path} --args='-c ${var.validation_config} -t ${module.common.testing_id} --region ${var.region} --metric-namespace ${module.common.otel_service_namespace}/${module.common.otel_service_name} --endpoint http://${kubernetes_service.sample_app_service[0].load_balancer_ingress.0.hostname}:${module.common.sample_app_lb_port}'" working_dir = "../../" } } diff --git a/terraform/template/ec2-docker-compose-config/default_ec2_docker_compose.yml.tpl b/terraform/template/ec2-docker-compose-config/default_ec2_docker_compose.yml.tpl index 043a5ee13..bddcaded8 100644 --- a/terraform/template/ec2-docker-compose-config/default_ec2_docker_compose.yml.tpl +++ b/terraform/template/ec2-docker-compose-config/default_ec2_docker_compose.yml.tpl @@ -3,7 +3,7 @@ services: sample_app: image: ${data_emitter_image} ports: - - "80:${sample_app_listen_address_port}" + - "${sample_app_external_port}:${sample_app_listen_address_port}" environment: LISTEN_ADDRESS: ${listen_address} OTEL_RESOURCE_ATTRIBUTES: ${otel_resource_attributes}