AWS_AMI_MAPS.tf 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ###############################################
  2. # DO NOT EDIT THIS FILE
  3. #
  4. # This file is generated through 'make all'.
  5. # If you need to make changes, make your changes
  6. # to the corresponding .j file and then rerun
  7. # make all
  8. ###############################################
  9. #############
  10. # New method: Search for it!
  11. data "aws_ami" "ubuntu" {
  12. most_recent = true
  13. filter {
  14. name = "name"
  15. values = ["ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-*"]
  16. }
  17. filter {
  18. name = "virtualization-type"
  19. values = ["hvm"]
  20. }
  21. owners = ["099720109477"] # Canonical
  22. }
  23. # Use via: ami = "${data.aws_ami.ubuntu.id}"
  24. data "aws_ami" "centos6" {
  25. most_recent = true
  26. owners = ["679593333241"]
  27. filter {
  28. name = "name"
  29. values = ["CentOS Linux 6 x86_64 HVM EBS *"]
  30. }
  31. }
  32. data "aws_ami" "centos7" {
  33. most_recent = true
  34. owners = ["679593333241"]
  35. filter {
  36. name = "name"
  37. values = ["CentOS Linux 7 x86_64 HVM EBS *"]
  38. }
  39. }
  40. #############
  41. # Old fashioned method, manual mapping:
  42. variable "ubuntu_amis" {
  43. type = "map"
  44. default = {
  45. us-east-1 = "ami-40d28157"
  46. us-east-2 = "ami-153e6470"
  47. }
  48. }
  49. # Use with: ami = "${lookup(var.ubuntu_amis, var.region)}"