Skip to content

Nested EBS Variables

Define and Attach EBS Volumes to Instances

Define EBS volumes that will be created using the disks attribute within the instances variable. When the variables are configured this way, the storage will be created and attached to the instance they are defined within.

This method of defining EBS storage is required for VM variable blocks that create more than one instance. It does not support detaching the storage without deleting the volume. If the variable is undefined, the storage is detached and deleted.

odb = {
    names = [
        "tstodb",
        "prdodb"
    ]
    root_block_device = {
            volume_size = 100
            volume_type = "io2"
            iops = "3000"
        }
    disks = {
        disk1 = {
            device_name = "/dev/sdb"
            size = 60
        },
        disk2 = {
            device_name = "/dev/sdc"
            size = 80
        }
    }
}