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 May 20, 2022
1 parent b74e1f4 commit f038884
Showing 1 changed file with 51 additions and 45 deletions.
96 changes: 51 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@
<p align="center"> <img src="https://user-images.githubusercontent.com/50652676/62349836-882fef80-b51e-11e9-99e3-7b974309c7e3.png" width="100" height="100"></p>




<h1 align="center">
Terraform AWS EFS
</h1>

<p align="center" style="font-size: 1.2rem;">
<p align="center" style="font-size: 1.2rem;">
Terraform module to create or deploy EFS on AWS.
</p>

<p align="center">

<a href="https://www.terraform.io">
<img src="https://img.shields.io/badge/Terraform-v0.14-green" alt="Terraform">
<img src="https://img.shields.io/badge/Terraform-v1.1.7-green" alt="Terraform">
</a>
<a href="LICENSE.md">
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="Licence">
<img src="https://img.shields.io/badge/License-APACHE-blue.svg" alt="Licence">
</a>
<a href="https://github.com/clouddrove/terraform-aws-efs/actions/workflows/tfsec.yml">
<img src="https://github.com/clouddrove/terraform-aws-efs/actions/workflows/tfsec.yml/badge.svg" alt="tfsec">
</a>
<a href="https://github.com/clouddrove/terraform-aws-efs/actions/workflows/terraform.yml">
<img src="https://github.com/clouddrove/terraform-aws-efs/actions/workflows/terraform.yml/badge.svg" alt="static-checks">
</a>


Expand All @@ -40,7 +44,7 @@
<hr>


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.
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.

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.

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

## Prerequisites

This module has a few dependencies:
This module has a few dependencies:

