Skip to content

Commit

Permalink
add support for Route53 Alias records in route53 command
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicBreuker committed Oct 30, 2024
1 parent f7d1cbc commit 00fe4fd
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions aws/route53.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,27 @@ func (m *Route53Module) getRoute53Records() {

for _, resourceRecord := range record.ResourceRecords {
recordValue := resourceRecord.Value
m.Records = append(
m.Records,
Record{
AWSService: "Route53",
Name: recordName,
Type: recordType,
Value: aws.ToString(recordValue),
PrivateZone: privateZone,
})
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 {
m.Records = append(
m.Records,
Record{
AWSService: "Route53",
Name: recordName,
Type: recordType,
Value: aws.ToString(recordValue),
PrivateZone: privateZone,
})
}

}
}
Expand Down

0 comments on commit 00fe4fd

Please sign in to comment.