-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #309 from wireapp/release_2020-07-07
Release_2020_07_07
- Loading branch information
Showing
13 changed files
with
163 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Terraform module: DNS records | ||
============================= | ||
|
||
State: __experimental__ | ||
|
||
This module creates a set of DNS entries on AWS. As of now it's capable of managing the following type of records: | ||
|
||
* A (`ips`) | ||
* CNAME (`cnames`) | ||
|
||
AWS resources: route53 | ||
|
||
|
||
#### How to use the module | ||
|
||
```hcl | ||
module "dns_records" { | ||
source = "github.com/wireapp/wire-server-deploy.git//terraform/modules/aws-dns-records?ref=develop" | ||
environment = "staging" | ||
zone_fqdn = "example.com" | ||
ips = [ "9.9.9.10", "23.42.23.42" ] | ||
} | ||
``` | ||
|
||
If not further specified, it creates entries for the following FQDNs: | ||
|
||
* `nginz-https.staging.example.com` | ||
* `nginz-ssl.staging.example.com` | ||
* `webapp.staging.example.com` | ||
* `assets.staging.example.com` | ||
* `account.staging.example.com` | ||
* `teams.staging.example.com` | ||
|
||
These sub-domains represent the primary set of FQDNs used in a | ||
[`wire-server` installation](https://docs.wire.com/how-to/install/helm-prod.html#how-to-set-up-dns-records), | ||
to expose all frontend applications as well as necessary HTTP & websocket endpoints. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
data "aws_route53_zone" "rz" { | ||
name = "${var.zone_fqdn}." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
locals { | ||
name_suffix = concat( | ||
var.inject_addition_subtree ? [(var.domain != null ? var.domain : var.environment)] : [], | ||
[var.zone_fqdn] | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
terraform { | ||
required_version = "~> 0.12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "aws_route53_record" "a" { | ||
for_each = toset(length(var.ips) > 0 ? var.subdomains : []) | ||
|
||
zone_id = data.aws_route53_zone.rz.zone_id | ||
name = join(".", concat([each.value], local.name_suffix)) | ||
type = "A" | ||
ttl = var.ttl | ||
records = var.ips | ||
} | ||
|
||
|
||
resource "aws_route53_record" "cname" { | ||
for_each = toset(length(var.cnames) > 0 ? var.subdomains : []) | ||
|
||
zone_id = data.aws_route53_zone.rz.zone_id | ||
name = join(".", concat([each.value], local.name_suffix)) | ||
type = "CNAME" | ||
ttl = var.ttl | ||
records = var.cnames | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
variable "environment" { | ||
type = string | ||
description = "name of the environment as a scope for the created resources (default: 'dev'; example: 'prod', 'staging')" | ||
default = "dev" | ||
} | ||
|
||
variable "zone_fqdn" { | ||
type = string | ||
description = "FQDN of the DNS zone root (required; example: example.com; will append: '.')" | ||
} | ||
|
||
variable "domain" { | ||
type = string | ||
description = "name of the sub-tree all given subdomains are append to (defaults to $environment; example: $subdomains[0].$domain.$zone_fqdn)" | ||
default = null | ||
} | ||
|
||
variable "subdomains" { | ||
type = list(string) | ||
description = "list of sub-domains that will be registered under the given root domain" | ||
default = [ | ||
"nginz-https", | ||
"nginz-ssl", | ||
"webapp", | ||
"assets", | ||
"account", | ||
"teams" | ||
] | ||
} | ||
|
||
variable "inject_addition_subtree" { | ||
type = bool | ||
description = "flag to indicate whether an additional level of depth based on environment name is injected into the DNS tree (e.g. webapp.dev.example.com vs. webapp.example.com" | ||
default = true | ||
} | ||
|
||
variable "ips" { | ||
type = list(string) | ||
description = "a list of IPs used to create A records for the given list of subdomains" | ||
default = [] | ||
} | ||
|
||
variable "cnames" { | ||
type = list(string) | ||
description = "a list of FQDNs used to create CNAME records for the given list of subdomains" | ||
default = [] | ||
} | ||
|
||
variable "ttl" { | ||
type = number | ||
description = "time to live for the DNS entries (defaults to 1 minute)" | ||
default = 60 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters