Skip to content

Commit 1bd3533

Browse files
committed
azurerm_nginx_deployment: Deprecate diagnose_support_enabled in v5.0
NGINXaaS is deprecating the diagnose_support_enabled field. Metrics will be enabled by default on all deployments and doesn't need to be explicity enabled via this field.
1 parent 8f3eb88 commit 1bd3533

11 files changed

+45
-60
lines changed

internal/services/nginx/nginx_api_key_resource_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,11 @@ resource "azurerm_subnet" "test" {
175175
}
176176
177177
resource "azurerm_nginx_deployment" "test" {
178-
name = "acctest-%[1]d"
179-
resource_group_name = azurerm_resource_group.test.name
180-
sku = "standardv2_Monthly"
181-
capacity = 10
182-
location = azurerm_resource_group.test.location
183-
diagnose_support_enabled = false
178+
name = "acctest-%[1]d"
179+
resource_group_name = azurerm_resource_group.test.name
180+
sku = "standardv2_Monthly"
181+
capacity = 10
182+
location = azurerm_resource_group.test.location
184183
185184
frontend_public {
186185
ip_address = [azurerm_public_ip.test.id]

internal/services/nginx/nginx_certificate_resource_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,11 @@ resource "azurerm_user_assigned_identity" "test" {
223223
224224
225225
resource "azurerm_nginx_deployment" "test" {
226-
name = "acctest-%[1]d"
227-
resource_group_name = azurerm_resource_group.test.name
228-
sku = "standardv2_Monthly"
229-
capacity = 10
230-
location = azurerm_resource_group.test.location
231-
diagnose_support_enabled = false
226+
name = "acctest-%[1]d"
227+
resource_group_name = azurerm_resource_group.test.name
228+
sku = "standardv2_Monthly"
229+
capacity = 10
230+
location = azurerm_resource_group.test.location
232231
233232
identity {
234233
type = "UserAssigned"

internal/services/nginx/nginx_configuration_resource_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,6 @@ resource "azurerm_nginx_deployment" "test" {
289289
capacity = 10
290290
location = azurerm_resource_group.test.location
291291
292-
diagnose_support_enabled = false
293-
294292
frontend_public {
295293
ip_address = [azurerm_public_ip.test.id]
296294
}

internal/services/nginx/nginx_deployment_data_source.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type DeploymentDataSourceModel struct {
2929
Location string `tfschema:"location"`
3030
Capacity int64 `tfschema:"capacity"`
3131
AutoScaleProfile []AutoScaleProfile `tfschema:"auto_scale_profile"`
32-
DiagnoseSupportEnabled bool `tfschema:"diagnose_support_enabled"`
32+
DiagnoseSupportEnabled bool `tfschema:"diagnose_support_enabled, removedInNextMajorVersion"`
3333
Email string `tfschema:"email"`
3434
IpAddress string `tfschema:"ip_address"`
3535
LoggingStorageAccount []LoggingStorageAccount `tfschema:"logging_storage_account,removedInNextMajorVersion"`
@@ -107,11 +107,6 @@ func (m DeploymentDataSource) Attributes() map[string]*pluginsdk.Schema {
107107
},
108108
},
109109

110-
"diagnose_support_enabled": {
111-
Type: pluginsdk.TypeBool,
112-
Computed: true,
113-
},
114-
115110
"email": {
116111
Type: pluginsdk.TypeString,
117112
Computed: true,
@@ -232,6 +227,12 @@ func (m DeploymentDataSource) Attributes() map[string]*pluginsdk.Schema {
232227
},
233228
},
234229
}
230+
231+
dataSource["diagnose_support_enabled"] = &pluginsdk.Schema{
232+
Deprecated: "this property is deprecated and will be removed in v5.0, metrics are enabled by default.",
233+
Type: pluginsdk.TypeBool,
234+
Computed: true,
235+
}
235236
}
236237
return dataSource
237238
}
@@ -323,7 +324,6 @@ func (m DeploymentDataSource) Read() sdk.ResourceFunc {
323324
output.IpAddress = pointer.From(props.IPAddress)
324325
output.NginxVersion = pointer.From(props.NginxVersion)
325326
output.DataplaneAPIEndpoint = pointer.From(props.DataplaneApiEndpoint)
326-
output.DiagnoseSupportEnabled = pointer.From(props.EnableDiagnosticsSupport)
327327

328328
if !features.FivePointOh() {
329329
if props.Logging != nil && props.Logging.StorageAccount != nil {
@@ -334,6 +334,7 @@ func (m DeploymentDataSource) Read() sdk.ResourceFunc {
334334
},
335335
}
336336
}
337+
output.DiagnoseSupportEnabled = pointer.From(props.EnableDiagnosticsSupport)
337338
}
338339

339340
if profile := props.NetworkProfile; profile != nil {

internal/services/nginx/nginx_deployment_resource.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type DeploymentModel struct {
7777
Location string `tfschema:"location"`
7878
Capacity int64 `tfschema:"capacity"`
7979
AutoScaleProfile []AutoScaleProfile `tfschema:"auto_scale_profile"`
80-
DiagnoseSupportEnabled bool `tfschema:"diagnose_support_enabled"`
80+
DiagnoseSupportEnabled bool `tfschema:"diagnose_support_enabled, removedInNextMajorVersion"`
8181
Email string `tfschema:"email"`
8282
IpAddress string `tfschema:"ip_address"`
8383
LoggingStorageAccount []LoggingStorageAccount `tfschema:"logging_storage_account,removedInNextMajorVersion"`
@@ -188,12 +188,6 @@ func (m DeploymentResource) Arguments() map[string]*pluginsdk.Schema {
188188
},
189189
},
190190

191-
"diagnose_support_enabled": {
192-
Type: pluginsdk.TypeBool,
193-
Optional: true,
194-
ValidateFunc: nil,
195-
},
196-
197191
"email": {
198192
Type: pluginsdk.TypeString,
199193
Optional: true,
@@ -324,6 +318,13 @@ func (m DeploymentResource) Arguments() map[string]*pluginsdk.Schema {
324318
},
325319
},
326320
}
321+
322+
resource["diagnose_support_enabled"] = &pluginsdk.Schema{
323+
Deprecated: "this property is deprecated and will be removed in v5.0, metrics are enabled by default.",
324+
Type: pluginsdk.TypeBool,
325+
Optional: true,
326+
ValidateFunc: nil,
327+
}
327328
}
328329
return resource
329330
}
@@ -397,9 +398,9 @@ func (m DeploymentResource) Create() sdk.ResourceFunc {
397398
},
398399
}
399400
}
401+
prop.EnableDiagnosticsSupport = pointer.To(model.DiagnoseSupportEnabled)
400402
}
401403

