Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #69 from gruntwork-io/tf13
Browse files Browse the repository at this point in the history
Update repo to work with TF 0.13
  • Loading branch information
brikis98 authored Oct 15, 2020
2 parents dcc8340 + f644bd6 commit 4427d4f
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 35 deletions.
17 changes: 4 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ defaults: &defaults
image: circleci/classic:201711-01
environment:
GRUNTWORK_INSTALLER_VERSION: v0.0.29
TERRATEST_LOG_PARSER_VERSION: v0.29.0
MODULE_CI_VERSION: v0.28.1
TERRAFORM_VERSION: 0.12.29
TERRATEST_LOG_PARSER_VERSION: v0.30.10
MODULE_CI_VERSION: v0.29.0
TERRAFORM_VERSION: 0.13.4
TERRAGRUNT_VERSION: NONE
PACKER_VERSION: 1.4.1
PACKER_VERSION: 1.6.4
GOLANG_VERSION: 1.14

version: 2
Expand All @@ -23,19 +23,10 @@ jobs:
- run: echo 'export PATH=$HOME/.local/bin:$HOME/terraform:$HOME/packer:$PATH' >> $BASH_ENV

# Install Gruntwork and HashiCorp dependencies
- restore_cache:
keys:
- v2-external-dep
# Use the Gruntwork Installer to install the gruntwork-module-circleci-helpers
- run: curl -Ls https://raw.githubusercontent.com/gruntwork-io/gruntwork-installer/master/bootstrap-gruntwork-installer.sh | bash /dev/stdin --version "${GRUNTWORK_INSTALLER_VERSION}"
- run: gruntwork-install --module-name "gruntwork-module-circleci-helpers" --repo "https://github.com/gruntwork-io/module-ci" --tag "${MODULE_CI_VERSION}"
- run: gruntwork-install --binary-name "terratest_log_parser" --repo "https://github.com/gruntwork-io/terratest" --tag "${TERRATEST_LOG_PARSER_VERSION}"
- run: configure-environment-for-gruntwork-module --terraform-version ${TERRAFORM_VERSION} --terragrunt-version ${TERRAGRUNT_VERSION} --packer-version ${PACKER_VERSION} --go-version ${GOLANG_VERSION}
- save_cache:
key: v2-external-dep
paths:
- $HOME/terraform
- $HOME/packer

# Install external dependencies
- run: DEBIAN_FRONTEND=noninteractive sudo apt-get update && sudo apt-get install -y python-pip
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
repos:
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.0.2
rev: v0.1.10
hooks:
- id: terraform-fmt
- id: gofmt
5 changes: 4 additions & 1 deletion examples/couchbase-cluster-mds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
# ----------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion examples/couchbase-cluster-simple-dns-tls/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
# ----------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion examples/couchbase-multi-datacenter-replication/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
# ----------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
}

provider "aws" {
Expand Down
5 changes: 4 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
# ----------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion modules/couchbase-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
# ----------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion modules/couchbase-iam-policies/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
# ----------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion modules/couchbase-server-security-group-rules/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
# ----------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion modules/load-balancer-target-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
# ----------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion modules/load-balancer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
# ----------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion modules/sync-gateway-security-group-rules/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
# ----------------------------------------------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12"
# This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting
# 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it
# forwards compatible with 0.13.x code.
required_version = ">= 0.12.26"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
21 changes: 10 additions & 11 deletions test/terratest_helpers.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package test

import (
"testing"
"fmt"
"time"
"github.com/gruntwork-io/terratest/modules/aws"
"github.com/gruntwork-io/terratest/modules/logger"
"github.com/gruntwork-io/terratest/modules/packer"
"io/ioutil"
"net/http"
"net/url"
"io/ioutil"
"strings"
"github.com/gruntwork-io/terratest/modules/logger"
"github.com/gruntwork-io/terratest/modules/packer"
"github.com/gruntwork-io/terratest/modules/aws"
"testing"
"time"
)

// The username and password we use in all the examples, mocks, and tests
Expand Down Expand Up @@ -49,18 +49,17 @@ func buildCouchbaseWithPackerE(t *testing.T, builderName string, baseAmiName str

options := &packer.Options{
Template: templatePath,
Only: builderName,
Only: builderName,
Vars: map[string]string{
"aws_region": awsRegion,
"aws_region": awsRegion,
"base_ami_name": baseAmiName,
"edition": edition,
"edition": edition,
},
}

return packer.BuildAmiE(t, options)
}


func HttpPostForm(t *testing.T, postUrl string, postParams url.Values) (int, string, error) {
logger.Logf(t, "Making an HTTP POST call to URL %s with body %v", postUrl, postParams)

Expand All @@ -82,4 +81,4 @@ func HttpPostForm(t *testing.T, postUrl string, postParams url.Values) (int, str
}

return resp.StatusCode, strings.TrimSpace(string(respBody)), nil
}
}

0 comments on commit 4427d4f

Please sign in to comment.