binxio / cfn-custom-provider-template

template source directory for creating AWS Custom CloudFormation Resources in Python
Apache License 2.0
3 stars 4 forks source link

Explicit Resource Type #1

Closed ambsw-technology closed 4 years ago

ambsw-technology commented 4 years ago

This PR makes the resource type explicit by importing the framework for resource types from cfn-certificate-provider, but defaulting to the backwards-compatible Custom::Custom. Unlike cfn-certificate-provider (which has a provider in the else), I have added an explicit error branch. I'm not sure if there's a compelling reason to not do this, but a typo in the Custom Resource name could land the user in the else branch. If this is another provider, it could produce strange errors (e.g. parameters missing or even building wrong resources).

While I was in the file, I also changed the import strategy for providers. This ensures that IDEs understand the imports even if they're nested in projects with different source roots. I did this for a while to use a custom modification while it was PR'd.

mvanholsteijn commented 4 years ago

thank you for your contribution!