-
Notifications
You must be signed in to change notification settings - Fork 25
Add PCU operations support #483
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
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 <[email protected]>
There was a problem hiding this comment.
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 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 <[email protected]>
Co-authored-by: Copilot <[email protected]>
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
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