Open AlexSpart opened 3 years ago
*Update : The solution on the link above says to use an additional module that lists the current API gateways, find the id of the one you want using the name and delete it before you create the new one. That way you don't have duplicates. The optimal solution though would be to list the APIs and if there is one with the same name, to update the definition of it, as here: https://docs.ansible.com/ansible/latest/modules/aws_api_gateway_module.html. This way you don't lose any additional configurations linked to the API, like for example routing traffic to it from your domain name.
When I am deploying my tosca model to my AWS service, a new API gateway is being created every time with the same name. It creates confusion and you have to always delete the previous API versions.
This is probably an Ansible "issue" as it can't identify the API resources by name but it does so by id. It is explained here: https://stackoverflow.com/questions/50292627/ansible-keeps-on-creating-multiple-api-gateway-on-every-execution/51011018.
It would be good to have this workaround so that we keep a clean Aws API gateway console.