Skip to content

Commit 87798fd

Browse files
committed
pushed README.md
1 parent d28a3f2 commit 87798fd

File tree

1 file changed

+70
-13
lines changed

1 file changed

+70
-13
lines changed

README.md

+70-13
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
Terraform AWS EC2
88
</h1>
99

10-
<p align="center" style="font-size: 1.2rem;">
11-
Terraform module to create an EC2 resource on AWS with Elastic IP Addresses and Elastic Block Store.
10+
<p align="center" style="font-size: 1.2rem;">
11+
Terraform module to create an EC2 resource on AWS with ElasticC IP Addresses and Elastic Block Store.
1212
</p>
1313

1414
<p align="center">
1515

1616
<a href="https://www.terraform.io">
17-
<img src="https://img.shields.io/badge/Terraform-v0.12-green" alt="Terraform">
17+
<img src="https://img.shields.io/badge/Terraform-v0.13-green" alt="Terraform">
1818
</a>
1919
<a href="LICENSE.md">
2020
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="Licence">
@@ -38,7 +38,7 @@
3838
<hr>
3939

4040

41-
We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
41+
We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
4242

4343
This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.
4444

@@ -49,9 +49,9 @@ We have [*fifty plus terraform modules*][terraform_modules]. A few of them are c
4949

5050
## Prerequisites
5151

52-
This module has a few dependencies:
52+
This module has a few dependencies:
5353

