Unnecessary requirement for project in resources - #280
Conversation
7dd4118 to
a55fe76
Compare
There was a problem hiding this comment.
Pull request overview
This PR makes the project attribute optional across several CloudStack resources by inheriting the project context from related resources (VPC, network, or IP address), aligning provider behavior with CloudStack API requirements and addressing #278.
Changes:
- Implement project inheritance logic in
port_forward,network,network_acl,ipaddress, andinstanceresources (plus read-path fallbacks for inherited project state). - Mark
projectasComputedwhere needed to prevent perpetual diffs when the provider populates state. - Add acceptance coverage and update docs to describe automatic project inheritance patterns.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/r/port_forward.html.markdown | Adds inheritance-focused examples and clarifies project inheritance behavior. |
| website/docs/r/network_acl.html.markdown | Adds inheritance example and updates project argument description. |
| website/docs/r/network.html.markdown | Documents VPC network project inheritance and updates project argument description. |
| website/docs/r/ipaddress.html.markdown | Adds examples for VPC/network usage and documents project inheritance. |
| website/docs/r/instance.html.markdown | Adds example demonstrating instance project inheritance from network. |
| cloudstack/resource_cloudstack_port_forward.go | Inherits project from IP address; adjusts read/list scoping to avoid missing rules in project context. |
| cloudstack/resource_cloudstack_network_acl.go | Inherits project from VPC and persists it in state for subsequent reads. |
| cloudstack/resource_cloudstack_network.go | Inherits projectid from VPC during create; adds read fallback to locate inherited-project networks. |
| cloudstack/resource_cloudstack_ipaddress.go | Inherits projectid from VPC/network during create. |
| cloudstack/resource_cloudstack_instance.go | Inherits projectid from network during create; adds read fallback to locate inherited-project instances. |
| cloudstack/resource_cloudstack_port_forward_test.go | Adds acceptance test for port forward project inheritance. |
| cloudstack/resource_cloudstack_network_test.go | Adds acceptance test for network project inheritance from VPC. |
| cloudstack/resource_cloudstack_network_acl_test.go | Adds acceptance test for network ACL project inheritance from VPC. |
| cloudstack/resource_cloudstack_ipaddress_test.go | Adds acceptance tests for IP address project inheritance from VPC/network. |
| cloudstack/resource_cloudstack_instance_test.go | Adds acceptance test for instance project inheritance from network. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@bhouse-nexthop can you check Copilot's comments? I have started the acceptance tests for this PR. |
done, can you re-request copilot review to validate? |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…it from ip address Support both explicit project specification and automatic inheritance from IP address: - Port forward inherits project from ip_address_id when no explicit project is set - Uses projectid=-1 for universal IP address lookup across projects - Updates state with inherited or explicit project during read operations - Schema updated to mark project as Optional and Computed - Maintains backward compatibility with existing implementations Changes: - Added Computed: true to project field - Modified resourceCloudStackPortForwardCreate to fetch IP address and inherit project - Modified resourceCloudStackPortForwardRead to handle universal project search - Added TestAccCloudStackPortForward_projectInheritance test case - Updated documentation with inheritance behavior and example All 4 port forward acceptance tests passing.
When creating a network in a VPC, if no explicit project is specified, the network will now automatically inherit the project from the VPC. This simplifies configuration by eliminating the need to specify the project parameter when creating networks in VPCs that belong to projects. Changes: - Modified resourceCloudStackNetworkCreate to fetch VPC details and inherit projectid when vpc_id is provided but project is not - Modified resourceCloudStackNetworkRead to handle networks with inherited projects by trying projectid=-1 when no explicit project is set - Added TestAccCloudStackNetwork_vpcProjectInheritance test case - Updated documentation with inheritance behavior and example All 14 network acceptance tests pass.
…network Implement automatic project inheritance for cloudstack_instance resource: - Instance inherits project from network_id when no explicit project is set - Only applies to Advanced networking zones - Uses projectid=-1 for universal network lookup across projects - Updates state with inherited project during read operations Changes: - Modified resourceCloudStackInstanceCreate to fetch network and inherit project - Modified resourceCloudStackInstanceRead to set project in state - Added TestAccCloudStackInstance_networkProjectInheritance test case - Updated documentation with inheritance behavior and example All 12 instance acceptance tests passing.
… VPC or network Implement automatic project inheritance for cloudstack_ipaddress resource: - IP address inherits project from vpc_id when no explicit project is set - IP address inherits project from network_id when no explicit project is set - Uses projectid=-1 for universal VPC/network lookup across projects - Updates state with inherited project during read operations Changes: - Modified resourceCloudStackIPAddressCreate to fetch VPC/network and inherit project - Modified resourceCloudStackIPAddressRead to handle universal project search - Added TestAccCloudStackIPAddress_vpcProjectInheritance test case - Added TestAccCloudStackIPAddress_networkProjectInheritance test case - Updated documentation with inheritance behavior and examples All 5 IP address acceptance tests passing.
…om VPC Implement automatic project inheritance for cloudstack_network_acl resource: - Network ACL inherits project from vpc_id when no explicit project is set - Uses projectid=-1 for universal VPC lookup across projects - Updates state with inherited project during read operations - Schema updated to mark project as Computed Changes: - Modified resourceCloudStackNetworkACLCreate to fetch VPC and inherit project - Modified resourceCloudStackNetworkACLRead to handle universal project search - Updated schema to mark project as Computed: true - Added TestAccCloudStackNetworkACL_vpcProjectInheritance test case - Updated documentation with inheritance behavior and example All 5 network ACL acceptance tests passing.
In resourceCloudStackInstanceRead, setting project before calling
setValueOrID(d, "project", ...) breaks the "preserve ID vs name"
behavior: if the user configured project as an ID, this d.Set overwrites
it with the project name, causing setValueOrID to treat it as a name and
persist the name instead of the ID.
This commit removes the early d.Set("project", vm.Project) and relies on
the existing setValueOrID(d, "project", vm.Project, vm.Projectid) later
in the function to properly preserve whether the user specified an ID or
name.
Changed 'deploy this instance to' to 'deploy this resource to' in the project argument description to accurately reflect that this is the Network ACL resource, not an instance resource.
Changed 'deploy this instance to' to 'deploy this network to' in the project argument description to accurately reflect that this is the Network resource, not an instance resource.
Changed 'deploy this instance to' to 'deploy this IP address to' in the project argument description to accurately reflect that this is the IP address resource, not an instance resource.
Added cloudstack_instance.web resource definition to the project inheritance example so it can be applied as-is. The example previously referenced cloudstack_instance.web.id without defining the resource.
The testAccCheckCloudStackNetworkACLProjectInherited function doesn't actually validate project inheritance - it only checks the ACL name. Since the test already has a state assertion that checks the project attribute (resource.TestCheckResourceAttr), this helper function is redundant and misleading. Removed the function and its call from the test.
492d5cf to
6e759b3
Compare
When project is inherited from a VPC or network during Create, the project
id is only set on the API params, not in resource state. On the following
Read, GetPublicIpAddressByID was called with an empty project and returned
count==0 for project-scoped IPs, causing the resource to be removed from
state (SetId("")). Add the same projectid=-1 read fallback already used by
the network and instance resources so inherited-project IPs are found.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Addressed the remaining Copilot comment (inherited-project IP being cleared from state) in ed6f474 via the same |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
cloudstack/resource_cloudstack_port_forward.go:130
- Project inheritance checks
ip.Projectid != ""but then persistsip.Projectto state. If the API returns a project ID without a project name, this leavesprojectempty and the subsequent Read uses an empty project scope, which can cause the resource to be cleared from state again.
if err == nil && count > 0 && ip.Projectid != "" {
log.Printf("[DEBUG] Inheriting project %s from IP address %s", ip.Projectid, d.Id())
// Set the project in the resource data for state management
d.Set("project", ip.Project)
}
cloudstack/resource_cloudstack_network_acl.go:119
resourceCloudStackNetworkACLReadlooks up the ACL list withWithProject(d.Get("project")). Ifprojectis empty in state (e.g., pre-existing resource or import), a project-scoped ACL list may not be found and will be removed from state before the later "derive project from VPC" logic can run. Consider the sameWithProject("-1")fallback used in other resources whenproject == ""and count==0.
f, count, err := cs.NetworkACL.GetNetworkACLListByID(
d.Id(),
cloudstack.WithProject(d.Get("project").(string)),
)
|
verified against simulator:
@bhouse-nexthop could you please take a look at copilot's comments |
|
Hi @bhouse-nexthop Can you check the outstanding comments, and resolve the conflicts. Thanks. |
The Read functions for cloudstack_network_acl and cloudstack_port_forward scoped their lookups to the project stored in state. When project is empty (imported resources, state from an older provider version, or an inherited project whose name the API did not return), the project-scoped lookup returns count==0 and the resource is silently cleared from state. Retry with projectid=-1 when the state project is empty and nothing was found, matching the fallback already used by the network, instance and ipaddress resources. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@sureshanaparti @sudo87 both outstanding Copilot comments are addressed in 1be6cbb. Both were the same underlying issue: Conflicts were already resolved in a0f9fec; GitHub reports the PR as mergeable against current main. |
kiranchavala
left a comment
There was a problem hiding this comment.
LGTM Tested manually
resource "cloudstack_network" "project_network" {
name = "project-network"
cidr = "10.1.1.0/24"
network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService"
project = "test-project"
zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
}
resource "cloudstack_instance" "app" {
name = "app-server"
service_offering = "Medium Instance"
network_id = cloudstack_network.project_network.id
template = "8e099212-9224-11f1-8104-bc2411614d68"
zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
# project is automatically inherited from the network
}
resource "cloudstack_vpc" "project_vpc" {
name = "project-vpc"
cidr = "10.0.0.0/16"
vpc_offering = "Default VPC offering"
project = "test-project"
zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
}
resource "cloudstack_ipaddress" "vpc_ip" {
vpc_id = cloudstack_vpc.project_vpc.id
# project is automatically inherited from the VPC
}
resource "cloudstack_vpc" "default" {
name = "test-vpc"
cidr = "10.0.0.0/8"
vpc_offering = "Default VPC Offering"
zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
project = "test-project"
}
resource "cloudstack_network" "vpc_network" {
name = "test-vpc-network"
cidr = "10.1.0.0/16"
network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks"
vpc_id = cloudstack_vpc.default.id
zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
# project is automatically inherited from the VPC
}
resource "cloudstack_vpc" "project_vpc2" {
name = "project-vpc2"
cidr = "10.0.0.0/16"
vpc_offering = "Default VPC offering"
project = "test-project"
zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
}
resource "cloudstack_network_acl" "project_acl" {
name = "project-acl"
description = "ACL for project VPC"
vpc_id = cloudstack_vpc.project_vpc2.id
# project is automatically inherited from the VPC
}
Terraform apply
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_instance.app will be created
+ resource "cloudstack_instance" "app" {
+ disk_offering = (known after apply)
+ display_name = (known after apply)
+ expunge = false
+ group = (known after apply)
+ id = (known after apply)
+ ip_address = (known after apply)
+ name = "app-server"
+ network_id = (known after apply)
+ override_disk_offering = (known after apply)
+ project = (known after apply)
+ root_disk_size = (known after apply)
+ service_offering = "Medium Instance"
+ start_vm = true
+ tags = (known after apply)
+ template = "8e099212-9224-11f1-8104-bc2411614d68"
+ uefi = false
+ zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
}
# cloudstack_ipaddress.vpc_ip will be created
+ resource "cloudstack_ipaddress" "vpc_ip" {
+ id = (known after apply)
+ ip_address = (known after apply)
+ is_portable = false
+ is_source_nat = (known after apply)
+ project = (known after apply)
+ tags = (known after apply)
+ vpc_id = (known after apply)
}
# cloudstack_network.project_network will be created
+ resource "cloudstack_network" "project_network" {
+ acl_id = "none"
+ cidr = "10.1.1.0/24"
+ display_text = (known after apply)
+ endip = (known after apply)
+ gateway = (known after apply)
+ id = (known after apply)
+ name = "project-network"
+ network_domain = (known after apply)
+ network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService"
+ project = "test-project"
+ source_nat_ip_address = (known after apply)
+ source_nat_ip_id = (known after apply)
+ startip = (known after apply)
+ tags = (known after apply)
+ zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
}
# cloudstack_network.vpc_network will be created
+ resource "cloudstack_network" "vpc_network" {
+ acl_id = "none"
+ cidr = "10.1.0.0/16"
+ display_text = (known after apply)
+ endip = (known after apply)
+ gateway = (known after apply)
+ id = (known after apply)
+ name = "test-vpc-network"
+ network_domain = (known after apply)
+ network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks"
+ project = (known after apply)
+ source_nat_ip_address = (known after apply)
+ source_nat_ip_id = (known after apply)
+ startip = (known after apply)
+ tags = (known after apply)
+ vpc_id = (known after apply)
+ zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
}
# cloudstack_network_acl.project_acl will be created
+ resource "cloudstack_network_acl" "project_acl" {
+ description = "ACL for project VPC"
+ id = (known after apply)
+ name = "project-acl"
+ project = (known after apply)
+ vpc_id = (known after apply)
}
# cloudstack_vpc.default will be created
+ resource "cloudstack_vpc" "default" {
+ cidr = "10.0.0.0/8"
+ display_text = (known after apply)
+ id = (known after apply)
+ name = "test-vpc"
+ network_domain = (known after apply)
+ project = "test-project"
+ source_nat_ip = (known after apply)
+ tags = (known after apply)
+ vpc_offering = "Default VPC Offering"
+ zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
}
# cloudstack_vpc.project_vpc will be created
+ resource "cloudstack_vpc" "project_vpc" {
+ cidr = "10.0.0.0/16"
+ display_text = (known after apply)
+ id = (known after apply)
+ name = "project-vpc"
+ network_domain = (known after apply)
+ project = "test-project"
+ source_nat_ip = (known after apply)
+ tags = (known after apply)
+ vpc_offering = "Default VPC offering"
+ zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
}
# cloudstack_vpc.project_vpc2 will be created
+ resource "cloudstack_vpc" "project_vpc2" {
+ cidr = "10.0.0.0/16"
+ display_text = (known after apply)
+ id = (known after apply)
+ name = "project-vpc2"
+ network_domain = (known after apply)
+ project = "test-project"
+ source_nat_ip = (known after apply)
+ tags = (known after apply)
+ vpc_offering = "Default VPC offering"
+ zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53"
}
Plan: 8 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_vpc.project_vpc: Creating...
cloudstack_vpc.default: Creating...
cloudstack_vpc.project_vpc2: Creating...
cloudstack_network.project_network: Creating...
cloudstack_network.project_network: Creation complete after 1s [id=f1933a08-50e0-4f6f-b6b9-f92ecad1054d]
cloudstack_instance.app: Creating...
cloudstack_vpc.project_vpc: Still creating... [00m10s elapsed]
cloudstack_vpc.default: Still creating... [00m10s elapsed]
cloudstack_vpc.project_vpc2: Still creating... [00m10s elapsed]
cloudstack_instance.app: Still creating... [00m10s elapsed]
cloudstack_vpc.project_vpc: Still creating... [00m20s elapsed]
cloudstack_vpc.default: Still creating... [00m20s elapsed]
cloudstack_vpc.project_vpc2: Still creating... [00m20s elapsed]
cloudstack_instance.app: Still creating... [00m20s elapsed]
cloudstack_vpc.default: Creation complete after 29s [id=3dcb0e19-e6b7-4f5f-99b6-4dbe35436616]
cloudstack_network.vpc_network: Creating...
cloudstack_network.vpc_network: Creation complete after 0s [id=faa726b7-6e8a-40d2-bad1-1d76b1dff677]
cloudstack_vpc.project_vpc: Still creating... [00m30s elapsed]
cloudstack_vpc.project_vpc2: Still creating... [00m30s elapsed]
cloudstack_instance.app: Still creating... [00m30s elapsed]
cloudstack_vpc.project_vpc: Still creating... [00m40s elapsed]
cloudstack_vpc.project_vpc2: Still creating... [00m40s elapsed]
cloudstack_instance.app: Still creating... [00m40s elapsed]
cloudstack_vpc.project_vpc2: Still creating... [00m50s elapsed]
cloudstack_vpc.project_vpc: Still creating... [00m50s elapsed]
cloudstack_instance.app: Still creating... [00m50s elapsed]
cloudstack_vpc.project_vpc: Creation complete after 56s [id=23ebf83d-d8c5-4ced-8cf1-09f049446362]
cloudstack_ipaddress.vpc_ip: Creating...
cloudstack_vpc.project_vpc2: Still creating... [01m00s elapsed]
cloudstack_instance.app: Still creating... [01m00s elapsed]
cloudstack_vpc.project_vpc2: Still creating... [01m10s elapsed]
cloudstack_instance.app: Still creating... [01m10s elapsed]
cloudstack_vpc.project_vpc2: Creation complete after 1m19s [id=8b2e16c3-8df4-4988-af70-df894e411127]
cloudstack_network_acl.project_acl: Creating...
cloudstack_instance.app: Creation complete after 1m19s [id=d1af869e-adb6-474a-b399-69d0bda19f02]
cloudstack_network_acl.project_acl: Creation complete after 1s [id=a325b623-ec85-4110-a342-517c03c365d9]
Terraform destroy
terraform destroy
cloudstack_vpc.project_vpc2: Refreshing state... [id=8b2e16c3-8df4-4988-af70-df894e411127]
cloudstack_vpc.default: Refreshing state... [id=3dcb0e19-e6b7-4f5f-99b6-4dbe35436616]
cloudstack_network.project_network: Refreshing state... [id=f1933a08-50e0-4f6f-b6b9-f92ecad1054d]
cloudstack_vpc.project_vpc: Refreshing state... [id=23ebf83d-d8c5-4ced-8cf1-09f049446362]
cloudstack_instance.app: Refreshing state... [id=d1af869e-adb6-474a-b399-69d0bda19f02]
cloudstack_network.vpc_network: Refreshing state... [id=faa726b7-6e8a-40d2-bad1-1d76b1dff677]
cloudstack_network_acl.project_acl: Refreshing state... [id=a325b623-ec85-4110-a342-517c03c365d9]
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_instance.app will be destroyed
- resource "cloudstack_instance" "app" {
- display_name = "app-server" -> null
- expunge = false -> null
- id = "d1af869e-adb6-474a-b399-69d0bda19f02" -> null
- ip_address = "10.1.1.135" -> null
- name = "app-server" -> null
- network_id = "f1933a08-50e0-4f6f-b6b9-f92ecad1054d" -> null
- project = "test-project" -> null
- service_offering = "Medium Instance" -> null
- start_vm = true -> null
- tags = {} -> null
- template = "8e099212-9224-11f1-8104-bc2411614d68" -> null
- uefi = false -> null
- zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53" -> null
# (2 unchanged attributes hidden)
}
# cloudstack_network.project_network will be destroyed
- resource "cloudstack_network" "project_network" {
- acl_id = "none" -> null
- cidr = "10.1.1.0/24" -> null
- display_text = "project-network" -> null
- gateway = "10.1.1.1" -> null
- id = "f1933a08-50e0-4f6f-b6b9-f92ecad1054d" -> null
- name = "project-network" -> null
- network_domain = "cs6cloud.internal" -> null
- network_offering = "DefaultIsolatedNetworkOfferingWithSourceNatService" -> null
- project = "test-project" -> null
- tags = {} -> null
- zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53" -> null
# (1 unchanged attribute hidden)
}
# cloudstack_network.vpc_network will be destroyed
- resource "cloudstack_network" "vpc_network" {
- acl_id = "none" -> null
- cidr = "10.1.0.0/16" -> null
- display_text = "test-vpc-network" -> null
- gateway = "10.1.0.1" -> null
- id = "faa726b7-6e8a-40d2-bad1-1d76b1dff677" -> null
- name = "test-vpc-network" -> null
- network_domain = "cs6cloud.internal" -> null
- network_offering = "DefaultIsolatedNetworkOfferingForVpcNetworks" -> null
- project = "test-project" -> null
- tags = {} -> null
- vpc_id = "3dcb0e19-e6b7-4f5f-99b6-4dbe35436616" -> null
- zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53" -> null
}
# cloudstack_network_acl.project_acl will be destroyed
- resource "cloudstack_network_acl" "project_acl" {
- description = "ACL for project VPC" -> null
- id = "a325b623-ec85-4110-a342-517c03c365d9" -> null
- name = "project-acl" -> null
- project = "test-project" -> null
- vpc_id = "8b2e16c3-8df4-4988-af70-df894e411127" -> null
}
# cloudstack_vpc.default will be destroyed
- resource "cloudstack_vpc" "default" {
- cidr = "10.0.0.0/8" -> null
- display_text = "test-vpc" -> null
- id = "3dcb0e19-e6b7-4f5f-99b6-4dbe35436616" -> null
- name = "test-vpc" -> null
- network_domain = "cs6cloud.internal" -> null
- project = "test-project" -> null
- source_nat_ip = "192.168.55.63" -> null
- tags = {} -> null
- vpc_offering = "Default VPC offering" -> null
- zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53" -> null
}
# cloudstack_vpc.project_vpc will be destroyed
- resource "cloudstack_vpc" "project_vpc" {
- cidr = "10.0.0.0/16" -> null
- display_text = "project-vpc" -> null
- id = "23ebf83d-d8c5-4ced-8cf1-09f049446362" -> null
- name = "project-vpc" -> null
- network_domain = "cs6cloud.internal" -> null
- project = "test-project" -> null
- source_nat_ip = "192.168.55.65" -> null
- tags = {} -> null
- vpc_offering = "Default VPC offering" -> null
- zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53" -> null
}
# cloudstack_vpc.project_vpc2 will be destroyed
- resource "cloudstack_vpc" "project_vpc2" {
- cidr = "10.0.0.0/16" -> null
- display_text = "project-vpc2" -> null
- id = "8b2e16c3-8df4-4988-af70-df894e411127" -> null
- name = "project-vpc2" -> null
- network_domain = "cs6cloud.internal" -> null
- project = "test-project" -> null
- source_nat_ip = "192.168.55.66" -> null
- tags = {} -> null
- vpc_offering = "Default VPC offering" -> null
- zone = "79ed2965-a32a-4c5e-8e6a-ddf5b0414b53" -> null
}
Plan: 0 to add, 0 to change, 7 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_acl.project_acl: Destroying... [id=a325b623-ec85-4110-a342-517c03c365d9]
cloudstack_network.vpc_network: Destroying... [id=faa726b7-6e8a-40d2-bad1-1d76b1dff677]
cloudstack_vpc.project_vpc: Destroying... [id=23ebf83d-d8c5-4ced-8cf1-09f049446362]
cloudstack_instance.app: Destroying... [id=d1af869e-adb6-474a-b399-69d0bda19f02]
cloudstack_network_acl.project_acl: Destruction complete after 1s
cloudstack_vpc.project_vpc2: Destroying... [id=8b2e16c3-8df4-4988-af70-df894e411127]
cloudstack_network.vpc_network: Destruction complete after 1s
cloudstack_vpc.default: Destroying... [id=3dcb0e19-e6b7-4f5f-99b6-4dbe35436616]
cloudstack_vpc.project_vpc: Destruction complete after 6s
projectcan be learned/inherited based on the other parameters specified. The cloudstack provider was mandatingprojectin instances where the actual cloudstack api does not require, such as on cloudstack_port_forward.This adds proper inheritance making the project completely optional in a lot of cases. You can't create an network in a different project than its associated vpc, likewise you can't create a network acl in a different project than the vpc, so you shouldn't have to specify it.
In some instances like cloudstack_port_forward and cloudstack_network_acl the project probably should be removed completely from the schema as it serves zero actual purpose, but I chose to preserve compatibility with existing users instead.
Fixes #278 - Ended up being "project" wasn't specified.