本文整理匯總了Golang中github.com/aws/aws-sdk-go/service/route53.Route53.DeleteHostedZone方法的典型用法代碼示例。如果您正苦於以下問題:Golang Route53.DeleteHostedZone方法的具體用法?Golang Route53.DeleteHostedZone怎麽用?Golang Route53.DeleteHostedZone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/aws/aws-sdk-go/service/route53.Route53
的用法示例。
在下文中一共展示了Route53.DeleteHostedZone方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: cleanupDomain
func cleanupDomain(r53 *route53.Route53, id string) {
// delete all non-default SOA/NS records
rrsets, err := cli53.ListAllRecordSets(r53, id)
fatalIfErr(err)
changes := []*route53.Change{}
for _, rrset := range rrsets {
if *rrset.Type != "NS" && *rrset.Type != "SOA" {
change := &route53.Change{
Action: aws.String("DELETE"),
ResourceRecordSet: rrset,
}
changes = append(changes, change)
}
}
if len(changes) > 0 {
req2 := route53.ChangeResourceRecordSetsInput{
HostedZoneId: &id,
ChangeBatch: &route53.ChangeBatch{
Changes: changes,
},
}
_, err = r53.ChangeResourceRecordSets(&req2)
if err != nil {
fmt.Printf("Warning: cleanup failed - %s\n", err)
}
}
req3 := route53.DeleteHostedZoneInput{Id: &id}
_, err = r53.DeleteHostedZone(&req3)
if err != nil {
fmt.Printf("Warning: cleanup failed - %s\n", err)
}
}