Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for terraform v0.13 and github provider v3 #40

Merged
merged 5 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ vendor

# Terratest directory used to store temporary data
.test-data
.terraform
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.0]
### Changed
- Add support for terraform v0.13.
- Add support for terraform aws provider v3.

## [0.2.3] - 2020-07-22
### Added
- Add README.md to examples/
### Fixed
- Correct typos in README.mds
- Correct typos in README.mds

## [0.2.2] - 2020-06-13
### Changed
Expand Down
1 change: 0 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* @soerenmartius @mariux
*.md @thenaturalist @soerenmartius @mariux
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.5.4
BUILD_TOOLS_VERSION ?= v0.6.1
BUILD_TOOLS_DOCKER_REPO ?= mineiros/build-tools
BUILD_TOOLS_DOCKER_IMAGE ?= ${BUILD_TOOLS_DOCKER_REPO}:${BUILD_TOOLS_VERSION}

Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

[![Build Status][badge-build]][build-status]
[![GitHub tag (latest SemVer)][badge-semver]][releases-github]
[![license][badge-license]][apache20]
[![Terraform Version][badge-terraform]][releases-terraform]
[![AWS Provider Version][badge-tf-aws]][releases-aws-provider]
[![Join Slack][badge-slack]][slack]

# terraform-aws-route53

