Created
September 17, 2024 22:08
-
-
Save pkqk/5c399f28b1ec4521f60b65be2a295ca6 to your computer and use it in GitHub Desktop.
delete Route53 Record
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
hostedzoneid=${1?usage: $0 hostedzoneid rrtype} | |
rrtype=${2?usage: $0 hostedzoneid rrtype} | |
aws route53 list-resource-record-sets --hosted-zone-id "${hostedzoneid}" --query "ResourceRecordSets[?Type=='${rrtype}']" | | |
jq 'map({Changes: [{Action: "DELETE", ResourceRecordSet: .}]})[0]' | | |
aws route53 change-resource-record-sets --hosted-zone-id "${hostedzoneid}" --change-batch file:///dev/stdin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment