Skip to content

Commit

Permalink
Updates to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SebRosander committed Jun 15, 2020
1 parent 21113fb commit 51ccee2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 32 deletions.
2 changes: 1 addition & 1 deletion azurerm/helpers/azure/app_service.go
Expand Up @@ -364,7 +364,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 @@ -647,7 +647,6 @@ func TestAccAzureRMAppService_scmUseMainIPRestriction(t *testing.T) {
Config: testAccAzureRMAppService_scmUseMainIPRestriction(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_use_main_ip_restriction", "true"),
),
},
data.ImportStep(),
Expand All @@ -666,8 +665,6 @@ func TestAccAzureRMAppService_scmOneIpRestriction(t *testing.T) {
Config: testAccAzureRMAppService_scmOneIpRestriction(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.ip_address", "10.10.10.10/32"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.action", "Allow"),
),
},
data.ImportStep(),
Expand All @@ -686,39 +683,20 @@ func TestAccAzureRMAppService_completeScmIpRestriction(t *testing.T) {
Config: testAccAzureRMAppService_completeScmIpRestriction(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.#", "1"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.ip_address", "10.10.10.10/32"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.name", "test-restriction"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.priority", "123"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.action", "Allow"),
),
},
data.ImportStep(),
{
Config: testAccAzureRMAppService_manyCompleteScmIpRestrictions(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.#", "2"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.ip_address", "10.10.10.10/32"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.name", "test-restriction"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.priority", "123"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.action", "Allow"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.1.ip_address", "20.20.20.0/24"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.1.name", "test-restriction-2"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.1.priority", "1234"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.1.action", "Deny"),
),
},
data.ImportStep(),
{
Config: testAccAzureRMAppService_completeScmIpRestriction(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.#", "1"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.ip_address", "10.10.10.10/32"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.name", "test-restriction"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.priority", "123"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.action", "Allow"),
),
},
data.ImportStep(),
Expand Down Expand Up @@ -752,7 +730,7 @@ func TestAccAzureRMAppService_zeroedScmIpRestriction(t *testing.T) {
CheckDestroy: testCheckAzureRMAppServiceSlotDestroy,
Steps: []resource.TestStep{
{
// This configuration includes a single explicit ip_restriction
// This configuration includes a single explicit scm_ip_restriction
Config: testAccAzureRMAppService_scmOneIpRestriction(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(data.ResourceName),
Expand All @@ -768,7 +746,7 @@ func TestAccAzureRMAppService_zeroedScmIpRestriction(t *testing.T) {
),
},
{
// This configuration explicitly sets ip_restriction to [] using attribute syntax.
// This configuration explicitly sets scm_ip_restriction to [] using attribute syntax.
Config: testAccAzureRMAppService_zeroedScmIpRestriction(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(data.ResourceName),
Expand All @@ -790,10 +768,6 @@ func TestAccAzureRMAppService_manyScmIpRestrictions(t *testing.T) {
Config: testAccAzureRMAppService_manyScmIpRestrictions(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.0.ip_address", "10.10.10.10/32"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.1.ip_address", "20.20.20.0/24"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.2.ip_address", "30.30.0.0/16"),
resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.scm_ip_restriction.3.ip_address", "192.168.1.2/24"),
),
},
data.ImportStep(),
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/app_service.html.markdown
Expand Up @@ -98,7 +98,7 @@ A `scm_ip_restriction` block exports the following:

* `name` - The name for this IP Restriction.

* `priority` - The priority for this IP Restriction. Restrictions are enforced in priority order. By default, priority is set to 65000 if not specified.
* `priority` - The priority for this IP Restriction.

* `action` - Allow or Deny access for this IP range. Defaults to Allow.

Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/app_service.html.markdown
Expand Up @@ -199,11 +199,11 @@ A `site_config` block supports the following:

* `scm_use_main_ip_restriction` - (Optional) IP security restrictions for scm to use main. Defaults to false.

-> **NOTE** Can't be use together with `scm_ip_restriction`.
-> **NOTE** Any `scm_ip_restriction` blocks configured are ignored by the service when `scm_use_main_ip_restriction` is set to `true`. Any scm restrictions will become active if this is subsequently set to `false` or removed.

* `scm_ip_restriction` - (Optional) A [List of objects](/docs/configuration/attr-as-blocks.html) representing ip restrictions as defined below.

-> **NOTE** User has to explicitly set `ip_restriction` to empty slice (`[]`) to remove it.
-> **NOTE** User has to explicitly set `scm_ip_restriction` to empty slice (`[]`) to remove it.

* `java_version` - (Optional) The version of Java to use. If specified `java_container` and `java_container_version` must also be specified. Possible values are `1.7`, `1.8` and `11` and their specific versions - except for Java 11 (e.g. `1.7.0_80`, `1.8.0_181`, `11`)

Expand Down

0 comments on commit 51ccee2

Please sign in to comment.