-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix: Replace default in encryption_config on null #3524
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
fix: Replace default in encryption_config on null #3524
Conversation
@bryantbiggs I came here for this same thing while trying to migrate from v20.x.x. i get that "all you need is null" but i respectfully request reconsidering this PR because:
|
Correct - we default to enabling encryption because its a recommended security practice per AWS. Would we do it differently today? Sure! EKS now encrypts secrets by default with an AWS provided key, but that is a very recent change - for years, secrets were not encrypted unless you enabled it and provided a custom KMS key. Ergo, we tried to do the "right thing" by users to make that easier.
I don't know what this means - what fails? to someone who has zero context about your configurations, how would they approach understanding this 😅
What is mis-leading? This is Terraform's way of saying "give me the variable optional attribute defaults". I didn't design it, just used it because folks wanted us to use variable optional attributes because they said it gives more information about the API of the variable shapes
Lots to unpack here so lets break it down further:
it may be what you need, if you want to disable encryption with a custom KMS key. Why its not already that, see what I provided above already
I don't follow - the default of |
this is what the original poster put in their description. the default value expects other values to exist that will not as a default.
|
I would love to see you produce a reproduction for this - the number of unknown unknowns is endless |
going a bit further into this, previously on v20.x.x |
ok - but we've clarified that when upgrading to v21.x that |
i'm simply inclined to agree with OP as i ran into the exact same situation independently and came to the same conclusion and eventually ended up here when searching. it really looks like the comparison was goofed from what it used to be vs what OP pointed out but if it's not gonna change then perhaps it could be mentioned in the upgrade guide? or the variable description? it's an undocumented change in behavior at the least. people shouldn't have to search through issues to find the correct way to deal with defaults. to be clear i'm not debating this to handle my specific situation. it's on behalf of anyone else that gets pinched by this change in the future. |
Submit a PR if you think it will help |
Description
Replaced the default value in variable - encryption_config because of the check here
Motivation and Context
Fixes #3469
Because if you don't use encryption_config and don't explicitly pass null, then the provider crashes with an error:
Lines 558 & 566 (main.tf) - Policy creation:
This tries to create encryption policies even when provider_key_arn is null.
Breaking Changes
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request