Skip to content

Conversation

alextmeyer
Copy link
Contributor

No description provided.

@alextmeyer alextmeyer requested review from a team as code owners October 1, 2025 18:37
@alextmeyer alextmeyer changed the title [CCA-1173] Add support for Cloud Cost Google Cloud Usage Cost Config resource and data source [datadog_gcp_uc_config] Add support for Cloud Cost Google Cloud Usage Cost Config resource and data source Oct 1, 2025
@alextmeyer alextmeyer requested a review from a team October 1, 2025 20:50
Copy link
Contributor

@buraizu buraizu left a comment

Choose a reason for hiding this comment

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

Approving with one minor update requested for accessibility

ProjectId types.String `tfsdk:"project_id"`
ServiceAccount types.String `tfsdk:"service_account"`
Status types.String `tfsdk:"status"`
StatusUpdatedAt types.String `tfsdk:"status_updated_at"`
Copy link

Choose a reason for hiding this comment

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

Could we convert timestamps to RFC 3339 format? Terraform has a library for timestamps and that's the recommended format: https://github.com/hashicorp/terraform-plugin-framework-timetypes

Caveat that we need timezone information for the timestamp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is only used in one place int he datadog terraform provider with other timestamps across data sources represented as strings. For consistency I will leave this as is for now. Given this is a data source I'd expect users to infrequently use this anyways (referencing an already existing config independent of the actual resource referencing it)

Description: "The current status of the GCP Usage Cost configuration (for example, active, error, or archived).",
},
"status_updated_at": schema.StringAttribute{
Computed: true,
Copy link

Choose a reason for hiding this comment

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

If this is converted to RFC 3339 then we'd add:
CustomType: timetypes.NewRFC3339Type()
and it would validate automatically.

state.CreatedAt = types.StringValue(attributes.GetCreatedAt())
state.Months = types.Int64Value(int64(attributes.GetMonths()))
state.ProjectId = types.StringValue(attributes.GetProjectId())
state.StatusUpdatedAt = types.StringValue(attributes.GetStatusUpdatedAt())
Copy link

Choose a reason for hiding this comment

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

Pretty sure this is where the actual conversion would take place from 2025-10-01T18:20:01.684913. If we're using UTC for timestamps then we'd need to add that as an assumption.

@alextmeyer
Copy link
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link

dd-devflow-routing-codex bot commented Oct 3, 2025

View all feedbacks in Devflow UI.

2025-10-03 14:07:45 UTC ℹ️ Start processing command /merge


2025-10-03 14:07:52 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 26m (p90).


2025-10-03 14:34:20 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit e95d372 into master Oct 3, 2025
12 checks passed
@dd-mergequeue dd-mergequeue bot deleted the alex.meyer/dd-ccm-gcp-uc-config-resource-datasource branch October 3, 2025 14:34
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.

5 participants