Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
sinbai committed Aug 30, 2022
1 parent 939f5da commit 529d300
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ func resourceApiManagementGatewayHostNameConfiguration() *pluginsdk.Resource {
ValidateFunc: validation.StringIsNotEmpty,
},

"is_client_certificate_requested": {
"request_client_certificate_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
},

"is_http2_enabled": {
"http2_enabled": {
Type: pluginsdk.TypeBool,
Default: true,
Optional: true,
},

"is_tls10_enabled": {
"tls10_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
},

"is_tls11_enabled": {
"tls11_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
},
Expand Down Expand Up @@ -113,10 +113,10 @@ func resourceApiManagementGatewayHostNameConfigurationCreateUpdate(d *pluginsdk.
GatewayHostnameConfigurationContractProperties: &apimanagement.GatewayHostnameConfigurationContractProperties{
Hostname: utils.String(d.Get("host_name").(string)),
CertificateID: utils.String(d.Get("certificate_id").(string)),
NegotiateClientCertificate: utils.Bool(d.Get("is_client_certificate_requested").(bool)),
TLS10Enabled: utils.Bool(d.Get("is_tls10_enabled").(bool)),
TLS11Enabled: utils.Bool(d.Get("is_tls11_enabled").(bool)),
HTTP2Enabled: utils.Bool(d.Get("is_http2_enabled").(bool)),
NegotiateClientCertificate: utils.Bool(d.Get("request_client_certificate_enabled").(bool)),
TLS10Enabled: utils.Bool(d.Get("tls10_enabled").(bool)),
TLS11Enabled: utils.Bool(d.Get("tls11_enabled").(bool)),
HTTP2Enabled: utils.Bool(d.Get("http2_enabled").(bool)),
},
}

Expand Down Expand Up @@ -160,10 +160,10 @@ func resourceApiManagementGatewayHostNameConfigurationRead(d *pluginsdk.Resource
if properties := resp.GatewayHostnameConfigurationContractProperties; properties != nil {
d.Set("host_name", properties.Hostname)
d.Set("certificate_id", properties.CertificateID)
d.Set("is_client_certificate_requested", properties.NegotiateClientCertificate)
d.Set("is_tls10_enabled", properties.TLS10Enabled)
d.Set("is_tls11_enabled", properties.TLS11Enabled)
d.Set("is_http2_enabled", properties.HTTP2Enabled)
d.Set("request_client_certificate_enabled", properties.NegotiateClientCertificate)
d.Set("tls10_enabled", properties.TLS10Enabled)
d.Set("tls11_enabled", properties.TLS11Enabled)
d.Set("http2_enabled", properties.HTTP2Enabled)
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ resource "azurerm_api_management_gateway_host_name_configuration" "test" {
api_management_id = azurerm_api_management.test.id
gateway_name = azurerm_api_management_gateway.test.name
certificate_id = azurerm_api_management_certificate.test.id
host_name = "host-name-%d"
is_client_certificate_requested = false
is_http2_enabled = false
is_tls10_enabled = false
is_tls11_enabled = true
certificate_id = azurerm_api_management_certificate.test.id
host_name = "host-name-%d"
request_client_certificate_enabled = false
http2_enabled = false
tls10_enabled = false
tls11_enabled = true
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger)
}
Expand Down Expand Up @@ -264,12 +264,12 @@ resource "azurerm_api_management_gateway_host_name_configuration" "test" {
api_management_id = azurerm_api_management.test.id
gateway_name = azurerm_api_management_gateway.test.name
certificate_id = azurerm_api_management_certificate.test.id
host_name = "host-name-%d"
is_client_certificate_requested = true
is_http2_enabled = true
is_tls10_enabled = true
is_tls11_enabled = false
certificate_id = azurerm_api_management_certificate.test.id
host_name = "host-name-%d"
request_client_certificate_enabled = true
http2_enabled = true
tls10_enabled = true
tls11_enabled = false
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomInteger)
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ resource "azurerm_api_management_gateway_host_name_configuration" "example" {
api_management_id = azurerm_api_management.example.id
gateway_name = azurerm_api_management_gateway.example.name
certificate_id = azurerm_api_management_certificate.example.id
host_name = "example-host-name"
is_client_certificate_requested = true
is_http2_enabled = true
is_tls10_enabled = true
is_tls11_enabled = false
certificate_id = azurerm_api_management_certificate.example.id
host_name = "example-host-name"
request_client_certificate_enabled = true
http2_enabled = true
tls10_enabled = true
tls11_enabled = false
}
```

Expand All @@ -75,13 +75,13 @@ The following arguments are supported:

* `host_name` - (Required) The host name to use for the API Management Gateway Host Name Configuration.

* `is_client_certificate_requested` - (Optional) Whether the API Management Gateway requests a client certificate.
* `request_client_certificate_enabled` - (Optional) Whether the API Management Gateway requests a client certificate.

* `is_http2_enabled` - (Optional) Whether HTTP/2.0 is supported.
* `http2_enabled` - (Optional) Whether HTTP/2.0 is supported.

* `is_tls10_enabled` - (Optional) Whether TLS 1.0 is supported.
* `tls10_enabled` - (Optional) Whether TLS 1.0 is supported.

* `is_tls11_enabled` - (Optional) Whether TLS 1.1 is supported.
* `tls11_enabled` - (Optional) Whether TLS 1.1 is supported.

## Attributes Reference

Expand Down

0 comments on commit 529d300

Please sign in to comment.