Skip to content

Commit

Permalink
Merge pull request #2745 from terraform-providers/b/application-gatew…
Browse files Browse the repository at this point in the history
…ay-http2

r/application_gateway: reading `EnableHTTP2` from the props block
  • Loading branch information
tombuildsstuff authored Jan 23, 2019
2 parents d90c022 + 45c8be5 commit 4fe5778
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions azurerm/resource_arm_application_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ func resourceArmApplicationGateway() *schema.Resource {

"location": locationSchema(),

"enable_http2": {
Type: schema.TypeBool,
Optional: true,
},

"resource_group_name": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -483,6 +478,11 @@ func resourceArmApplicationGateway() *schema.Resource {
},
},

"enable_http2": {
Type: schema.TypeBool,
Optional: true,
},

"probe": {
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -873,7 +873,6 @@ func resourceArmApplicationGatewayRead(d *schema.ResourceData, meta interface{})

d.Set("name", applicationGateway.Name)
d.Set("resource_group_name", id.ResourceGroup)
d.Set("enable_http2", applicationGateway.EnableHTTP2)
if location := applicationGateway.Location; location != nil {
d.Set("location", azureRMNormalizeLocation(*location))
}
Expand All @@ -900,6 +899,8 @@ func resourceArmApplicationGatewayRead(d *schema.ResourceData, meta interface{})
return fmt.Errorf("Error setting `disabled_ssl_protocols`: %+v", setErr)
}

d.Set("enable_http2", props.EnableHTTP2)

httpListeners, err := flattenApplicationGatewayHTTPListeners(props.HTTPListeners)
if err != nil {
return fmt.Errorf("Error flattening `http_listener`: %+v", err)
Expand All @@ -908,10 +909,6 @@ func resourceArmApplicationGatewayRead(d *schema.ResourceData, meta interface{})
return fmt.Errorf("Error setting `http_listener`: %+v", setErr)
}

if setErr := d.Set("gateway_ip_configuration", flattenApplicationGatewayIPConfigurations(props.GatewayIPConfigurations)); setErr != nil {
return fmt.Errorf("Error setting `gateway_ip_configuration`: %+v", setErr)
}

if setErr := d.Set("frontend_port", flattenApplicationGatewayFrontendPorts(props.FrontendPorts)); setErr != nil {
return fmt.Errorf("Error setting `frontend_port`: %+v", setErr)
}
Expand All @@ -920,6 +917,10 @@ func resourceArmApplicationGatewayRead(d *schema.ResourceData, meta interface{})
return fmt.Errorf("Error setting `frontend_ip_configuration`: %+v", setErr)
}

if setErr := d.Set("gateway_ip_configuration", flattenApplicationGatewayIPConfigurations(props.GatewayIPConfigurations)); setErr != nil {
return fmt.Errorf("Error setting `gateway_ip_configuration`: %+v", setErr)
}

if setErr := d.Set("probe", flattenApplicationGatewayProbes(props.Probes)); setErr != nil {
return fmt.Errorf("Error setting `probe`: %+v", setErr)
}
Expand Down

0 comments on commit 4fe5778

Please sign in to comment.