diff --git a/README.md b/README.md index e8af771..3d65027 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ Before you begin using this Terraform module, ensure you meet the following prer | lb\_deregistration\_delay | Amount time, in seconds, for GraphDB LB target group to wait before changing the state of a deregistering target from draining to unused. | `string` | `300` | no | | lb\_health\_check\_path | The endpoint to check for GraphDB's health status. | `string` | `"/rest/cluster/node/status"` | no | | lb\_health\_check\_interval | (Optional) Interval in seconds for checking the target group healthcheck. Defaults to 10. | `number` | `10` | no | -| lb\_tls\_certificate\_arn | ARN of the TLS certificate, imported in ACM, which will be used for the TLS listener on the load balancer. | `string` | `null` | no | +| lb\_tls\_certificate\_arn | ARN of the TLS certificate, imported in ACM, which will be used for the TLS listener on the load balancer. | `string` | `""` | no | | lb\_tls\_policy | TLS security policy on the listener. | `string` | `"ELBSecurityPolicy-TLS13-1-2-2021-06"` | no | | allowed\_inbound\_cidrs\_lb | (Optional) List of CIDR blocks to permit inbound traffic from to load balancer | `list(string)` | `null` | no | | allowed\_inbound\_cidrs\_ssh | (Optional) List of CIDR blocks to permit for SSH to GraphDB nodes | `list(string)` | `null` | no | @@ -146,7 +146,7 @@ Before you begin using this Terraform module, ensure you meet the following prer | monitoring\_route53\_health\_check\_aws\_region | Define the region in which you want the monitoring to be deployed. It is used to define where the Route53 Availability Check will be deployed, since if it is not specified it will deploy the check in us-east-1 and if you deploy in different region it will not find the dimensions. | `string` | `"us-east-1"` | no | | monitoring\_route53\_availability\_http\_port | Define the HTTP port for the Route53 availability check | `number` | `80` | no | | monitoring\_route53\_availability\_https\_port | Define the HTTPS port for the Route53 availability check | `number` | `443` | no | -| monitoring\_route53\_healtcheck\_fqdn\_url | Define custom domain name for the Route53 Health check | `string` | `""` | no | +| monitoring\_route53\_healtcheck\_fqdn\_url | Define custom domain name for the Route53 Health check | `string` | n/a | yes | | graphdb\_properties\_path | Path to a local file containing GraphDB properties (graphdb.properties) that would be appended to the default in the VM. | `string` | `null` | no | | graphdb\_java\_options | GraphDB options to pass to GraphDB with GRAPHDB\_JAVA\_OPTS environment variable. | `string` | `null` | no | | deploy\_logging\_module | Enable or disable logging module | `bool` | `false` | no | diff --git a/main.tf b/main.tf index fe9b4bd..0556ca9 100644 --- a/main.tf +++ b/main.tf @@ -221,12 +221,13 @@ module "monitoring" { cmk_key_alias = var.sns_cmk_key_alias parameter_store_kms_key_arn = local.calculated_parameter_store_kms_key_arn cloudwatch_log_group_retention_in_days = var.monitoring_log_group_retention_in_days - route53_availability_request_url = var.monitoring_route53_healtcheck_fqdn_url != "" ? var.monitoring_route53_healtcheck_fqdn_url : module.load_balancer.lb_dns_name + route53_availability_request_url = var.monitoring_route53_healtcheck_fqdn_url route53_availability_measure_latency = var.monitoring_route53_measure_latency sns_kms_key_arn = local.calculated_sns_kms_key_arn graphdb_node_count = var.graphdb_node_count route53_availability_http_string_type = local.calculated_http_string_type - route53_availability_port = var.lb_tls_certificate_arn != "" ? var.monitoring_route53_availability_http_port : var.monitoring_route53_availability_https_port + lb_tls_certificate_arn = var.lb_tls_certificate_arn + lb_dns_name = module.load_balancer.lb_dns_name != "" ? module.load_balancer.lb_dns_name : null } module "graphdb" { diff --git a/modules/monitoring/availability_tests.tf b/modules/monitoring/availability_tests.tf index 220028a..97b6253 100644 --- a/modules/monitoring/availability_tests.tf +++ b/modules/monitoring/availability_tests.tf @@ -21,8 +21,8 @@ resource "aws_sns_topic_subscription" "graphdb_route53_sns_topic_subscription" { resource "aws_route53_health_check" "graphdb_availability_check" { provider = aws.useast1 failure_threshold = var.route53_availability_timeout - fqdn = var.route53_availability_request_url - port = var.route53_availability_port + fqdn = var.route53_availability_request_url != "" ? var.route53_availability_request_url : var.lb_dns_name + port = var.lb_tls_certificate_arn != "" ? var.route53_availability_https_port : var.route53_availability_http_port request_interval = var.route53_availability_frequency regions = var.route53_availability_regions resource_path = var.graphdb_node_count == 1 ? "/protocol" : "/rest/cluster/node/status" diff --git a/modules/monitoring/variables.tf b/modules/monitoring/variables.tf index 9719ed0..a25aaa5 100644 --- a/modules/monitoring/variables.tf +++ b/modules/monitoring/variables.tf @@ -175,3 +175,25 @@ variable "graphdb_node_count" { description = "Number of GraphDB nodes to deploy in ASG" type = number } + +variable "route53_availability_http_port" { + description = "Define the HTTP port for the Route53 availability check" + type = number + default = 80 +} + +variable "route53_availability_https_port" { + description = "Define the HTTPS port for the Route53 availability check" + type = number + default = 443 +} + +variable "lb_tls_certificate_arn" { + description = "ARN of the TLS certificate, imported in ACM, which will be used for the TLS listener on the load balancer." + type = string +} + +variable "lb_dns_name" { + description = "Define the LB DNS name" + type = string +} diff --git a/variables.tf b/variables.tf index d641b53..b113692 100644 --- a/variables.tf +++ b/variables.tf @@ -76,7 +76,7 @@ variable "lb_health_check_interval" { variable "lb_tls_certificate_arn" { description = "ARN of the TLS certificate, imported in ACM, which will be used for the TLS listener on the load balancer." type = string - default = null + default = "" } variable "lb_tls_policy" { @@ -377,7 +377,6 @@ variable "monitoring_route53_availability_https_port" { variable "monitoring_route53_healtcheck_fqdn_url" { description = "Define custom domain name for the Route53 Health check" type = string - default = "" } # GraphDB overrides