Add support for additional optional parameters for creating network offerings#205
Merged
DaanHoogland merged 17 commits intomainfrom Aug 29, 2025
Merged
Add support for additional optional parameters for creating network offerings#205DaanHoogland merged 17 commits intomainfrom
DaanHoogland merged 17 commits intomainfrom
Conversation
Contributor
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm but one of the test jobs is failing. Do we need to adjust the test code for this?
vishesh92
reviewed
Aug 26, 2025
Member
vishesh92
left a comment
There was a problem hiding this comment.
clgtm. @Pearl1594 can you also update the docs and add tests?
…he/cloudstack-terraform-provider into add-additional-params-netOff
vishesh92
reviewed
Aug 28, 2025
vishesh92
approved these changes
Aug 29, 2025
Member
vishesh92
left a comment
There was a problem hiding this comment.
lgtm. tested some basic scenarios locally and it works as expected.
DaanHoogland
approved these changes
Aug 29, 2025
Contributor
DaanHoogland
left a comment
There was a problem hiding this comment.
tests passing now, code still looks good
kiranchavala
approved these changes
Aug 29, 2025
Collaborator
kiranchavala
left a comment
There was a problem hiding this comment.
LGTM, Tested with the newly added parameters for the "cloudstack_network_offering" and also the datasource for network offering
─ terraform apply
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# cloudstack_network_offering.default will be created
+ resource "cloudstack_network_offering" "default" {
+ conserve_mode = true
+ display_text = "Network offering created using Terraform"
+ enable = true
+ for_nsx = false
+ for_vpc = true
+ guest_ip_type = "Isolated"
+ id = (known after apply)
+ max_connections = 2
+ name = "pd-tf-test-for-vpc"
+ network_mode = "NATTED"
+ network_rate = 1000
+ service_provider_list = {
+ "Dhcp" = "VpcVirtualRouter"
+ "Dns" = "VpcVirtualRouter"
+ "Lb" = "VpcVirtualRouter"
+ "NetworkAcl" = "VpcVirtualRouter"
+ "SourceNat" = "VpcVirtualRouter"
+ "StaticNat" = "VpcVirtualRouter"
}
+ specify_as_number = false
+ specify_ip_ranges = false
+ specify_vlan = true
+ supported_services = [
+ "Dhcp",
+ "Dns",
+ "Lb",
+ "NetworkACL",
+ "SourceNat",
+ "StaticNat",
]
+ traffic_type = "GUEST"
}
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
cloudstack_network_offering.default: Creating...
cloudstack_network_offering.default: Creation complete after 1s [id=1ba9b6a6-2ebb-4a89-918f-0db5c22f03d7]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
╭─ ~/Desktop/cloudstack-India-demo/cloudstack-terraform copy ✔ ╱ 14s ╱ 02:40:38 PM
╰─ Terraform destroy
cloudstack_network_offering.default: Refreshing state... [id=1ba9b6a6-2ebb-4a89-918f-0db5c22f03d7]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
- destroy
Terraform will perform the following actions:
# cloudstack_network_offering.default will be destroyed
- resource "cloudstack_network_offering" "default" {
- conserve_mode = true -> null
- display_text = "Network offering created using Terraform" -> null
- enable = true -> null
- for_nsx = false -> null
- for_vpc = true -> null
- guest_ip_type = "Isolated" -> null
- id = "1ba9b6a6-2ebb-4a89-918f-0db5c22f03d7" -> null
- max_connections = 2 -> null
- name = "pd-tf-test-for-vpc" -> null
- network_mode = "NATTED" -> null
- network_rate = 1000 -> null
- service_provider_list = {
- "Dhcp" = "VpcVirtualRouter"
- "Dns" = "VpcVirtualRouter"
- "Lb" = "VpcVirtualRouter"
- "NetworkACL" = "VpcVirtualRouter"
- "SourceNat" = "VpcVirtualRouter"
- "StaticNat" = "VpcVirtualRouter"
} -> null
- specify_as_number = false -> null
- specify_ip_ranges = false -> null
- specify_vlan = true -> null
- supported_services = [
- "Dhcp",
- "Dns",
- "Lb",
- "NetworkACL",
- "SourceNat",
- "StaticNat",
] -> null
- traffic_type = "Guest" -> null
}
Plan: 0 to add, 0 to change, 1 to destroy.
Do you really want to destroy all resources?
Terraform will destroy all your managed infrastructure, as shown above.
There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
cloudstack_network_offering.default: Destroying... [id=1ba9b6a6-2ebb-4a89-918f-0db5c22f03d7]
cloudstack_network_offering.default: Destruction complete after 1s
Destroy complete! Resources: 1 destroyed.
data "cloudstack_network_offering" "net-off-data-source"{
filter{
name = "name"
value="pd-tf-test-for-vpc"
}
}
output "network_rate" {
value = data.cloudstack_network_offering.net-off-data-source.network_rate
}
terraform apply
cloudstack_network_offering.default: Refreshing state... [id=e763ca9c-5ada-40f7-b4b3-87e769e2c0c4]
data.cloudstack_network_offering.net-off-data-source: Reading...
data.cloudstack_network_offering.net-off-data-source: Read complete after 1s [id=e763ca9c-5ada-40f7-b4b3-87e769e2c0c4]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
- destroy
Terraform will perform the following actions:
# cloudstack_network_offering.default will be destroyed
# (because cloudstack_network_offering.default is not in configuration)
- resource "cloudstack_network_offering" "default" {
- conserve_mode = true -> null
- display_text = "Network offering created using Terraform" -> null
- enable = true -> null
- for_nsx = false -> null
- for_vpc = true -> null
- guest_ip_type = "Isolated" -> null
- id = "e763ca9c-5ada-40f7-b4b3-87e769e2c0c4" -> null
- max_connections = 2 -> null
- name = "pd-tf-test-for-vpc" -> null
- network_mode = "NATTED" -> null
- network_rate = 1000 -> null
- service_provider_list = {
- "Dhcp" = "VpcVirtualRouter"
- "Dns" = "VpcVirtualRouter"
- "Lb" = "VpcVirtualRouter"
- "NetworkACL" = "VpcVirtualRouter"
- "SourceNat" = "VpcVirtualRouter"
- "StaticNat" = "VpcVirtualRouter"
} -> null
- specify_as_number = false -> null
- specify_ip_ranges = false -> null
- specify_vlan = true -> null
- supported_services = [
- "Dhcp",
- "Dns",
- "Lb",
- "NetworkACL",
- "SourceNat",
- "StaticNat",
] -> null
- traffic_type = "Guest" -> null
}
Plan: 0 to add, 0 to change, 1 to destroy.
Changes to Outputs:
+ network_rate = 1000
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
cloudstack_network_offering.default: Destroying... [id=e763ca9c-5ada-40f7-b4b3-87e769e2c0c4]
cloudstack_network_offering.default: Destruction complete after 0s
Apply complete! Resources: 0 added, 0 changed, 1 destroyed.
Outputs:
network_rate = 1000
ianc769
pushed a commit
to ianc769/cloudstack-terraform-provider
that referenced
this pull request
Sep 3, 2025
kiranchavala
pushed a commit
that referenced
this pull request
Sep 16, 2025
* Add CloudStack project resource * Add test for empty display_text defaulting to name value * Uncomment and implement tests for accountid and userid in project resource * Minor README Fix * Update display_text to required for API compatibility and adjust documentation * Clean up tests for 4.20.1.0 * fix: include domain ID when looking up projects by ID Fix issue where getProjectByID() would always return "id not found" while getProjectByName() could find the same project. CloudStack projects are only unique within a domain context, so we now include domain ID in lookups. - Modified getProjectByID() to accept optional domain parameter - Updated all calls to include domain when available - Updated test functions accordingly - Updated documentation to clarify domain requirement for project imports * feat: add cloudstack_project data source and corresponding tests * remove rogue testing script * Update cloudstack/resource_cloudstack_project.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * adding domain validation to ensure projects are only reused within the intended scope Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Updated cloudstack go sdk to v2.17.1 (#193) * Fix creation of firewall & Egress firewall rules when created in a project * chore(deps): bump github.com/cloudflare/circl from 1.3.7 to 1.6.1 Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.7 to 1.6.1. - [Release notes](https://github.com/cloudflare/circl/releases) - [Commits](cloudflare/circl@v1.3.7...v1.6.1) --- updated-dependencies: - dependency-name: github.com/cloudflare/circl dependency-version: 1.6.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * resolve retrieveError issue * Update cloudstack/resource_cloudstack_project.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update cloudstack/resource_cloudstack_project.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Change display_text field from required to optional in resourceCloudStackProject * Pin github actions version for opentofu * rat + excludes and add licenses to other files (#200) * readme: add specific test instruction in readme (#211) Add instructions for specific test execution * data: get vpc in project by project name (#209) * Support additional parameters for cloudstack_nic resource (#210) * serviceoffering: add params for custom offering, storage tags, encryptroot (#212) * Support desc and ruleId in create_network_acl_rule * fix review comment * change rule_id -> rule_number and add doc * add params in unit tests * verify description and rule_number in unit test * use fields defined in schema * fix test verification sequence * handle review comments * Add support for additional optional parameters for creating network offerings (#205) * Add disk_offering & override_disk_offering to instance resource * Update website/docs/r/instance.html.markdown Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Allow specifying private end port & public end port for port forward rules * Update tests * Add `cloudstack_physicalnetwork` and some underlying additional resources (#201) * feat: add cidrlist parameter to loadbalancer rule (#147) * feat: add cloudstack_project resource to provider * fix: update display_text to displaytext in project resource and tests. fix: update lookup to use getAccountNameByID helper function * fix: rename display_text to displaytext in project resource and tests --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com> Co-authored-by: Pearl Dsilva <pearl1594@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: vishesh92 <vishesh92@gmail.com> Co-authored-by: dahn <daan@onecht.net> Co-authored-by: Manoj Kumar <manojkr.itbhu@gmail.com> Co-authored-by: Wei Zhou <weizhou@apache.org> Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com> Co-authored-by: ABW <49398549+chrxmvtik@users.noreply.github.com>
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.
Test done:
Terraform config:
On applying the config: