Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow connecting network ACL to a (VPC) network according API specs #28

Open
synergiator opened this issue Dec 27, 2021 · 2 comments
Open
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@synergiator
Copy link

synergiator commented Dec 27, 2021

As per Apache CloudStack API, the method createNetworkACL supports a network ID as parameter.

According to this provider's documentation, it offers linking network ACL to a VPC ID, but not to a given network ID.

Currently, running the call through provider indeed links the network ACL to the VPC (possibly by the VPC's API parameter), but the application of the network ACL to a network can be as I assume done only from the network side.

@harikrishna-patnala harikrishna-patnala added the enhancement New feature or request label Dec 30, 2021
@rohityadavcloud rohityadavcloud added this to the v0.5.0 milestone Jan 30, 2024
@kiranchavala
Copy link
Collaborator

@vishesh92

Need to add networkid parameter to the "resource_cloudstack_network_acl"

https://cloudstack.apache.org/api/apidocs-4.19/apis/createNetworkACL.html

https://github.com/apache/cloudstack-go/blob/main/cloudstack/NetworkACLService.go

When i performed the changes getting a build error


			"network_id": {
				Type:     schema.TypeString,
				Optional: true,
				ForceNew: true,
			},
			
			
	if networkid, ok := d.GetOk("network_id"); ok {
		p.SetNetworkid(networkid.(string))
	}

  cloudstack-terraform-provider git:(add-networkid) ✗ make build
==> Checking that code complies with gofmt requirements...
go install
# github.com/terraform-providers/terraform-provider-cloudstack/cloudstack
cloudstack/resource_cloudstack_network_acl.go:91:5: p.SetNetworkid undefined (type *"github.com/apache/cloudstack-go/v2/cloudstack".CreateNetworkACLListParams has no field or method SetNetworkid)
make: *** [build] Error 1

@vishesh92
Copy link
Member

vishesh92 commented Mar 7, 2024

@synergiator resource_cloudstack_network_acl is actually a network ACL list. And resource_cloudstack_network_acl_rule is the network ACL. Network ACL requires a aclid (ACL List's uuid). If you don't pass aclid and pass network id, cloudstack will check if the network has a VPC and checks for existing acl id. If it doesn't find one, it creates a new ACL list and use that.

@rohityadavcloud rohityadavcloud modified the milestones: v0.5.0, v0.6.0 Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants