diff --git a/testing/infra/terraform/modules/moxy/main.tf b/testing/infra/terraform/modules/moxy/main.tf index 1ad05aa0d90..245b69f0987 100644 --- a/testing/infra/terraform/modules/moxy/main.tf +++ b/testing/infra/terraform/modules/moxy/main.tf @@ -24,7 +24,7 @@ resource "aws_security_group" "main" { vpc_id = var.vpc_id egress = [ { - cidr_blocks = ["0.0.0.0/0", ] + cidr_blocks = ["0.0.0.0/0"] description = "" from_port = 0 ipv6_cidr_blocks = [] @@ -37,7 +37,7 @@ resource "aws_security_group" "main" { ] ingress = [ { - cidr_blocks = ["0.0.0.0/0", ] + cidr_blocks = ["0.0.0.0/0"] description = "" from_port = 22 ipv6_cidr_blocks = [] @@ -48,7 +48,7 @@ resource "aws_security_group" "main" { to_port = 22 }, { - cidr_blocks = ["0.0.0.0/0", ] + cidr_blocks = ["0.0.0.0/0"] description = "" from_port = local.moxy_port ipv6_cidr_blocks = [] diff --git a/testing/infra/terraform/modules/standalone_apm_server/README.md b/testing/infra/terraform/modules/standalone_apm_server/README.md index 618c50691d3..6b452b50cac 100644 --- a/testing/infra/terraform/modules/standalone_apm_server/README.md +++ b/testing/infra/terraform/modules/standalone_apm_server/README.md @@ -22,6 +22,7 @@ This module can be used to create a standalone APM Server deployment against a s | [null_resource.apm_server_log](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource | | [random_password.apm_secret_token](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource | | [aws_ami.os](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami) | data source | +| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source | | [aws_subnets.public_subnets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnets) | data source | | [external_external.latest_apm_server](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/external) | data source | | [external_external.latest_elastic_agent](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/external) | data source | @@ -38,7 +39,6 @@ This module can be used to create a standalone APM Server deployment against a s | [elasticsearch\_password](#input\_elasticsearch\_password) | The Elasticsearch password | `string` | n/a | yes | | [elasticsearch\_url](#input\_elasticsearch\_url) | The secure Elasticsearch URL | `string` | n/a | yes | | [elasticsearch\_username](#input\_elasticsearch\_username) | The Elasticsearch username | `string` | n/a | yes | -| [region](#input\_region) | Optional ESS region where to run the smoke tests | `string` | `"gcp-us-west2"` | no | | [stack\_version](#input\_stack\_version) | Optional stack version | `string` | `"latest"` | no | | [tags](#input\_tags) | Optional set of tags to use for all deployments | `map(string)` | `{}` | no | | [vpc\_id](#input\_vpc\_id) | VPC ID to provision the EC2 instance | `string` | n/a | yes | diff --git a/testing/infra/terraform/modules/standalone_apm_server/main.tf b/testing/infra/terraform/modules/standalone_apm_server/main.tf index a43f81b36da..997213ec44c 100644 --- a/testing/infra/terraform/modules/standalone_apm_server/main.tf +++ b/testing/infra/terraform/modules/standalone_apm_server/main.tf @@ -107,18 +107,24 @@ data "aws_ami" "os" { owners = [local.image_owners[var.aws_os]] } +data "aws_region" "current" {} + data "aws_subnets" "public_subnets" { filter { name = "vpc-id" values = [var.vpc_id] } + filter { + name = "availability-zone" + values = ["${data.aws_region.current}a"] + } } resource "aws_security_group" "main" { vpc_id = var.vpc_id egress = [ { - cidr_blocks = ["0.0.0.0/0", ] + cidr_blocks = ["0.0.0.0/0"] description = "" from_port = 0 ipv6_cidr_blocks = [] @@ -131,7 +137,7 @@ resource "aws_security_group" "main" { ] ingress = [ { - cidr_blocks = ["0.0.0.0/0", ] + cidr_blocks = ["0.0.0.0/0"] description = "" from_port = 22 ipv6_cidr_blocks = [] @@ -142,7 +148,7 @@ resource "aws_security_group" "main" { to_port = 22 }, { - cidr_blocks = ["0.0.0.0/0", ] + cidr_blocks = ["0.0.0.0/0"] description = "" from_port = local.apm_port ipv6_cidr_blocks = [] diff --git a/testing/infra/terraform/modules/standalone_apm_server/variables.tf b/testing/infra/terraform/modules/standalone_apm_server/variables.tf index 40b999c126c..dbdf8dd7239 100644 --- a/testing/infra/terraform/modules/standalone_apm_server/variables.tf +++ b/testing/infra/terraform/modules/standalone_apm_server/variables.tf @@ -43,12 +43,6 @@ variable "stack_version" { type = string } -variable "region" { - default = "gcp-us-west2" - description = "Optional ESS region where to run the smoke tests" - type = string -} - variable "ea_managed" { default = false description = "Whether or not install Elastic Agent managed APM Server" diff --git a/testing/smoke/managed/main.tf b/testing/smoke/managed/main.tf index 8767159c715..3810839ca3f 100644 --- a/testing/smoke/managed/main.tf +++ b/testing/smoke/managed/main.tf @@ -57,7 +57,6 @@ module "standalone_apm_server" { elasticsearch_username = module.ec_deployment.elasticsearch_username elasticsearch_password = module.ec_deployment.elasticsearch_password stack_version = var.stack_version - region = var.region tags = merge(local.ci_tags, module.tags.tags) ea_managed = true diff --git a/testing/smoke/supported-os/main.tf b/testing/smoke/supported-os/main.tf index b40a39577ca..98741422ec5 100644 --- a/testing/smoke/supported-os/main.tf +++ b/testing/smoke/supported-os/main.tf @@ -57,7 +57,6 @@ module "standalone_apm_server" { elasticsearch_username = module.ec_deployment.elasticsearch_username elasticsearch_password = module.ec_deployment.elasticsearch_password stack_version = var.stack_version - region = var.region tags = merge(local.ci_tags, module.tags.tags) ea_managed = false