data "aws_ami" "ubuntu2004" { most_recent = true owners = [ var.common_services_account ] filter { name = "virtualization-type" values = ["hvm"] } filter { name = "root-device-type" values = ["ebs"] } filter { name = "name" values = [ "MSOC_Ubuntu_2004_Minion*" ] } } locals { # We need some data from the block devices block_device_mappings = { for bd in data.aws_ami.ubuntu2004.block_device_mappings: bd.device_name => bd } }