In the KMS generator config define a custom error for NotFoundException + regenerate code #659
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
The KMS Key resource is broken and you can't create a KMS key with it. Fixes: #647
After looking at the code it seems the IsNotFound() function was generated incorrectly:
https://github.com/crossplane/provider-aws/blob/1ad7872a1b8f19cbd56f020e780ee698198163dc/pkg/controller/kms/key/zz_conversions.go#L147
I added a custom exception to the generator config. Although the API returns a 400 http code if the kms key does not exist, I still had to use 404 in the config, which seemed to do the trick.
I followed the instructions from CODE_GENERATION.md and ran these two commands:
In code-generator:
In provider-aws:
I'm not sure I generated the code correctly as there are more changes that I would expect.
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
I've built and deployed the provider to a real environment and tested KMS key creation, with and without an external-name.