Skip to content

Add support for VPC offering resource#306

Draft
Pearl1594 wants to merge 1 commit into
mainfrom
vpc-offering-suppot
Draft

Add support for VPC offering resource#306
Pearl1594 wants to merge 1 commit into
mainfrom
vpc-offering-suppot

Conversation

@Pearl1594

Copy link
Copy Markdown
Contributor

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

replace github.com/apache/cloudstack-go/v2 => /home/pearl/sb/cloudstack-go

Copilot AI review requested due to automatic review settings July 23, 2026 18:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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_offering resource implementation (CRUD + import).
  • Added cloudstack_vpc_offering data 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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants