Skip to content
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
11 changes: 5 additions & 6 deletions internal/services/nginx/nginx_api_key_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,11 @@ resource "azurerm_subnet" "test" {
}

resource "azurerm_nginx_deployment" "test" {
name = "acctest-%[1]d"
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
capacity = 10
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
name = "acctest-%[1]d"
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
capacity = 10
location = azurerm_resource_group.test.location

frontend_public {
ip_address = [azurerm_public_ip.test.id]
Expand Down
11 changes: 5 additions & 6 deletions internal/services/nginx/nginx_certificate_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,11 @@ resource "azurerm_user_assigned_identity" "test" {


resource "azurerm_nginx_deployment" "test" {
name = "acctest-%[1]d"
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
capacity = 10
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
name = "acctest-%[1]d"
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
capacity = 10
location = azurerm_resource_group.test.location

identity {
type = "UserAssigned"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,6 @@ resource "azurerm_nginx_deployment" "test" {
capacity = 10
location = azurerm_resource_group.test.location

diagnose_support_enabled = false

frontend_public {
ip_address = [azurerm_public_ip.test.id]
}
Expand Down
15 changes: 8 additions & 7 deletions internal/services/nginx/nginx_deployment_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type DeploymentDataSourceModel struct {
Location string `tfschema:"location"`
Capacity int64 `tfschema:"capacity"`
AutoScaleProfile []AutoScaleProfile `tfschema:"auto_scale_profile"`
DiagnoseSupportEnabled bool `tfschema:"diagnose_support_enabled"`
DiagnoseSupportEnabled bool `tfschema:"diagnose_support_enabled, removedInNextMajorVersion"`
Email string `tfschema:"email"`
IpAddress string `tfschema:"ip_address"`
LoggingStorageAccount []LoggingStorageAccount `tfschema:"logging_storage_account,removedInNextMajorVersion"`
Expand Down Expand Up @@ -107,11 +107,6 @@ func (m DeploymentDataSource) Attributes() map[string]*pluginsdk.Schema {
},
},

"diagnose_support_enabled": {
Type: pluginsdk.TypeBool,
Computed: true,
},

"email": {
Type: pluginsdk.TypeString,
Computed: true,
Expand Down Expand Up @@ -232,6 +227,12 @@ func (m DeploymentDataSource) Attributes() map[string]*pluginsdk.Schema {
},
},
}

dataSource["diagnose_support_enabled"] = &pluginsdk.Schema{
Deprecated: "this property is deprecated and will be removed in v5.0, metrics are enabled by default.",
Type: pluginsdk.TypeBool,
Computed: true,
}
}
return dataSource
}
Expand Down Expand Up @@ -323,7 +324,6 @@ func (m DeploymentDataSource) Read() sdk.ResourceFunc {
output.IpAddress = pointer.From(props.IPAddress)
output.NginxVersion = pointer.From(props.NginxVersion)
output.DataplaneAPIEndpoint = pointer.From(props.DataplaneApiEndpoint)
output.DiagnoseSupportEnabled = pointer.From(props.EnableDiagnosticsSupport)

if !features.FivePointOh() {
if props.Logging != nil && props.Logging.StorageAccount != nil {
Expand All @@ -334,6 +334,7 @@ func (m DeploymentDataSource) Read() sdk.ResourceFunc {
},
}
}
output.DiagnoseSupportEnabled = pointer.From(props.EnableDiagnosticsSupport)
}

if profile := props.NetworkProfile; profile != nil {
Expand Down
18 changes: 9 additions & 9 deletions internal/services/nginx/nginx_deployment_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type DeploymentModel struct {
Location string `tfschema:"location"`
Capacity int64 `tfschema:"capacity"`
AutoScaleProfile []AutoScaleProfile `tfschema:"auto_scale_profile"`
DiagnoseSupportEnabled bool `tfschema:"diagnose_support_enabled"`
DiagnoseSupportEnabled bool `tfschema:"diagnose_support_enabled, removedInNextMajorVersion"`
Email string `tfschema:"email"`
IpAddress string `tfschema:"ip_address"`
LoggingStorageAccount []LoggingStorageAccount `tfschema:"logging_storage_account,removedInNextMajorVersion"`
Expand Down Expand Up @@ -188,12 +188,6 @@ func (m DeploymentResource) Arguments() map[string]*pluginsdk.Schema {
},
},

"diagnose_support_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
ValidateFunc: nil,
},

"email": {
Type: pluginsdk.TypeString,
Optional: true,
Expand Down Expand Up @@ -324,6 +318,12 @@ func (m DeploymentResource) Arguments() map[string]*pluginsdk.Schema {
},
},
}

resource["diagnose_support_enabled"] = &pluginsdk.Schema{
Deprecated: "this property is deprecated and will be removed in v5.0, metrics are enabled by default.",
Type: pluginsdk.TypeBool,
Optional: true,
}
}
return resource
}
Expand Down Expand Up @@ -397,9 +397,9 @@ func (m DeploymentResource) Create() sdk.ResourceFunc {
},
}
}
prop.EnableDiagnosticsSupport = pointer.To(model.DiagnoseSupportEnabled)
}

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

isBasicSKU := strings.HasPrefix(model.Sku, "basic")
Expand Down Expand Up @@ -512,7 +512,6 @@ func (m DeploymentResource) Read() sdk.ResourceFunc {
output.IpAddress = pointer.From(props.IPAddress)
output.NginxVersion = pointer.From(props.NginxVersion)
output.DataplaneAPIEndpoint = pointer.From(props.DataplaneApiEndpoint)
output.DiagnoseSupportEnabled = pointer.From(props.EnableDiagnosticsSupport)

if !features.FivePointOh() {
if props.Logging != nil && props.Logging.StorageAccount != nil {
Expand All @@ -523,6 +522,7 @@ func (m DeploymentResource) Read() sdk.ResourceFunc {
},
}
}
output.DiagnoseSupportEnabled = pointer.From(props.EnableDiagnosticsSupport)
}