- [Terraform 0.12](https://learn.hashicorp.com/terraform/getting-started/install.html)
- [Terraform 1.x.x](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 @@ -74,17 +78,16 @@ This module has a few dependencies:
Here is an example of how you can use this module in your inventory structure:
```hcl
module "efs" {
source = "git::https://github.com/clouddrove/terraform-aws-efs.git?ref=tags/0.12.0"
name = "efs"
application = var.application
environment = var.environment
label_order = var.label_order
creation_token = var.token
region = var.region
availability_zones = ["${var.region}b", "${var.region}c"]
vpc_id = module.vpc.vpc_id
subnets = module.subnets.private_subnet_id
security_groups = ["sg-xxxxxxxxxxxx"]
source = "clouddrove/efs/aws"
version = "1.0.1"
name = "efs"
creation_token = var.token
region = var.region
availability_zones = ["${var.region}b", "${var.region}c"]
vpc_id = module.vpc.vpc_id
subnets = module.subnets.private_subnet_id
security_groups = ["sg-xxxxxxxxxxxx"]
efs_backup_policy_enabled = true
}
```

Expand All @@ -96,44 +99,47 @@ Here is an example of how you can use this module in your inventory structure:
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| application | Application name, e.g. `cd` or `CloudDrove` | string | n/a | yes |
| attributes | Additional attributes \(e.g. `1`\) | list(string) | `<list>` | no |
| availability\_zones | Availability Zone IDs | list(string) | n/a | yes |
| creation\_token | A unique name \(a maximum of 64 characters are allowed\) used as reference when creating the EFS | string | n/a | yes |
| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | string | `"-"` | no |
| efs\_enabled | Set to false to prevent the module from creating any resources | bool | `"true"` | no |
| encrypted | If true, the file system will be encrypted | bool | `"false"` | no |
| environment | Environment, e.g. `prod`, `staging`, `dev`, or `test` | string | n/a | yes |
| label\_order | label order, e.g. `name`,`application` | list | `<list>` | no |
| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | string | `"anmol@clouddrove.com"` | no |
| mount\_target\_ip\_address | The address \(within the address range of the specified subnet\) at which the file system may be mounted via the mount target | string | `""` | no |
| name | Solution name, e.g. `app` | string | n/a | yes |
| performance\_mode | The file system performance mode. Can be either `generalPurpose` or `maxIO` | string | `"generalPurpose"` | no |
| provisioned\_throughput\_in\_mibps | The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with `throughput\_mode` set to provisioned | string | `"0"` | no |
| region | AWS Region | string | n/a | yes |
| security\_groups | Security group IDs to allow access to the EFS | list(string) | n/a | yes |
| subnets | Subnet IDs | list(string) | n/a | yes |
| tags | Additional tags \(e.g. `\{ BusinessUnit = "XYZ" \}` | map(string) | `<map>` | no |
| throughput\_mode | Throughput mode for the file system. Defaults to bursting. Valid values: `bursting`, `provisioned`. When using `provisioned`, also set `provisioned\_throughput\_in\_mibps` | string | `"bursting"` | no |
| vpc\_id | VPC ID | string | n/a | yes |
| zone\_id | Route53 DNS zone ID | string | `""` | no |
|------|-------------|------|---------|:--------:|
| attributes | If true, the file system will be encrypted | `list(string)` | `[]` | no |
| availability\_zones | Availability Zone IDs | `list(string)` | n/a | yes |
| creation\_token | A unique name (a maximum of 64 characters are allowed) used as reference when creating the EFS | `string` | n/a | yes |
| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no |
| efs\_backup\_policy\_enabled | If `true`, it will turn on automatic backups. | `bool` | `true` | no |
| efs\_enabled | Set to false to prevent the module from creating any resources | `bool` | `true` | no |
| encrypted | If true, the file system will be encrypted | `bool` | `true` | no |
| environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `"test"` | no |
| 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)` | <pre>[<br> "name",<br> "environment"<br>]</pre> | no |
| managedby | ManagedBy, eg 'CloudDrove'. | `string` | `"hello@clouddrove.com"` | no |
| mount\_target\_ip\_address | The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target | `string` | `null` | no |
| name | Solution name, e.g. `app` | `any` | n/a | yes |
| performance\_mode | The file system performance mode. Can be either `generalPurpose` or `maxIO` | `string` | `"generalPurpose"` | no |
| provisioned\_throughput\_in\_mibps | The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with `throughput_mode` set to provisioned | `number` | `0` | no |
| region | AWS Region | `string` | n/a | yes |
| repository | Terraform current module repo | `string` | `"https://github.com/clouddrove/terraform-aws-efs"` | no |
| security\_groups | Security group IDs to allow access to the EFS | `list(string)` | n/a | yes |
| subnets | Subnet IDs | `list(string)` | n/a | yes |
| tags | Additional tags (e.g. `{ BusinessUnit = "XYZ" }` | `map(string)` | `{}` | no |
| throughput\_mode | Throughput mode for the file system. Defaults to bursting. Valid values: `bursting`, `provisioned`. When using `provisioned`, also set `provisioned_throughput_in_mibps` | `string` | `"bursting"` | no |
| vpc\_id | VPC ID | `string` | n/a | yes |
| zone\_id | Route53 DNS zone ID | `string` | `""` | no |

## Outputs

| Name | Description |
|------|-------------|
| arn | EFS ARN |
| id | EFS ID |
| mount\_target\_ids | List of EFS mount target IDs \(one per Availability Zone\) |
| mount\_target\_ips | List of EFS mount target IPs \(one per Availability Zone\) |
| mount\_target\_ids | List of EFS mount target IDs (one per Availability Zone) |
| mount\_target\_ips | List of EFS mount target IPs (one per Availability Zone) |
| network\_interface\_ids | List of mount target network interface IDs |
| tags | The tags of the ecs cluster |




## Testing
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.
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.

You need to run the following command in the testing folder:
```hcl
Expand All @@ -142,7 +148,7 @@ You need to run the following command in the testing folder:



## Feedback
## Feedback
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-efs/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-efs)!
Expand Down

0 comments on commit f038884

Please sign in to comment.