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

app_service_environment resource - allow "Web, Publishing" for the internal_load_balancing_mode argument #7346

Merged
merged 5 commits into from Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from 4 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
Expand Up @@ -24,6 +24,10 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

const (
InternalLoadBalancingModeWebPublishing web.InternalLoadBalancingMode = "Web, Publishing"
)

func resourceArmAppServiceEnvironment() *schema.Resource {
return &schema.Resource{
Create: resourceArmAppServiceEnvironmentCreate,
Expand Down Expand Up @@ -61,11 +65,13 @@ func resourceArmAppServiceEnvironment() *schema.Resource {
"internal_load_balancing_mode": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Default: string(web.InternalLoadBalancingModeNone),
ValidateFunc: validation.StringInSlice([]string{
string(web.InternalLoadBalancingModeNone),
string(web.InternalLoadBalancingModePublishing),
string(web.InternalLoadBalancingModeWeb),
string(InternalLoadBalancingModeWebPublishing),
}, false),
},
jackofallops marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
Expand Up @@ -379,3 +379,39 @@ resource "azurerm_subnet" "gateway" {
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger)
}

func TestAccAzureRMAppServiceEnvironment_internalLoadBalancer(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_app_service_environment", "test")

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acceptance.PreCheck(t) },
Providers: acceptance.SupportedProviders,
CheckDestroy: testCheckAzureRMAppServiceEnvironmentDestroy,
Steps: []resource.TestStep{
{
Config: testAccAzureRMAppServiceEnvironment_internalLoadBalancerAndWhitelistedIpRanges(data),
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceEnvironmentExists(data.ResourceName),
resource.TestCheckResourceAttr(data.ResourceName, "internal_load_balancing_mode", "Web, Publishing"),
),
},
data.ImportStep(),
},
})
}

jackofallops marked this conversation as resolved.
Show resolved Hide resolved
func testAccAzureRMAppServiceEnvironment_internalLoadBalancerAndWhitelistedIpRanges(data acceptance.TestData) string {
template := testAccAzureRMAppServiceEnvironment_template(data)
return fmt.Sprintf(`
%s

resource "azurerm_app_service_environment" "test" {
name = "acctest-ase-%d"
subnet_id = azurerm_subnet.ase.id
pricing_tier = "I1"
front_end_scale_factor = 5
internal_load_balancing_mode = "Web, Publishing"
user_whitelisted_ip_ranges = ["11.22.33.44/32", "55.66.77.0/24"]
}
`, template, data.RandomInteger)
}
15 changes: 9 additions & 6 deletions website/docs/r/app_service_environment.html.markdown
Expand Up @@ -41,11 +41,12 @@ resource "azurerm_subnet" "gateway" {
}

resource "azurerm_app_service_environment" "example" {
name = "example-ase"
subnet_id = azurerm_subnet.ase.id
pricing_tier = "I2"
front_end_scale_factor = 10
user_whitelisted_ip_ranges = ["11.22.33.44/32", "55.66.77.0/24"]
name = "example-ase"
subnet_id = azurerm_subnet.ase.id
pricing_tier = "I2"
front_end_scale_factor = 10
internal_load_balancing_mode = "Web, Publishing"
user_whitelisted_ip_ranges = ["11.22.33.44/32", "55.66.77.0/24"]
}

```
Expand All @@ -58,7 +59,9 @@ resource "azurerm_app_service_environment" "example" {

~> **NOTE** a /24 or larger CIDR is required. Once associated with an ASE this size cannot be changed.

* `internal_load_balancing_mode` - (Optional) Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are `None`, `Web` and `Publishing`. Defaults to `None`.
* `internal_load_balancing_mode` - (Optional) Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values are `None`, `Web`, `Publishing` and combined value `"Web, Publishing"`. Defaults to `None`.

~> **NOTE** You should prefer to select value either `None` or combined value `"Web, Publishing"` as the other values might become deprecated in the future.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this documented / published somewhere? If not official, it's probably as well to leave this out for the time being.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is info from Microsoft ASE Program Manager - Christina - (my internal communication). No any official statement I'm aware of. Let me know what you prefer I'll change it accordingly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - I think until the official information on this is published somewhere, we should avoid preempting it, plans and IT projects do have a way of changing unexpectedly!


* `pricing_tier` - (Optional) Pricing tier for the front end instances. Possible values are `I1`, `I2` and `I3`. Defaults to `I1`.

Expand Down