Skip to content

Commit

Permalink
Merge pull request #2 from clouddrove/CD-90
Browse files Browse the repository at this point in the history
github action
  • Loading branch information
Nikita Dugar committed Dec 28, 2019
2 parents 52a2fd2 + 53c9173 commit 260c2a5
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 9 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Terraform GitHub Actions'
on:
- pull_request

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

- name: 'Checkout'
uses: actions/checkout@master

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

- name: 'Terraform Init'
uses: clouddrove/github-actions@v2.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.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2

- name: 'Terraform Plan'
uses: clouddrove/github-actions@v2.0
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Terratest'
uses: clouddrove/github-actions@v2.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 }} # required
if: always()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ This module has a few dependencies:
Here is an example of how you can use this module in your inventory structure:
```hcl
module "vpn" {
source = "git::https://github.com/clouddrove/terraform-aws-vpn.git"
source = "git::https://github.com/clouddrove/terraform-aws-vpn.git?ref=tags/0.12.1"
name = "vpn"
application = "clouddrove"
environment = "test"
Expand Down
2 changes: 1 addition & 1 deletion README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ usage : |-
Here is an example of how you can use this module in your inventory structure:
```hcl
module "vpn" {
source = "git::https://github.com/clouddrove/terraform-aws-vpn.git?ref=tags/0.12.0"
source = "git::https://github.com/clouddrove/terraform-aws-vpn.git?ref=tags/0.12.1"
name = "vpn"
application = "clouddrove"
environment = "test"
Expand Down
13 changes: 7 additions & 6 deletions _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module "vpc" {
}

module "public_subnets" {
source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.3"
source = "git::https://github.com/clouddrove/terraform-aws-subnet.git?ref=tags/0.12.4"

name = "public-subnet"
application = "clouddrove"
Expand All @@ -30,11 +30,12 @@ module "public_subnets" {


module "vpn" {
source = "git::https://github.com/clouddrove/terraform-aws-vpn.git?ref=tags/0.12.0"
name = "vpn"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]
source = "./../"
name = "vpn"
application = "clouddrove"
environment = "test"
label_order = ["environment", "application", "name"]

vpc_id = module.vpc.vpc_id
customer_ip_address = "115.160.246.74"
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# tags for resources. You can use terraform-labels to implement a strict
# naming convention.
module "labels" {
source = "git::https://github.com/clouddrove/terraform-labels.git"
source = "git::https://github.com/clouddrove/terraform-labels.git?ref=tags/0.12.0"

name = var.name
application = var.application
Expand Down

0 comments on commit 260c2a5

Please sign in to comment.