Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.88k stars 1.2k forks source link

undeploy didn't nuke my apigw custom domain #698

Open pjz opened 7 years ago

pjz commented 7 years ago

Context

I did a 'zappa undeploy production' for a project with a 'domain' set under 'production'.

Expected Behavior

I expected that to correctly remove the apigw entries that it created.

Actual Behavior

It removed the API-GW API, but not the 'Custom Domain Name' that it was using. The custom domain was 'emptied', however, in that it no longer listed any API Mappings, but I can't tell if that was Zappa doing its job or AWS nuking a reference to a no-longer-existing API entry.

Possible Fix

Your Environment

Miserlou commented 7 years ago

There is a TODO in the code about this - the question is should Zappa do this or not.

I guess it should remove the Domain Name from API Gateway, but not remove the Route53 entry. Make sense?

pjz commented 7 years ago

Agreed.

pjz commented 7 years ago

Wait, why not remove the Route53 entry? It's an alias that points to the API-GW custom domain ('8ukj2r8fajf8jq24f.cloudfront.net') right? And that domain is going to be completely invalid if you nuke the API-GW. So why not update the Route53 entry? Or at least have an option to do so?

Miserlou commented 7 years ago

We could remove just the one CNAME record I suppose

pjz commented 7 years ago

Yeah, I'd consider doing that under the heading of 'maintain referential integrity'. It's not a database, but the concept still kind of applies.

atif1996 commented 7 years ago

I suggest providing a flag to enable the feature, but have it remove the route53 as well as the custom domain name.

In the past I would have said to not remove the custom domain name, but since AWS can handle the certificates through ACM, its not a big deal anymore.

Miserlou commented 7 years ago

I can't believe this still is open. MUSTFIX for next release!