Skip to content

Commit

Permalink
Merge pull request #45 from mineiros-io/mariux/tf14
Browse files Browse the repository at this point in the history
feat: Add support for terraform 0.14
  • Loading branch information
mariux authored Mar 8, 2021
2 parents fa86146 + a777517 commit b637825
Show file tree
Hide file tree
Showing 23 changed files with 44 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: CI/CD Pipeline
on: push

env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.MINEIROS_TESTING_AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.MINEIROS_TESTING_AWS_ACCESS_KEY_ID }}

jobs:
pre-commit:
Expand Down
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.0]
### Added
- Add support for Terraform v0.14.x

## [0.3.0]
### Added
- Add support for Terraform v0.13.x
Expand Down Expand Up @@ -76,9 +80,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Implement support for `aws_route53_record` resource.

<!-- markdown-link-check-disable -->
[Unreleased]: https://github.com/mineiros-io/terraform-aws-route53/compare/v0.3.0...HEAD
[0.3.0]: https://github.com/mineiros-io/terraform-aws-route53/compare/v0.2.3...v0.3.0
[Unreleased]: https://github.com/mineiros-io/terraform-aws-route53/compare/v0.4.0...HEAD
[0.4.0]: https://github.com/mineiros-io/terraform-aws-route53/compare/v0.3.0...v0.4.0
<!-- markdown-link-check-enable -->
[0.3.0]: https://github.com/mineiros-io/terraform-aws-route53/compare/v0.2.3...v0.3.0
[0.2.3]: https://github.com/mineiros-io/terraform-aws-route53/compare/v0.2.2...v0.2.3
[0.2.2]: https://github.com/mineiros-io/terraform-aws-route53/compare/v0.2.1...v0.2.2
[0.2.1]: https://github.com/mineiros-io/terraform-aws-route53/compare/v0.2.0...v0.2.1
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Set default shell to bash
SHELL := /bin/bash -o pipefail

