Skip to content

Commit

Permalink
tf: restore explicit tags for apm_standalone module (#15357)
Browse files Browse the repository at this point in the history
  • Loading branch information
1pkg authored Jan 23, 2025
1 parent 03c128c commit 3ed1167
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 3 deletions.
5 changes: 2 additions & 3 deletions testing/benchmark/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ provider "ec" {}

provider "aws" {
region = var.worker_region
default_tags {
tags = merge(local.ci_tags, module.tags.labels)
}
}

locals {
Expand Down Expand Up @@ -146,6 +143,7 @@ module "moxy" {

aws_provisioner_key_name = var.private_key

tags = merge(local.ci_tags, module.tags.tags)
depends_on = [module.vpc]
}

Expand All @@ -171,5 +169,6 @@ module "standalone_apm_server" {
elasticsearch_username = "elastic"
elasticsearch_password = module.moxy[0].moxy_password

tags = merge(local.ci_tags, module.tags.tags)
depends_on = [module.moxy]
}
3 changes: 3 additions & 0 deletions testing/infra/terraform/modules/moxy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,13 @@ resource "aws_instance" "moxy" {
"sleep 1"
]
}

tags = var.tags
}

resource "aws_key_pair" "provisioner_key" {
public_key = file("${var.aws_provisioner_key_name}.pub")
tags = var.tags
}

resource "random_password" "moxy_password" {
Expand Down
6 changes: 6 additions & 0 deletions testing/infra/terraform/modules/moxy/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ variable "moxy_bin_path" {
type = string
description = "Moxy path to binary to copy to the worker machine"
}

variable "tags" {
type = map(string)
default = {}
description = "Optional set of tags to use for all resources"
}
3 changes: 3 additions & 0 deletions testing/infra/terraform/modules/standalone_apm_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ resource "aws_instance" "apm" {
]
)
}

tags = var.tags
}

resource "null_resource" "apm_server_log" {
Expand Down Expand Up @@ -252,6 +254,7 @@ data "external" "latest_apm_server" {

resource "aws_key_pair" "provisioner_key" {
public_key = file("${var.aws_provisioner_key_name}.pub")
tags = var.tags
}

resource "random_password" "apm_secret_token" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ variable "apm_server_tail_sampling_storage_limit" {
description = "Storage size limit of APM Server tail-based sampling. Defaults to 10GB"
type = string
}

variable "tags" {
type = map(string)
default = {}
description = "Optional set of tags to use for all deployments"
}
1 change: 1 addition & 0 deletions testing/smoke/managed/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module "standalone_apm_server" {
elasticsearch_password = module.ec_deployment.elasticsearch_password
stack_version = var.stack_version

tags = merge(local.ci_tags, module.tags.tags)
ea_managed = true
}

Expand Down
1 change: 1 addition & 0 deletions testing/smoke/supported-os/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ module "standalone_apm_server" {
elasticsearch_password = module.ec_deployment.elasticsearch_password
stack_version = var.stack_version

tags = merge(local.ci_tags, module.tags.tags)
ea_managed = false
}

Expand Down

0 comments on commit 3ed1167

Please sign in to comment.