Skip to content

Commit

Permalink
Merge pull request #7 from clouddrove/0.14
Browse files Browse the repository at this point in the history
0.14
  • Loading branch information
Nikita Dugar authored Apr 14, 2021
2 parents 19c6b64 + 3514bb1 commit 1b1b7a5
Show file tree
Hide file tree
Showing 10 changed files with 650 additions and 47 deletions.
61 changes: 39 additions & 22 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,67 @@ 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@v6.0'
with:
actions_subcommand: 'fmt'

validate:
name: 'terraform validate'
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

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

plan:
name: 'terraform plan'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2.3.4

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

- 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 plan'
uses: 'clouddrove/github-actions@v4.0'
uses: 'clouddrove/github-actions@v6.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()
17 changes: 8 additions & 9 deletions .github/workflows/terratest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,27 @@ on:
types: [labeled]

jobs:
terraform:
name: 'Terraform'
Terratest:
name: 'Terratest'
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 }}
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'
if: ${{ github.event.label.name == 'terratest' }}
tf_actions_working_dir: '_test'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
Expand All @@ -39,4 +37,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
if: always()

21 changes: 21 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 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-iam-role
# 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 @@ -39,7 +39,7 @@ usage: |-
```hcl
module "iam-role" {
source = "clouddrove/iam-role/aws"
version = "0.13.0"
version = "0.14.0"
name = "iam-role"
application = "clouddrove"
Expand Down
20 changes: 20 additions & 0 deletions _example/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ module "iam-role" {
source = "./../"

name = "iam-role"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
label_order = ["environment", "name"]

assume_role_policy = data.aws_iam_policy_document.default.json

Expand Down
Loading

0 comments on commit 1b1b7a5

Please sign in to comment.