I wrote a CloudFormation template which creates a vpc, subnets, routes, asg's and instances.
I want CloudFormation to handle the association of the newly created vpc with an existing Route53 hosted zone but I can't find how to do it in CloudFormation.
Using the aws cli, this can be achieved by running (in the user_data script):
aws route53 associate-vpc-with-hosted-zone --hosted-zone-id AAZZZ123AA --vpc VPCRegion=us-west-2,VPCId=$vpcid
But I want CloudFormation to manage these associations so when the stack is deleted then the vpc association will be deleted as well.
I couldn't find online how it can be achieved with CloudFormation, so does anybody know if it can be done?