New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce ability to create invalid RDS template #29
Conversation
It's a big set of changes, so it's hard to judge whether it's completely correct, especially not understanding the underlying rules. I do like the enumeration format. |
I stole the enumeration format from @hibikir . I've tried to capture the rules around creation in the Scaladoc, but it is convoluted. |
I forgot to include in the commit and above that I also added support for DeletionPolicy. |
LGTM. I can't verify that the modeling is perfect, but what I can say is that it's better than the one provided by Amazon. If more changes are needed later, because we didn't quite grasp all the RDS rules, so be it. |
I found a few issues with this PR. There is no good way to map from a While I'd like to keep those checks in, I am not seeing a way to do that, so I'm going to convert to using Tokens. |
Hmm… it is possible to code things to know whether you have a raw value or a resource reference, and behave differently depending on the result. However, I haven't spent enough time looking at the code to try to figure out what's the best way to implement that with the minimum amount of impact on the existing API. |
Yes, that is what you would have to do, because there are situations where you literally cannot turn a token into an actual thing at generation time (not knowable, like the parameter case), so you'd have to have two paths and get more checks on only one side All e-mails and attachments sent and received are subject to monitoring, reading and archival by Monsanto, including its The information contained in this email may be subject to the export control laws and regulations of the United States, potentially |
I was thinking about using something like Either, but then I figured these values will almost always be parameters, not hard-coded. Well, I may do that if for nothing other than it may be worthwhile to keep the logic in for those reading the code. |
Implement a complex mechanism for reducing the chance of creating JSON for an RDS DBInstance that is invalid. My hope is that the complexity equals and is not greater than the complexity inherent in the restrictions around RDS creation. There is still one run-time check around storage encryption since specifying it is only valid on new instances created within VPCs. There are restrictions on the values of AllocatedStorage when using Iops but often these values are given as parameter and therefore must accept Token[Int]. I currently used Either to take Int or Token[Int] but at some point it would be good to allow one to reach through the Token to see if the Int is there too test. Tests were added to cover all of the above. A couple other minor changes: - Clean up build.sbt - Implement and use EnumFormat for all enumerations JSON serialization
I implemented this as Either and fixed a couple other minor things. |
Reduce ability to create invalid RDS template
Implement a complex mechanism for reducing the chance of creating JSON
for an RDS DBInstance that is invalid. My hope is that the complexity
equals and is not greater than the complexity inherent in the
restrictions around RDS creation. There is still one run-time check
around storage encryption since specifying it is only valid on new
instances created within VPCs.
A couple other minor changes:
When this change gets merged, the release will have to increment the major version number since this breaks RDS backward compatibility badly.