module "ec2" {
source = "git::ssh://git@github.com:tonygyerr/terraform-aws-ec2.git"
ami = var.ami
app_name = var.app_name
aws_key_name = var.aws_key_name
associate_public_ip_address = var.associate_public_ip_address
instance_count = var.instance_count
instance_type = var.instance_type
network_interface = var.network_interface
public_subnet_ids = var.public_subnet_ids
subnet_id = var.subnet_id
tags = var.tags
vpc = true
vpc_config = var.vpc_config
}
- Docker (for using Docker Image of dependencies)
- Git
- Terraform
- AWS Key pair for Terraform provisioning.
- AWS S3 bucket for remote terraform state file (tfstate)
- AWS Dynamo Database for tfstate table state lock
cd examples
terraform get
terraform init -backend-config ../backend-config/dev.tfvars
terraform plan -var-file="../env-config/dev.tfvars"
terraform apply -var-file="../env-config/dev.tfvars" -auto-approve
terraform destroy -var-file="../env-config/dev.tfvars"
Name | Version |
---|---|
aws | ~> 2.0 |
Name | Version |
---|---|
aws | ~> 2.0 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
acn_tags | optional tags | map(string) |
{} |
no |
ami | n/a | string |
n/a | yes |
app_name | Application Name | string |
"" |
no |
app_vol_encryption | n/a | string |
"true" |
no |
app_vol_size | size for app vol | string |
"30" |
no |
app_vol_type | volume type for app | string |
"gp2" |
no |
associate_public_ip_address | n/a | bool |
n/a | yes |
aws_key_name | aws key name | string |
"" |
no |
aws_region | ec2 region for the vpc | string |
"" |
no |
iam_instance_profile_name | n/a | string |
"" |
no |
instance_count | n/a | string |
n/a | yes |
instance_type | app instance type | string |
"t2.micro" |
no |
network_interface | Network interface ID to associate with | string |
"" |
no |
open_cidr | vpc cidr for subnet | string |
"0.0.0.0/0" |
no |
public_ipv4_pool | EC2 IPv4 address pool identifier or amazon. This option is only available for VPC EIPs. | string |
null |
no |
public_subnet_ids | list of subnet ids | list |
[] |
no |
security_groups | security groups applied to the load balancer. e.g. ["sg-ab15ebe3","sg-b012ecf8"] | list |
[] |
no |
subnet_id | n/a | string |
n/a | yes |
tags | optional tags | map(string) |
n/a | yes |
vpc | Boolean if the EIP is in a VPC or not | bool |
null |
no |
vpc_config | configuration option for vpc | map(string) |
n/a | yes |
Name | Description |
---|---|
app_ebs_id | n/a |
app_ec2_id | n/a |
app_sg_id | n/a |
id | Contains the EIP allocation ID |
private_ip | n/a |
public_dns | Public DNS associated with the Elastic IP address |
public_eip | Contains the public IP address |
public_ip | n/a |