Add support for VPC offering resource#306
Draft
Pearl1594 wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Terraform support for managing and querying CloudStack VPC offerings by introducing a new cloudstack_vpc_offering resource and cloudstack_vpc_offering data source, along with acceptance tests and website documentation.
Changes:
- Added
cloudstack_vpc_offeringresource implementation (CRUD + import). - Added
cloudstack_vpc_offeringdata source with filter support and acceptance tests. - Added provider registration and website docs for both the resource and data source.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/r/vpc_offering.html.markdown | Adds resource documentation and usage example for cloudstack_vpc_offering. |
| website/docs/d/vpc_offering.html.markdown | Adds data source documentation and example for data.cloudstack_vpc_offering. |
| cloudstack/resource_cloudstack_vpc_offering.go | Implements the VPC offering Terraform resource (schema + CRUD). |
| cloudstack/resource_cloudstack_vpc_offering_test.go | Adds acceptance tests for the new VPC offering resource (basic, capabilities, import). |
| cloudstack/provider.go | Registers the new resource and data source in the provider. |
| cloudstack/data_source_cloudstack_vpc_offering.go | Implements the VPC offering data source, including filtering and attribute population. |
| cloudstack/data_source_cloudstack_vpc_offering_test.go | Adds acceptance tests for the new VPC offering data source. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+55
to
+61
| "zone_id": { | ||
| Type: schema.TypeList, | ||
| Elem: &schema.Schema{Type: schema.TypeString}, | ||
| Optional: true, | ||
| Description: "the ID of the containing zone(s), null for public offerings", | ||
| ForceNew: true, | ||
| }, |
Comment on lines
+222
to
+226
| updatedName := strings.ReplaceAll(m["name"].(string), "_", "") | ||
| vpcOfferingField, ok := vpcOfferingJSON[updatedName].(string) | ||
| if !ok { | ||
| continue | ||
| } |
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.
Depends on: apache/cloudstack-go#158
Can be tested by locally pointing to the local go repo by adding the following like to go.mod