Skip to content

Commit

Permalink
Merge pull request #7059 from aqche/app_service_ip_restriction_priority
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops committed Jun 1, 2020
2 parents f8130ad + 9e79ac8 commit ba6ba57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion azurerm/helpers/azure/app_service.go
Expand Up @@ -325,7 +325,7 @@ func SchemaAppServiceSiteConfig() *schema.Schema {
"priority": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Default: 65000,
ValidateFunc: validation.IntBetween(1, 2147483647),
},
"action": {
Expand Down
Expand Up @@ -538,7 +538,7 @@ func TestAccAzureRMAppService_completeIpRestriction(t *testing.T) {
Config: testAccAzureRMAppService_manyCompleteIpRestrictions(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.#", "2"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.#", "3"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.ip_address", "10.10.10.10/32"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.name", "test-restriction"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.priority", "123"),
Expand All @@ -547,6 +547,10 @@ func TestAccAzureRMAppService_completeIpRestriction(t *testing.T) {
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.1.name", "test-restriction-2"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.1.priority", "1234"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.1.action", "Deny"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.2.ip_address", "30.30.30.0/24"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.2.name", "test-restriction-3"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.2.priority", "65000"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.2.action", "Deny"),
),
},
data.ImportStep(),
Expand Down Expand Up @@ -2737,6 +2741,12 @@ resource "azurerm_app_service" "test" {
priority = 1234
action = "Deny"
}
ip_restriction {
ip_address = "30.30.30.0/24"
name = "test-restriction-3"
action = "Deny"
}
}
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger)
Expand Down

0 comments on commit ba6ba57

Please sign in to comment.