-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from clouddrove/0.14
Upgrade module with Terraform 0.14
- Loading branch information
Showing
18 changed files
with
177 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,30 +12,30 @@ jobs: | |
- name: 'Checkout' | ||
uses: actions/checkout@master | ||
|
||
- name: Set up Python 3.7. | ||
- 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' | ||
uses: 'clouddrove/github-actions@v6.0' | ||
with: | ||
actions_subcommand: 'readme' | ||
github_token: '${{ secrets.GITHUB}}' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} | ||
|
||
|
||
- name: pre-commit check errors | ||
- name: 'pre-commit check errors' | ||
uses: pre-commit/[email protected] | ||
continue-on-error: true | ||
|
||
- name: pre-commit fix erros | ||
- name: 'pre-commit fix erros' | ||
uses: pre-commit/[email protected] | ||
continue-on-error: true | ||
|
||
- name: 'push readme' | ||
uses: 'clouddrove/github-actions@v4.0' | ||
uses: 'clouddrove/github-actions@v6.0' | ||
continue-on-error: true | ||
with: | ||
actions_subcommand: 'push' | ||
|
@@ -51,4 +51,4 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required | ||
if: always() | ||
if: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,51 +5,66 @@ 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/[email protected]' | ||
with: | ||
actions_subcommand: 'fmt' | ||
|
||
validate: | ||
name: 'terraform validate' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/[email protected] | ||
|
||
- 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/[email protected]' | ||
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 | ||
|
||
- name: 'Terraform plan' | ||
uses: 'clouddrove/[email protected]' | ||
plan: | ||
name: 'terraform plan' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/[email protected] | ||
|
||
- name: 'Terraform init' | ||
uses: 'clouddrove/[email protected]' | ||
with: | ||
actions_subcommand: 'plan' | ||
actions_subcommand: 'init' | ||
tf_actions_working_dir: ./_example | ||
|
||
- name: 'Slack Notification' | ||
uses: clouddrove/action-slack@v2 | ||
- name: 'Configure AWS Credentials' | ||
uses: clouddrove/configure-aws-credentials@v1 | ||
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() | ||
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/[email protected]' | ||
with: | ||
actions_subcommand: 'plan' | ||
tf_actions_working_dir: ./_example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
.terraform | ||
.idea | ||
*.iml | ||
*.zip | ||
*.zip | ||
*.terraform.lock.hcl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
repos: | ||
- repo: git://github.com/antonbabenko/pre-commit-terraform | ||
rev: v1.43.0 | ||
|
||
- repo: https://github.com/gruntwork-io/pre-commit | ||
rev: v0.1.12 # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases | ||
hooks: | ||
- id: terraform_fmt | ||
- id: terraform-fmt | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
- repo: git://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 # Use the ref you want to point at | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
- id: check-byte-order-marker | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: trailing-whitespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export GENIE_PATH ?= $(shell 'pwd')/../../../genie | ||
|
||
include $(GENIE_PATH)/Makefile | ||
include $(GENIE_PATH)/Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
output "tags" { | ||
value = module.cloudtrail-slack-notification.tags | ||
description = "A mapping of tags to assign to the resource." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Managed By : CloudDrove | ||
// Description : This Terratest is used to test the Terraform VPC module. | ||
// Copyright @ CloudDrove. All Right Reserved. | ||
package test | ||
|
||
import ( | ||
"testing" | ||
"github.com/gruntwork-io/terratest/modules/terraform" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func Test(t *testing.T) { | ||
t.Parallel() | ||
|
||
terraformOptions := &terraform.Options{ | ||
// Source path of Terraform directory. | ||
TerraformDir: "../_example", | ||
} | ||
|
||
// This will run 'terraform init' and 'terraform application' and will fail the test if any errors occur | ||
terraform.InitAndApply(t, terraformOptions) | ||
|
||
// To clean up any resources that have been created, run 'terraform destroy' towards the end of the test | ||
defer terraform.Destroy(t, terraformOptions) | ||
|
||
// To get the value of an output variable, run 'terraform output' | ||
Tags := terraform.OutputMap(t, terraformOptions, "tags") | ||
|
||
// Check that we get back the outputs that we expect | ||
assert.Equal(t, "cloudtrail-slack-notification-test", Tags["Name"]) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
# Module : Lambda | ||
# Description : Terraform module to create Lambda resource on AWS for managing queue. | ||
#Module : Cloudtrail Slack Notification | ||
#Description : Terraform cloudtrail slack notification module outputs. | ||
output "cloudtrail-slack-arn" { | ||
value = module.cloudtrail-slack.arn | ||
description = "The Amazon Resource Name (ARN) identifying your cloudtrail logs Lambda Function." | ||
} | ||
} | ||
|
||
output "tags" { | ||
value = module.cloudtrail-slack.tags | ||
description = "A mapping of tags to assign to the resource." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
export PKG_DIR="python" | ||
rm -rf ${PKG_DIR} && mkdir -p ${PKG_DIR} && docker run -rm -v $(pwd):/foo lambci/lambda:build-python3.8 | ||
pip install -r requirements.txt --no-deps -t ${PKG_DIR} | ||
pip install -r requirements.txt --no-deps -t ${PKG_DIR} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ urllib5==5.0.0 | |
certifi==2020.4.5.1 | ||
chardet==3.0.4 | ||
idna==2.9 | ||
requests==2.23.0 | ||
requests==2.23.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.