Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

fix(aws-alb): destroy r53 record #3076

Merged
merged 2 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3076.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
plugin/aws-alb: Use Route53 zone id when destroying a resource record
```
6 changes: 3 additions & 3 deletions builtin/aws/alb/releaser.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ func (r *Releaser) resourceRecordSetDestroy(
r53 := route53.New(sess)

records, err := r53.ListResourceRecordSets(&route53.ListResourceRecordSetsInput{
HostedZoneId: aws.String(lbState.ZoneId),
HostedZoneId: aws.String(r.config.ZoneId),
StartRecordName: aws.String(state.FQDN),
StartRecordType: aws.String("A"),
MaxItems: aws.String("1"),
Expand All @@ -671,7 +671,7 @@ func (r *Releaser) resourceRecordSetDestroy(
return nil
}

log.Debug("removing route53 record", "zone-id", lbState.ZoneId)
log.Debug("removing route53 record", "zone-id", r.config.ZoneId)
input := &route53.ChangeResourceRecordSetsInput{
ChangeBatch: &route53.ChangeBatch{
Changes: []*route53.Change{
Expand All @@ -690,7 +690,7 @@ func (r *Releaser) resourceRecordSetDestroy(
},
Comment: aws.String("managed by waypoint"),
},
HostedZoneId: aws.String(lbState.ZoneId),
HostedZoneId: aws.String(r.config.ZoneId),
}

result, err := r53.ChangeResourceRecordSets(input)
Expand Down