Skip to content

Commit

Permalink
Merge pull request #3 from clouddrove/CD-209
Browse files Browse the repository at this point in the history
upgrade terraform version to 0.13.0 and Add pipelines
  • Loading branch information
Sohan Yadav committed Oct 28, 2020
2 parents c47080c + f68d9c2 commit 24fa204
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 9 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()
55 changes: 55 additions & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 'Terraform GitHub Actions'
on:
pull_request:
branches:
- master

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

- name: 'Terraform init'
uses: 'clouddrove/github-actions@v4.0'
with:
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'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.12.0
rev: v1.43.0
hooks:
- 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
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) 2020 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
5 changes: 3 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-cloudtrail-slack-notification
# Badges to display
badges:
- name: "Terraform"
image: "https://img.shields.io/badge/Terraform-v0.12-green"
image: "https://img.shields.io/badge/Terraform-v0.13-green"
url: "https://www.terraform.io"
- name: "Licence"
image: "https://img.shields.io/badge/License-MIT-blue.svg"
Expand All @@ -36,7 +36,8 @@ usage : |-
Here is an example of how you can use this module in your inventory structure:
```hcl
module "cloudtrail-slack-notification" {
source = "git::https://github.com/clouddrove/terraform-aws-cloudtrail-slack-notification.git?ref=tags/0.12.2"
source = "clouddrove/cloudtrail-slack-notification/aws"
version = "0.13.0"
name = "cloudtrail-slack-notification"
application = "clouddrove"
environment = "test"
Expand Down
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


resource "null_resource" "main" {
count = var.enabled ? 1 : 0
count = var.enabled ? 1 : 0
provisioner "local-exec" {
command = format("cd %s/slack && bash build.sh", path.module)
}
Expand All @@ -12,7 +12,8 @@ resource "null_resource" "main" {
#Module : Cloudtrail Logs
#Description : This terraform module is designed to create cloudtrail log.
module "cloudtrail-slack" {
source = "git::https://github.com/clouddrove/terraform-aws-lambda.git?ref=tags/0.12.5"
source = "clouddrove/lambda/aws"
version = "0.13.0"

name = var.name
application = var.application
Expand Down
7 changes: 6 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Terraform version
terraform {
required_version = ">= 0.12"
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}

0 comments on commit 24fa204

Please sign in to comment.