Skip to content

Commit

Permalink
Merge pull request #21 from hashicorp/main
Browse files Browse the repository at this point in the history
Fork Sync: Update from parent repository
  • Loading branch information
mbialon authored Sep 25, 2023
2 parents ba94027 + 9b327e4 commit 34d2e82
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 16 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 3.75.0 (Unreleased)

BUG FIXES:

* `azurerm_palo_alto_local_rulestack_prefix_list` - fix rulestack not being committed on delete [GH-23362]
* `azurerm_palo_alto_local_rulestack_fqdn_list` - fix rulestack not being committed on delete [GH-23362]


## 3.74.0 (September 21, 2023)

NOTES:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ func (r LocalRulestackFQDNList) Delete() sdk.ResourceFunc {
Timeout: 30 * time.Minute,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.FqdnListLocalRulestack
rulestackClient := metadata.Client.PaloAlto.Client.LocalRulestacks

id, err := fqdnlistlocalrulestack.ParseLocalRulestackFqdnListID(metadata.ResourceData.Id())
if err != nil {
Expand All @@ -201,6 +202,10 @@ func (r LocalRulestackFQDNList) Delete() sdk.ResourceFunc {
return fmt.Errorf("deleting %s: %+v", *id, err)
}

if err = rulestackClient.CommitThenPoll(ctx, rulestackId); err != nil {
return fmt.Errorf("committing Local Rulestack config for %s: %+v", id, err)
}

return nil
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ func (r LocalRuleStackPrefixList) Delete() sdk.ResourceFunc {
Timeout: 30 * time.Minute,
Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error {
client := metadata.Client.PaloAlto.Client.PrefixListLocalRulestack
rulestackClient := metadata.Client.PaloAlto.Client.LocalRulestacks

id, err := prefixlistlocalrulestack.ParseLocalRulestackPrefixListID(metadata.ResourceData.Id())
if err != nil {
Expand All @@ -196,10 +197,14 @@ func (r LocalRuleStackPrefixList) Delete() sdk.ResourceFunc {
locks.ByID(rulestackId.ID())
defer locks.UnlockByID(rulestackId.ID())

if _, err = client.Delete(ctx, *id); err != nil {
if err = client.DeleteThenPoll(ctx, *id); err != nil {
return fmt.Errorf("deleting %s: %+v", *id, err)
}

if err = rulestackClient.CommitThenPoll(ctx, rulestackId); err != nil {
return fmt.Errorf("committing Local Rulestack config for %s: %+v", id, err)
}

return nil
},
}
Expand Down
28 changes: 14 additions & 14 deletions internal/services/paloalto/local_rulestack_rule_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,6 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_fqdn_list" "test" {
name = "testacc-pafqdn-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
fully_qualified_domain_names = ["contoso.com", "test.example.com", "anothertest.example.com"]
}
resource "azurerm_palo_alto_local_rulestack_prefix_list" "test" {
name = "testacc-palr-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
prefix_list = ["10.0.0.0/8", "172.16.0.0/16"]
}
resource "azurerm_palo_alto_local_rulestack_rule" "test" {
name = "testacc-palr-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
Expand Down Expand Up @@ -529,6 +515,20 @@ resource "azurerm_palo_alto_local_rulestack_certificate" "test" {
self_signed = true
}
resource "azurerm_palo_alto_local_rulestack_fqdn_list" "test" {
name = "testacc-pafqdn-%[1]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
fully_qualified_domain_names = ["contoso.com", "test.example.com", "anothertest.example.com"]
}
resource "azurerm_palo_alto_local_rulestack_prefix_list" "test" {
name = "testacc-palr-%[1]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
prefix_list = ["10.0.0.0/8", "172.16.0.0/16"]
}
data "azurerm_client_config" "current" {}
resource "azurerm_key_vault" "test" {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/container_app.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ An `ingress` block supports the following:

* `fqdn` - The FQDN of the ingress.

* `external_enabled` - (Optional) Is this an external Ingress.
* `external_enabled` - (Optional) Are connections to this Ingress from outside the Container App Environment enabled? Defaults to `false`.

* `target_port` - (Required) The target port on the container for the Ingress traffic.

Expand Down

0 comments on commit 34d2e82

Please sign in to comment.