Configuration in this directory creates single EC2 instance with minimum set of arguments: AMI ID and instance type. It will also assign Elastic IP (EIP) to an instance.
Configuration in this directory creates EC2 instances with minimum set of arguments. It will also assign Elastic IP (EIP) to an instance.
Unspecified arguments for security group id and subnet are inherited from the default VPC.
Unspecified arguments for security group id and subnet are inherited from the default VPC.
...
@@ -24,10 +24,14 @@ Note that this example may create resources which can cost money. Run `terraform
...
@@ -24,10 +24,14 @@ Note that this example may create resources which can cost money. Run `terraform
| Name | Description |
| Name | Description |
|------|-------------|
|------|-------------|
| credit_specification | Credit specification of EC2 instance |
| credit_specification | Credit specification of EC2 instance (empty list for not t2 instance types) |
| id | List of IDs of instances |
| credit_specification_t2_unlimited | Credit specification of t2-type EC2 instance |
| ids | List of IDs of instances |
| ids_t2 | List of IDs of t2-type instances |
| instance_id | EC2 instance ID |
| instance_id | EC2 instance ID |
| instance_public_dns | Public DNS name assigned to the EC2 instance |
| instance_public_dns | Public DNS name assigned to the EC2 instance |
| public_dns | List of public DNS names assigned to the instances |
| public_dns | List of public DNS names assigned to the instances |
| tags | List of tags |
| vpc_security_group_ids | List of VPC security group ids assigned to the instances |
description="List of private DNS names assigned to the instances. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC"
description="List of private DNS names assigned to the instances. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC"
value=["${aws_instance.this.*.private_dns}"]
value=["${local.this_private_dns}"]
}
}
output"private_ip"{
output"private_ip"{
description="List of private IP addresses assigned to the instances"
description="List of private IP addresses assigned to the instances"
value=["${aws_instance.this.*.private_ip}"]
value=["${local.this_private_ip}"]
}
}
output"security_groups"{
output"security_groups"{
description="List of associated security groups of instances"
description="List of associated security groups of instances"
value=["${aws_instance.this.*.security_groups}"]
value=["${local.this_security_groups}"]
}
}
output"vpc_security_group_ids"{
output"vpc_security_group_ids"{
description="List of associated security groups of instances, if running in non-default VPC"
description="List of associated security groups of instances, if running in non-default VPC"