Ejemplo n.º 1
0
Archivo: cfr.go Proyecto: 2722/lantern
func DeleteDistribution(cfr *cloudfront.CloudFront, dist *Distribution) error {
	// See:
	// http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/DeleteDistribution.html
	getreq := &cloudfront.GetDistributionConfigRequest{ID: dist.distributionId}
	getresp, err := cfr.GetDistributionConfig(getreq)
	if err != nil {
		return err
	}
	delreq := &cloudfront.DeleteDistributionRequest{
		ID:      dist.distributionId,
		IfMatch: getresp.ETag,
	}
	return cfr.DeleteDistribution(delreq)
}