Started to add disks modules.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
resource "aws_volume_attachment" "mount-volume" {
|
||||
device_name = "/dev/sd${element(var.drive-letters, count.index)}"
|
||||
instance_id = var.ec2-id
|
||||
count = length(var.disks)
|
||||
volume_id = element(var.disks, count.index).id
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
variable "drive-letters" {
|
||||
default = ["f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
|
||||
description = "These drive letters will be used when arraching disks to EC2 instance with `ec2-id'"
|
||||
type = list(string)
|
||||
nullable = false
|
||||
}
|
||||
|
||||
variable "disks" {
|
||||
description = "An array of disks to attach to the EC2 isntance with `ec2-id`"
|
||||
type = list
|
||||
}
|
||||
|
||||
variable "ec2-id" {
|
||||
description = "The ID of the EC@ instance to attach the drives to."
|
||||
type = string
|
||||
}
|
||||
Reference in New Issue
Block a user