diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml
new file mode 100644
index 0000000..3646f9f
--- /dev/null
+++ b/.github/workflows/readme.yml
@@ -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()
\ No newline at end of file
diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml
index 556d0eb..160e806 100644
--- a/.github/workflows/terraform.yml
+++ b/.github/workflows/terraform.yml
@@ -1,57 +1,54 @@
name: 'Terraform GitHub Actions'
on:
- - pull_request
+ 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@v2.0
+ uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'fmt'
- - name: 'Terraform Init'
- uses: clouddrove/github-actions@v2.0
+ - name: 'Terraform init'
+ uses: 'clouddrove/github-actions@v4.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example
- - name: Configure AWS Credentials
- uses: clouddrove/configure-aws-credentials@v1
+ - name: 'Terraform validate'
+ uses: 'clouddrove/github-actions@v4.0'
with:
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- aws-region: us-east-2
+ actions_subcommand: 'validate'
+ tf_actions_working_dir: ./_example
- - name: 'Terraform Plan'
- uses: clouddrove/github-actions@v2.0
+ - name: 'Terraform plan'
+ uses: 'clouddrove/github-actions@v4.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'
+ author_name: 'CloudDrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
- if: always()
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
+ if: always()
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 797a1bb..a279a61 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
.terraform
.idea
*.iml
+go.sum
\ No newline at end of file
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 1269ee7..9a789cb 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -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
\ No newline at end of file
+ - id: check-added-large-files
+ - id: trailing-whitespace
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 136d77d..807110a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -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
diff --git a/README.md b/README.md
deleted file mode 100644
index 2c08610..0000000
--- a/README.md
+++ /dev/null
@@ -1,157 +0,0 @@
-
-
-
-
-
-
- Terraform AWS Cloudtrail
-
-
-
- Terraform module to provision an AWS CloudTrail with encrypted S3 bucket. This bucket is used to store CloudTrail logs.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy Bigger problems are always solved by breaking them into smaller manageable problems. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller connected yet manageable pieces within the infrastructure.
-
-This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.
-
-We have [*fifty plus terraform modules*][terraform_modules]. A few of them are comepleted and are available for open source usage while a few others are in progress.
-
-
-
-
-## Prerequisites
-
-This module has a few dependencies:
-
-- [Terraform 0.12](https://learn.hashicorp.com/terraform/getting-started/install.html)
-- [Go](https://golang.org/doc/install)
-- [github.com/stretchr/testify/assert](https://github.com/stretchr/testify)
-- [github.com/gruntwork-io/terratest/modules/terraform](https://github.com/gruntwork-io/terratest)
-
-
-
-
-
-
-
-## Examples
-
-
-**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/terraform-aws-cloudtrail/releases).
-
-
-### Simple Example
-Here is an example of how you can use this module in your inventory structure:
-```hcl
- module "cloudtrail" {
- source = "git::https://github.com/clouddrove/terraform-aws-cloudtrail.git?ref=tags/0.12.3"
- name = "cloudtrail"
- application = "clouddrove"
- environment = "security"
- label_order = ["environment", "name", "application"]
- s3_bucket_name = "s3-logs"
- enable_logging = true
- enable_log_file_validation = true
- include_global_service_events = true
- is_multi_region_trail = false
- kms_key_id = "arn:aws:kms:eu-west-1:xxxxxxxxx:key/xxxxxx-xxxx-xxxx-xxxxx"
- }
-```
-
-
-
-
-
-
-## Inputs
-
-| Name | Description | Type | Default | Required |
-|------|-------------|:----:|:-----:|:-----:|
-| application | Application \(e.g. `cd` or `clouddrove`\). | string | `""` | no |
-| attributes | Additional attributes \(e.g. `1`\). | list(string) | `` | no |
-| cloud\_watch\_logs\_group\_arn | Specifies a log group name using an Amazon Resource Name \(ARN\), that represents the log group to which CloudTrail logs will be delivered. | string | `""` | no |
-| cloud\_watch\_logs\_role\_arn | Specifies the role for the CloudWatch Logs endpoint to assume to write to a user’s log group. | string | `""` | no |
-| enable\_log\_file\_validation | Specifies whether log file integrity validation is enabled. Creates signed digest for validated contents of logs. | bool | `"true"` | no |
-| enable\_logging | Enable logging for the trail. | bool | `"true"` | no |
-| enabled\_cloudtrail | If true, deploy the resources for the module. | bool | `"true"` | no |
-| environment | Environment \(e.g. `prod`, `dev`, `staging`\). | string | `""` | no |
-| event\_selector | Specifies an event selector for enabling data event logging, It needs to be a list of map values. See: https://www.terraform.io/docs/providers/aws/r/cloudtrail.html for details on this map variable. | list(string) | `` | no |
-| include\_global\_service\_events | Specifies whether the trail is publishing events from global services such as IAM to the log files. | bool | `"false"` | no |
-| is\_multi\_region\_trail | Specifies whether the trail is created in the current region or in all regions. | bool | `"false"` | no |
-| is\_organization\_trail | The trail is an AWS Organizations trail. | bool | `"false"` | no |
-| kms\_key\_id | Specifies the KMS key ARN to use to encrypt the logs delivered by CloudTrail. | string | `""` | no |
-| label\_order | Label order, e.g. `name`,`application`. | list | `` | no |
-| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | string | `"anmol@clouddrove.com"` | no |
-| name | Name \(e.g. `app` or `cluster`\). | string | n/a | yes |
-| s3\_bucket\_name | S3 bucket name for CloudTrail log. | string | n/a | yes |
-| tags | Additional tags \(e.g. map\(`BusinessUnit`,`XYZ`\). | map(string) | `