BUILD_TOOLS_VERSION ?= v0.6.1
BUILD_TOOLS_VERSION ?= v0.7.0
BUILD_TOOLS_DOCKER_REPO ?= mineiros/build-tools
BUILD_TOOLS_DOCKER_IMAGE ?= ${BUILD_TOOLS_DOCKER_REPO}:${BUILD_TOOLS_VERSION}

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A [Terraform](https://www.terraform.io) module to create a scalable and highly a
[Amazon Route53](https://aws.amazon.com/route53/) Domain Name System (DNS) on
[Amazon Web Services (AWS)](https://aws.amazon.com/).

***This module supports Terraform v0.13 as well as v0.12.20 and above
***This module supports Terraform v0.14, v0.13 as well as v0.12.20 and above
and is compatible with the terraform AWS provider v3 as well as v2.45 and above.***

- [Module Features](#module-features)
Expand Down Expand Up @@ -68,7 +68,7 @@ a record for `www` pointing to localhost.
```hcl
module "repository" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
name = "mineiros.io"
Expand Down Expand Up @@ -308,7 +308,7 @@ Copyright &copy; 2020 [Mineiros GmbH][homepage]
[badge-build]: https://mineiros.semaphoreci.com/badges/terraform-aws-route53/branches/master.svg?style=shields
[badge-semver]: https://img.shields.io/github/v/tag/mineiros-io/terraform-aws-route53.svg?label=latest&sort=semver
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack

[badge-tf-aws]: https://img.shields.io/badge/AWS-3%20and%202.45+-F8991D.svg?logo=terraform
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
[homepage]: https://mineiros.io/?ref=terraform-aws-route53

[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
[badge-semver]: https://img.shields.io/github/v/tag/mineiros-io/terraform-aws-route53.svg?label=latest&sort=semver

Expand Down
4 changes: 2 additions & 2 deletions examples/basic-routing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The `www.` subdomains are implement through CNAMES and point on the A-Records.
```hcl
module "route53" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
name = "a-dev-mineiros.io"
Expand Down Expand Up @@ -87,7 +87,7 @@ Run `terraform destroy` to destroy all resources again.

[homepage]: https://mineiros.io/?ref=terraform-aws-route53
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
[releases-terraform]: https://github.com/hashicorp/terraform/releases
[apache20]: https://opensource.org/licenses/Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-routing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ resource "aws_s3_bucket_object" "error" {

module "route53" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

name = "a-dev-mineiros.io"

Expand Down
6 changes: 3 additions & 3 deletions examples/delegation-set/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ you can create a reusable delegation set and then associate the reusable delegat
```hcl
module "route53-zone-with-delegation-set" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
name = "mineiros.io"
}
module "route53-zone" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
name = "mineiros.com"
delegation_set_id = module.route53-zone-with-delegation-set.delegation_set.id
Expand Down Expand Up @@ -59,7 +59,7 @@ Run `terraform destroy` to destroy all resources again.
[main.tf]: https://github.com/mineiros-io/terraform-aws-route53/blob/master/examples/delegation-set/main.tf
[homepage]: https://mineiros.io/?ref=terraform-aws-route53
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
[releases-terraform]: https://github.com/hashicorp/terraform/releases
[apache20]: https://opensource.org/licenses/Apache-2.0
Expand Down
4 changes: 2 additions & 2 deletions examples/delegation-set/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ provider "aws" {

module "route53-zone-with-delegation-set" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

name = "mineiros.io"
}
Expand All @@ -37,7 +37,7 @@ module "route53-zone-with-delegation-set" {

module "route53-zone" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

name = "mineiros.com"
delegation_set_id = module.route53-zone-with-delegation-set.delegation_set.id
Expand Down
4 changes: 2 additions & 2 deletions examples/failover-routing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "aws_route53_health_check" "primary" {
module "route53" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
name = "mineiros.io"
skip_delegation_set_creation = true
Expand Down Expand Up @@ -87,7 +87,7 @@ Run `terraform destroy` to destroy all resources again.
[main.tf]: https://github.com/mineiros-io/terraform-aws-route53/blob/master/examples/failover-routing/main.tf
[homepage]: https://mineiros.io/?ref=terraform-aws-route53
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
[releases-terraform]: https://github.com/hashicorp/terraform/releases
[apache20]: https://opensource.org/licenses/Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion examples/failover-routing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ resource "aws_route53_health_check" "primary" {

module "route53" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

name = "mineiros.io"
skip_delegation_set_creation = true
Expand Down
8 changes: 4 additions & 4 deletions examples/multiple-domains-different-records/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ All created zones will share the same delegation set.
# Create multiple zones with a single module
module "zones" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
name = [
"mineiros.io",
Expand All @@ -25,7 +25,7 @@ module "zones" {
# Create the records for zone a
module "zone_a_records" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
# Wrap the reference to the zone inside a try statement to prevent ugly exceptions if we run terraform destroy
# without running a successful terraform apply before.
Expand All @@ -45,7 +45,7 @@ module "zone_a_records" {
# Create the records for zone b
module "zone_b_records" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
zone_id = try(module.zones.zone["mineiros.com"].zone_id, null)
Expand Down Expand Up @@ -93,7 +93,7 @@ Run `terraform destroy` to destroy all resources again.
[main.tf]: https://github.com/mineiros-io/terraform-aws-route53/blob/master/examples/multiple-domains-different-records/main.tf
[homepage]: https://mineiros.io/?ref=terraform-aws-route53
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
[releases-terraform]: https://github.com/hashicorp/terraform/releases
[apache20]: https://opensource.org/licenses/Apache-2.0
Expand Down
6 changes: 3 additions & 3 deletions examples/multiple-domains-different-records/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ provider "aws" {
# Create multiple zones with a single module
module "zones" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

name = [
"mineiros.io",
Expand All @@ -27,7 +27,7 @@ module "zones" {
# Create the records for zone a
module "zone_a_records" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

# Wrap the reference to the zone inside a try statement to prevent ugly exceptions if we run terraform destroy
# without running a successful terraform apply before.
Expand All @@ -47,7 +47,7 @@ module "zone_a_records" {
# Create the records for zone b
module "zone_b_records" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

zone_id = try(module.zones.zone["mineiros.com"].zone_id, null)

Expand Down
4 changes: 2 additions & 2 deletions examples/multiple-domains-same-records/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ both. The zones will share the same delegation set.
```hcl
module "zones" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
name = [
"mineiros.io",
Expand Down Expand Up @@ -78,7 +78,7 @@ Run `terraform destroy` to destroy all resources again.
[main.tf]: https://github.com/mineiros-io/terraform-aws-route53/blob/master/examples/multiple-domains-same-records/main.tf
[homepage]: https://mineiros.io/?ref=terraform-aws-route53
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
[releases-terraform]: https://github.com/hashicorp/terraform/releases
[apache20]: https://opensource.org/licenses/Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion examples/multiple-domains-same-records/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ provider "aws" {

module "zones" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

# Create two zones
name = [
Expand Down
4 changes: 2 additions & 2 deletions examples/private-hosted-zone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The code in [main.tf] creates a private Route53 Zone with a single A-Record.
```hcl
module "route53" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
name = "mineiros.io"
Expand Down Expand Up @@ -63,7 +63,7 @@ Run `terraform destroy` to destroy all resources again.
[main.tf]: https://github.com/mineiros-io/terraform-aws-route53/blob/master/examples/private-hosted-zone/main.tf
[homepage]: https://mineiros.io/?ref=terraform-aws-route53
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
[releases-terraform]: https://github.com/hashicorp/terraform/releases
[apache20]: https://opensource.org/licenses/Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion examples/private-hosted-zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "aws_default_vpc" "default" {

module "route53" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

name = "mineiros.io"

Expand Down
4 changes: 2 additions & 2 deletions examples/weighted-routing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The code in [main.tf] creates a Route53 Zone with two attached weighted records.
```hcl
module "route53" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"
name = "mineiros.io"
skip_delegation_set_creation = true
Expand Down Expand Up @@ -76,7 +76,7 @@ Run `terraform destroy` to destroy all resources again.
[main.tf]: https://github.com/mineiros-io/terraform-aws-route53/blob/master/examples/weighted-routing/main.tf
[homepage]: https://mineiros.io/?ref=terraform-aws-route53
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack
[releases-terraform]: https://github.com/hashicorp/terraform/releases
[apache20]: https://opensource.org/licenses/Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion examples/weighted-routing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ provider "aws" {

module "route53" {
source = "mineiros-io/route53/aws"
version = "~> 0.3.0"
version = "~> 0.4.0"

name = "mineiros.io"
skip_delegation_set_creation = true
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ locals {
zones = var.name == null ? [] : try(tolist(var.name), [tostring(var.name)], [])
skip_zone_creation = length(local.zones) == 0
run_in_vpc = length(var.vpc_ids) > 0
skip_delegation_set_creation = ! var.module_enabled || local.skip_zone_creation || local.run_in_vpc ? true : var.skip_delegation_set_creation
skip_delegation_set_creation = !var.module_enabled || local.skip_zone_creation || local.run_in_vpc ? true : var.skip_delegation_set_creation

delegation_set_id = var.delegation_set_id != null ? var.delegation_set_id : try(
aws_route53_delegation_set.delegation_set[0].id, null
Expand Down
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Alternatively, you can also run the tests without Docker.
[Go]: https://golang.org/
[Terraform]: https://www.terraform.io/downloads.html
[badge-license]: https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%200.12.20+-623CE4.svg?logo=terraform
[badge-terraform]: https://img.shields.io/badge/terraform-0.14,%200.13,%200.12.20+-623CE4.svg?logo=terraform
[badge-slack]: https://img.shields.io/badge/[email protected]?logo=slack

[releases-terraform]: https://github.com/hashicorp/terraform/releases
Expand Down
8 changes: 0 additions & 8 deletions test/basic_routing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/gruntwork-io/terratest/modules/random"
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -35,13 +34,6 @@ func TestBasicRouting(t *testing.T) {
// This will run `terraform init` and `terraform apply` and fail the test if there are any errors
terraform.InitAndApply(t, terraformOptions)

// Retrieve the zone_name from the outputs
zoneName := terraform.Output(t, terraformOptions, "zone_name")

// Validate if the name of the created zone matches the name that we defined in zone_name
// the following assertion will fail in aws providers < 3.0
assert.Equal(t, expectedZoneName, zoneName)

// Validate that the length of the list of records
expectedListLen := len(expectedDevTargets)
outputList := terraform.OutputList(t, terraformOptions, "dev_targets")
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ------------------------------------------------------------------------------

terraform {
required_version = ">= 0.12.20, < 0.14"
required_version = ">= 0.12.20, < 0.15"

required_providers {
aws = ">= 2.45, < 4.0"
Expand Down

0 comments on commit b637825

Please sign in to comment.