Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
clouddrove-ci committed Oct 19, 2021
1 parent 49ba9ad commit 5be9f6b
Showing 1 changed file with 51 additions and 144 deletions.
195 changes: 51 additions & 144 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@


<h1 align="center">
Terraform AWS EC2
Terraform AWS Pritunl
</h1>

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

<p align="center">
Expand All @@ -24,13 +24,13 @@
</p>
<p align="center">

<a href='https://facebook.com/sharer/sharer.php?u=https://github.com/clouddrove/terraform-aws-ec2'>
<a href='https://facebook.com/sharer/sharer.php?u=https://github.com/clouddrove/terraform-aws-pritunl'>
<img title="Share on Facebook" src="https://user-images.githubusercontent.com/50652676/62817743-4f64cb80-bb59-11e9-90c7-b057252ded50.png" />
</a>
<a href='https://www.linkedin.com/shareArticle?mini=true&title=Terraform+AWS+EC2&url=https://github.com/clouddrove/terraform-aws-ec2'>
<a href='https://www.linkedin.com/shareArticle?mini=true&title=Terraform+AWS+Pritunl&url=https://github.com/clouddrove/terraform-aws-pritunl'>
<img title="Share on LinkedIn" src="https://user-images.githubusercontent.com/50652676/62817742-4e339e80-bb59-11e9-87b9-a1f68cae1049.png" />
</a>
<a href='https://twitter.com/intent/tweet/?text=Terraform+AWS+EC2&url=https://github.com/clouddrove/terraform-aws-ec2'>
<a href='https://twitter.com/intent/tweet/?text=Terraform+AWS+Pritunl&url=https://github.com/clouddrove/terraform-aws-pritunl'>
<img title="Share on Twitter" src="https://user-images.githubusercontent.com/50652676/62817740-4c69db00-bb59-11e9-8a79-3580fbbf6d5c.png" />
</a>

Expand All @@ -51,7 +51,7 @@ We have [*fifty plus terraform modules*][terraform_modules]. A few of them are c

This module has a few dependencies:

