Skip to content

Commit

Permalink
terrafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops committed Jul 31, 2023
1 parent 1a72665 commit c12f6f4
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,28 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_certificate" "test" {
name = "testacc-palc-%[2]d"
name = "testacc-palc-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
self_signed = true
self_signed = true
}
`, r.template(data), data.RandomInteger)
}

func (r LocalRulestackCertificateResource) requiresImport(data acceptance.TestData) string {
return fmt.Sprintf(`
%[1]s
resource "azurerm_palo_alto_local_rulestack_certificate" "import" {
name = azurerm_palo_alto_local_rulestack_certificate.test.name
name = azurerm_palo_alto_local_rulestack_certificate.test.name
rulestack_id = azurerm_palo_alto_local_rulestack_certificate.test.rulestack_id
self_signed = azurerm_palo_alto_local_rulestack_certificate.test.self_signed
self_signed = azurerm_palo_alto_local_rulestack_certificate.test.self_signed
}
`, r.basic(data))
}

Expand All @@ -167,14 +170,15 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_certificate" "test" {
name = "testacc-palc-%[2]d"
name = "testacc-palc-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
self_signed = true
self_signed = true
audit_comment = "Acceptance test audit comment - %[2]d"
description = "Acceptance test Desc - %[2]d"
}
`, r.template(data), data.RandomInteger)
}

Expand All @@ -187,14 +191,15 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_certificate" "test" {
name = "testacc-palc-%[2]d"
name = "testacc-palc-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
self_signed = true
self_signed = true
audit_comment = "Updated acceptance test audit comment - %[2]d"
description = "Updated acceptance test Desc - %[2]d"
}
`, r.template(data), data.RandomInteger)
}

Expand All @@ -207,7 +212,7 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_certificate" "test" {
name = "testacc-palc-%[2]d"
name = "testacc-palc-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
certificate_signer_id = "https://example.com/not-a-real-url"
Expand All @@ -217,6 +222,8 @@ resource "azurerm_palo_alto_local_rulestack_certificate" "test" {
}
`, r.template(data), data.RandomInteger)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ provider "azurerm" {
%s
resource "azurerm_palo_alto_local_rulestack_fqdn_list" "test" {
name = "testacc-pafqdn-%[2]d"
name = "testacc-pafqdn-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
fully_qualified_domain_names = ["contoso.com", "test.example.com"]
}
`, r.template(data), data.RandomInteger)
}

Expand All @@ -131,7 +132,7 @@ provider "azurerm" {
%s
resource "azurerm_palo_alto_local_rulestack_fqdn_list" "test" {
name = "testacc-pafqdn-%[2]d"
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"]
Expand All @@ -140,21 +141,24 @@ resource "azurerm_palo_alto_local_rulestack_fqdn_list" "test" {
description = "Acc Test Description - %[2]d"
}
`, r.template(data), data.RandomInteger)
}

