ec2-instance-group

cloudposse/ec2-instance-group/aws

Terraform Module HCL AWS

Terraform Module for provisioning multiple general purpose EC2 hosts for stateful applications.

Install
module "ec2-instance-group" {
source = "cloudposse/ec2-instance-group/aws"
version = "1.0.0"
}
plain text: /constructs/tfmod-cloudposse-ec2-instance-group-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

terraform-aws-ec2-instance-group ![Latest Release](https://github.com/cloudposse/terraform-aws-ec2-instance-group/releases/latest) ![Slack Community](https://slack.cloudposse.com) [![README Header][readme_header_img]][readme_header_link] [![Cloud Posse][logo]](https://cpco.io/homepage) Terraform Module for providing N general purpose EC2 hosts. If you only need to provision a single EC2 instance, consider using the terraform-aws-ec2-instance module instead. IMPORTANT This module by-design does not provision an AutoScaling group. It was designed to provision a discrete number of instances suitable for running stateful services such as databases (e.g. Kafka, Redis, etc). Included features: Automatically create a Security Group Option to switch EIP attachment CloudWatch monitoring and automat

Inputs (50)
NameTypeDescriptionDefault
amistringThe AMI to use for the instance required
ami_ownerstringOwner of the given AMI required
subnetstringVPC Subnet ID the instance is launched in required
tenantstringID element _(Rarely used, not included by default)_. A customer identifier, indinull
statistic_levelstringThe statistic to apply to the alarm's associated metric. Allowed values are: Sam"Maximum"
ebs_volume_typestringThe type of EBS volume. Can be standard, gp2 or io1"gp2"
ebs_volume_sizenumberSize of the EBS volume in gigabytes10
labels_as_tagsset(string)Set of labels (ID elements) to include as tags in the `tags` output. Default is [ "default" ]
label_orderlist(string)The order in which the labels (ID elements) appear in the `id`. Defaults to ["nanull
availability_zonestringAvailability Zone the instance is launched in. If not set, will be launched in t""
namestringID element. Usually the component or solution name, e.g. 'app' or 'jenkins'. Thinull
label_key_casestringControls the letter case of the `tags` keys (label names) for tags generated by null
associate_public_ip_addressboolAssociate a public IP address with the instancefalse
security_group_descriptionstringThe Security Group description."EC2 instances Security Group"
stagestringID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'bunull
attributeslist(string)ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`, []
security_group_namelist(string)The name to assign to the security group. Must be unique within the VPC. If not []
ebs_optimizedboolLaunched EC2 instance will be EBS-optimizedfalse
root_volume_typestringType of root volume. Can be standard, gp2 or io1"gp2"
metric_namespacestringThe namespace for the alarm's associated metric. Allowed values can be found in "AWS/EC2"
enabledboolSet to false to prevent the module from creating any resourcesnull
instance_countnumberCount of ec2 instances to create1
metadata_http_tokens_requiredboolWhether or not the metadata service requires session tokens, also referred to astrue
… and 10 more inputs
Outputs (20)
primary_network_interface_ids — IDs of the instance's primary network interface
eip_per_instance_count — Number of EIPs per instance.
ids — Disambiguated IDs list
aws_key_pair_name — Name of AWS key pair
ebs_ids — IDs of EBSs
security_group_name — EC2 instances Security Group name
instance_count — Total number of instances created
ssh_key_pem_path — Path where SSH key pair was created (if applicable)
security_group_ids — ID on the new AWS Security Group associated with creating instance
security_group_arn — EC2 instances Security Group ARN
eni_to_eip_map — Map of ENI with EIP
private_ips — Private IPs of instances
name — Instance(s) name
alarm_ids — CloudWatch Alarm IDs
new_ssh_keypair_generated — Was a new ssh_key_pair generated
security_group_id — EC2 instances Security Group ID
role_names — Names of AWS IAM Roles associated with creating instance
public_ips — List of Public IPs of instances (or EIP)
private_dns — Private DNS records of instances
public_dns — All public DNS records for the public interfaces and ENIs
Resources (9)
aws_cloudwatch_metric_alarmaws_ebs_volumeaws_eipaws_iam_instance_profileaws_iam_roleaws_instanceaws_network_interfaceaws_network_interface_attachmentaws_volume_attachment
Details
FrameworkTerraform Module
LanguageHCL
Version1.0.0
Cloud AWS
★ Stars19
Forks34
Total downloads51.4k
Inputs50
Outputs20
Resources9
Examples2
LicenseApache-2.0
Namespacecloudposse
Updated