We are using the module.nexus.stdout to create the resource aws_route53_record but the module.nexus.stdout gives a different result and when we run the command 'kubectl get services --namespace nexus nexus -o json | jq -r ‘.status.loadBalancer.ingress[0].hostname’ it gives the currently running pod name i.e a86166087f3024a69805fcdfa19f96c8-1108193269.us-east-2.elb.amazonaws.com
.
my terraform plan shows ~ triggers = {
~ stderr = → aa8226b3e078a432892a1dc079830779-2139391391.us-east-2.elb.amazonaws.com
~ stdout = a86166087f3024a69805fcdfa19f96c8-1108193269.us-east-2.elb.amazonaws.com
→ aa8226b3e078a432892a1dc079830779-2139391391.us-east-2.elb.amazonaws.com
}
Below are the configs that we are using to create the aws_route53_record.
module “nexus” {
source = “matti/resource/shell”
version = “1.5.0”
command = “kubectl get services --namespace nexus nexus -o json | jq -r ‘.status.loadBalancer.ingress[0].hostname’”
}
output “nexus” {
value = module.nexus.stdout
}
resource “aws_route53_record” “nexus” {
zone_id = aws_route53_zone.monitoring.zone_id
name = “nexus.monitoring.watch.com”
type = “CNAME”
ttl = 300
records = [module.nexus.stdout]
}