Skip to content

supply projectid to API read calls for firewall and egress_firewall #165

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cloudstack/resource_cloudstack_egress_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ func resourceCloudStackEgressFirewall() *schema.Resource {
},
},

"project": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},

"parallelism": {
Type: schema.TypeInt,
Optional: true,
Expand Down Expand Up @@ -265,6 +271,10 @@ func resourceCloudStackEgressFirewallRead(d *schema.ResourceData, meta interface
p.SetNetworkid(d.Id())
p.SetListall(true)

if err := cloudstack.WithProject(d.Get("project").(string))(cs, p); err != nil {
return err
}

l, err := cs.Firewall.ListEgressFirewallRules(p)
if err != nil {
return err
Expand Down
10 changes: 10 additions & 0 deletions cloudstack/resource_cloudstack_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ func resourceCloudStackFirewall() *schema.Resource {
},
},

"project": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
},

"parallelism": {
Type: schema.TypeInt,
Optional: true,
Expand Down Expand Up @@ -256,6 +262,10 @@ func resourceCloudStackFirewallRead(d *schema.ResourceData, meta interface{}) er
p.SetIpaddressid(d.Id())
p.SetListall(true)

if err := cloudstack.WithProject(d.Get("project").(string))(cs, p); err != nil {
return err
}

l, err := cs.Firewall.ListFirewallRules(p)
if err != nil {
return err
Expand Down