Skip to content

Commit

Permalink
change port 80 to 8080 for sample app
Browse files Browse the repository at this point in the history
  • Loading branch information
wyTrivail committed Oct 26, 2020
1 parent f8206da commit 80a7240
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions terraform/common/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 2 additions & 1 deletion terraform/ec2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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 = "../../"
}
}
Expand Down
4 changes: 2 additions & 2 deletions terraform/ecs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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}'"
}
}

Expand Down
2 changes: 1 addition & 1 deletion terraform/ecs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ variable "aoc_image_repo" {
}

variable "aoc_version" {
default = "v0.1.12-296689894"
default = "v0.1.0-324996423"
}

variable "validation_config" {
Expand Down
4 changes: 2 additions & 2 deletions terraform/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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 = "../../"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 80a7240

Please sign in to comment.