Skip to content
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

azurerm_app_service ip_restriction - add default for priority #7059

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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