402-
prop.EnableDiagnosticsSupport = pointer.To(model.DiagnoseSupportEnabled)
403404
prop.NetworkProfile = expandNetworkProfile(model.FrontendPublic, model.FrontendPrivate, model.NetworkInterface)
404405

405406
isBasicSKU := strings.HasPrefix(model.Sku, "basic")
@@ -512,7 +513,6 @@ func (m DeploymentResource) Read() sdk.ResourceFunc {
512513
output.IpAddress = pointer.From(props.IPAddress)
513514
output.NginxVersion = pointer.From(props.NginxVersion)
514515
output.DataplaneAPIEndpoint = pointer.From(props.DataplaneApiEndpoint)
515-
output.DiagnoseSupportEnabled = pointer.From(props.EnableDiagnosticsSupport)
516516

517517
if !features.FivePointOh() {
518518
if props.Logging != nil && props.Logging.StorageAccount != nil {
@@ -523,6 +523,7 @@ func (m DeploymentResource) Read() sdk.ResourceFunc {
523523
},
524524
}
525525
}
526+
output.DiagnoseSupportEnabled = pointer.From(props.EnableDiagnosticsSupport)
526527
}
527528

528529
if profile := props.NetworkProfile; profile != nil {

internal/services/nginx/nginx_deployment_resource_test.go

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ resource "azurerm_nginx_deployment" "test" {
175175
resource_group_name = azurerm_resource_group.test.name
176176
sku = "standardv2_Monthly"
177177
location = azurerm_resource_group.test.location
178-
diagnose_support_enabled = false
179178
automatic_upgrade_channel = "stable"
180179
181180
frontend_public {
@@ -208,7 +207,6 @@ resource "azurerm_nginx_deployment" "test" {
208207
resource_group_name = azurerm_resource_group.test.name
209208
sku = "standardv2_Monthly"
210209
location = azurerm_resource_group.test.location
211-
diagnose_support_enabled = false
212210
automatic_upgrade_channel = "stable"
213211
214212
frontend_private {
@@ -243,7 +241,6 @@ resource "azurerm_nginx_deployment" "test" {
243241
resource_group_name = azurerm_resource_group.test.name
244242
sku = "standardv2_Monthly"
245243
location = azurerm_resource_group.test.location
246-
diagnose_support_enabled = false
247244
automatic_upgrade_channel = "stable"
248245
249246
frontend_public {
@@ -286,7 +283,6 @@ resource "azurerm_nginx_deployment" "test" {
286283
resource_group_name = azurerm_resource_group.test.name
287284
sku = "standardv2_Monthly"
288285
location = azurerm_resource_group.test.location
289-
diagnose_support_enabled = false
290286
automatic_upgrade_channel = "stable"
291287
292288
frontend_public {
@@ -322,14 +318,15 @@ func (a DeploymentResource) update(data acceptance.TestData) string {
322318
return fmt.Sprintf(`
323319
324320
321+
322+
325323
%s
326324
327325
resource "azurerm_nginx_deployment" "test" {
328-
name = "acctest-%[2]d"
329-
resource_group_name = azurerm_resource_group.test.name
330-
sku = "standardv2_Monthly"
331-
location = azurerm_resource_group.test.location
332-
diagnose_support_enabled = false
326+
name = "acctest-%[2]d"
327+
resource_group_name = azurerm_resource_group.test.name
328+
sku = "standardv2_Monthly"
329+
location = azurerm_resource_group.test.location
333330
334331
frontend_public {
335332
ip_address = [azurerm_public_ip.test.id]
@@ -361,7 +358,6 @@ resource "azurerm_nginx_deployment" "test" {
361358
resource_group_name = azurerm_resource_group.test.name
362359
sku = "standardv2_Monthly"
363360
location = azurerm_resource_group.test.location
364-
diagnose_support_enabled = false
365361
automatic_upgrade_channel = "stable"
366362
367363
frontend_private {
@@ -396,7 +392,6 @@ resource "azurerm_nginx_deployment" "test" {
396392
resource_group_name = azurerm_resource_group.test.name
397393
sku = "standardv2_Monthly"
398394
location = azurerm_resource_group.test.location
399-
diagnose_support_enabled = false
400395
automatic_upgrade_channel = "stable"
401396
402397
frontend_private {
@@ -431,7 +426,6 @@ resource "azurerm_nginx_deployment" "test" {
431426
resource_group_name = azurerm_resource_group.test.name
432427
sku = "standardv2_Monthly"
433428
location = azurerm_resource_group.test.location
434-
diagnose_support_enabled = false
435429
automatic_upgrade_channel = "stable"
436430
437431
frontend_public {
@@ -530,7 +524,6 @@ resource "azurerm_nginx_deployment" "test" {
530524
resource_group_name = azurerm_resource_group.test.name
531525
sku = "standardv2_Monthly"
532526
location = azurerm_resource_group.test.location
533-
diagnose_support_enabled = false
534527
automatic_upgrade_channel = "stable"
535528
536529
frontend_public {

website/docs/5.0-upgrade-guide.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ Please follow the format in the example below for listing breaking changes in re
393393

394394
* The deprecated `logging_storage_account` block has been removed in favour of the `azurerm_monitor_diagnostic_setting` resource.
395395
* The deprecated `managed_resource_group` property has been removed.
396+
* The deprecated `diagnose_support_enabled` property has been removed.
396397

397398
### `azurerm_palo_alto_next_generation_firewall_virtual_hub_local_rulestack`
398399

@@ -564,6 +565,7 @@ Please follow the format in the example below for listing breaking changes in da
564565

565566
* The deprecated `logging_storage_account` block has been removed.
566567
* The deprecated `managed_resource_group` property has been removed.
568+
* The deprecated `diagnose_support_enabled` property has been removed.
567569

568570
### `azurerm_servicebus_namespace_disaster_recovery_config`
569571

website/docs/d/nginx_deployment.html.markdown

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ In addition to the Arguments listed above - the following Attributes are exporte
4141

4242
* `auto_scale_profile` - An `auto_scale_profile` block as defined below.
4343

44-
* `diagnose_support_enabled` - Whether metrics are exported to Azure Monitor.
45-
4644
* `email` - Preferred email associated with the NGINX Deployment.
4745

4846
* `frontend_private` - A `frontend_private` block as defined below.

website/docs/r/nginx_certificate.html.markdown

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ resource "azurerm_subnet" "example" {
5555
}
5656
5757
resource "azurerm_nginx_deployment" "example" {
58-
name = "example-nginx"
59-
resource_group_name = azurerm_resource_group.example.name
60-
sku = "publicpreview_Monthly_gmz7xq9ge3py"
61-
location = azurerm_resource_group.example.location
62-
managed_resource_group = "example"
63-
diagnose_support_enabled = true
64-
58+
name = "example-nginx"
59+
resource_group_name = azurerm_resource_group.example.name
60+
sku = "publicpreview_Monthly_gmz7xq9ge3py"
61+
location = azurerm_resource_group.example.location
62+
managed_resource_group = "example"
6563
frontend_public {
6664
ip_address = [azurerm_public_ip.example.id]
6765
}

website/docs/r/nginx_configuration.html.markdown

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ resource "azurerm_subnet" "example" {
5555
}
5656
5757
resource "azurerm_nginx_deployment" "example" {
58-
name = "example-nginx"
59-
resource_group_name = azurerm_resource_group.example.name
60-
sku = "publicpreview_Monthly_gmz7xq9ge3py"
61-
location = azurerm_resource_group.example.location
62-
diagnose_support_enabled = true
58+
name = "example-nginx"
59+
resource_group_name = azurerm_resource_group.example.name
60+
sku = "publicpreview_Monthly_gmz7xq9ge3py"
61+
location = azurerm_resource_group.example.location
6362
6463
frontend_public {
6564
ip_address = [azurerm_public_ip.example.id]

0 commit comments

Comments
 (0)