Skip to content

Commit

Permalink
Merge pull request #19 from clouddrove/0.15.0
Browse files Browse the repository at this point in the history
update guthub-action,module tags and module update in 0.15
  • Loading branch information
Om Sharma authored Jul 1, 2021
2 parents 4065078 + 260596b commit e20236d
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 69 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master
uses: actions/checkout@v2.3.4

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

- name: 'create readme'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v8.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@v8.0'
continue-on-error: true
with:
actions_subcommand: 'push'
Expand Down
97 changes: 78 additions & 19 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,79 +5,138 @@ on:
- master

jobs:
terraform:
name: 'Terraform'
fmt:
name: 'terraform fmt'
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@v8.0'
with:
actions_subcommand: 'fmt'
- name: 'Terraform Format'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'fmt'

alb:
name: 'alb'
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@v6.0'
with:
actions_subcommand: 'fmt'

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

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

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

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

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

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

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

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

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

pre-commit:
name: 'Pre-Commit'
needs:
- fmt
- alb
- clb
- nlb
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2.3.4

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

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
with:
Expand All @@ -87,4 +146,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
if: always()
51 changes: 51 additions & 0 deletions .github/workflows/terratest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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 Basic'
if: ${{ github.event.label.name == 'terratest' }}
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: '_test/basic_example'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

<p align="center" style="font-size: 1.2rem;">
<p align="center" style="font-size: 1.2rem;">
This terraform module is used to create ALB on AWS.
</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 @@ -280,7 +280,7 @@ Here are examples of how you can use this module in your inventory structure:


## 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 @@ -289,7 +289,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-alb/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-alb)!
Expand Down
8 changes: 4 additions & 4 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ github_repo: clouddrove/terraform-aws-alb
# 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 @@ -37,7 +37,7 @@ usage : |-
```hcl
module "alb" {
source = "clouddrove/alb/aws"
version = "0.14.0"
version = "0.15.0"
name = "alb"
internal = false
load_balancer_type = "application"
Expand Down Expand Up @@ -79,7 +79,7 @@ usage : |-
```hcl
module "alb" {
source = "clouddrove/alb/aws"
version = "0.14.0"
version = "0.15.0"
name = "nlb"
internal = false
load_balancer_type = "application"
Expand Down Expand Up @@ -124,7 +124,7 @@ usage : |-
```hcl
module "clb" {
source = "clouddrove/alb/aws"
version = "0.14.0"
version = "0.15.0"
name = "clb"
load_balancer_type = "classic"
Expand Down
18 changes: 6 additions & 12 deletions _example/alb/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://github.com/clouddrove/terraform-aws-vpc"
environment = "test"
label_order = ["name", "environment"]

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

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

name = "public-subnet"
repository = "https://github.com/clouddrove/terraform-aws-subnet"
environment = "test"
label_order = ["name", "environment"]

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

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

name = "http-https"
repository = "https://github.com/clouddrove/terraform-aws-security-group"
environment = "test"
label_order = ["name", "environment"]

Expand All @@ -49,10 +46,9 @@ module "http_https" {

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

name = "ssh"
repository = "https://github.com/clouddrove/terraform-aws-security-group"
environment = "test"
label_order = ["name", "environment"]

Expand All @@ -64,10 +60,9 @@ module "ssh" {

module "iam-role" {
source = "clouddrove/iam-role/aws"
version = "0.14.0"
version = "0.15.0"

name = "iam-role"
repository = "https://github.com/clouddrove/terraform-aws-iam-role"
environment = "test"
label_order = ["name", "environment"]

Expand Down Expand Up @@ -103,10 +98,9 @@ data "aws_iam_policy_document" "iam-policy" {

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

name = "ec2-instance"
repository = "https://github.com/clouddrove/terraform-aws-ec2"
environment = "test"
label_order = ["name", "environment"]

Expand Down
Loading

0 comments on commit e20236d

Please sign in to comment.