forked from leboncoin/terraform-aws-nvme-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
33 lines (26 loc) · 725 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
provider "aws" {
region = "${var.aws_region}"
}
resource "aws_instance" "instance" {
ami = "${var.ami}"
instance_type = "${var.instance_type}"
user_data = "${data.template_cloudinit_config.config.rendered}"
subnet_id = "${var.subnet_id}"
key_name = "${var.key_name}"
tags {
Name = "${var.hostname}"
managed-by = "Terraform"
}
}
resource "aws_ebs_volume" "nvme" {
size = 100
availability_zone = "${var.availability_zone}"
type = "gp2"
}
resource "aws_volume_attachment" "nvme_mount" {
device_name = "/dev/xvdf"
skip_destroy = true
force_detach = true
volume_id = "${aws_ebs_volume.nvme.id}"
instance_id = "${aws_instance.instance.id}"
}