-
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
azurerm_mssql_managed_database - support for tags #27857
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.
LGTM with a couple of things we could do differently
@@ -157,15 +161,15 @@ func (r MsSqlManagedDatabaseResource) Create() sdk.ResourceFunc { | |||
parameters := manageddatabases.ManagedDatabase{ | |||
Location: managedInstance.Model.Location, | |||
Properties: &manageddatabases.ManagedDatabaseProperties{}, | |||
Tags: &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.
Tags: &model.Tags, | |
Tags: pointer.To(model.Tags), |
@@ -233,6 +238,17 @@ func (r MsSqlManagedDatabaseResource) Update() sdk.ResourceFunc { | |||
|
|||
d := metadata.ResourceData | |||
|
|||
if d.HasChange("tags") { | |||
parameters := manageddatabases.ManagedDatabase{ | |||
Tags: &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.
Tags: &model.Tags, | |
Tags: pointer.To(model.Tags), |
@@ -319,6 +335,10 @@ func (r MsSqlManagedDatabaseResource) Read() sdk.ResourceFunc { | |||
model.PointInTimeRestore = flattenManagedDatabasePointInTimeRestore(v) | |||
} | |||
|
|||
if model.Tags != nil { | |||
state.Tags = 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.
You could get rid of this block and just do state.Tags = pointer.From(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.
LGTM when we add docs!
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. |
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_mssql_managed_database - support for tags [GH-00000]
This is a (please select all that apply):
Related Issue(s)
Fixes #27809
Note
If this PR changes meaningfully during the course of review please update the title and description as required.