Skip to content

Commit

Permalink
upgrade 0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyanio committed Oct 2, 2020
1 parent cfebd60 commit 370e587
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 35 deletions.
75 changes: 56 additions & 19 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Terraform GitHub Actions'
on:
- pull_request
- push

jobs:
terraform:
Expand All @@ -11,37 +11,74 @@ jobs:
- name: 'Checkout'
uses: actions/checkout@master

- name: 'Terraform Format'
uses: clouddrove/github-actions@v2.0
- name: 'Terraform Format fmt'
uses: hashicorp/terraform-github-actions@master
with:
actions_subcommand: 'fmt'
tf_actions_version: 0.13.3
tf_actions_subcommand: 'fmt'
tf_actions_working_dir: "./_example/basic_example"
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Terraform Init'
uses: clouddrove/github-actions@v2.0
- name: 'Terraform Format fmt'
uses: hashicorp/terraform-github-actions@master
with:
actions_subcommand: 'init'
tf_actions_working_dir: ./_example
tf_actions_version: 0.13.3
tf_actions_subcommand: 'fmt'
tf_actions_working_dir: "./_example/secure_example"
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- 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-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]
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Get dependencies
run: |
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
else
go get -v -t -d ./...
fi
- name: Test Basic Example
working-directory: ./_test/basic_example
run: go test

- name: Test Secure Example
working-directory: ./_test/secure_example
run: go test

- name: 'Terraform Init Baic Example'
uses: hashicorp/terraform-github-actions@master
with:
actions_subcommand: 'plan'
tf_actions_working_dir: ./_example
tf_actions_version: 0.13.3
tf_actions_subcommand: 'init'
tf_actions_working_dir: "./_example/basic_example"
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Terratest'
uses: clouddrove/github-actions@v2.0
- name: 'Terraform Init Secure Example'
uses: hashicorp/terraform-github-actions@master
with:
actions_subcommand: 'terratest'
tf_actions_working_dir: ./_test
tf_actions_version: 0.13.3
tf_actions_subcommand: 'init'
tf_actions_working_dir: "./_example/secure_example"
tf_actions_comment: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -53,5 +90,5 @@ jobs:
author_name: 'Clouddrove'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }} # required
if: always()
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
6 changes: 3 additions & 3 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ github_repo: clouddrove/terraform-aws-ec2
# 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,7 @@ usage : |-
### Basic Example
```hcl
module "ec2" {
source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=tags/0.12.7"
source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=tags/0.13.0"
name = "ec2-instance"
application = "clouddrove"
environment = "test"
Expand Down Expand Up @@ -66,7 +66,7 @@ usage : |-
### Secure Example
```hcl
module "ec2" {
source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=tags/0.12.7"
source = "git::https://github.com/clouddrove/terraform-aws-ec2.git?ref=tags/0.13.0"
name = "ec2-instance"
application = "clouddrove"
environment = "test"
Expand Down
9 changes: 5 additions & 4 deletions _example/basic_example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ provider "aws" {
}

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

name = "vpc"
application = "clouddrove"
Expand All @@ -14,7 +14,7 @@ module "vpc" {
}

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

name = "public-subnet"
application = "clouddrove"
Expand All @@ -26,10 +26,11 @@ module "public_subnets" {
cidr_block = module.vpc.vpc_cidr_block
type = "public"
igw_id = module.vpc.igw_id
ipv6_cidr_block = module.vpc.ipv6_cidr_block
}

module "http-https" {
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.3"
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.5"

name = "http-https"
application = "clouddrove"
Expand All @@ -42,7 +43,7 @@ module "http-https" {
}

module "ssh" {
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.3"
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.5"

name = "ssh"
application = "clouddrove"
Expand Down
9 changes: 5 additions & 4 deletions _example/secure_example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ provider "aws" {
}

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

name = "vpc"
application = "clouddrove"
Expand All @@ -14,7 +14,7 @@ module "vpc" {
}

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

name = "public-subnet"
application = "clouddrove"
Expand All @@ -26,10 +26,11 @@ module "public_subnets" {
cidr_block = module.vpc.vpc_cidr_block
type = "public"
igw_id = module.vpc.igw_id
ipv6_cidr_block = module.vpc.ipv6_cidr_block
}

module "http-https" {
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.3"
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.5"

name = "http-https"
application = "clouddrove"
Expand All @@ -42,7 +43,7 @@ module "http-https" {
}

module "ssh" {
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.3"
source = "git::https://github.com/clouddrove/terraform-aws-security-group.git?ref=tags/0.12.5"

name = "ssh"
application = "clouddrove"
Expand Down
2 changes: 1 addition & 1 deletion _test/basic_example/ec2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func Test(t *testing.T) {

terraformOptions := &terraform.Options{
// Source path of Terraform directory.
TerraformDir: "../_example",
TerraformDir: "../../_example/basic_example",
Upgrade: true,
}

Expand Down
8 changes: 8 additions & 0 deletions _test/basic_example/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/clouddrove/terraform-aws-ec2/baisc_example

go 1.13

require (
github.com/gruntwork-io/terratest v0.30.6
github.com/stretchr/testify v1.6.1
)
2 changes: 1 addition & 1 deletion _test/secure_example/ec2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func Test(t *testing.T) {

terraformOptions := &terraform.Options{
// Source path of Terraform directory.
TerraformDir: "../_example",
TerraformDir: "../../_example/secure_example",
Upgrade: true,
}

Expand Down
8 changes: 8 additions & 0 deletions _test/secure_example/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/clouddrove/terraform-aws-ec2/secure_example

go 1.13

require (
github.com/gruntwork-io/terratest v0.30.6
github.com/stretchr/testify v1.6.1
)
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
# 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=tags/0.12.0"
source = "git::https://github.com/clouddrove/terraform-labels.git?ref=tags/0.13.0"

name = var.name
application = var.application
environment = var.environment
label_order = var.label_order
managedby = var.managedby
enabled = var.instance_enabled
}

locals {
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 370e587

Please sign in to comment.