ami.tf 494 B

123456789101112131415161718192021222324252627
  1. data "aws_ami" "ubuntu2004" {
  2. most_recent = true
  3. owners = [var.common_services_account]
  4. filter {
  5. name = "virtualization-type"
  6. values = ["hvm"]
  7. }
  8. filter {
  9. name = "root-device-type"
  10. values = ["ebs"]
  11. }
  12. filter {
  13. name = "name"
  14. values = ["MSOC_Ubuntu_2004_Minion*"]
  15. }
  16. }
  17. locals {
  18. # We need some data from the block devices
  19. block_device_mappings = {
  20. for bd in data.aws_ami.ubuntu2004.block_device_mappings :
  21. bd.device_name => bd
  22. }
  23. }