Skip to content

Commit

Permalink
updated and upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-uniyal committed Oct 27, 2020
1 parent adbcb2d commit ee1c49d
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 14 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 'Create README.md file'
on:
push:
branches:
- master

jobs:
readme-create:
name: 'readme-create'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: Set up Python 3.7.
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: 'create readme'
uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB}}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}


- name: pre-commit check errors
uses: pre-commit/action@v2.0.0
continue-on-error: true

- name: pre-commit fix erros
uses: pre-commit/action@v2.0.0
continue-on-error: true

- name: 'push readme'
uses: 'clouddrove/github-actions@v4.0'
continue-on-error: true
with:
actions_subcommand: 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'CloudDrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
55 changes: 55 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 'Terraform GitHub Actions'
on:
pull_request:
branches:
- master

jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: Configure AWS Credentials
uses: clouddrove/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
aws-region: us-east-2


- name: 'Terraform Format'
uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'fmt'

- name: 'Terraform init'
uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example

- name: 'Terraform validate'
uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example

- name: 'Terraform plan'
uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'CloudDrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
42 changes: 42 additions & 0 deletions .github/workflows/terratest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: 'Terratest GitHub Actions'
on:
pull_request:
branches:
- master
types: [labeled]

jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
steps:

- name: 'Checkout'
uses: actions/checkout@master

- name: Configure AWS Credentials
uses: clouddrove/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.TEST_AWS_ACCESS_SECRET_KEY }}
aws-region: us-east-2

- name: 'Terratest'
if: ${{ github.event.label.name == 'terratest' }}
uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: '_test'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
status: ${{ job.status }}
fields: repo,author
author_name: 'CloudDrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.30.0
rev: v1.43.0
hooks:
- id: terraform_fmt
- id: terraform_tflint
- id: terraform_fmt

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
rev: v3.2.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
- id: check-yaml
- id: check-added-large-files
- id: check-added-large-files
- id: trailing-whitespace
5 changes: 3 additions & 2 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ github_repo: clouddrove/terraform-aws-efs
# Badges to display
badges:
- name: "Terraform"
image: "https://img.shields.io/badge/Terraform-v0.12-green"
image: "https://img.shields.io/badge/Terraform-v0.13-green"
url: "https://www.terraform.io"
- name: "Licence"
image: "https://img.shields.io/badge/License-MIT-blue.svg"
Expand All @@ -36,7 +36,8 @@ usage : |-
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"
source = "clouddrove/efs/aws"
version = "0.13.0"
name = "efs"
application = var.application
environment = var.environment
Expand Down
11 changes: 7 additions & 4 deletions _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ provider "aws" {
}

module "vpc" {
source = "git::https://github.com/clouddrove/terraform-aws-vpc.git?ref=tags/0.12.4"

source = "clouddrove/vpc/aws"
version = "0.13.0"
name = "vpc"
application = var.application
environment = var.environment
Expand All @@ -14,8 +14,8 @@ module "vpc" {
}

module "subnets" {
source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.4"

source = "clouddrove/subnet/aws"
version = "0.13.0"
name = "subnet"
application = var.application
environment = var.environment
Expand All @@ -27,8 +27,11 @@ module "subnets" {
igw_id = module.vpc.igw_id
nat_gateway_enabled = var.nat_gateway
cidr_block = module.vpc.vpc_cidr_block
ipv6_cidr_block = module.vpc.ipv6_cidr_block
}



module "efs" {
source = "./.."

Expand Down
8 changes: 8 additions & 0 deletions _test/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/clouddrove/terraform-aws-efs

go 1.13

require (
github.com/gruntwork-io/terratest v0.30.5
github.com/stretchr/testify v1.6.1
)
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#Description : Terraform module to create consistent naming for multiple names.

module "label" {
source = "git::https://github.com/clouddrove/terraform-labels.git?ref=tags/0.12.0"
source = "git::https://github.com/clouddrove/terraform-labels.git?ref=tags/0.13.0"
name = var.name
application = var.application
environment = var.environment
Expand All @@ -25,6 +25,7 @@ resource "aws_efs_file_system" "default" {
performance_mode = var.performance_mode
provisioned_throughput_in_mibps = var.provisioned_throughput_in_mibps
throughput_mode = var.throughput_mode
kms_key_id = var.kms_key_id
}

#Module : EFS
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,8 @@ variable "mount_target_ip_address" {
default = ""
}

variable "kms_key_id" {
type = string
description = "The ARN for the KMS encryption key. When specifying kms_key_id, encrypted needs to be set to true."
default = ""
}
8 changes: 7 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Terraform version
terraform {
required_version = "~> 0.12.0"
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.10.0"
}
}
}

0 comments on commit ee1c49d

Please sign in to comment.