A terraform module to return true or false based on if an instance type supports the EBS optmized flag. If you want to use various instance types and EBS optimization, this module does the heavy lifting of determining if that's possible. Without the module, EC2 instance creation would fail on unsupported types and -- even worse -- launch configurations will create normally but fail silently when instances attempt to launch. This module means you don't need to think about that problem.
A full example leveraging other community modules is contained in the examples/ebs_optimized_test_fixture. Here's the gist of using it via the Terraform registry:
variable "web_type" {
description = "Size/type of the host."
default = "m1.large"
}
module "ebs_optimized" {
source = "terraform-aws-modules/ebs-optimized/aws"
instance_type = "${var.web_type}"
}
resource "aws_instance" "web" {
ami = "${data.aws_ami.ubuntu.id}"
instance_type = "${var.web_type}"
ebs_optimized = "${module.ebs_optimized.answer}"
}
This module has been packaged with inspec tests through kitchen and kitchen-terraform. To run them:
-
Install bundler and the gems from our Gemfile:
gem install bundler && bundle install
-
Test using
bundle exec kitchen test
from the root of the repo.
inspec AWS resources are relatively new and not working on all platforms yet. If you're working with the module and tests are being skipped, ensure you verify functionality manually in the AWS console.
Documentation should be modified within main.tf
and generated using terraform-docs.
Generate them like so:
go get github.com/segmentio/terraform-docs
terraform-docs md ./ | cat -s | ghead -n -1 > README.md
Report issues/questions/feature requests on in the issues section.
Full contributing guidelines are covered here.
The changelog captures all important release notes.
Created and maintained by Brandon O'Connor - [email protected]. Many thanks to the contributors listed here!
MIT Licensed. See LICENSE for full details.
Name | Description | Type | Default | Required |
---|---|---|---|---|
instance_type | Instance type to evaluate if EBS optimized is an option. | string | - | yes |
Name | Description |
---|---|
answer | Returns 1 (true) or 0 (false) depending on if the instance type is able to be EBS optimized. |