Skip to content

Commit

Permalink
Merge pull request #9 from clouddrove/0.15
Browse files Browse the repository at this point in the history
Upgrade module to terraform 0.15
  • Loading branch information
Om Sharma committed Jul 1, 2021
2 parents 33717dd + cb8bcc8 commit 848d88a
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
python-version: '3.x'

- name: 'create readme'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB}}'
Expand All @@ -35,7 +35,7 @@ jobs:
continue-on-error: true

- name: 'push readme'
uses: 'clouddrove/github-actions@v6.0'
uses: 'clouddrove/github-actions@v8.0'
continue-on-error: true
with:
actions_subcommand: 'push'
Expand Down
128 changes: 94 additions & 34 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,78 +5,138 @@ 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/github-actions@v8.0'
with:
actions_subcommand: 'fmt'
- name: 'Terraform Format'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'fmt'

bucket-basic:
name: 'bucket-basic'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2.3.4

- 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@v6.0'
with:
actions_subcommand: 'fmt'

- name: 'Terraform init bucket-basic'
uses: 'clouddrove/github-actions@v6.0'
- name: 'Terraform init for bucket-basic'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/bucket-basic

- name: 'Terraform validate bucket-basic'
uses: 'clouddrove/github-actions@v6.0'
- name: 'Terraform validate for bucket-basic'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example/bucket-basic

- name: 'Terraform plan bucket-basic'
uses: 'clouddrove/github-actions@v6.0'
- name: 'Terraform plan for bucket-basic'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example/bucket-basic

- name: 'Terraform init domain-cdn'
uses: 'clouddrove/github-actions@v6.0'
bucket-secure:
name: 'bucket-secure'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2.3.4

- 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 init for bucket-secure'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/domain-cdn
tf_actions_working_dir: ./_example/bucket-secure

- name: 'Terraform validate domain-cdn'
uses: 'clouddrove/github-actions@v6.0'
- name: 'Terraform validate for bucket-secure'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example/domain-cdn
tf_actions_working_dir: ./_example/bucket-secure

- name: 'Terraform plan domain-cdn'
uses: 'clouddrove/github-actions@v6.0'
- name: 'Terraform plan for bucket-secure'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example/domain-cdn
tf_actions_working_dir: ./_example/bucket-secure

domain-cdn:
name: 'domain-cdn'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2.3.4

- 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 init bucket-secure'
uses: 'clouddrove/github-actions@v6.0'
- name: 'Terraform init for domain-cdn'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example/bucket-secure
tf_actions_working_dir: ./_example/domain-cdn

- name: 'Terraform validate bucket-secure'
uses: 'clouddrove/github-actions@v6.0'
- name: 'Terraform validate for domain-cdn'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'validate'
tf_actions_working_dir: ./_example/bucket-secure
tf_actions_working_dir: ./_example/domain-cdn

- name: 'Terraform plan bucket-secure'
uses: 'clouddrove/github-actions@v6.0'
- name: 'Terraform plan for domain-cdn'
uses: 'clouddrove/github-actions@v8.0'
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example/bucket-secure
tf_actions_working_dir: ./_example/domain-cdn


pre-commit:
name: 'Pre-Commit'
needs:
- fmt
- bucket-basic
- bucket-secure
- domain-cdn
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2.3.4

- name: 'Install Tflint'
run: |
curl https://github.com/raw/terraform-linters/tflint/master/install_linux.sh | bash
- name: 'Pre-Commit 🔎'
uses: pre-commit/action@v2.0.3
continue-on-error: true

- name: 'Slack Notification'
uses: clouddrove/action-slack@v2
Expand All @@ -87,4 +147,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
if: always()
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Terraform AWS Cloudfront CDN
</h1>

<p align="center" style="font-size: 1.2rem;">
<p align="center" style="font-size: 1.2rem;">
Terraform module provisions CloudFront CDN resource on AWS.
</p>

Expand Down Expand Up @@ -35,7 +35,7 @@
<hr>


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 <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
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 <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> 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.

Expand All @@ -46,7 +46,7 @@ We have [*fifty plus terraform modules*][terraform_modules]. A few of them are c

## Prerequisites

This module has a few dependencies:
This module has a few dependencies:

