-
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
azurerm_automation_powershell72_module
: support tag
property
#26106
Conversation
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.
Thanks @wuxu92. Could you please address the two comments. Once that's done this should be good to go.
@@ -226,6 +231,7 @@ func (r PowerShell72ModuleResource) Update() sdk.ResourceFunc { | |||
Properties: module.ModuleCreateOrUpdateProperties{ | |||
ContentLink: expandPowerShell72ModuleLink(model.ModuleLink), | |||
}, | |||
Tags: pointer.To(model.Tags), |
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.
We should use d.HasChanges("tags")
here before adding it to parameters
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.
updated,
@@ -320,6 +326,7 @@ func (r PowerShell72ModuleResource) Read() sdk.ResourceFunc { | |||
|
|||
output.Name = id.PowerShell72ModuleName | |||
output.AutomationAccountID = module.NewAutomationAccountID(id.SubscriptionId, id.ResourceGroupName, id.AutomationAccountName).ID() | |||
output.Tags = pointer.From(resp.Model.Tags) |
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.
Like we do elsewhere for Tags in the read, can we nil check the Model and use the tags.Flatten
function.
output.Tags = pointer.From(resp.Model.Tags) | |
if model := resp.Model; model != nil { | |
output.Tags = tags.Flatten(model.Tags) | |
} | |
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.
updated,
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.
Thanks @wuxu92 LGTM 👍
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_automation_powershell72_module
- support for thetags
propertyThis is a (please select all that apply):
Related Issue(s)