Skip to content

Commit

Permalink
feat!: Add support for geoproximity routing policy. Upgraded TF versi…
Browse files Browse the repository at this point in the history
…on to 1.3.2 (#105)

Co-authored-by: Anton Babenko <[email protected]>
  • Loading branch information
bhutkovskyysos and antonbabenko authored Jun 8, 2024
1 parent 385af6e commit 461eef2
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.88.0
rev: v1.91.0
hooks:
- id: terraform_fmt
- id: terraform_docs
Expand All @@ -24,7 +24,7 @@ repos:
- '--args=--only=terraform_unused_required_providers'
- id: terraform_validate
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ There are independent submodules:
```hcl
module "zones" {
source = "terraform-aws-modules/route53/aws//modules/zones"
version = "~> 2.0"
version = "~> 3.0"
zones = {
"terraform-aws-modules-example.com" = {
Expand All @@ -40,7 +40,7 @@ module "zones" {
module "records" {
source = "terraform-aws-modules/route53/aws//modules/records"
version = "~> 2.0"
version = "~> 3.0"
zone_name = keys(module.zones.route53_zone_zone_id)[0]
Expand Down
6 changes: 3 additions & 3 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ Note that this example may create resources which cost money. Run `terraform des

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.49 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.37 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.49 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.37 |

## Modules

Expand Down
24 changes: 24 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,30 @@ module "records" {
continent = "EU"
}
},
{
name = "geoproximity-aws-region"
type = "CNAME"
ttl = 5
records = ["us-east-1.test.example.com."]
set_identifier = "us-east-1-region"
geoproximity_routing_policy = {
aws_region = "us-east-1"
bias = 0
}
},
{
name = "geoproximity-coordinates"
type = "CNAME"
ttl = 5
records = ["nyc.test.example.com."]
set_identifier = "nyc"
geoproximity_routing_policy = {
coordinates = {
latitude = "40.71"
longitude = "-74.01"
}
}
},
{
name = "cloudfront"
type = "A"
Expand Down
4 changes: 2 additions & 2 deletions examples/complete/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 1.0"
required_version = ">= 1.3.2"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.49"
version = ">= 5.37"
}
}
}
2 changes: 1 addition & 1 deletion modules/delegation-sets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module "zones" {

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.56 |

## Providers
Expand Down
2 changes: 1 addition & 1 deletion modules/delegation-sets/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1.3.2"

required_providers {
aws = {
Expand Down
6 changes: 3 additions & 3 deletions modules/records/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ records_jsonencoded = jsonencode([

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.49 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.37 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.49 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.37 |

## Modules

Expand Down
19 changes: 19 additions & 0 deletions modules/records/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,23 @@ resource "aws_route53_record" "this" {
subdivision = lookup(each.value.geolocation_routing_policy, "subdivision", null)
}
}

dynamic "geoproximity_routing_policy" {
for_each = length(keys(lookup(each.value, "geoproximity_routing_policy", {}))) == 0 ? [] : [true]

content {
aws_region = lookup(each.value.geoproximity_routing_policy, "aws_region", null)
bias = lookup(each.value.geoproximity_routing_policy, "bias", null)
local_zone_group = lookup(each.value.geoproximity_routing_policy, "local_zone_group", null)

dynamic "coordinates" {
for_each = lookup(each.value.geoproximity_routing_policy, "coordinates", null) == null ? [] : [lookup(each.value.geoproximity_routing_policy, "coordinates", null)]

content {
latitude = coordinates.value.latitude
longitude = coordinates.value.longitude
}
}
}
}
}
4 changes: 2 additions & 2 deletions modules/records/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1.3.2"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 2.49"
version = ">= 5.37"
}
}
}
2 changes: 1 addition & 1 deletion modules/resolver-rule-associations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module "resolver_rule_associations" {

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.56 |

## Providers
Expand Down
2 changes: 1 addition & 1 deletion modules/resolver-rule-associations/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1.3.2"

required_providers {
aws = {
Expand Down
2 changes: 1 addition & 1 deletion modules/zones/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This module creates Route53 zones.

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.49 |

## Providers
Expand Down
2 changes: 1 addition & 1 deletion modules/zones/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 0.13.1"
required_version = ">= 1.3.2"

required_providers {
aws = {
Expand Down

0 comments on commit 461eef2

Please sign in to comment.