- [Terraform 0.13](https://learn.hashicorp.com/terraform/getting-started/install.html)
- [Go](https://golang.org/doc/install)
Expand Down Expand Up @@ -205,7 +205,7 @@ Here are some examples of how you can use this module in your inventory structur


## Testing
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.

You need to run the following command in the testing folder:
```hcl
Expand All @@ -214,7 +214,7 @@ You need to run the following command in the testing folder:



## Feedback
## Feedback
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-cloudfront-cdn/issues), or feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com).

If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-cloudfront-cdn)!
Expand Down
9 changes: 3 additions & 6 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ usage : |-
```hcl
module "cdn" {
source = "clouddrove/cloudfront-cdn/aws"
version = "0.14.0"
version = "0.15.0"
name = "basic-cdn"
repository = "https://registry.terraform.io/modules/clouddrove/cloudfront/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]
enabled_bucket = true
Expand All @@ -60,9 +59,8 @@ usage : |-
```hcl
module "cdn" {
source = "clouddrove/cloudfront-cdn/aws"
version = "0.14.0"
version = "0.15.0"
name = "secure-cdn"
repository = "https://registry.terraform.io/modules/clouddrove/cloudfront/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]
aliases = ["clouddrove.com"]
Expand All @@ -80,9 +78,8 @@ usage : |-
```hcl
module "cdn" {
source = "clouddrove/cloudfront-cdn/aws"
version = "0.14.0"
version = "0.15.0"
name = "domain-cdn"
repository = "https://registry.terraform.io/modules/clouddrove/cloudfront/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]
custom_domain = true
Expand Down
8 changes: 2 additions & 6 deletions _example/bucket-basic/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ provider "aws" {

module "s3_bucket" {
source = "clouddrove/s3/aws"
version = "0.14.0"
version = "0.15.0"

name = "basic-bucket-cdn"
repository = "https://registry.terraform.io/modules/clouddrove/s3/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]

versioning = true
acl = "private"
bucket_enabled = true
bucket_policy = true
aws_iam_policy_document = data.aws_iam_policy_document.s3_policy.json
}
Expand All @@ -34,9 +32,8 @@ data "aws_iam_policy_document" "s3_policy" {

module "acm" {
source = "clouddrove/acm/aws"
version = "0.14.0"
version = "0.15.0"
name = "certificate"
repository = "https://registry.terraform.io/modules/clouddrove/acm/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]
domain_name = "clouddrove.com"
Expand All @@ -49,7 +46,6 @@ module "cdn" {
source = "./../../"

name = "basic-cdn"
repository = "https://registry.terraform.io/modules/cdn/s3/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]

Expand Down
12 changes: 4 additions & 8 deletions _example/bucket-secure/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,20 @@ provider "aws" {

module "s3_bucket" {
source = "clouddrove/s3/aws"
version = "0.14.0"
version = "0.15.0"
name = "secure-bucket-cdn"
repository = "https://registry.terraform.io/modules/clouddrove/s3/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]

versioning = true
acl = "private"
bucket_enabled = true
versioning = true
acl = "private"
}

module "acm" {
source = "clouddrove/acm/aws"
version = "0.14.0"
version = "0.15.0"

name = "certificate"
repository = "https://registry.terraform.io/modules/acm/s3/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]

Expand All @@ -34,7 +31,6 @@ module "cdn" {
source = "./../../"

name = "secure-cdn"
repository = "https://registry.terraform.io/modules/cdn/s3/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]
enabled_bucket = true
Expand Down
4 changes: 1 addition & 3 deletions _example/domain-cdn/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ provider "aws" {

module "acm" {
source = "clouddrove/acm/aws"
version = "0.14.0"
version = "0.15.0"

name = "certificate"
repository = "https://registry.terraform.io/modules/acm/s3/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]

Expand All @@ -21,7 +20,6 @@ module "cdn" {
source = "./../../"

name = "domain-cdn"
repository = "https://registry.terraform.io/modules/cdn/s3/aws/0.14.0"
environment = "test"
label_order = ["name", "environment"]
custom_domain = true
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# 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?ref=0.14.0"
source = "clouddrove/labels/aws"
version = "0.15.0"

name = var.name
repository = var.repository
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ variable "name" {

variable "repository" {
type = string
default = ""
default = "https://github.com/clouddrove/terraform-aws-cloudfront-cdn"
description = "Terraform current module repo"

validation {
Expand Down
Loading

0 comments on commit 848d88a

Please sign in to comment.