TPT-4302: Support ACLP alert definition additonal fields and entities#2334
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for ACLP Monitor Alert Definition “scope/regions/entities” fields and introduces a new data source for listing entities associated with a specific alert definition.
Changes:
- Expose
scope,regions, andentitiesonlinode_monitor_alert_definition(resource + data sources) and update tests/docs accordingly. - Add new
linode_monitor_alert_definition_entitiesdata source (schema/models/read + acceptance test + templates + docs). - Bump
linodego(and severalgolang.org/x/*) module versions.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| linode/monitoralertdefinitions/datasource_test.go | Extends acceptance checks for new alert definition fields in list data source. |
| linode/monitoralertdefinitionentities/tmpl/template.go | Adds acceptance test template helper for new entities data source. |
| linode/monitoralertdefinitionentities/tmpl/data_basic.gotf | Adds basic test config wiring definitions → entities data source. |
| linode/monitoralertdefinitionentities/framework_schema_datasource.go | Defines schema + filter block for entities-by-alert-definition data source. |
| linode/monitoralertdefinitionentities/framework_models.go | Adds TF model + parsing for returned entities list. |
| linode/monitoralertdefinitionentities/framework_datasource.go | Implements Read() + API listing for entities data source. |
| linode/monitoralertdefinitionentities/datasource_test.go | Adds integration acceptance test for the new data source. |
| linode/monitoralertdefinition/resource_test.go | Extends resource acceptance checks for new fields. |
| linode/monitoralertdefinition/framework_resource_schema.go | Adds scope, regions, entities to resource schema. |
| linode/monitoralertdefinition/framework_resource.go | Sends scope/regions on Create; adds regions handling on Update equality/update. |
| linode/monitoralertdefinition/framework_models_unit_test.go | Extends unit test to validate flattening of new fields. |
| linode/monitoralertdefinition/framework_models.go | Adds new model fields and flattening logic for scope/regions/entities. |
| linode/monitoralertdefinition/framework_datasource_schema.go | Exposes new computed fields on alert definition data source schema. |
| linode/monitoralertdefinition/datasource_test.go | Extends acceptance checks for new fields in single alert definition data source. |
| linode/framework_provider.go | Registers the new linode_monitor_alert_definition_entities data source. |
| go.mod | Bumps linodego and several golang.org/x dependencies. |
| go.sum | Updates sums for bumped modules. |
| docs/resources/monitor_alert_definition.md | Documents new scope/regions args and exported entities block. |
| docs/data-sources/monitor_alert_definitions.md | Documents new exported fields and entities block. |
| docs/data-sources/monitor_alert_definition_entities.md | Adds docs page for new entities data source. |
| docs/data-sources/monitor_alert_definition.md | Documents new exported fields and entities block. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Updating |
Scope is not updatable though. I added RequiresReplace to it |
📝 Description
Update ACLP monitor alert definition to support scope, region, and entities. Add a new data source to list entities under each specific alert definition. Remove entity_ids from read path and has_more_resource from top-level, because API considers them deprecated in the response and is going to fully remove them in the next release.
✔️ How to Test