Skip to content

ACLP Logs#2359

Merged
yec-akamai merged 25 commits into
linode:devfrom
sjer-akamai:dev
Jul 7, 2026
Merged

ACLP Logs#2359
yec-akamai merged 25 commits into
linode:devfrom
sjer-akamai:dev

Conversation

@klipensk

Copy link
Copy Markdown
Contributor

📝 Description

Adds Terraform support for the monitoring log destinations api and streams api.

✔️ How to Test

Unit tests:

  • log destinations API: make PKG_NAME=monitorlogsdestination test-unit
  • log streams API: make PKG_NAME=monitorlogsstream test-unit

Integration tests (package specific):

  • log destinations: LINODE_TOKEN=<your_token> make TEST_SUITE=monitorlogsdestination,monitorlogsdestinations test-int
  • log streams: LINODE_TOKEN=<your_token> RUN_LONG_TESTS=true TIMEOUT=300m make TEST_SUITE=monitorlogsdestination,monitorlogsdestinations,monitorlogsstream,monitorlogsstreams,monitorlogsstreamhistory test-int

@klipensk
klipensk requested review from a team as code owners May 25, 2026 09:28
@klipensk
klipensk requested review from psnoch-akamai and yec-akamai and removed request for a team May 25, 2026 09:28
@sjer-akamai
sjer-akamai force-pushed the dev branch 2 times, most recently from 33d0b4a to a2f18a1 Compare May 25, 2026 14:00
@yec-akamai
yec-akamai requested a review from Copilot May 31, 2026 18:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Terraform Framework support for Monitor Logs destinations and streams, including singular resources/data sources, list data sources, stream history lookup, acceptance/unit tests, provider registration, and CI suite wiring.

Changes:

  • Adds linode_monitor_logs_destination and linode_monitor_logs_stream resources with schema, CRUD, model flattening, templates, and tests.
  • Adds singular/list data sources for destinations and streams, plus a stream history data source.
  • Registers the new Terraform types and adds their integration suites to the workflow.

Reviewed changes

Copilot reviewed 52 out of 52 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.github/workflows/integration_tests.yml Adds monitor logs suites and long-test env propagation.
linode/framework_provider.go Registers new monitor logs resources and data sources.
linode/monitorlogsdestination/framework_resource.go Implements destination resource CRUD.
linode/monitorlogsdestination/framework_models.go Adds destination resource/data source models and flattening.
linode/monitorlogsdestination/framework_schema_resource.go Defines destination resource schema.
linode/monitorlogsdestination/framework_schema_datasource.go Defines singular destination data source schema.
linode/monitorlogsdestination/framework_datasource.go Implements singular destination data source read.
linode/monitorlogsdestination/framework_models_unit_test.go Adds destination model unit tests.
linode/monitorlogsdestination/resource_test.go Adds destination resource acceptance tests.
linode/monitorlogsdestination/datasource_test.go Adds destination data source acceptance tests.
linode/monitorlogsdestination/tmpl/template.go Adds destination test template helpers.
linode/monitorlogsdestination/tmpl/basic.gotf Adds destination basic resource test config.
linode/monitorlogsdestination/tmpl/updates.gotf Adds destination update test config.
linode/monitorlogsdestination/tmpl/bucket_only.gotf Adds bucket-only teardown config.
linode/monitorlogsdestination/tmpl/data_basic.gotf Adds destination data source test config.
linode/monitorlogsdestination/tmpl/data_not_found.gotf Adds destination not-found data source config.
linode/monitorlogsdestination/tmpl/invalid_type.gotf Adds invalid destination type config.
linode/monitorlogsdestinations/framework_datasource.go Implements list destination data source read/filtering.
linode/monitorlogsdestinations/framework_models.go Adds list destination models.
linode/monitorlogsdestinations/framework_schema_datasource.go Defines list destination data source schema/filter config.
linode/monitorlogsdestinations/datasource_test.go Adds list destination data source acceptance test.
linode/monitorlogsdestinations/tmpl/template.go Adds list destination test template helpers.
linode/monitorlogsdestinations/tmpl/data_basic.gotf Adds list destination data source test config.
linode/monitorlogsdestinations/tmpl/bucket_only.gotf Adds bucket-only teardown config.
linode/monitorlogsstream/framework_resource.go Implements stream resource CRUD/import.
linode/monitorlogsstream/framework_models.go Adds stream resource/data source models and options builders.
linode/monitorlogsstream/framework_schema_resource.go Defines stream resource schema.
linode/monitorlogsstream/framework_schema_datasource.go Defines singular stream data source schema.
linode/monitorlogsstream/framework_datasource.go Implements singular stream data source read.
linode/monitorlogsstream/framework_models_unit_test.go Adds stream model unit tests.
linode/monitorlogsstream/resource_test.go Adds long-running stream lifecycle acceptance test and invalid config tests.
linode/monitorlogsstream/datasource_test.go Adds stream data source not-found test.
linode/monitorlogsstream/tmpl/template.go Adds stream test template helpers.
linode/monitorlogsstream/tmpl/basic.gotf Adds stream basic resource test config.
linode/monitorlogsstream/tmpl/lifecycle.gotf Adds stream lifecycle config covering related data sources.
linode/monitorlogsstream/tmpl/updates.gotf Adds stream update config.
linode/monitorlogsstream/tmpl/data_basic.gotf Adds singular stream data source config.
linode/monitorlogsstream/tmpl/data_not_found.gotf Adds stream not-found data source config.
linode/monitorlogsstream/tmpl/invalid_type.gotf Adds invalid stream type config.
linode/monitorlogsstream/tmpl/invalid_destination.gotf Adds invalid destination config.
linode/monitorlogsstreams/framework_datasource.go Implements list stream data source read/filtering.
linode/monitorlogsstreams/framework_models.go Adds list stream models.
linode/monitorlogsstreams/framework_schema_datasource.go Defines list stream data source schema/filter config.
linode/monitorlogsstreams/datasource_test.go Adds skipped list stream data source test placeholder.
linode/monitorlogsstreams/tmpl/template.go Adds list stream data source template helper.
linode/monitorlogsstreams/tmpl/data_basic.gotf Adds list stream data source config.
linode/monitorlogsstreamhistory/framework_datasource.go Implements stream history data source read.
linode/monitorlogsstreamhistory/framework_models.go Adds stream history models and flattening.
linode/monitorlogsstreamhistory/framework_schema_datasource.go Defines stream history data source schema.
linode/monitorlogsstreamhistory/datasource_test.go Adds skipped stream history test placeholder.
linode/monitorlogsstreamhistory/tmpl/template.go Adds stream history template helper.
linode/monitorlogsstreamhistory/tmpl/data_basic.gotf Adds stream history data source config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linode/framework_provider.go
Comment thread linode/monitorlogsstreams/datasource_test.go
Comment thread linode/monitorlogsstreamhistory/datasource_test.go
Comment thread linode/monitorlogsstream/framework_resource.go