if profile := props.NetworkProfile; profile != nil {
Expand Down
17 changes: 4 additions & 13 deletions internal/services/nginx/nginx_deployment_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ resource "azurerm_nginx_deployment" "test" {
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
automatic_upgrade_channel = "stable"

frontend_public {
Expand Down Expand Up @@ -208,7 +207,6 @@ resource "azurerm_nginx_deployment" "test" {
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
automatic_upgrade_channel = "stable"

frontend_private {
Expand Down Expand Up @@ -243,7 +241,6 @@ resource "azurerm_nginx_deployment" "test" {
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
automatic_upgrade_channel = "stable"

frontend_public {
Expand Down Expand Up @@ -286,7 +283,6 @@ resource "azurerm_nginx_deployment" "test" {
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
automatic_upgrade_channel = "stable"

frontend_public {
Expand Down Expand Up @@ -325,11 +321,10 @@ func (a DeploymentResource) update(data acceptance.TestData) string {
%s

resource "azurerm_nginx_deployment" "test" {
name = "acctest-%[2]d"
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
name = "acctest-%[2]d"
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.test.location

frontend_public {
ip_address = [azurerm_public_ip.test.id]
Expand Down Expand Up @@ -361,7 +356,6 @@ resource "azurerm_nginx_deployment" "test" {
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
automatic_upgrade_channel = "stable"

frontend_private {
Expand Down Expand Up @@ -396,7 +390,6 @@ resource "azurerm_nginx_deployment" "test" {
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
automatic_upgrade_channel = "stable"

frontend_private {
Expand Down Expand Up @@ -431,7 +424,6 @@ resource "azurerm_nginx_deployment" "test" {
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
automatic_upgrade_channel = "stable"

frontend_public {
Expand Down Expand Up @@ -530,7 +522,6 @@ resource "azurerm_nginx_deployment" "test" {
resource_group_name = azurerm_resource_group.test.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.test.location
diagnose_support_enabled = false
automatic_upgrade_channel = "stable"

frontend_public {
Expand Down
2 changes: 2 additions & 0 deletions website/docs/5.0-upgrade-guide.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ Please follow the format in the example below for listing breaking changes in re

* The deprecated `logging_storage_account` block has been removed in favour of the `azurerm_monitor_diagnostic_setting` resource.
* The deprecated `managed_resource_group` property has been removed.
* The deprecated `diagnose_support_enabled` property has been removed.

### `azurerm_palo_alto_next_generation_firewall_virtual_hub_local_rulestack`

Expand Down Expand Up @@ -568,6 +569,7 @@ Please follow the format in the example below for listing breaking changes in da

* The deprecated `logging_storage_account` block has been removed.
* The deprecated `managed_resource_group` property has been removed.
* The deprecated `diagnose_support_enabled` property has been removed.

### `azurerm_servicebus_namespace_disaster_recovery_config`

Expand Down
2 changes: 0 additions & 2 deletions website/docs/d/nginx_deployment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ In addition to the Arguments listed above - the following Attributes are exporte

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

* `diagnose_support_enabled` - Whether metrics are exported to Azure Monitor.

* `email` - Preferred email associated with the NGINX Deployment.

* `frontend_private` - A `frontend_private` block as defined below.
Expand Down
12 changes: 5 additions & 7 deletions website/docs/r/nginx_certificate.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ resource "azurerm_subnet" "example" {
}

resource "azurerm_nginx_deployment" "example" {
name = "example-nginx"
resource_group_name = azurerm_resource_group.example.name
sku = "publicpreview_Monthly_gmz7xq9ge3py"
location = azurerm_resource_group.example.location
managed_resource_group = "example"
diagnose_support_enabled = true

name = "example-nginx"
resource_group_name = azurerm_resource_group.example.name
sku = "publicpreview_Monthly_gmz7xq9ge3py"
location = azurerm_resource_group.example.location
managed_resource_group = "example"
frontend_public {
ip_address = [azurerm_public_ip.example.id]
}
Expand Down
9 changes: 4 additions & 5 deletions website/docs/r/nginx_configuration.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ resource "azurerm_subnet" "example" {
}

resource "azurerm_nginx_deployment" "example" {
name = "example-nginx"
resource_group_name = azurerm_resource_group.example.name
sku = "publicpreview_Monthly_gmz7xq9ge3py"
location = azurerm_resource_group.example.location
diagnose_support_enabled = true
name = "example-nginx"
resource_group_name = azurerm_resource_group.example.name
sku = "publicpreview_Monthly_gmz7xq9ge3py"
location = azurerm_resource_group.example.location

frontend_public {
ip_address = [azurerm_public_ip.example.id]
Expand Down
3 changes: 0 additions & 3 deletions website/docs/r/nginx_deployment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ resource "azurerm_nginx_deployment" "example" {
resource_group_name = azurerm_resource_group.example.name
sku = "standardv3_Monthly"
location = azurerm_resource_group.example.location
diagnose_support_enabled = true
automatic_upgrade_channel = "stable"

frontend_public {
Expand Down Expand Up @@ -99,8 +98,6 @@ The following arguments are supported:

* `auto_scale_profile` - (Optional) An `auto_scale_profile` block as defined below.

* `diagnose_support_enabled` - (Optional) Should the metrics be exported to Azure Monitor?

* `email` - (Optional) Specify the preferred support contact email address for receiving alerts and notifications.

* `identity` - (Optional) An `identity` block as defined below.
Expand Down
Loading