A [Terraform](https://www.terraform.io) 0.12 module to create a scalable and highly available
A [Terraform](https://www.terraform.io) module to create a scalable and highly available
[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
and is compatible with the terraform AWS provider v3 as well as v2.45 and above.***

- [Module Features](#module-features)
- [Getting Started](#getting-started)
- [Examples](#examples)
Expand Down Expand Up @@ -65,7 +68,7 @@ a record for `www` pointing to localhost.
```hcl
module "repository" {
source = "mineiros-io/route53/aws"
version = "0.2.0"
version = "~> 0.3.0"

name = "mineiros.io"

Expand Down Expand Up @@ -290,6 +293,8 @@ Run `make help` to see details on each available target.

## License

[![license][badge-license]][apache20]

This module is licensed under the Apache License Version 2.0, January 2004.
Please see [LICENSE] for full details.

Expand All @@ -306,6 +311,9 @@ Copyright © 2020 [Mineiros GmbH][homepage]
[badge-terraform]: https://img.shields.io/badge/terraform-0.13%20and%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
[releases-aws-provider]: https://github.com/terraform-providers/terraform-provider-aws/releases

[build-status]: https://mineiros.semaphoreci.com/projects/terraform-aws-route53
[releases-github]: https://github.com/mineiros-io/terraform-aws-route53/releases
[releases-terraform]: https://github.com/hashicorp/terraform/releases
Expand Down
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
[examples/failover-routing]: https://github.com/mineiros-io/terraform-aws-route53/tree/master/examples/failover-routing
[examples/multiple-domains-different-records]: https://github.com/mineiros-io/terraform-aws-route53/tree/master/examples/multiple-domains-different-records
[examples/multiple-domains-same-records]: https://github.com/mineiros-io/terraform-aws-route53/tree/master/examples/multiple-domains-same-records
[examples/private-hosted-zone]: https://github.com/mineiros-io/terraform-aws-route53/tree/master/examples/private-hosted-zone
[examples/weighted-routing]: https://github.com/mineiros-io/terraform-aws-route53/tree/master/examples/weighted-routing

[homepage]: https://mineiros.io/?ref=terraform-aws-route53
Expand Down
2 changes: 1 addition & 1 deletion 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.2.2"
version = "~> 0.3.0"

name = "a-dev-mineiros.io"

Expand Down
5 changes: 2 additions & 3 deletions examples/basic-routing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
# ------------------------------------------------------------------------------

provider "aws" {
region = "us-east-1"
version = "~> 2.45"
region = "us-east-1"
}

# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -74,7 +73,7 @@ resource "aws_s3_bucket_object" "error" {

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

name = "a-dev-mineiros.io"

Expand Down
4 changes: 2 additions & 2 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.2.2"
version = "~> 0.3.0"

name = "mineiros.io"
}

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

name = "mineiros.com"
delegation_set_id = module.route53-zone-with-delegation-set.delegation_set.id
Expand Down
7 changes: 3 additions & 4 deletions examples/delegation-set/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = "us-east-1"
version = "~> 2.45"
region = "us-east-1"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand All @@ -26,7 +25,7 @@ provider "aws" {

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

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

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

name = "mineiros.com"
delegation_set_id = module.route53-zone-with-delegation-set.delegation_set.id
Expand Down
2 changes: 1 addition & 1 deletion 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.2.2"
version = "~> 0.3.0"

name = "mineiros.io"
skip_delegation_set_creation = true
Expand Down
5 changes: 2 additions & 3 deletions examples/failover-routing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = "us-east-1"
version = "~> 2.45"
region = "us-east-1"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand All @@ -38,7 +37,7 @@ resource "aws_route53_health_check" "primary" {

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

name = "mineiros.io"
skip_delegation_set_creation = true
Expand Down
6 changes: 3 additions & 3 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.2.2"
version = "~> 0.3.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.2.2"
version = "~> 0.3.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.2.2"
version = "~> 0.3.0"

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

Expand Down
9 changes: 4 additions & 5 deletions examples/multiple-domains-different-records/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = "us-east-1"
version = "~> 2.45"
region = "us-east-1"
}

# Create multiple zones with a single module
module "zones" {
source = "mineiros-io/route53/aws"
version = "0.2.2"
version = "~> 0.3.0"

name = [
"mineiros.io",
Expand All @@ -28,7 +27,7 @@ module "zones" {
# Create the records for zone a
module "zone_a_records" {
source = "mineiros-io/route53/aws"
version = "0.2.2"
version = "~> 0.3.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 @@ -48,7 +47,7 @@ module "zone_a_records" {
# Create the records for zone b
module "zone_b_records" {
source = "mineiros-io/route53/aws"
version = "0.2.2"
version = "~> 0.3.0"

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

Expand Down
2 changes: 1 addition & 1 deletion 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.2.2"
version = "~> 0.3.0"

name = [
"mineiros.io",
Expand Down
5 changes: 2 additions & 3 deletions examples/multiple-domains-same-records/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = "us-east-1"
version = "~> 2.45"
region = "us-east-1"
}

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

# Create two zones
name = [
Expand Down
2 changes: 1 addition & 1 deletion 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.2.2"
version = "~> 0.3.0"

name = "mineiros.io"

Expand Down
5 changes: 2 additions & 3 deletions examples/private-hosted-zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = "us-east-1"
version = "~> 2.45"
region = "us-east-1"
}

# Default VPC. Terraform does not create this resource, but instead "adopts" it into management.
Expand All @@ -31,7 +30,7 @@ resource "aws_default_vpc" "default" {

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

name = "mineiros.io"

Expand Down
2 changes: 1 addition & 1 deletion 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.2.2"
version = "~> 0.3.0"

name = "mineiros.io"
skip_delegation_set_creation = true
Expand Down
5 changes: 2 additions & 3 deletions examples/weighted-routing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = "us-east-1"
version = "~> 2.45"
region = "us-east-1"
}

# ---------------------------------------------------------------------------------------------------------------------
Expand All @@ -26,7 +25,7 @@ provider "aws" {

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

name = "mineiros.io"
skip_delegation_set_creation = true
Expand Down
3 changes: 1 addition & 2 deletions test/basic_routing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = var.aws_region
version = "~> 2.45"
region = var.aws_region
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion test/basic_routing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ func TestBasicRouting(t *testing.T) {
zoneName := terraform.Output(t, terraformOptions, "zone_name")

// Validate if the name of the created zone matches the name that we defined in zone_name
assert.Equal(t, expectedZoneName+".", zoneName)
// 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)
Expand Down
3 changes: 1 addition & 2 deletions test/delegation-set/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = var.aws_region
version = "~> 2.45"
region = var.aws_region
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions test/failover-routing/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = var.aws_region
version = "~> 2.45"
region = var.aws_region
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions test/multiple-domains-different-records/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = var.aws_region
version = "~> 2.45"
region = var.aws_region
}

# Create multiple zones with a single module
Expand Down
3 changes: 1 addition & 2 deletions test/multiple-domains-same-records/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
# ---------------------------------------------------------------------------------------------------------------------

provider "aws" {
region = var.aws_region
version = "~> 2.45"
region = var.aws_region
}

module "zones" {
Expand Down
Loading