@yec-akamai yec-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add documentations for the new resources and data sources under /docs?

Comment thread linode/monitorlogsdestination/framework_schema_resource.go Outdated
@yec-akamai yec-akamai added community-contribution new-feature for new features in the changelog. labels Jun 2, 2026
@klipensk

klipensk commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

added docs #2359 (review)

@klipensk
klipensk requested a review from yec-akamai June 3, 2026 12:13
@klipensk klipensk changed the title [DPS-42656] [ACLP SDK][Terraform] ACLP Logs SDK Pull request ACLP Logs SDK Pull request Jun 3, 2026
@sjer-akamai
sjer-akamai force-pushed the dev branch 2 times, most recently from b3ca4ad to 4573e30 Compare June 25, 2026 07:06
klipensk and others added 11 commits June 25, 2026 09:45
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: sjerecze <sjerecze@akamai.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts:
#	linode/framework_provider.go
Signed-off-by: sjerecze <sjerecze@akamai.com>
@sjer-akamai

Copy link
Copy Markdown
Contributor

Rebased previous commits to clean up git history a bit and merged newest dev branch.

Signed-off-by: sjerecze <sjerecze@akamai.com>
return detailsAttr.GetType().(types.ObjectType).AttrTypes
}

func TestFlattenStream_AuditLogs(t *testing.T) {

@psnoch-akamai psnoch-akamai Jul 2, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I got error for this test
./framework_models_unit_test.go:310:21: opts.Type undefined (type linodego.StreamUpdateOptions has no field or method Type). Could you verify it please?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be fixed

"github.com/linode/terraform-provider-linode/v4/linode/monitorlogsstream/tmpl"
)

func TestAccDataSourceMonitorLogsStream_notFound(t *testing.T) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I got error here
./resource_test.go:124:3: cannot use []string{…} (value of type []string) as []linodego.RegionCapability value in argument to acceptance.GetRandomRegionWithCaps ./resource_test.go:124:12: cannot use linodego.CapabilityObjectStorage (constant "Object Storage" of string type linodego.RegionCapability) as string value in array or slice literal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be fixed

Signed-off-by: sjerecze <sjerecze@akamai.com>

@yec-akamai yec-akamai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tests are all passing now. Thank you!


```terraform
data "linode_monitor_logs_streams" "all" {}
```

@psnoch-akamai psnoch-akamai Jul 7, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If there is empty list of streams, it returns error:
│ Error: Failed to list resources │ │ with data.linode_monitor_logs_destinations.test, │ on config.tf line 13, in data "linode_monitor_logs_destinations" "test": │ 13: data "linode_monitor_logs_destinations" "test" { │ │ [400] [X-Filter.+and] Cannot apply filter

The same output for empty destinations and data "linode_monitor_logs_destinations" "all" {}

@sjer-akamai sjer-akamai Jul 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems to be an API issue. Applied the same fix already present in listMonitorAlertChannels in repo, moving the filtering from API to terraform. Should work now

…d destinations list.

Signed-off-by: sjerecze <sjerecze@akamai.com>

@psnoch-akamai psnoch-akamai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested locally, works fine

@yec-akamai
yec-akamai merged commit 70a0110 into linode:dev Jul 7, 2026
9 checks passed
@ezilber-akamai ezilber-akamai added project for new projects in the changelog. and removed new-feature for new features in the changelog. labels Jul 10, 2026
@ezilber-akamai ezilber-akamai changed the title ACLP Logs SDK Pull request ACLP Logs Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

project for new projects in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants