Skip to content

Commit

Permalink
try depends_on
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Sep 20, 2024
1 parent 5a372f6 commit d62c3ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ Change logs are auto-generated with commitizen.
| <a name="input_region"></a> [region](#input\_region) | AWS config region | `string` | `""` | no |
| <a name="input_region_map"></a> [region\_map](#input\_region\_map) | AWS region map | `map(string)` | <pre>{<br> "east": "us-gov-east-1",<br> "west": "us-gov-west-1"<br>}</pre> | no |
| <a name="input_route53_endpoints"></a> [route53\_endpoints](#input\_route53\_endpoints) | Map of target route53 endpoints (for inbound) central VPCs | `map(map(string))` | <pre>{<br> "route53_main": {<br> "account_id": "269244441389",<br> "alias": "lab-gov-network-nonprod",<br> "us-gov-east-1": "vpc-070595c5b133243dd",<br> "us-gov-west-1": "vpc-08b7b4db6a5ddf9c1"<br> }<br>}</pre> | no |
| <a name="input_shared_vpc_label"></a> [shared\_vpc\_label](#input\_shared\_vpc\_label) | Label to use for shared VPC for flowlogs and other things | `string` | `null` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | AWS Tags to apply to appropriate resources | `map(string)` | `{}` | no |
| <a name="input_vpc_domain_name"></a> [vpc\_domain\_name](#input\_vpc\_domain\_name) | The DNS domain name of the vpc the cluster is in. | `string` | n/a | yes |
| <a name="input_vpc_name"></a> [vpc\_name](#input\_vpc\_name) | Define the VPC name that will be used by this cluster | `string` | n/a | yes |
Expand Down
6 changes: 4 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ resource "aws_route53_zone" "cluster_domain" {
# east region
#---
module "route53_cluster_domain_east" {
depends_on = [aws_route53_zone.cluster_domain]

count = local.region == "us-gov-east-1" && !(var.shared_vpc_label == null || var.shared_vpc_label == "") ? 1 : 0
count = local.region == "us-gov-east-1" && local.is_shared_vpc ? 1 : 0
providers = {
aws.self = aws.self
aws.peer = aws.route53_main_east
Expand All @@ -67,8 +68,9 @@ module "route53_cluster_domain_east" {
# west region
#-------------------------------------------------
module "route53_cluster_domain_west" {
depends_on = [aws_route53_zone.cluster_domain]

count = local.region == "us-gov-west-1" && !(var.shared_vpc_label == null || var.shared_vpc_label == "") ? 1 : 0
count = local.region == "us-gov-west-1" && local.is_shared_vpc ? 1 : 0
providers = {
aws.self = aws.self
aws.peer = aws.route53_main_west
Expand Down
6 changes: 0 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ variable "os_username" {
# DNS variables
###################################################################

variable "shared_vpc_label" {
description = "Label to use for shared VPC for flowlogs and other things"
type = string
default = null
}

variable "region_map" {
description = "AWS region map"
type = map(string)
Expand Down

0 comments on commit d62c3ae

Please sign in to comment.