-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
#26797: disable_access_keys_authentication property for Redis Cache #26964
#26797: disable_access_keys_authentication property for Redis Cache #26964
Conversation
@@ -553,6 +558,11 @@ func resourceRedisCacheCreate(d *pluginsdk.ResourceData, meta interface{}) error | |||
parameters.Properties.SubnetId = utils.String(v.(string)) | |||
} | |||
|
|||
if v, ok := d.GetOk("access_keys_authentication_disabled"); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second return value of d.GetOK
indicates the value of the given key has been set to a non-zero value (e.g. false
for boolean). So this only tells if this value is true (ok
), or false (!ok
). In case it is false
, shall we also set it and send it to the API, instead of leaving it null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GetOk
doc says
// GetOk returns the data for the given key and whether or not the key
// has been set to a non-zero value at some point.
//
// The first result will not necessarilly be nil if the value doesn't exist.
// The second result should be checked to determine this information.
I believe if we get false
value from configuration we'll get v
= false
and ok
= true
and the value will be sent to the API. I'll give this a test.
@@ -671,6 +681,13 @@ func resourceRedisCacheUpdate(d *pluginsdk.ResourceData, meta interface{}) error | |||
parameters.Properties.RedisConfiguration = redisConfiguration | |||
} | |||
|
|||
if v, ok := d.GetOk("access_keys_authentication_disabled"); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can reference how public_network_access_enabled
does for update. You don't need this d.GetOK()
, instead, use d.Get()
can get the value:
true
if explicitly specified to betrue
false
if explicitly specified to befalse
, or absent
This is a SDKv2 behavior.
- Removed redundant checks - Checks transition of both AD and access keys auth
Closing this PR, replacing with a new one that complies with contribution guide: #27039 |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Community Note
Description
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_resource
- support for thething1
property [GH-00000]This is a (please select all that apply):
Related Issue(s)
Fixes #0000
Note
If this PR changes meaningfully during the course of review please update the title and description as required.