Terraform module to get the current set of publicly available ubuntu AMIs.
This module grabs all of the AMIs listed at:
https://cloud-images.ubuntu.com/locator/ec2/
and then looks up the one you want given the input variables
- region - E.g. eu-central-1
- distribution - E.g. trusty
- architecture - amd64/i386
- virttype - hvm/pv
- storagetype - instance-store/ebs-io1/ebs-ssd/ebs
- ami_id
module "ami" {
source = "github.com/terraform-community-modules/tf_aws_ubuntu_ami"
region = "eu-central-1"
distribution = "trusty"
architecture = "amd64"
virttype = "hvm"
storagetype = "instance-store"
}
resource "aws_instance" "web" {
ami = "${module.ami.ami_id}"
instance_type = "m3.8xlarge"
}
This module also supports a couple of shortcuts for common configurations, where you know the instance_type you'd like to use, but don't want to bother looking up the virttype
module "ami" {
source = "github.com/terraform-community-modules/tf_aws_ubuntu_ami/ebs"
region = "eu-central-1"
distribution = "trusty"
instance_type = "m3.large"
}
module "ami" {
source = "github.com/terraform-community-modules/tf_aws_ubuntu_ami/instance-store"
region = "eu-central-1"
distribution = "trusty"
instance_type = "m3.large"
}
Apache2 - see the included LICENSE file for more details.