-
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_log_analytics_linked_storage_account
- fix data_source_type
case sensitivity
#18116
azurerm_log_analytics_linked_storage_account
- fix data_source_type
case sensitivity
#18116
Conversation
internal/services/loganalytics/log_analytics_linked_storage_account_resource.go
Outdated
Show resolved
Hide resolved
…m into fix_log_analytics_linked_storage_account_dst
internal/services/loganalytics/log_analytics_linked_storage_account_resource.go
Outdated
Show resolved
Hide resolved
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 ♻️ is this supposed to still be a drafT?
3336a02
to
4e65e45
Compare
This is really a special case, a Enum is used in request path to create: Lines 85 to 107 in c7e7b2b
I think in Read we should also set below is a example response (id in response matches the request case, but DataSourceType in response.properties does not): PUT https://management.azure.com/subscriptions/{{subscriptionId}}/resourceGroups/wt-test-app_ins/providers/Microsoft.OperationalInsights/workspaces/exampleworkspace/linkedStorageAccounts/CustomLogs?api-version=2020-08-01
{
"properties": {
"storageAccountIds": [
"/subscriptions/{{subscriptionId}}/resourceGroups/wt-test-app_ins/providers/Microsoft.Storage/storageAccounts/wantatexamplesa"
]
}
}
response:
{
"properties": {
"dataSourceType": "customlogs",
"storageAccountIds": [
"/subscriptions/{{subscriptionId}}/resourceGroups/wt-test-app_ins/providers/Microsoft.Storage/storageAccounts/wantatexamplesa"
]
},
"id": "/subscriptions/{{subscriptionId}}/resourceGroups/wt-test-app_ins/providers/Microsoft.OperationalInsights/workspaces/exampleworkspace/linkedStorageAccounts/CustomLogs",
"name": "customlogs",
"type": "Microsoft.OperationalInsights/workspaces/linkedStorageAccounts"
} |
@teowa - yes we should use the correct casing always |
@@ -143,7 +144,8 @@ resource "azurerm_storage_account" "test" { | |||
} | |||
|
|||
func (r LogAnalyticsLinkedStorageAccountResource) basic(data acceptance.TestData) string { | |||
return fmt.Sprintf(` | |||
if !features.FourPointOh() { |
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.
this shouldn't be required because we're ignoring case till 4.0?
@@ -131,6 +137,7 @@ func resourceLogAnalyticsLinkedStorageAccountRead(d *pluginsdk.ResourceData, met | |||
|
|||
d.Set("resource_group_name", id.ResourceGroupName) | |||
d.Set("workspace_resource_id", linkedstorageaccounts.NewWorkspaceID(id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName).ID()) | |||
d.Set("data_source_type", string(id.DataSourceType)) |
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.
since this is part of the id, we might want to do a state migration so we can remove the parse insensitively above?
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 @teowa - LGTM now 🍄
This functionality has been released in v3.25.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. |
Resolves #16234
Use
strings.ToLower()
, like in the schema belowterraform-provider-azurerm/internal/services/loganalytics/log_analytics_linked_storage_account_resource.go
Lines 40 to 54 in 99542c6
Test Result