You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Guillaume Donval 731b3c3bbc Merge branch 'feature/getUpstreamCode' of fxinnovation-public/terraform-module-aws-ec2 into master 1 year ago
examples refactor: makes unique names for security groups 1 year ago
.gitignore refactor: removes kitchen in .gitignore 1 year ago
.pre-commit-config.yaml tech: adds pre-commit-config and gitignore 1 year ago
Jenkinsfile test: removes explicit library 1 year ago
README.md doc: fixes a description 1 year ago
data.tf fix: fixes default use of subnets 1 year ago
main.tf fix: fixes digit suffix 1 year ago
outputs.tf fix: fixes default use of subnets 1 year ago
variables.tf doc: fixes a description 1 year ago

README.md

Terraform module: EC2

Create X EC2 instances with X extra volumes, encrypted by default.

This module creates the same kind of instances. They share the same features. To create different instances, calls this module multiple times.

Notes

To install pre-commit hooks: pre-commit install. It will automatically validate, fmt and update README.md for you.

Inputs

Name Description Type Default Required
ami The AMI to use for the instances. string "" no
associate_public_ip_address Associate a public ip address for each instances. string "false" no
cpu_credits The credit option for CPU usage (unlimited or standard). string "standard" no
disable_api_termination If true, enables EC2 Instance Termination Protection. string "false" no
ebs_block_device Additional EBS block devices to attach to the instance. list [] no
ebs_optimized If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. string "false" no
ephemeral_block_device Customize Ephemeral (also known as Instance Store) volumes on the instance. list [] no
external_volume_count Number of external volumes to create. string "0" no
external_volume_device_names Device names for the external volumes. list [ "" ] no
external_volume_kms_key_alias Alias of the KMS key used to encrypt the external volume. string "alias/default/ec2" no
external_volume_kms_key_arn KMS key used to encrypt the external volume. To be used when var.external_volume_kms_key_create is set to false. string "" no
external_volume_kms_key_create Whether or not to create KMS key. Cannot be computed from other variable in terraform 0.11.0. string "true" no
external_volume_kms_key_name Name prefix for the KMS key to be used for external volumes. Will be suffixes with a two-digit count index. string "" no
external_volume_kms_key_tags Tags for the KMS key to be used for external volumes. map {} no
external_volume_name Prefix of the external volumes to create. string "extra-volumes" no
external_volume_sizes Size of the external volumes. list [ "" ] no
external_volume_tags Tags for the external volumes. Will be merged with tags. Tags will be shared among all external volumes. map {} no
iam_instance_profile The IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. string "" no
instance_count Number of instances to create. Can also be 0. string "1" no
instance_initiated_shutdown_behavior Shutdown behavior for the instance. Amazon defaults this to stop for EBS-backed instances and terminate for instance-store instances. Cannot be set on instance-store instances. string "" no
instance_tags Tags specific to the instances. map {} no
instance_type The type of instance to start. Updates to this field will trigger a stop/start of the EC2 instance. string "t3.small" no
ipv6_address_count A number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. string "0" no
ipv6_addresses Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface. list [] no
key_name The key name of the Key Pair to use for the instance; which can be managed using the aws_key_pair resource. string "" no
monitoring If true, the launched EC2 instances will have detailed monitoring enabled. string "false" no
name Name prefix of the instances. Will be suffixed by a var.num_suffix_digits count index. string "" no
num_suffix_digits Number of significant digits to append to instances name. Use a string containing a leading 0. string "02" no
placement_group The Placement Group to start the instances in. string "" no
private_ips Private IPs of the instances. If set, the list must contain as many IP as the number of var.instance_count. list [] no
root_block_device Customize details about the root block device of the instance. See Block Devices below for details list [] no
source_dest_check Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. string "true" no
subnet_id Subnet ID where to provision all the instances. Can be used instead or along with var.subnet_ids. string "" no
subnet_ids Subnet IDs where to provision the instances. Can be used instead or along with var.subnet_id. list [ "" ] no
subnet_ids_count How many subnet IDs in subnet_ids. Cannot be computed automatically from other variables in Terraform 0.11.X. string "0" no
tags Tags to be used for all this module resources. Will be merged with specific tags. map {} no
tenancy The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the import-instance command. string "default" no
use_num_suffix Always append numerical suffix to instance name, even if instance_count is 1. string "false" no
user_data The user data to provide when launching the instance. string "" no
volume_tags Tags of the root volume of the instance. Will be merged with tags. map {} no
vpc_security_group_ids An object containing the list of security group IDs to associate with each instance. map {} no

Outputs

Name Description
arns Instance ARNs.
availability_zones Availability zones of the instances.
credit_specifications Credit specification of instance.
external_volume_arns ARNs of all the extra volumes.
external_volume_ids IDs of all the extra volumes.
ids Instance IDs.
kms_key_id KMS key ID (ARN) used to encrypt all the extra volumes.
primary_network_interface_ids The IDs of the instances primary network interfaces.
private_dns Private domain names of the instances.
private_ips Private IPs of the instances.
public_dns Public domain names of the instances.
public_ips Public IPs of the instances.
subnet_ids The VPC subnet IDs where the instances are.