Skip to content

Commit

Permalink
Adds dns_subdomain variable to override subdomain (#58)
Browse files Browse the repository at this point in the history
* Adds dns_subdomain variable to override subdomain

* Adds dns_subdomain var to README

* Updated README.md

Co-authored-by: Maxim Mironenko <simixido@gmail.com>
Co-authored-by: actions-bot <58130806+actions-bot@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 14, 2020
1 parent 99d2a91 commit f86673c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Available targets:
| cluster_mode_replicas_per_node_group | Number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will force a new resource | number | `0` | no |
| cluster_size | Number of nodes in cluster. *Ignored when `cluster_mode_enabled` == `true`* | number | `1` | no |
| delimiter | Delimiter between `name`, `namespace`, `stage` and `attributes` | string | `-` | no |
| dns_subdomain | The subdomain to use for the CNAME record. If not provided then the CNAME record will use var.name. | string | `` | no |
| elasticache_subnet_group_name | Subnet group name for the ElastiCache instance | string | `` | no |
| enabled | Set to false to prevent the module from creating any resources | bool | `true` | no |
| engine_version | Redis engine version | string | `4.0.10` | no |
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
| cluster_mode_replicas_per_node_group | Number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will force a new resource | number | `0` | no |
| cluster_size | Number of nodes in cluster. *Ignored when `cluster_mode_enabled` == `true`* | number | `1` | no |
| delimiter | Delimiter between `name`, `namespace`, `stage` and `attributes` | string | `-` | no |
| dns_subdomain | The subdomain to use for the CNAME record. If not provided then the CNAME record will use var.name. | string | `` | no |
| elasticache_subnet_group_name | Subnet group name for the ElastiCache instance | string | `` | no |
| enabled | Set to false to prevent the module from creating any resources | bool | `true` | no |
| engine_version | Redis engine version | string | `4.0.10` | no |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ resource "aws_cloudwatch_metric_alarm" "cache_memory" {
module "dns" {
source = "git::https://github.com/cloudposse/terraform-aws-route53-cluster-hostname.git?ref=tags/0.3.0"
enabled = var.enabled && var.zone_id != "" ? true : false
name = var.name
name = var.dns_subdomain != "" ? var.dns_subdomain : var.name
ttl = 60
zone_id = var.zone_id
records = var.cluster_mode_enabled ? [join("", aws_elasticache_replication_group.default.*.configuration_endpoint_address)] : [join("", aws_elasticache_replication_group.default.*.primary_endpoint_address)]
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ variable "zone_id" {
description = "Route53 DNS Zone ID"
}

variable "dns_subdomain" {
type = string
default = ""
description = "The subdomain to use for the CNAME record. If not provided then the CNAME record will use var.name."
}

variable "delimiter" {
type = string
default = "-"
Expand Down

0 comments on commit f86673c

Please sign in to comment.