Skip to content

Commit

Permalink
Don't pass empty tags properties
Browse files Browse the repository at this point in the history
  • Loading branch information
iwahbe committed Aug 4, 2023
1 parent 1fd15a3 commit fd37ad2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -7194,11 +7194,15 @@ func applyTags(

allTags := defaultTags.MergeTags(resourceTags.Tags).IgnoreConfig(ignoredTags)

allTagProperties := make(resource.PropertyMap, len(allTags))
for k, v := range allTags {
allTagProperties[resource.PropertyKey(k)] = resource.NewStringProperty(v.ValueString())
if len(allTags) > 0 {
allTagProperties := make(resource.PropertyMap, len(allTags))
for k, v := range allTags {
allTagProperties[resource.PropertyKey(k)] = resource.NewStringProperty(v.ValueString())
}
config["tags"] = resource.NewObjectProperty(allTagProperties)
} else {
delete(config, "tags")
}
config["tags"] = resource.NewObjectProperty(allTagProperties)

return config, nil
}

0 comments on commit fd37ad2

Please sign in to comment.