Skip to content

Commit

Permalink
upgrade terraform version 0.15
Browse files Browse the repository at this point in the history
  • Loading branch information
yadavprakash committed Jun 22, 2021
1 parent bd46ff2 commit eef1a37
Show file tree
Hide file tree
Showing 20 changed files with 92 additions and 72 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
python-version: '3.x'

- name: 'create readme'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB}}'
Expand All @@ -35,7 +35,7 @@ jobs:
continue-on-error: true

- name: 'push readme'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
continue-on-error: true
with:
actions_subcommand: 'push'
Expand All @@ -51,4 +51,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
if: always()
42 changes: 31 additions & 11 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,65 +20,85 @@ jobs:
aws-region: us-east-2

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

- name: 'Terraform init for memcached'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/memcached

- name: 'Terraform validate for memcached'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example/memcached

- name: 'Terraform plan for memcached'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example/memcached

- name: 'Terraform init for redis'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/redis

- name: 'Terraform validate for redis'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example/redis

- name: 'Terraform plan for redis'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example/redis

- name: 'Terraform init for redis-cluster'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/redis-cluster

- name: 'Terraform validate for redis-cluster'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example/redis-cluster

- name: 'Terraform plan for redis-cluster'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v7.0'
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example/redis-cluster



pre-commit:
name: 'Pre-Commit'
needs:
- fmt
- basic_example
- secure_example
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/[email protected]

- name: 'Install Tflint'
run: |
curl https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash
- name: 'Pre-Commit 🔎'
uses: pre-commit/[email protected]
continue-on-error: true

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
Expand All @@ -88,4 +108,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
if: always()
2 changes: 1 addition & 1 deletion .github/workflows/terratest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
if: always()
22 changes: 15 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.45.0

- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.12 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
hooks:
- id: terraform_fmt
- id: terraform-fmt
- id: shellcheck
- id: tflint

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1 # Use the ref you want to point at
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
- id: check-added-large-files
- id: check-added-large-files
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export GENIE_PATH ?= $(shell 'pwd')/../../../genie

include $(GENIE_PATH)/Makefile
include $(GENIE_PATH)/Makefile
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Terraform AWS Elasticache
</h1>

<p align="center" style="font-size: 1.2rem;">
<p align="center" style="font-size: 1.2rem;">
Terraform module to create Elasticache Cluster and replica for Redis and Memcache.
</p>

