The module updates Route53 to create an A record in a zone for instances in an autoscaling group. When the instance is terminated, the respective record is removed.
Prerequisites:
Autoscaling group name must be known before using this module. "Known" means that either we already created the ASG:
resource "aws_autoscaling_group" "update-dns" {
max_size = 1
min_size = 3
}
and then we can pass the ASG name as asg_name = aws_autoscaling_group.update-dns.name
or we know
the ASG name beforehand
resource "random_string" "asg_name" {
length = 6
special = false
}
locals {
asg_name = "${aws_launch_template.jumphost.name}-${random_string.asg_name.result}"
}
and then we can pass asg_name = local.asg_name
:
module "update_dns" {
source = "infrahouse/update-dns/aws"
version = "~> 0.1"
asg_name = local.asg_name
route53_zone_id = var.route53_zone_id
route53_hostname = var.route53_hostname
route53_public_ip = true
}
Name | Version |
---|---|
terraform | ~> 1.5 |
aws | ~> 5.11 |
random | ~> 3.6 |
Name | Version |
---|---|
archive | n/a |
aws | ~> 5.11 |
null | n/a |
random | ~> 3.6 |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
asg_name | Autoscaling group name to assign this lambda to. | string |
n/a | yes |
route53_hostname | An A record with this name will be created in the rout53 zone. Can be either a string or one of special values: _PrivateDnsName_, tbc. | string |
"_PrivateDnsName_" |
no |
route53_public_ip | If true, create the A record with the public IP address. Otherwise, private instance IP address. | bool |
true |
no |
route53_ttl | TTL in seconds on the route53 A record. | number |
300 |
no |
route53_zone_id | Route53 zone id of a zone where A record will be created. | any |
n/a | yes |
No outputs.