54-
- [Terraform 0.12](https://learn.hashicorp.com/terraform/getting-started/install.html)
54+
- [Terraform 0.13](https://learn.hashicorp.com/terraform/getting-started/install.html)
5555
- [Go](https://golang.org/doc/install)
5656
- [github.com/stretchr/testify/assert](https://github.com/stretchr/testify)
5757
- [github.com/gruntwork-io/terratest/modules/terraform](https://github.com/gruntwork-io/terratest)
@@ -72,8 +72,8 @@ Here is examples of how you can use this module in your inventory structure:
7272
### Basic Example
7373
```hcl
7474
module "ec2" {
75-
source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=tags/0.12.7"
76-
name = "ec2-instance"
75+
source = "clouddrove/ec2/aws"
76+
version = "0.13.0"
7777
application = "clouddrove"
7878
environment = "test"
7979
label_order = ["environment", "application", "name"]
@@ -102,8 +102,8 @@ Here is examples of how you can use this module in your inventory structure:
102102
### Secure Example
103103
```hcl
104104
module "ec2" {
105-
source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=tags/0.12.7"
106-
name = "ec2-instance"
105+
source = "clouddrove/ec2/aws"
106+
version = "0.13.0"
107107
application = "clouddrove"
108108
environment = "test"
109109
label_order = ["environment", "application", "name"]
@@ -136,6 +136,63 @@ Here is examples of how you can use this module in your inventory structure:
136136

137137

138138

139+
## Inputs
140+
141+
| Name | Description | Type | Default | Required |
142+
|------|-------------|------|---------|:--------:|
143+
| ami | The AMI to use for the instance. | `string` | n/a | yes |
144+
| application | Application (e.g. `cd` or `clouddrove`). | `string` | `""` | no |
145+
| assign\_eip\_address | Assign an Elastic IP address to the instance. | `bool` | `false` | no |
146+
| associate\_public\_ip\_address | Associate a public IP address with the instance. | `bool` | `true` | no |
147+
| attributes | Additional attributes (e.g. `1`). | `list` | `[]` | no |
148+
| availability\_zone | Availability Zone the instance is launched in. If not set, will be launched in the first AZ of the region. | `list` | `[]` | no |
149+
| cpu\_core\_count | Sets the number of CPU cores for an instance. | `string` | `null` | no |
150+
| cpu\_credits | The credit option for CPU usage. Can be `standard` or `unlimited`. T3 instances are launched as unlimited by default. T2 instances are launched as standard by default. | `string` | `"standard"` | no |
151+
| delimiter | Delimiter to be used between `organization`, `environment`, `name` and `attributes`. | `string` | `"-"` | no |
152+
| disable\_api\_termination | If true, enables EC2 Instance Termination Protection. | `bool` | `false` | no |
153+
| disk\_size | Size of the root volume in gigabytes. | `number` | `8` | no |
154+
| dns\_enabled | Flag to control the dns\_enable. | `bool` | `false` | no |
155+
| dns\_zone\_id | The Zone ID of Route53. | `string` | `""` | no |
156+
| ebs\_block\_device | Additional EBS block devices to attach to the instance. | `list` | `[]` | no |
157+
| ebs\_device\_name | Name of the EBS device to mount. | `list(string)` | <pre>[<br> "/dev/xvdb",<br> "/dev/xvdc",<br> "/dev/xvdd",<br> "/dev/xvde",<br> "/dev/xvdf",<br> "/dev/xvdg",<br> "/dev/xvdh",<br> "/dev/xvdi",<br> "/dev/xvdj",<br> "/dev/xvdk",<br> "/dev/xvdl",<br> "/dev/xvdm",<br> "/dev/xvdn",<br> "/dev/xvdo",<br> "/dev/xvdp",<br> "/dev/xvdq",<br> "/dev/xvdr",<br> "/dev/xvds",<br> "/dev/xvdt",<br> "/dev/xvdu",<br> "/dev/xvdv",<br> "/dev/xvdw",<br> "/dev/xvdx",<br> "/dev/xvdy",<br> "/dev/xvdz"<br>]</pre> | no |
158+
| ebs\_iops | Amount of provisioned IOPS. This must be set with a volume\_type of io1. | `number` | `0` | no |
159+
| ebs\_optimized | If true, the launched EC2 instance will be EBS-optimized. | `bool` | `false` | no |
160+
| ebs\_volume\_enabled | Flag to control the ebs creation. | `bool` | `false` | no |
161+
| ebs\_volume\_size | Size of the EBS volume in gigabytes. | `number` | `30` | no |
162+
| ebs\_volume\_type | The type of EBS volume. Can be standard, gp2 or io1. | `string` | `"gp2"` | no |
163+
| encrypted | If true, the disk will be encrypted. | `bool` | `false` | no |
164+
| environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `""` | no |
165+
| ephemeral\_block\_device | Customize Ephemeral (also known as Instance Store) volumes on the instance. | `list` | `[]` | no |
166+
| host\_id | The Id of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. | `string` | `null` | no |
167+
| hostname | DNS records to create. | `string` | `""` | no |
168+
| iam\_instance\_profile | The IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. | `string` | `""` | no |
169+
| instance\_count | Number of instances to launch. | `number` | `1` | no |
170+
| instance\_enabled | Flag to control the instance creation. | `bool` | `true` | no |
171+
| instance\_initiated\_shutdown\_behavior | Shutdown behavior for the instance. | `string` | `""` | no |
172+
| instance\_profile\_enabled | Flag to control the instance profile creation. | `bool` | `false` | no |
173+
| instance\_tags | Instance tags. | `map` | `{}` | no |
174+
| instance\_type | The type of instance to start. Updates to this field will trigger a stop/start of the EC2 instance. | `string` | n/a | yes |
175+
| ipv6\_address\_count | Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. | `number` | `0` | no |
176+
| ipv6\_addresses | List of IPv6 addresses from the range of the subnet to associate with the primary network interface. | `list` | `[]` | no |
177+
| key\_name | The key name to use for the instance. | `string` | `""` | no |
178+
| kms\_key\_id | The ARN for the KMS encryption key. When specifying kms\_key\_id, encrypted needs to be set to true. | `string` | `""` | no |
179+
| label\_order | Label order, e.g. `name`,`application`. | `list` | `[]` | no |
180+
| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | `string` | `"[email protected]"` | no |
181+
| monitoring | If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0). | `bool` | `false` | no |
182+
| name | Name (e.g. `app` or `cluster`). | `string` | `""` | no |
183+
| network\_interface | Customize network interfaces to be attached at instance boot time. | `list(map(string))` | `[]` | no |
184+
| placement\_group | The Placement Group to start the instance in. | `string` | `""` | no |
185+
| root\_block\_device | Customize details about the root block device of the instance. See Block Devices below for details. | `list` | `[]` | no |
186+
| 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. | `bool` | `true` | no |
187+
| subnet | VPC Subnet ID the instance is launched in. | `string` | `null` | no |
188+
| subnet\_ids | A list of VPC Subnet IDs to launch in. | `list(string)` | `[]` | no |
189+
| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | `map` | `{}` | no |
190+
| 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` | `""` | no |
191+
| ttl | The TTL of the record to add to the DNS zone to complete certificate validation. | `string` | `"300"` | no |
192+
| type | Type of DNS records to create. | `string` | `"CNAME"` | no |
193+
| user\_data | The Base64-encoded user data to provide when launching the instances. | `string` | `""` | no |
194+
| vpc\_security\_group\_ids\_list | A list of security group IDs to associate with. | `list(string)` | `[]` | no |
195+
139196
## Outputs
140197

141198
| Name | Description |
@@ -148,15 +205,15 @@ Here is examples of how you can use this module in your inventory structure:
148205
| key\_name | The key name of the instance. |
149206
| placement\_group | The placement group of the instance. |
150207
| private\_ip | Private IP of instance. |
151-
| public\_ip | Public IP of instance \(or EIP\). |
208+
| public\_ip | Public IP of instance (or EIP). |
152209
| subnet\_id | The EC2 subnet ID. |
153210
| vpc\_security\_group\_ids | The associated security groups in non-default VPC. |
154211

155212

156213

157214

158215
## Testing
159-
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.
216+
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.
160217

161218
You need to run the following command in the testing folder:
162219
```hcl
@@ -165,7 +222,7 @@ You need to run the following command in the testing folder:
165222

166223

167224

168-
## Feedback
225+
## Feedback
169226
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-ec2/issues), or feel free to drop us an email at [[email protected]](mailto:[email protected]).
170227

171228
If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-ec2)!

0 commit comments

Comments
 (0)