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

Complex Parameter Validation #3

Open ambsw-technology opened 4 years ago

ambsw-technology commented 4 years ago

I'm working on a custom provider to fill in some gaps in WorkSpaces deployment. There are a bunch of CLI calls that can affect one of the resources (i.e. a directory service registered with WorkSpaces) that (as far as I can tell) need to be handled together. As a result, I have to accept both the general EnableSelfService as well as individual self-service permissions (e.g. IncreaseVolumeSize). If EnableSelfService is disabled, trying to allow IncreaseVolumeSize is invalid so I need to do some additional parameter validation.

At the moment, it looks like I should wrap is_valid_request and do my checks after super. If that's the right place, perhaps it makes sense to "document" it in the template e.g. a commented-out method that makes the super call and then has the comment # additional validation here. I can PR, but I want to make sure there isn't a by-design place to be doing this.

ambsw-technology commented 4 years ago

(posted in the wrong issue)