Add PCU operations support#483
Merged
Merged
Conversation
…oking, but untested and quite a few TODOs to come back to)
Adds documentation for the work in PR #483 --------- Co-authored-by: toptobes <kavinpg@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive support for PCU (Provisioned Capacity Units) operations, enabling users to manage dedicated compute capacity for databases through Terraform. The implementation includes data sources for querying PCU groups and associations, resources for managing them, and a provider function to simplify datacenter ID resolution.
Key changes:
- Adds PCU group management resources and data sources for provisioning and querying dedicated compute capacity
- Introduces a
resolve_datacenterfunction to simplify datacenter ID lookups from database resources - Updates test infrastructure to properly export environment variables for acceptance tests
Reviewed Changes
Copilot reviewed 32 out of 34 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
test/run_tests.sh |
Exports TF_ACC environment variable to enable acceptance tests |
internal/provider/validators.go |
Adds Int32 validator for greater-than-or-equal-to comparisons |
internal/provider/utils_pcu.go |
Implements core PCU service interfaces and API interaction logic |
internal/provider/util_terraform.go |
Adds helper functions for Terraform attribute merging and HTTP response handling |
internal/provider/util_misc.go |
Adds generic utility functions for nil handling and type conversions |
internal/provider/types_pcus.go |
Defines PCU data models and schema attribute builders |
internal/provider/resource_table.go |
Updates import order (cosmetic change) |
internal/provider/resource_pcu_group_test.go |
Adds acceptance tests for PCU group lifecycle |
internal/provider/resource_pcu_group_assocation.go |
Implements PCU group association resource with transfer support |
internal/provider/resource_pcu_group.go |
Implements PCU group resource with park/unpark functionality |
internal/provider/resource_database.go |
Updates comments from "All" to "FindById" |
internal/provider/provider_framework_test.go |
Adds test helper for creating Astra client |
internal/provider/provider_framework.go |
Registers new PCU data sources, resources, and functions |
internal/provider/function_resolve_datacenter.go |
Implements datacenter ID resolution function |
internal/provider/data_source_pcu_groups.go |
Implements data source for listing PCU groups |
internal/provider/data_source_pcu_group_associations.go |
Implements data source for PCU group associations |
internal/provider/data_source_pcu_group.go |
Implements data source for single PCU group lookup |
go.mod |
Updates Go version and dependency versions |
examples/ and docs/ files |
Adds documentation and examples for new PCU features |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
It's expensive both in time and money to test PCU APIs repeatedly and reliably, so it makes sense to limit this to a smoke test.
044f081 to
79b4856
Compare
bdunn313
approved these changes
Nov 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
STATUS: Currently all of the implementation code is written and in theory working, but is not tested as of yet (no actual access to PCU stuff yet). Also a lot of minor TODOs to come back to.
Adds support for the following:
pcu_groupdata sourcepcu_groupsdata sourcepcu_group_associationsdata sourceresolve_datacenterfunction (warning: requires terraform v1.8+)pcu_groupresourcepcu_group_associationresourceHad to comment out the implementations of a few other resources/data sources as the modified
astra-go-clientused in this branch has unintended breaking changes.TODOs before merging
AZUREvsAzurecoming back from API?) -> should sanitize the case of return values?astra-go-clienton related PR