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_environment - support for internal_ip_address, service_ip_address, outbound_ip_addresses #12026

Merged
merged 2 commits into from
Jun 3, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions azurerm/internal/services/web/app_service_environment_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,26 @@ func resourceAppServiceEnvironment() *pluginsdk.Resource {
"tags": tags.ForceNewSchema(),

// Computed

// VipInfo
"internal_ip_address": {
Type: pluginsdk.TypeString,
Computed: true,
},

"service_ip_address": {
Type: pluginsdk.TypeString,
Computed: true,
},

"outbound_ip_addresses": {
Type: pluginsdk.TypeList,
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
},
Computed: true,
},

"location": {
Type: pluginsdk.TypeString,
Computed: true,
Expand Down Expand Up @@ -386,6 +406,19 @@ func resourceAppServiceEnvironmentRead(d *pluginsdk.ResourceData, meta interface
d.Set("cluster_setting", flattenClusterSettings(props.ClusterSettings))
}

// Get IP attributes for ASE.
vipInfo, err := client.GetVipInfo(ctx, id.ResourceGroup, id.HostingEnvironmentName)
if err != nil {
if utils.ResponseWasNotFound(vipInfo.Response) {
return fmt.Errorf("Error retrieving VIP info: App Service Environment %q (Resource Group %q) was not found", id.HostingEnvironmentName, id.ResourceGroup)
}
return fmt.Errorf("Error retrieving VIP info App Service Environment %q (Resource Group %q): %+v", id.HostingEnvironmentName, id.ResourceGroup, err)
}

d.Set("internal_ip_address", vipInfo.InternalIPAddress)
d.Set("service_ip_address", vipInfo.ServiceIPAddress)
d.Set("outbound_ip_addresses", vipInfo.OutboundIPAddresses)

return tags.FlattenAndSet(d, existing.Tags)
}

Expand Down
6 changes: 6 additions & 0 deletions website/docs/r/app_service_environment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,14 @@ A `cluster_setting` block supports the following:

* `id` - The ID of the App Service Environment.

* `internal_ip_address` - IP address of internal load balancer of the App Service Environment.

* `location` - The location where the App Service Environment exists.

* `outbound_ip_addresses` - List of outbound IP addresses of the App Service Environment.

* `service_ip_address` - IP address of service endpoint of the App Service Environment.

## Timeouts

The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions:
Expand Down