Skip to content

Commit

Permalink
WIP: New Resource: azurerm_app_service_environment
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Mar 14, 2018
1 parent ef4b9ae commit b737aeb
Show file tree
Hide file tree
Showing 4 changed files with 720 additions and 3 deletions.
17 changes: 14 additions & 3 deletions azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,17 @@ type ArmClient struct {
trafficManagerEndpointsClient trafficmanager.EndpointsClient

// Web
appServicePlansClient web.AppServicePlansClient
appServicesClient web.AppsClient
appServiceEnvironmentsClient web.AppServiceEnvironmentsClient
appServicePlansClient web.AppServicePlansClient
appServicesClient web.AppsClient
}

func (c *ArmClient) configureClient(client *autorest.Client, auth autorest.Authorizer) {
setUserAgent(client)
client.Authorizer = auth
client.Sender = autorest.CreateSender(withRequestLogging())
client.SkipResourceProviderRegistration = c.skipProviderRegistration
client.PollingDuration = 60 * time.Minute
client.PollingDuration = 1 * time.Hour
}

func withRequestLogging() autorest.SendDecorator {
Expand Down Expand Up @@ -828,6 +829,16 @@ func (c *ArmClient) registerTrafficManagerClients(endpoint, subscriptionId strin
}

func (c *ArmClient) registerWebClients(endpoint, subscriptionId string, auth autorest.Authorizer) {
appServiceEnvironmentsClient := web.NewAppServiceEnvironmentsClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&appServiceEnvironmentsClient.Client, auth)
// App Service Environments are s-l-o-w.
// "It takes a minimum of 2-3 hours, and a maximum of 20-30 hours to perform any scaling operation on App Service Environments"
// https://feedback.azure.com/forums/169385-web-apps/suggestions/15907903-app-service-environment-scaling-time-is-too-long
appServiceEnvironmentsClient.Client.RetryAttempts = 1800
appServiceEnvironmentsClient.Client.RetryDuration = 60 * time.Second
appServiceEnvironmentsClient.Client.PollingDuration = 30 * time.Hour
c.appServiceEnvironmentsClient = appServiceEnvironmentsClient

appServicePlansClient := web.NewAppServicePlansClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&appServicePlansClient.Client, auth)
c.appServicePlansClient = appServicePlansClient
Expand Down
1 change: 1 addition & 0 deletions azurerm/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func Provider() terraform.ResourceProvider {
"azurerm_application_insights": resourceArmApplicationInsights(),
"azurerm_application_security_group": resourceArmApplicationSecurityGroup(),
"azurerm_app_service": resourceArmAppService(),
"azurerm_app_service_environment": resourceArmAppServiceEnvironment(),
"azurerm_app_service_plan": resourceArmAppServicePlan(),
"azurerm_app_service_active_slot": resourceArmAppServiceActiveSlot(),
"azurerm_app_service_slot": resourceArmAppServiceSlot(),
Expand Down
Loading

0 comments on commit b737aeb

Please sign in to comment.