Skip to content

Commit

Permalink
Merge pull request #7 from clouddrove/0.14
Browse files Browse the repository at this point in the history
Upgrade module with Terraform 0.14
  • Loading branch information
Sohan Yadav committed Jan 20, 2021
2 parents 9a9faf2 + 1bd90e0 commit 8d456c9
Show file tree
Hide file tree
Showing 21 changed files with 145 additions and 108 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master
uses: actions/checkout@v2.3.4

- name: Set up Python 3.7.
- 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'
uses: 'clouddrove/github-actions@v6.0'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB}}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}


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

- name: pre-commit fix erros
- 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'
uses: 'clouddrove/github-actions@v6.0'
continue-on-error: true
with:
actions_subcommand: 'push'
Expand All @@ -51,4 +50,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
if: always()
66 changes: 40 additions & 26 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,68 +5,82 @@ on:
- master

jobs:
terraform:
name: 'Terraform'
fmt:
name: 'Terraform Format'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master
uses: actions/checkout@v2.3.4

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

fifo:
name: 'fifo'
needs: fmt
runs-on: ubuntu-latest
steps:

- name: 'Checkout'
uses: actions/checkout@v2.3.4

- 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'
uses: 'clouddrove/github-actions@v6.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/fifo

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

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

standard:
name: 'standard'
needs: fmt
runs-on: ubuntu-latest
steps:

- name: 'Checkout'
uses: actions/checkout@v2.3.4

- 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 init'
uses: 'clouddrove/github-actions@v4.0'
uses: 'clouddrove/github-actions@v6.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/standard

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

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

- 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()
41 changes: 34 additions & 7 deletions .github/workflows/terratest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
types: [labeled]

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

- name: 'Checkout'
uses: actions/checkout@master
uses: actions/checkout@v2.3.4

- name: Configure AWS Credentials
- name: 'Configure AWS Credentials'
uses: clouddrove/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.TEST_AWS_ACCESS_KEY }}
Expand All @@ -23,16 +23,43 @@ jobs:

- name: 'Terratest'
if: ${{ github.event.label.name == 'terratest' }}
uses: 'clouddrove/github-actions@v4.0'
uses: 'clouddrove/github-actions@v6.0'
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: _test/fifo
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()


standard:
name: 'Terratest for standard'
runs-on: ubuntu-latest
steps:

- name: 'Checkout'
uses: actions/checkout@v2.3.4

- 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'
uses: 'clouddrove/github-actions@v6.0'
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: _test/standard
Expand All @@ -48,4 +75,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
if: always()
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
*.tfstate.backup
.terraform
.idea
*.iml
*.iml
*.terraform.lock.hcl
20 changes: 14 additions & 6 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.43.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.2.0
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0 # Use the ref you want to point at
hooks:
- 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: trailing-whitespace
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Cloud Drove
Copyright (c) 2021 Cloud Drove

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
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 SQS
</h1>

<p align="center" style="font-size: 1.2rem;">
<p align="center" style="font-size: 1.2rem;">
Terraform module to create SQS resource on AWS for managing queue.
</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 @@ -155,7 +155,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 @@ -164,7 +164,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-sqs/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-sqs)!
Expand Down
14 changes: 6 additions & 8 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ github_repo: clouddrove/terraform-aws-sqs
# Badges to display
badges:
- name: "Terraform"
image: "https://img.shields.io/badge/terraform-v0.13-green"
image: "https://img.shields.io/badge/terraform-v0.14-green"
url: "https://www.terraform.io"
- name: "Licence"
image: "https://img.shields.io/badge/License-MIT-blue.svg"
Expand All @@ -38,11 +38,10 @@ usage : |-
```hcl
module "sqs" {
source = "clouddrove/sqs/aws"
version = "0.13.0"
version = "0.14.0"
name = "sqs-fifo"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
label_order = ["name", "environment"]
fifo_queue = true
content_based_deduplication = true
}
Expand All @@ -51,11 +50,10 @@ usage : |-
```hcl
module "sqs" {
source = "clouddrove/sqs/aws"
version = "0.13.0"
version = "0.14.0"
name = "sqs"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
label_order = ["name", "environment"]
delay_seconds = 90
max_message_size = 2048
message_retention_seconds = 86400
Expand All @@ -76,4 +74,4 @@ usage : |-
resources = ["arn:aws:sqs:eu-west-1:xxxxxxxxx:test-clouddrove-sqs"]
}
}
```
```
4 changes: 2 additions & 2 deletions _example/fifo/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ module "sqs" {
source = "./../../"

name = "sqs-fifo"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
label_order = ["name", "environment"]

enabled = true
fifo_queue = true
content_based_deduplication = true
}
2 changes: 1 addition & 1 deletion _example/fifo/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ output "arn" {
output "tags" {
value = module.sqs.tags
description = "A mapping of tags to assign to the sqs."
}
}
Loading

0 comments on commit 8d456c9

Please sign in to comment.