Skip to content

Commit f514349

Browse files
Improve platform and external-dns for release engineering (cloudposse/terraform-aws-components#588)
Co-authored-by: cloudpossebot <[email protected]>
1 parent a2dae2d commit f514349

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

src/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ components:
6666
| Name | Source | Version |
6767
|------|--------|---------|
6868
| <a name="module_dns_gbl_delegated"></a> [dns\_gbl\_delegated](#module\_dns\_gbl\_delegated) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.1 |
69+
| <a name="module_dns_gbl_primary"></a> [dns\_gbl\_primary](#module\_dns\_gbl\_primary) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.1 |
6970
| <a name="module_eks"></a> [eks](#module\_eks) | cloudposse/stack-config/yaml//modules/remote-state | 1.4.1 |
7071
| <a name="module_external_dns"></a> [external\_dns](#module\_external\_dns) | cloudposse/helm-release/aws | 0.7.0 |
7172
| <a name="module_iam_roles"></a> [iam\_roles](#module\_iam\_roles) | ../../account-map/modules/iam-roles | n/a |
@@ -97,6 +98,7 @@ components:
9798
| <a name="input_delimiter"></a> [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
9899
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br>Map of maps. Keys are names of descriptors. Values are maps of the form<br>`{<br> format = string<br> labels = list(string)<br>}`<br>(Type is `any` so the map values can later be enhanced to provide additional options.)<br>`format` is a Terraform format string to be passed to the `format()` function.<br>`labels` is a list of labels, in order, to pass to `format()` function.<br>Label values will be normalized before being passed to `format()` so they will be<br>identical to how they appear in `id`.<br>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
99100
| <a name="input_dns_gbl_delegated_environment_name"></a> [dns\_gbl\_delegated\_environment\_name](#input\_dns\_gbl\_delegated\_environment\_name) | The name of the environment where global `dns_delegated` is provisioned | `string` | `"gbl"` | no |
101+
| <a name="input_dns_gbl_primary_environment_name"></a> [dns\_gbl\_primary\_environment\_name](#input\_dns\_gbl\_primary\_environment\_name) | The name of the environment where global `dns_primary` is provisioned | `string` | `"gbl"` | no |
100102
| <a name="input_eks_component_name"></a> [eks\_component\_name](#input\_eks\_component\_name) | The name of the eks component | `string` | `"eks/cluster"` | no |
101103
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
102104
| <a name="input_environment"></a> [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |

src/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ locals {
88
txt_owner = var.txt_prefix != "" ? format(module.this.tenant != null ? "%[1]s-%[2]s-%[3]s-%[4]s" : "%[1]s-%[2]s-%[4]s", var.txt_prefix, module.this.environment, module.this.tenant, module.this.stage) : ""
99
txt_prefix = var.txt_prefix != "" ? format("%s-", local.txt_owner) : ""
1010
zone_ids = compact(concat(
11-
values(module.dns_gbl_delegated.outputs.zones)[*].zone_id
11+
values(module.dns_gbl_delegated.outputs.zones)[*].zone_id,
12+
values(module.dns_gbl_primary.outputs.zones)[*].zone_id
1213
))
1314
}
1415

src/remote-state.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,19 @@ module "dns_gbl_delegated" {
2020
zones = {}
2121
}
2222
}
23+
24+
module "dns_gbl_primary" {
25+
source = "cloudposse/stack-config/yaml//modules/remote-state"
26+
version = "1.4.1"
27+
28+
component = "dns-primary"
29+
environment = var.dns_gbl_primary_environment_name
30+
31+
context = module.this.context
32+
33+
ignore_errors = true
34+
35+
defaults = {
36+
zones = {}
37+
}
38+
}

src/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ variable "dns_gbl_delegated_environment_name" {
126126
default = "gbl"
127127
}
128128

129+
variable "dns_gbl_primary_environment_name" {
130+
type = string
131+
description = "The name of the environment where global `dns_primary` is provisioned"
132+
default = "gbl"
133+
}
134+
129135
variable "publish_internal_services" {
130136
type = bool
131137
description = "Allow external-dns to publish DNS records for ClusterIP services"

0 commit comments

Comments
 (0)