Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_container_registry - Deprecate network_rule_set.virtual_network #24140

Merged
merged 1 commit into from
Dec 7, 2023
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
10 changes: 9 additions & 1 deletion internal/services/containers/container_registry_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/helpers/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/migration"
containerValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/containers/validate"
keyVaultValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/validate"
Expand Down Expand Up @@ -899,7 +900,7 @@ func flattenExportPolicy(p *registries.Policies) bool {
}

func resourceContainerRegistrySchema() map[string]*pluginsdk.Schema {
return map[string]*pluginsdk.Schema{
schema := map[string]*pluginsdk.Schema{
"name": {
Type: pluginsdk.TypeString,
Required: true,
Expand Down Expand Up @@ -1045,6 +1046,7 @@ func resourceContainerRegistrySchema() map[string]*pluginsdk.Schema {
},

"virtual_network": {
Deprecated: " This is only used exclusively for service endpoints (which is a feature being deprecated). Users are expected to use Private Endpoints instead",
Type: pluginsdk.TypeSet,
Optional: true,
ConfigMode: pluginsdk.SchemaConfigModeAttr,
Expand Down Expand Up @@ -1149,4 +1151,10 @@ func resourceContainerRegistrySchema() map[string]*pluginsdk.Schema {

"tags": commonschema.Tags(),
}

if features.FourPointOhBeta() {
delete(schema["network_rule_set"].Elem.(*pluginsdk.Resource).Schema, "virtual_network")
}

return schema
}
10 changes: 0 additions & 10 deletions website/docs/r/container_registry.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ The `network_rule_set` block supports the following:

* `ip_rule` - (Optional) One or more `ip_rule` blocks as defined below.

* `virtual_network` - (Optional) One or more `virtual_network` blocks as defined below.

~> **NOTE:** `network_rule_set` is only supported with the `Premium` SKU at this time.

~> **NOTE:** Azure automatically configures Network Rules - to remove these you'll need to specify an `network_rule_set` block with `default_action` set to `Deny`.
Expand All @@ -219,14 +217,6 @@ The `ip_rule` block supports the following:

---

The `virtual_network` block supports the following:

* `action` - (Required) The behaviour for requests matching this rule. At this time the only supported value is `Allow`

* `subnet_id` - (Required) The subnet id from which requests will match the rule.

---

The `trust_policy` block supports the following:

* `enabled` - (Optional) Boolean value that indicates whether the policy is enabled.
Expand Down
Loading