diff --git a/README.md b/README.md index 226c8db..ed02f51 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,7 @@ Available targets: | egress\_allowed | Allow all egress traffic from instance | `bool` | `false` | no | | enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no | | environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | +| host\_name | The Bastion hostname created in Route53 | `string` | `"bastion"` | no | | id\_length\_limit | Limit `id` to this many characters.
Set to `0` for unlimited length.
Set to `null` for default, which is `0`.
Does not affect `id_full`. | `number` | `null` | no | | ingress\_security\_groups | AWS security group IDs allowed ingress to instance | `list(string)` | `[]` | no | | instance\_type | Bastion instance type | `string` | `"t2.micro"` | no | diff --git a/docs/terraform.md b/docs/terraform.md index ef56ea8..48dcd9f 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -29,6 +29,7 @@ | egress\_allowed | Allow all egress traffic from instance | `bool` | `false` | no | | enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no | | environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | +| host\_name | The Bastion hostname created in Route53 | `string` | `"bastion"` | no | | id\_length\_limit | Limit `id` to this many characters.
Set to `0` for unlimited length.
Set to `null` for default, which is `0`.
Does not affect `id_full`. | `number` | `null` | no | | ingress\_security\_groups | AWS security group IDs allowed ingress to instance | `list(string)` | `[]` | no | | instance\_type | Bastion instance type | `string` | `"t2.micro"` | no | diff --git a/main.tf b/main.tf index 066a88a..a1b60c9 100644 --- a/main.tf +++ b/main.tf @@ -127,11 +127,12 @@ resource "aws_instance" "default" { } module "dns" { - source = "cloudposse/route53-cluster-hostname/aws" - version = "0.9.0" - enabled = module.this.enabled && var.zone_id != "" ? true : false - zone_id = var.zone_id - ttl = 60 - records = var.associate_public_ip_address ? aws_instance.default.*.public_dns : aws_instance.default.*.private_dns - context = module.this.context + source = "cloudposse/route53-cluster-hostname/aws" + version = "0.9.0" + enabled = module.this.enabled && var.zone_id != "" ? true : false + zone_id = var.zone_id + ttl = 60 + records = var.associate_public_ip_address ? aws_instance.default.*.public_dns : aws_instance.default.*.private_dns + context = module.this.context + dns_name = var.host_name } diff --git a/variables.tf b/variables.tf index 0c060c9..c2bdc48 100644 --- a/variables.tf +++ b/variables.tf @@ -105,3 +105,9 @@ variable "egress_allowed" { default = false description = "Allow all egress traffic from instance" } + +variable "host_name" { + type = string + default = "bastion" + description = "The Bastion hostname created in Route53" +}