Could anyone advise on how I can auto-mount an EBS volume created using Terraform and make it available on /custom
?
resource "aws_instance" "ec201" {
...
ebs_block_device {
device_name = "/dev/sdd"
volume_type = "gp2"
volume_size = 10
delete_on_termination = true
encrypted = true
}
...
Is it possible to auto-mount it?
I've read these pages:
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html
- Automatically mount an EBS volume upon starting an Amazon EC2 Linux instance
When I do a:
> lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
...
nvme1n1 259:0 0 10G 0 disk
nvme0n1 259:1 0 250G 0 disk
└─nvme0n1p1 259:2 0 250G 0 part /
I have a 10GB partition that is not mounted. Would it be possible to auto-mount it using terraform?