- [Terraform 0.13](https://learn.hashicorp.com/terraform/getting-started/install.html)
- [Terraform 0.15](https://learn.hashicorp.com/terraform/getting-started/install.html)
- [Go](https://golang.org/doc/install)
- [github.com/stretchr/testify/assert](https://github.com/stretchr/testify)
- [github.com/gruntwork-io/terratest/modules/terraform](https://github.com/gruntwork-io/terratest)
Expand All @@ -65,131 +65,50 @@ This module has a few dependencies:
## Examples


**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/terraform-aws-ec2/releases).
**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/terraform-aws-pritunl/releases).


Here is examples of how you can use this module in your inventory structure:
### Basic Example
### Example
```hcl
module "ec2" {
source = "clouddrove/ec2/aws"
name = "ec2"
environment = "test"
label_order = ["name", "environment"]
#instance
instance_enabled = true
instance_count = 2
ami = "ami-08d658f84a6d84a80"
instance_type = "t2.nano"
monitoring = false
tenancy = "default"
#Networking
vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids]
subnet_ids = tolist(module.public_subnets.public_subnet_id)
assign_eip_address = true
associate_public_ip_address = true
#Keypair
key_name = module.keypair.name
#IAM
instance_profile_enabled = true
iam_instance_profile = module.iam-role.name
#Root Volume
root_block_device = [
{
volume_type = "gp2"
volume_size = 15
delete_on_termination = true
kms_key_id = module.kms_key.key_arn
}
]
#EBS Volume
ebs_optimized = false
ebs_volume_enabled = false
ebs_volume_type = "gp2"
ebs_volume_size = 30
#DNS
dns_enabled = false
dns_zone_id = "Z1XJD7SSBKXLC1"
hostname = "ec2"
#Tags
instance_tags = { "snapshot" = true }
# Metadata
metadata_http_tokens_required = "optional"
metadata_http_endpoint_enabled = "enabled"
metadata_http_put_response_hop_limit = 2
}
```
module "pritunl" {
source = "./../"
name = "pritunl"
environment = "test"
label_order = ["name", "environment"]
#instance
pritunl_enabled = true
ami = "ami-0a8e758f5e873d1c1"
instance_type = "t2.medium"
monitoring = false
tenancy = "default"
#Networking
vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids, module.vpn_sg.security_group_ids]
subnet_ids = tolist(module.public_subnets.public_subnet_id)
assign_eip_address = true
associate_public_ip_address = true
#Keypair
key_name = module.keypair.name
#IAM
instance_profile_enabled = true
iam_instance_profile = module.iam-role.name
#Root Volume
root_block_device = [
{
volume_type = "gp2"
volume_size = 20
delete_on_termination = true
kms_key_id = module.kms_key.key_arn
}
]
### ebs_mount
```hcl
module "ec2" {
source = "clouddrove/ec2/aws"
name = "ec2"
environment = "test"
label_order = ["name", "environment"]
#Instance
instance_enabled = true
instance_count = 2
ami = "ami-08d658f84a6d84a80"
instance_type = "t2.nano"
monitoring = false
tenancy = "default"
#Keypair
key_name = module.keypair.name
#Networking
vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids]
subnet_ids = tolist(module.public_subnets.public_subnet_id)
assign_eip_address = true
associate_public_ip_address = true
#IAM
instance_profile_enabled = true
iam_instance_profile = module.iam-role.name
#Root Volume
root_block_device = [
{
volume_type = "gp2"
volume_size = 15
delete_on_termination = true
kms_key_id = module.kms_key.key_arn
}
]
#EBS Volume
ebs_optimized = false
ebs_volume_enabled = true
ebs_volume_type = "gp2"
ebs_volume_size = 30
#DNS
dns_enabled = false
dns_zone_id = "Z1XJD7SSBKXLC1"
hostname = "ec2"
#Tags
instance_tags = { "snapshot" = true }
# Metadata
metadata_http_tokens_required = "optional"
metadata_http_endpoint_enabled = "enabled"
metadata_http_put_response_hop_limit = 2
#Mount EBS With User Data
user_data = file("user-data.sh")
#user data
user_data = file("${path.module}/pritunl.sh")
}
```

Expand All @@ -216,7 +135,7 @@ Here is examples of how you can use this module in your inventory structure:
| ebs\_block\_device | Additional EBS block devices to attach to the instance. | `list(any)` | `[]` | no |
| 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 |
| ebs\_iops | Amount of provisioned IOPS. This must be set with a volume\_type of io1. | `number` | `0` | no |
| ebs\_optimized | If true, the launched EC2 instance will be EBS-optimized. | `bool` | `true` | no |
| ebs\_optimized | If true, the launched EC2 instance will be EBS-optimized. | `bool` | `false` | no |
| ebs\_volume\_enabled | Flag to control the ebs creation. | `bool` | `false` | no |
| ebs\_volume\_size | Size of the EBS volume in gigabytes. | `number` | `30` | no |
| ebs\_volume\_type | The type of EBS volume. Can be standard, gp2 or io1. | `string` | `"gp2"` | no |
Expand All @@ -226,7 +145,6 @@ Here is examples of how you can use this module in your inventory structure:
| hostname | DNS records to create. | `string` | `""` | no |
| iam\_instance\_profile | The IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. | `string` | `""` | no |
| instance\_count | Number of instances to launch. | `number` | `1` | no |
| instance\_enabled | Flag to control the instance creation. | `bool` | `true` | no |
| instance\_initiated\_shutdown\_behavior | n/a | `string` | `"terminate"` | no |
| instance\_profile\_enabled | Flag to control the instance profile creation. | `bool` | `false` | no |
| instance\_tags | Instance tags. | `map(any)` | `{}` | no |
Expand All @@ -237,14 +155,12 @@ Here is examples of how you can use this module in your inventory structure:
| kms\_key\_id | The ARN for the KMS encryption key. When specifying kms\_key\_id, encrypted needs to be set to true. | `string` | `""` | no |
| label\_order | Label order, e.g. `name`,`application`. | `list(any)` | `[]` | no |
| managedby | ManagedBy, eg 'CloudDrove'. | `string` | `"hello@clouddrove.com"` | no |
| metadata\_http\_endpoint\_enabled | Whether the metadata service is available. Valid values include enabled or disabled. Defaults to enabled. | `string` | `"enabled"` | no |
| metadata\_http\_put\_response\_hop\_limit | The desired HTTP PUT response hop limit (between 1 and 64) for instance metadata requests. | `number` | `2` | no |
| metadata\_http\_tokens\_required | Whether or not the metadata service requires session tokens, also referred to as Instance Metadata Service Version 2 (IMDSv2). Valid values include optional or required. Defaults to optional. | `string` | `"optional"` | no |
| monitoring | If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0). | `bool` | `true` | no |
| name | Name (e.g. `app` or `cluster`). | `string` | `""` | no |
| network\_interface | Customize network interfaces to be attached at instance boot time | `list(map(string))` | `[]` | no |
| placement\_group | The Placement Group to start the instance in. | `string` | `""` | no |
| repository | Terraform current module repo | `string` | `"https://github.com/clouddrove/terraform-aws-ec2"` | no |
| pritunl\_enabled | Flag to control the instance creation. | `bool` | `true` | no |
| repository | Terraform current module repo | `string` | `"https://github.com/clouddrove/terraform-aws-pritunl"` | no |
| root\_block\_device | Customize details about the root block device of the instance. See Block Devices below for details. | `list(any)` | `[]` | no |
| 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 |
| subnet | VPC Subnet ID the instance is launched in. | `string` | `null` | no |
Expand All @@ -260,18 +176,9 @@ Here is examples of how you can use this module in your inventory structure:

| Name | Description |
|------|-------------|
| arn | The ARN of the instance. |
| az | The availability zone of the instance. |
| instance\_count | The count of instances. |
| instance\_id | The instance ID. |
| ipv6\_addresses | A list of assigned IPv6 addresses. |
| key\_name | The key name of the instance. |
| placement\_group | The placement group of the instance. |
| private\_ip | Private IP of instance. |
| public\_ip | Public IP of instance (or EIP). |
| subnet\_id | The EC2 subnet ID. |
| tags | The instance ID. |
| vpc\_security\_group\_ids | The associated security groups in non-default VPC. |
| tags | The instance tags. |



Expand All @@ -287,9 +194,9 @@ You need to run the following command in the testing folder:


## Feedback
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 [hello@clouddrove.com](mailto:hello@clouddrove.com).
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-pritunl/issues), or feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com).

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

## About us

Expand Down

0 comments on commit 5be9f6b

Please sign in to comment.