Skip to content
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

[datadog_logs_custom_pipeline] Add tags and description to logs pipelines #2773

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

joboccara
Copy link

@joboccara joboccara commented Jan 16, 2025

This PR adds the tags and description for pipelines to the Datadog Terraform provider.

The provider interprets the Terraform files and uses the Go SDK to invoke the Datadog public API to change the state of the logs pipelines and make them match the state expressed in the Terraform files. This PR makes it read and writes the tags and description of logs pipelines from the public API.

LOGSC-2078

@joboccara joboccara requested review from a team as code owners January 16, 2025 14:27
@joboccara joboccara marked this pull request as draft January 16, 2025 14:27
@joboccara joboccara marked this pull request as ready for review January 29, 2025 09:53
@joboccara joboccara requested a review from a team as a code owner January 29, 2025 09:53
Copy link

@InesDatadog InesDatadog left a comment

Choose a reason for hiding this comment

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

Looks good for Logs Access ✅

Copy link

@EdwinSri EdwinSri left a comment

Choose a reason for hiding this comment

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

Could you please add a PR description? 😄 I am not familiar with this part of the code so don't really understand what change is being made, why we are making this change and why my team needs to review it.

EDIT: edited out the part about linking the jira ticket since apparently github is smart enough to pick it up from the PR title

@joboccara joboccara changed the title LOGSC-2078 Add tags and description to logs pipelines [datadog_logs_custom_pipeline] Add tags and description to logs pipelines Jan 30, 2025
@@ -63,6 +63,21 @@ func dataSourceDatadogLogsPipelines() *schema.Resource {
Type: schema.TypeBool,
Computed: true,
},
"tags": {
Description: "Tags of the pipeline",
Type: schema.TypeList,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Type: schema.TypeList,
Type: schema.TypeSet,

"is_enabled": {Type: schema.TypeBool, Optional: true},
"name": {Type: schema.TypeString, Required: true},
"is_enabled": {Type: schema.TypeBool, Optional: true},
"tags": {Type: schema.TypeList, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"tags": {Type: schema.TypeList, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}},
"tags": {Type: schema.TypeSet, Optional: true, Elem: &schema.Schema{Type: schema.TypeString}},

Copy link
Author

Choose a reason for hiding this comment

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

@skarimo if we use a set isn't it a risk of changing the order of the tags?
The set has the advantage of unicity but the pipelines API already does dedup if necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants