Skip to content

Commit

Permalink
Upgrade terraform version to 0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyanio committed Oct 19, 2020
1 parent 6c5a3db commit 95075ab
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 42 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()
62 changes: 28 additions & 34 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,53 @@
name: 'Terraform GitHub Actions'
on:
- push
pull_request:
branches:
- master

jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@master
- name: 'Terraform Format fmt'
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: 0.13.4
tf_actions_subcommand: 'fmt'
tf_actions_working_dir: "./_example"
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- 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: Set up Go 1.13
uses: actions/setup-go@v1

- name: 'Terraform Format'
uses: 'clouddrove/github-actions@v4.0'
with:
go-version: 1.13
id: go
- name: Get dependencies
run: |
if [ -f Gopkg.toml ]; then
curl https://github.com/raw/golang/dep/master/install.sh | sh
dep ensure
else
go get -v -t -d ./...
fi
- name: Test Example
working-directory: ./_test
run: go test
- name: 'Terraform Init Example'
uses: hashicorp/terraform-github-actions@master
actions_subcommand: 'fmt'

- name: 'Terraform init'
uses: 'clouddrove/github-actions@v4.0'
with:
tf_actions_version: 0.13.4
tf_actions_subcommand: 'init'
tf_actions_working_dir: "./_example"
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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'
author_name: 'CloudDrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
Expand Down
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: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.7.4
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.43.0
hooks:
- id: terraform_fmt
- id: terraform_fmt

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
rev: v3.2.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
- id: check-yaml
- id: check-added-large-files
- id: trailing-whitespace
3 changes: 2 additions & 1 deletion README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ usage : |-
Here is an example of how you can use this module in your inventory structure:
```hcl
module "kms_key" {
source = "git::https://github.com/clouddrove/terraform-aws-kms.git?ref=tags/0.13.0"
source = "clouddrove/kms/aws"
version = "0.13.0"
name = "kms"
application = "clouddrove"
environment = "test"
Expand Down
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Terraform version
terraform {
required_version = ">= 0.13"
required_version = ">= 0.12.0, < 0.14.0"
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
}

0 comments on commit 95075ab

Please sign in to comment.