A Terraform module for provisioning AWS EC2 instances with support for spot instances, multiple configurations, and comprehensive resource management.
terraform-aws-ec2-instance is a Terraform module that automates the provisioning and management of Amazon EC2 instances. It provides a reusable, configurable way to create EC2 instances with associated resources like security groups, IAM roles, and EBS volumes, reducing the boilerplate code needed for AWS infrastructure deployment. The module supports various instance types including spot instances and offers extensive configuration options through Terraform's declarative syntax.
DevOps engineers, cloud infrastructure teams, and developers using Terraform to manage AWS environments who need to provision EC2 instances consistently and efficiently as part of their infrastructure-as-code workflows.
This module saves time and reduces errors by encapsulating AWS EC2 best practices and complex resource dependencies into a single, well-tested Terraform module. It provides more abstraction and convenience than writing raw Terraform resources while maintaining full configurability and integration with the broader Terraform ecosystem.
Terraform module to create AWS EC2 instance(s) resources 🇺🇦
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports single instances, multiple instances via for_each, and spot instances with configurable pricing and persistence, reducing repetitive code.
Allows granular control over creation of associated resources like security groups, IAM profiles, and Elastic IPs through boolean flags such as create_security_group and create_eip.
Exposes a wide range of EC2 options including instance types, AMI selection via SSM parameters, metadata settings, and block device customization, covering most use cases.
Can automatically create and attach security groups with configurable ingress/egress rules, simplifying network security management within the module.
The README explicitly notes that network_interface cannot be specified with vpc_security_group_ids, associate_public_ip_address, or subnet_id, restricting certain advanced setups.
Does not support encrypted AMIs out of the box; users must manually create encrypted AMIs using separate resources, as admitted in the README section 'Make an encrypted AMI'.
With over 70 input variables, the module can be overwhelming for newcomers and increases the risk of misconfiguration or debugging challenges.