You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pe...@apache.org on 2025/07/15 19:00:18 UTC

(cloudstack-terraform-provider) branch fix-firewall-creation-in-proj created (now d39b65e)

This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a change to branch fix-firewall-creation-in-proj
in repository https://gitbox.apache.org/repos/asf/cloudstack-terraform-provider.git


      at d39b65e  Fix creation of firewall & Egress firewall rules when created in a project

This branch includes the following new commits:

     new d39b65e  Fix creation of firewall & Egress firewall rules when created in a project

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(cloudstack-terraform-provider) 01/01: Fix creation of firewall & Egress firewall rules when created in a project

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a commit to branch fix-firewall-creation-in-proj
in repository https://gitbox.apache.org/repos/asf/cloudstack-terraform-provider.git

commit d39b65e9aafc3cf7dc8b324923bffa787a8c710e
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Tue Jul 15 15:00:06 2025 -0400

    Fix creation of firewall & Egress firewall rules when created in a project
---
 cloudstack/resource_cloudstack_egress_firewall.go | 12 ++++++++++++
 cloudstack/resource_cloudstack_firewall.go        | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/cloudstack/resource_cloudstack_egress_firewall.go b/cloudstack/resource_cloudstack_egress_firewall.go
index 9b7f394..e2a83e4 100644
--- a/cloudstack/resource_cloudstack_egress_firewall.go
+++ b/cloudstack/resource_cloudstack_egress_firewall.go
@@ -45,6 +45,13 @@ func resourceCloudStackEgressFirewall() *schema.Resource {
 				ForceNew: true,
 			},
 
+			"project": {
+				Type:     schema.TypeString,
+				Optional: true,
+				Computed: true,
+				ForceNew: true,
+			},
+
 			"managed": {
 				Type:     schema.TypeBool,
 				Optional: true,
@@ -265,6 +272,11 @@ func resourceCloudStackEgressFirewallRead(d *schema.ResourceData, meta interface
 	p.SetNetworkid(d.Id())
 	p.SetListall(true)
 
+	// If there is a project supplied, we retrieve and set the project id
+	if err := setProjectid(p, cs, d); err != nil {
+		return err
+	}
+
 	l, err := cs.Firewall.ListEgressFirewallRules(p)
 	if err != nil {
 		return err
diff --git a/cloudstack/resource_cloudstack_firewall.go b/cloudstack/resource_cloudstack_firewall.go
index b7ba7e0..a39628c 100644
--- a/cloudstack/resource_cloudstack_firewall.go
+++ b/cloudstack/resource_cloudstack_firewall.go
@@ -45,6 +45,13 @@ func resourceCloudStackFirewall() *schema.Resource {
 				ForceNew: true,
 			},
 
+			"project": {
+				Type:     schema.TypeString,
+				Optional: true,
+				Computed: true,
+				ForceNew: true,
+			},
+
 			"managed": {
 				Type:     schema.TypeBool,
 				Optional: true,
@@ -256,6 +263,11 @@ func resourceCloudStackFirewallRead(d *schema.ResourceData, meta interface{}) er
 	p.SetIpaddressid(d.Id())
 	p.SetListall(true)
 
+	// If there is a project supplied, we retrieve and set the project id
+	if err := setProjectid(p, cs, d); err != nil {
+		return err
+	}
+
 	l, err := cs.Firewall.ListFirewallRules(p)
 	if err != nil {
 		return err