func (r LocalRulestackFQDNList) requiresImport(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
resource "azurerm_palo_alto_local_rulestack_fqdn_list" "import" {
name = azurerm_palo_alto_local_rulestack_fqdn_list.test.name
name = azurerm_palo_alto_local_rulestack_fqdn_list.test.name
rulestack_id = azurerm_palo_alto_local_rulestack_fqdn_list.test.rulestack_id
fully_qualified_domain_names = azurerm_palo_alto_local_rulestack_fqdn_list.test.fully_qualified_domain_names
}
`, r.basic(data))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_prefix_list" "test" {
name = "testacc-palr-%[2]d"
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"]
Expand All @@ -131,10 +131,11 @@ resource "azurerm_palo_alto_local_rulestack_prefix_list" "test" {
func (r LocalRuleStackPrefixList) requiresImport(data acceptance.TestData) string {
return fmt.Sprintf(`
%[1]s
resource "azurerm_palo_alto_local_rulestack_prefix_list" "import" {
name = azurerm_palo_alto_local_rulestack_prefix_list.test.name
name = azurerm_palo_alto_local_rulestack_prefix_list.test.name
rulestack_id = azurerm_palo_alto_local_rulestack_prefix_list.test.rulestack_id
prefix_list = azurerm_palo_alto_local_rulestack_prefix_list.test.prefix_list
Expand All @@ -151,7 +152,7 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_prefix_list" "test" {
name = "testacc-palr-%[2]d"
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"]
Expand Down
55 changes: 31 additions & 24 deletions internal/services/paloalto/local_rule_stack_rule_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_rule" "test" {
name = "testacc-palr-%[2]d"
name = "testacc-palr-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
priority = 100
action = "Allow"
priority = 100
action = "Allow"
applications = ["any"]
Expand All @@ -153,20 +153,23 @@ resource "azurerm_palo_alto_local_rulestack_rule" "test" {
}
`, r.template(data), data.RandomInteger)
}

func (r LocalRuleResource) requiresImport(data acceptance.TestData) string {
return fmt.Sprintf(`
%[1]s
resource "azurerm_palo_alto_local_rulestack_rule" "import" {
name = azurerm_palo_alto_local_rulestack_rule.test.name
rulestack_id = azurerm_palo_alto_local_rulestack_rule.test.rulestack_id
priority = azurerm_palo_alto_local_rulestack_rule.test.priority
action = "Allow"
applications = azurerm_palo_alto_local_rulestack_rule.test.applications
name = azurerm_palo_alto_local_rulestack_rule.test.name
rulestack_id = azurerm_palo_alto_local_rulestack_rule.test.rulestack_id
priority = azurerm_palo_alto_local_rulestack_rule.test.priority
action = "Allow"
applications = azurerm_palo_alto_local_rulestack_rule.test.applications
destination {
cidrs = azurerm_palo_alto_local_rulestack_rule.test.destination.0.cidrs
Expand All @@ -188,10 +191,10 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_rule" "test" {
name = "testacc-palr-%[2]d"
name = "testacc-palr-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
priority = 100
action = "Allow"
priority = 100
action = "Allow"
applications = ["any"]
Expand All @@ -207,6 +210,10 @@ resource "azurerm_palo_alto_local_rulestack_rule" "test" {
`, r.template(data), data.RandomInteger)
}

Expand All @@ -219,22 +226,22 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_certificate" "test" {
name = "testacc-palc-%[2]d"
name = "testacc-palc-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
self_signed = true
self_signed = true
}
resource "azurerm_palo_alto_local_rulestack_fqdn_list" "test" {
name = "testacc-pafqdn-%[2]d"
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_rule" "test" {
name = "testacc-palr-%[2]d"
name = "testacc-palr-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
priority = 100
priority = 100
action = "DenySilent"
applications = ["any"]
Expand Down Expand Up @@ -288,16 +295,16 @@ provider "azurerm" {
%[1]s
resource "azurerm_palo_alto_local_rulestack_certificate" "test" {
name = "testacc-palc-%[2]d"
name = "testacc-palc-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
self_signed = true
self_signed = true
}
resource "azurerm_palo_alto_local_rulestack_rule" "test" {
name = "testacc-palr-%[2]d"
name = "testacc-palr-%[2]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
priority = 100
priority = 100
action = "DenySilent"
applications = ["any"]
Expand Down Expand Up @@ -345,14 +352,14 @@ resource "azurerm_resource_group" "test" {
}
resource "azurerm_palo_alto_local_rulestack_certificate" "trust" {
name = "testacc-palcT-%[1]d"
name = "testacc-palcT-%[1]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
certificate_signer_id = "https://example.com/acctest-trust-cert"
}
resource "azurerm_palo_alto_local_rulestack_certificate" "untrust" {
name = "testacc-palcU-%[1]d"
name = "testacc-palcU-%[1]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
certificate_signer_id = "https://example.com/acctest-untrust-cert"
Expand Down Expand Up @@ -380,14 +387,14 @@ resource "azurerm_palo_alto_local_rulestack" "test" {
}
resource "azurerm_palo_alto_local_rulestack_certificate" "trust" {
name = "testacc-palcT-%[1]d"
name = "testacc-palcT-%[1]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
certificate_signer_id = "https://example.com/acctest-trust-cert"
}
resource "azurerm_palo_alto_local_rulestack_certificate" "untrust" {
name = "testacc-palcU-%[1]d"
name = "testacc-palcU-%[1]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
certificate_signer_id = "https://example.com/acctest-untrust-cert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ resource "azurerm_palo_alto_local_rulestack" "test" {
}
resource "azurerm_palo_alto_local_rulestack_certificate" "test" {
name = "testacc-palc-%[1]d"
name = "testacc-palc-%[1]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
certificate_signer_id = "https://example.com/not-a-real-url"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ resource "azurerm_palo_alto_local_rulestack" "test" {
}
resource "azurerm_palo_alto_local_rulestack_certificate" "test" {
name = "testacc-palc-%[1]d"
name = "testacc-palc-%[1]d"
rulestack_id = azurerm_palo_alto_local_rulestack.test.id
certificate_signer_id = "https://example.com/not-a-real-url"
Expand Down
Loading

0 comments on commit c12f6f4

Please sign in to comment.