-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
automation_account
- add public_network_access_enabled
#15429
automation_account
- add public_network_access_enabled
#15429
Conversation
shu-ying789
commented
Feb 15, 2022
automation_account
- add test for public_network_access_enabledautomation_account
- add public_network_access_enabled
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.
Hey @shu-ying789. Thanks for opening this PR! Unfortunately, this is a breaking change as Terraform wants to update the existing resource with this new attribute as seen here
~ public_network_access_enabled = false -> true
I've detailed how to get around this in the comments
@@ -187,7 +192,7 @@ func resourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}) | |||
d.Set("name", id.Name) | |||
d.Set("resource_group_name", id.ResourceGroup) | |||
d.Set("location", location.NormalizeNilable(resp.Location)) | |||
|
|||
d.Set("public_network_access_enabled", resp.PublicNetworkAccess) |
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.
resp.PublicNetworkAccess
isn't returned from the API if it wasn't passed to the API on creation so we get a state change even though it is enabled in the portal. My suggestion is that we always make sure to set public_network_access_enabled
to true even if that attribute isn't returned from the API
d.Set("public_network_access_enabled", resp.PublicNetworkAccess) | |
publicNetworkAccessEnabled := true | |
if resp.PublicNetworkAccess != nil { | |
publicNetworkAccessEnabled = *resp.PublicNetworkAccess | |
} | |
d.Set("public_network_access_enabled", publicNetworkAccessEnabled) |
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.
LGTM!
This functionality has been released in v2.97.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |