Skip to content

Commit

Permalink
Use nvme ssd if available
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonip committed Feb 7, 2025
1 parent 840e59e commit 5ff6df6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions testing/infra/terraform/modules/standalone_apm_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ resource "aws_instance" "apm" {
private_key = file("${var.aws_provisioner_key_name}")
}

// For instance types with 'd.' e.g. c6id.2xlarge, use the NVMe ssd as data disk.
provisioner "remote-exec" {
inline = length(regexall("d[.]", self.instance_type)) > 0 ? [
"sudo mkfs -t xfs /dev/nvme1n1",
"mkdir ~/data",
"sudo mount /dev/nvme1n1 ~/data",
"sudo chown $USER:$USER ~/data",
] : []
}

provisioner "file" {
source = "${var.apm_server_bin_path}/apm-server"
destination = local.bin_path
Expand Down

0 comments on commit 5ff6df6

Please sign in to comment.