-
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
new resource: azurerm_log_analytics_workspace_datasource_linux_syslog #6449
new resource: azurerm_log_analytics_workspace_datasource_linux_syslog #6449
Conversation
There is a dedicated workspace-level resource called `linux_syslog_collection`, which has only a `state` indicating whether `linux_syslog` DS is applied to all the machines in this workspace. Rather than creating a corresponding resource for the "collection", making it as a workspace property seems more intuitive in context of terraform.
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 @magodo,
overall this looks good, but i question that the SDK is missing the required objects for this resource. Shouldn't we update the swagger and use the SDK?
location = azurerm_resource_group.example.location | ||
resource_group_name = azurerm_resource_group.example.name | ||
sku = "PerGB2018" | ||
} |
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.
Should we include the toggle in here?
type dataSourceLinuxSyslog struct { | ||
Name string `json:"syslogName"` | ||
Severities []dataSourceLinuxSyslogSeverity `json:"syslogSeverities"` | ||
} | ||
|
||
type dataSourceLinuxSyslogSeverity struct { | ||
Severity string `json:"severity"` | ||
} |
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.
Shouldn't this be added to the sagger and become part of the SDK?
|
||
resp, err := client.Get(ctx, resourceGroup, workspaceName, name) | ||
if err != nil { | ||
return fmt.Errorf("failed to retrieve Log Analytics Data Source Linux Syslog %q (Resource Group %q / Workspace: %q): %+v", name, resourceGroup, workspaceName, err) |
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.
replacing error with failed doesn't really change the fact we start the error message with a ERROR or FAILED. maybe we should change to grammar like
return fmt.Errorf("failed to retrieve Log Analytics Data Source Linux Syslog %q (Resource Group %q / Workspace: %q): %+v", name, resourceGroup, workspaceName, err) | |
return fmt.Errorf("retrieving Log Analytics Data Source Linux Syslog %q (Resource Group %q / Workspace: %q): %+v", name, resourceGroup, workspaceName, err) |
return fmt.Errorf("failed to retrieve Log Analytics Data Source Linux Syslog %q (Resource Group %q / Workspace: %q): %+v", name, resourceGroup, workspaceName, err) | ||
} | ||
if resp.ID == nil || *resp.ID == "" { | ||
return fmt.Errorf("cannot read Log Analytics Data Source Linux Syslog %q (Resource Group %q / Workspace: %q) ID", name, resourceGroup, workspaceName) |
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.
and
return fmt.Errorf("cannot read Log Analytics Data Source Linux Syslog %q (Resource Group %q / Workspace: %q) ID", name, resourceGroup, workspaceName) | |
return fmt.Errorf("reading Log Analytics Data Source Linux Syslog %q (Resource Group %q / Workspace: %q) ID", name, resourceGroup, workspaceName) |
as the error or failed is implied? YDYT?
@katbyte Thank you for the quick response 👍 |
hey @magodo Unfortunately we need the SDK to define these types else they can change on Azure's side without correctly handling semantic versioning - as such these types need to be present in the Azure SDK/Swagger here. Since this is currently blocked on this upstream API Issue - I'm going to temporarily close this issue for the moment (it's already in the Blocked milestone) - but once the upstream issue has been resolved then we can re-open this and take another look. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
This implements one of the log analytics workspace data sources required in #3182
NOTE: There is a dedicated workspace-level resource called
linux_syslog_collection
, which has only astate
indicating whetherlinux_syslog
DS is applied to all the machines in this workspace. Rather than creating a corresponding resource for the "collection", making it a workspace property seems more intuitive in the context of terraform.Test result