Skip to content

Commit

Permalink
provision standalone APM server in a AZ
Browse files Browse the repository at this point in the history
  • Loading branch information
1pkg committed Sep 27, 2024
1 parent 9ae0a48 commit 3811bb7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions testing/infra/terraform/modules/moxy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand All @@ -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 = []
Expand All @@ -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 = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -38,7 +39,6 @@ This module can be used to create a standalone APM Server deployment against a s
| <a name="input_elasticsearch_password"></a> [elasticsearch\_password](#input\_elasticsearch\_password) | The Elasticsearch password | `string` | n/a | yes |
| <a name="input_elasticsearch_url"></a> [elasticsearch\_url](#input\_elasticsearch\_url) | The secure Elasticsearch URL | `string` | n/a | yes |
| <a name="input_elasticsearch_username"></a> [elasticsearch\_username](#input\_elasticsearch\_username) | The Elasticsearch username | `string` | n/a | yes |
| <a name="input_region"></a> [region](#input\_region) | Optional ESS region where to run the smoke tests | `string` | `"gcp-us-west2"` | no |
| <a name="input_stack_version"></a> [stack\_version](#input\_stack\_version) | Optional stack version | `string` | `"latest"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Optional set of tags to use for all deployments | `map(string)` | `{}` | no |
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | VPC ID to provision the EC2 instance | `string` | n/a | yes |
Expand Down
12 changes: 9 additions & 3 deletions testing/infra/terraform/modules/standalone_apm_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand All @@ -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 = []
Expand All @@ -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 = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion testing/smoke/managed/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion testing/smoke/supported-os/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3811bb7

Please sign in to comment.