Skip to content

TPT-4302: Support ACLP alert definition additonal fields and entities#2334

Merged
yec-akamai merged 9 commits into
proj/aclp-alerting-definitionfrom
TPT-4302/alert-20k
May 7, 2026
Merged

TPT-4302: Support ACLP alert definition additonal fields and entities#2334
yec-akamai merged 9 commits into
proj/aclp-alerting-definitionfrom
TPT-4302/alert-20k

Conversation

@yec-akamai
Copy link
Copy Markdown
Contributor

@yec-akamai yec-akamai commented Apr 27, 2026

📝 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

make test-unit PKG_NAME=monitoralertdefinition
make test-int PKG_NAME=monitoralertdefinition
make test-int PKG_NAME=monitoralertdefinitions
make test-int PKG_NAME=monitoralertdefinitionentities

@yec-akamai yec-akamai added the new-feature for new features in the changelog. label Apr 27, 2026
@yec-akamai yec-akamai requested review from a team as code owners April 27, 2026 23:35
@yec-akamai yec-akamai requested review from psnoch-akamai and zliang-akamai and removed request for a team April 27, 2026 23:35
@yec-akamai yec-akamai changed the title TPT-4302: Support TPT-4302: Support ACLP alert definition additonal fields and entities Apr 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and entities on linode_monitor_alert_definition (resource + data sources) and update tests/docs accordingly.
  • Add new linode_monitor_alert_definition_entities data source (schema/models/read + acceptance test + templates + docs).
  • Bump linodego (and several golang.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.

Comment thread linode/monitoralertdefinitionentities/framework_datasource.go
Comment thread docs/data-sources/monitor_alert_definition_entities.md
Comment thread linode/monitoralertdefinition/framework_resource.go
Comment thread linode/monitoralertdefinition/framework_resource_schema.go
@zliang-akamai
Copy link
Copy Markdown
Member

Updating scope after initial apply may trigger infinite diff. I think we may have to handle it in the update function or a requiring replacement plan modifier.

linode_monitor_alert_definition.test: Refreshing state...

OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place (current -> planned)

OpenTofu will perform the following actions:

  # linode_monitor_alert_definition.test will be updated in-place
  ~ resource "linode_monitor_alert_definition" "test" {
        id                 = 11113
      ~ scope              = "entity" -> "account"
        # (17 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

@yec-akamai
Copy link
Copy Markdown
Contributor Author

Updating scope after initial apply may trigger infinite diff. I think we may have to handle it in the update function or a requiring replacement plan modifier.

linode_monitor_alert_definition.test: Refreshing state...

OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place (current -> planned)

OpenTofu will perform the following actions:

  # linode_monitor_alert_definition.test will be updated in-place
  ~ resource "linode_monitor_alert_definition" "test" {
        id                 = 11113
      ~ scope              = "entity" -> "account"
        # (17 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Scope is not updatable though. I added RequiresReplace to it

@yec-akamai yec-akamai merged commit cd2225f into proj/aclp-alerting-definition May 7, 2026
12 checks passed
@yec-akamai yec-akamai deleted the TPT-4302/alert-20k branch May 7, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants