Skip to content

Commit a69e5c0

Browse files
author
Om Sharma
authored
Merge pull request #9 from clouddrove/0.15
fix terratest
2 parents 6a4b316 + d4d8309 commit a69e5c0

File tree

8 files changed

+43
-31
lines changed

8 files changed

+43
-31
lines changed

.github/workflows/readme.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: 'Checkout'
13-
uses: actions/checkout@master
13+
uses: actions/checkout@v2.3.4
1414

15-
- name: Set up Python 3.7.
15+
- name: 'Set up Python 3.7'
1616
uses: actions/setup-python@v2
1717
with:
1818
python-version: '3.x'
@@ -26,11 +26,11 @@ jobs:
2626
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
2727

2828

29-
- name: pre-commit check errors
29+
- name: 'pre-commit check errors'
3030
uses: pre-commit/action@v2.0.0
3131
continue-on-error: true
3232

33-
- name: pre-commit fix erros
33+
- name: 'pre-commit fix errors'
3434
uses: pre-commit/action@v2.0.0
3535
continue-on-error: true
3636

.pre-commit-config.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
repos:
2-
- repo: git://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.45.0
2+
3+
- repo: https://github.com/gruntwork-io/pre-commit
4+
rev: v0.1.12 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
45
hooks:
5-
- id: terraform_fmt
6+
- id: terraform-fmt
7+
- id: shellcheck
8+
- id: tflint
69

7-
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v3.4.0
10+
- repo: git://github.com/pre-commit/pre-commit-hooks
11+
rev: v4.0.1 # Use the ref you want to point at
912
hooks:
13+
- id: end-of-file-fixer
14+
- id: trailing-whitespace
15+
- id: mixed-line-ending
16+
- id: check-byte-order-marker
17+
- id: check-executables-have-shebangs
1018
- id: check-merge-conflict
19+
- id: debug-statements
1120
- id: check-yaml
1221
- id: check-added-large-files
13-
- id: trailing-whitespace

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<p align="center"> <img src="https://user-images.githubusercontent.com/50652676/62349836-882fef80-b51e-11e9-99e3-7b974309c7e3.png" width="100" height="100"></p>
44

55

6+
7+
68
<h1 align="center">
79
Terraform AWS EFS
810
</h1>

_example/outputs.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,9 @@ output "efs_network_interface_ids" {
3939
value = module.efs.network_interface_ids
4040
description = "List of mount target network interface IDs"
4141
}
42+
43+
output "tags" {
44+
value = module.efs.tags
45+
description = "The tags of the ecs cluster"
46+
47+
}

_example/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ variable "region" {
44

55
variable "repository" {
66
type = string
7-
default = "https://registry.terraform.io/modules/clouddrove/subnet/aws/0.14.0"
7+
default = "https://github.com/clouddrove/terraform-aws-efs"
88
description = "Terraform current module repo"
99

1010
validation {

_test/efs_test.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
// Managed By : CloudDrove
2-
// Description : This Terratest is used to test the Terraform EFS module.
2+
// Description : This Terratest is used to test the Terraform EFS modules.
33
// Copyright @ CloudDrove. All Right Reserved.
4-
54
package test
65

76
import (
87
"testing"
9-
//"strings"
10-
"github.com/stretchr/testify/assert"
118
"github.com/gruntwork-io/terratest/modules/terraform"
9+
"github.com/stretchr/testify/assert"
1210
)
1311

14-
func TestEFS(t *testing.T) {
12+
func Test(t *testing.T) {
1513
t.Parallel()
1614

1715
terraformOptions := &terraform.Options{
1816
// Source path of Terraform directory.
1917
TerraformDir: "../_example",
20-
Upgrade: true,
2118
}
2219

23-
// This will run `terraform init` and `terraform apply` and fail the test if there are any errors
20+
// This will run 'terraform init' and 'terraform application' and will fail the test if any errors occur
2421
terraform.InitAndApply(t, terraformOptions)
2522

26-
// At the end of the test, run `terraform destroy` to clean up any resources that were created
23+
// To clean up any resources that have been created, run 'terraform destroy' towards the end of the test
2724
defer terraform.Destroy(t, terraformOptions)
2825

29-
// Run `terraform output` to get the value of an output variable
30-
keyArn := terraform.Output(t, terraformOptions, "efs_arn")
26+
// To get the value of an output variable, run 'terraform output'
27+
Tags := terraform.OutputMap(t, terraformOptions, "tags")
28+
29+
// Check that we get back the outputs that we expect
30+
assert.Equal(t, "efs-test", Tags["Name"])
3131

32-
// Verify we're getting back the outputs we expect
33-
assert.Contains(t, keyArn, "arn:aws:elasticfilesystem")
3432
}

_test/go.mod

Lines changed: 0 additions & 8 deletions
This file was deleted.

outputs.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@ output "network_interface_ids" {
2525
value = [coalescelist(aws_efs_mount_target.default.*.network_interface_id, [""])]
2626
description = "List of mount target network interface IDs"
2727
}
28+
29+
output "tags" {
30+
value = module.label.tags
31+
description = "The tags of the ecs cluster"
32+
33+
}

0 commit comments

Comments
 (0)