Skip to content

Commit

Permalink
Add legacy long form project to compute firewall policy rule (#12563) (
Browse files Browse the repository at this point in the history
…#8940)

[upstream:25ca219ce93747b189a4a6501348ff812a765052]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Dec 18, 2024
1 parent 8d2f212 commit bc349d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .changelog/12563.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none

```
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func resourceComputeFirewallPolicyRuleCreate(d *schema.ResourceData, meta interf
obj["firewallPolicy"] = firewallPolicyProp
}

url, err := tpgresource.ReplaceVars(d, config, "{{ComputeBasePath}}locations/global/firewallPolicies/{{firewall_policy}}/addRule")
url, err := tpgresource.ReplaceVarsForId(d, config, "{{ComputeBasePath}}locations/global/firewallPolicies/{{firewall_policy}}/addRule")
if err != nil {
return err
}
Expand Down Expand Up @@ -376,7 +376,7 @@ func resourceComputeFirewallPolicyRuleCreate(d *schema.ResourceData, meta interf
}

// Store the ID now
id, err := tpgresource.ReplaceVars(d, config, "locations/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}}")
id, err := tpgresource.ReplaceVarsForId(d, config, "locations/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}}")
if err != nil {
return fmt.Errorf("Error constructing id: %s", err)
}
Expand Down Expand Up @@ -406,7 +406,7 @@ func resourceComputeFirewallPolicyRuleRead(d *schema.ResourceData, meta interfac
return err
}

url, err := tpgresource.ReplaceVars(d, config, "{{ComputeBasePath}}locations/global/firewallPolicies/{{firewall_policy}}/getRule?priority={{priority}}")
url, err := tpgresource.ReplaceVarsForId(d, config, "{{ComputeBasePath}}locations/global/firewallPolicies/{{firewall_policy}}/getRule?priority={{priority}}")
if err != nil {
return err
}
Expand Down Expand Up @@ -560,7 +560,7 @@ func resourceComputeFirewallPolicyRuleUpdate(d *schema.ResourceData, meta interf
obj["firewallPolicy"] = firewallPolicyProp
}

url, err := tpgresource.ReplaceVars(d, config, "{{ComputeBasePath}}locations/global/firewallPolicies/{{firewall_policy}}/patchRule?priority={{priority}}")
url, err := tpgresource.ReplaceVarsForId(d, config, "{{ComputeBasePath}}locations/global/firewallPolicies/{{firewall_policy}}/patchRule?priority={{priority}}")
if err != nil {
return err
}
Expand Down Expand Up @@ -613,7 +613,7 @@ func resourceComputeFirewallPolicyRuleDelete(d *schema.ResourceData, meta interf

billingProject := ""

url, err := tpgresource.ReplaceVars(d, config, "{{ComputeBasePath}}locations/global/firewallPolicies/{{firewall_policy}}/removeRule?priority={{priority}}")
url, err := tpgresource.ReplaceVarsForId(d, config, "{{ComputeBasePath}}locations/global/firewallPolicies/{{firewall_policy}}/removeRule?priority={{priority}}")
if err != nil {
return err
}
Expand Down Expand Up @@ -668,7 +668,7 @@ func resourceComputeFirewallPolicyRuleImport(d *schema.ResourceData, meta interf
}

// Replace import id for the resource id
id, err := tpgresource.ReplaceVars(d, config, "locations/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}}")
id, err := tpgresource.ReplaceVarsForId(d, config, "locations/global/firewallPolicies/{{firewall_policy}}/rules/{{priority}}")
if err != nil {
return nil, fmt.Errorf("Error constructing id: %s", err)
}
Expand Down

0 comments on commit bc349d5

Please sign in to comment.