Unnecessary requirement for project in resources#280
Open
bhouse-nexthop wants to merge 5 commits intoapache:mainfrom
Open
Unnecessary requirement for project in resources#280bhouse-nexthop wants to merge 5 commits intoapache:mainfrom
project in resources#280bhouse-nexthop wants to merge 5 commits intoapache:mainfrom
Conversation
…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.
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.
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