Associates a route53 hostname with private ips of an external load balancer.
Keeps private IPs in sync by monitoring CloudTrail for ENI changes and running a lambda on every change.
data "aws_vpc" "default" {
}
module "ec2_alb_private_hostname" {
source = "git::https://github.com/maxfortun/ec2_alb_private_hostname.git"
name = "external-load-balancer-name"
log_retention_in_days = "1"
tags = {
tag = "here"
}
region = "us-east-1"
listener_arns = aws_lb_listener.listener.*.arn
zone_id = data.aws_route53_zone.svc.zone_id
hostname_prefix = "vir-lb-name-private"
source_ips = [ data.aws_vpc.default.cidr_block ]
}
Can be triggered manually by calling https://<load balancer hostname>/private-hostname/update
.
Name |
Description |
Type |
Default |
hostname |
If only one hostname is needed specify hostname, otherwise use hostname_prefix. |
string |
"" |
hostname_prefix |
If more than one hostname is needed specify hostname_prefix, otherwise use hostname. |
string |
"" |
listener_arns |
List of application load balancer listeners arns to attach private hostnames to. |
list(string) |
n/a |
log_retention_in_days |
Number of days to retain lambda logs. |
any |
n/a |
name |
Load balancer name. |
any |
n/a |
region |
AWS region. |
any |
n/a |
source_ips |
List of source ips in cidr format that are allowed to access /private-hostname/update. |
list(string) |
n/a |
tags |
Tags to assign to created resources. |
map(string) |
n/a |
zone_id |
AWS Route53 Hosted Zone Id for private hostnames. |
any |
n/a |
Name |
Description |
arn |
ARN of the Lambda function. |
hostnames |
n/a |
No modules.