Expand Down Expand Up @@ -38,7 +38,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 @@ -49,7 +49,7 @@ 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.13](https://learn.hashicorp.com/terraform/getting-started/install.html)
- [Go](https://golang.org/doc/install)
Expand Down Expand Up @@ -203,7 +203,7 @@ Here are some examples of how you can use this module in your inventory structur


## 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 @@ -212,7 +212,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-elasticache/issues), or feel free to drop us an email at [[email protected]](mailto:[email protected]).

If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-elasticache)!
Expand Down
19 changes: 8 additions & 11 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ github_repo: clouddrove/terraform-aws-elasticache
# Badges to display
badges:
- name: "Terraform"
image: "https://img.shields.io/badge/terraform-v0.14-green"
image: "https://img.shields.io/badge/terraform-v0.15-green"
url: "https://www.terraform.io"
- name: "Licence"
image: "https://img.shields.io/badge/License-MIT-blue.svg"
Expand All @@ -39,11 +39,10 @@ usage : |-
```hcl
module "redis" {
source = "clouddrove/elasticache/aws
version = "0.14.0"
version = "0.15.0"
name = "redis"
repository = "https://registry.terraform.io/modules/clouddrove/elasticache/aws/0.14.0"
environment = "test"
label_order = ["environment", "application", "name"]
label_order = ["environment", "name"]
engine = "redis"
engine_version = "5.0.0"
family = "redis5.0"
Expand All @@ -61,11 +60,10 @@ usage : |-
```hcl
module "redis-cluster" {
source = "clouddrove/elasticache/aws
version = "0.14.0"
version = "0.15.0"
name = "cluster"
repository = "https://registry.terraform.io/modules/clouddrove/elasticache/aws/0.14.0"
environment = "test"
label_order = ["environment", "application", "name"]
label_order = ["environment","name"]
cluster_replication_enabled = true
engine = "redis"
engine_version = "5.0.0"
Expand All @@ -85,11 +83,10 @@ usage : |-
```hcl
module "memcached" {
source = "clouddrove/elasticache/aws
version = "0.14.0"
version = "0.15.0"
name = "memcached"
repository = "https://registry.terraform.io/modules/clouddrove/elasticache/aws/0.14.0"
environment = "test"
label_order = ["environment", "application", "name"]
label_order = ["environment", "name"]
cluster_enabled = true
engine = "memcached"
engine_version = "1.5.10"
Expand All @@ -102,4 +99,4 @@ usage : |-
security_group_ids = ["sg-xxxxxxxxx"]
availability_zones = ["eu-west-1a","eu-west-1b" ]
}
```
```
1 change: 1 addition & 0 deletions _example/memcached/.terraform.tfstate.lock.info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ID":"746d2987-7658-4223-7e5b-1e5744be7295","Operation":"OperationTypeApply","Info":"","Who":"prakash@prakash","Version":"0.15.0","Created":"2021-06-22T11:22:20.054532025Z","Path":"terraform.tfstate"}
9 changes: 3 additions & 6 deletions _example/memcached/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ provider "aws" {

module "vpc" {
source = "clouddrove/vpc/aws"
version = "0.14.0"
version = "0.15.0"

name = "vpc"
repository = "https://registry.terraform.io/modules/clouddrove/vpc/aws/0.14.0"
environment = "test"
label_order = [
"name", "environment"]
Expand All @@ -17,10 +16,9 @@ module "vpc" {

module "subnets" {
source = "clouddrove/subnet/aws"
version = "0.14.0"
version = "0.15.0"

name = "subnets"
repository = "https://registry.terraform.io/modules/clouddrove/subnet/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]

Expand All @@ -34,10 +32,9 @@ module "subnets" {

module "memcached-sg" {
source = "clouddrove/security-group/aws"
version = "0.14.0"
version = "0.15.0"

name = "memcached-sg"
repository = "https://registry.terraform.io/modules/clouddrove/security-group/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]

Expand Down
2 changes: 1 addition & 1 deletion _example/memcached/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "tags" {
value = module.memcached.tags
description = "A mapping of tags to assign to the resource."
}
}
13 changes: 5 additions & 8 deletions _example/redis-cluster/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ provider "aws" {

module "vpc" {
source = "clouddrove/vpc/aws"
version = "0.14.0"
version = "0.15.0"

name = "vpc"
repository = "https://registry.terraform.io/modules/clouddrove/vpc/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]

Expand All @@ -16,10 +15,9 @@ module "vpc" {

module "subnets" {
source = "clouddrove/subnet/aws"
version = "0.14.0"
version = "0.15.0"

name = "subnets"
repository = "https://registry.terraform.io/modules/clouddrove/subnet/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]
availability_zones = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
Expand All @@ -31,10 +29,10 @@ module "subnets" {
}

module "redis-sg" {
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git"
source = "clouddrove/security-group/aws"
version = "0.15.0"

name = "redis-sg"
repository = "https://registry.terraform.io/modules/clouddrove/security-group/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]

Expand All @@ -47,7 +45,6 @@ module "redis-cluster" {
source = "./../../"

name = "cluster"
repository = "https://registry.terraform.io/modules/clouddrove/vpc/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]

Expand All @@ -64,4 +61,4 @@ module "redis-cluster" {
replicas_per_node_group = 2
num_node_groups = 1
automatic_failover_enabled = true
}
}
2 changes: 1 addition & 1 deletion _example/redis-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ output "id" {
output "tags" {
value = module.redis-cluster.tags
description = "A mapping of tags to assign to the resource."
}
}
Loading

0 comments on commit eef1a37

Please sign in to comment.