Skip to content

Commit 5ff6df6

Browse files
committed
Use nvme ssd if available
1 parent 840e59e commit 5ff6df6

File tree

1 file changed

+10
-0
lines changed
  • testing/infra/terraform/modules/standalone_apm_server

1 file changed

+10
-0
lines changed

testing/infra/terraform/modules/standalone_apm_server/main.tf

+10
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,16 @@ resource "aws_instance" "apm" {
182182
private_key = file("${var.aws_provisioner_key_name}")
183183
}
184184

185+
// For instance types with 'd.' e.g. c6id.2xlarge, use the NVMe ssd as data disk.
186+
provisioner "remote-exec" {
187+
inline = length(regexall("d[.]", self.instance_type)) > 0 ? [
188+
"sudo mkfs -t xfs /dev/nvme1n1",
189+
"mkdir ~/data",
190+
"sudo mount /dev/nvme1n1 ~/data",
191+
"sudo chown $USER:$USER ~/data",
192+
] : []
193+
}
194+
185195
provisioner "file" {
186196
source = "${var.apm_server_bin_path}/apm-server"
187197
destination = local.bin_path

0 commit comments

Comments
 (0)