From ab4866fcbff0f23871267e16cb305479ccc850e9 Mon Sep 17 00:00:00 2001 From: Dominic Breuker Date: Wed, 13 Nov 2024 21:24:17 +0100 Subject: [PATCH] fix bug with route53 alias record processing --- aws/route53.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/aws/route53.go b/aws/route53.go index 800ec45..652d76d 100644 --- a/aws/route53.go +++ b/aws/route53.go @@ -235,19 +235,19 @@ func (m *Route53Module) getRoute53Records() { recordName = aws.ToString(record.Name) recordType = string(record.Type) - for _, resourceRecord := range record.ResourceRecords { - recordValue := resourceRecord.Value - if record.AliasTarget != nil { - m.Records = append( - m.Records, - Record{ - AWSService: "Route53", - Name: recordName, - Type: fmt.Sprintf("Alias[%s]", recordType), - Value: aws.ToString(record.AliasTarget.DNSName), - PrivateZone: privateZone, - }) - } else { + if record.AliasTarget != nil { + m.Records = append( + m.Records, + Record{ + AWSService: "Route53", + Name: recordName, + Type: fmt.Sprintf("Alias[%s]", recordType), + Value: aws.ToString(record.AliasTarget.DNSName), + PrivateZone: privateZone, + }) + } else { + for _, resourceRecord := range record.ResourceRecords { + recordValue := resourceRecord.Value m.Records = append( m.Records, Record{ @@ -258,8 +258,8 @@ func (m *Route53Module) getRoute53Records() { PrivateZone: privateZone, }) } - } + } }