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

[Deprecation] azurerm_express_route_connection - Remove private_link_fast_path_enabled #28161

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
35 changes: 12 additions & 23 deletions internal/services/network/express_route_connection_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/hashicorp/go-azure-sdk/resource-manager/network/2024-03-01/expressrouteconnections"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/network/validate"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
Expand All @@ -23,7 +24,7 @@ import (
)

func resourceExpressRouteConnection() *pluginsdk.Resource {
return &pluginsdk.Resource{
resource := &pluginsdk.Resource{
Create: resourceExpressRouteConnectionCreate,
Read: resourceExpressRouteConnectionRead,
Update: resourceExpressRouteConnectionUpdate,
Expand Down Expand Up @@ -75,11 +76,6 @@ func resourceExpressRouteConnection() *pluginsdk.Resource {
Optional: true,
},

"private_link_fast_path_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
},

"express_route_gateway_bypass_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
Expand Down Expand Up @@ -157,6 +153,16 @@ func resourceExpressRouteConnection() *pluginsdk.Resource {
},
},
}

if !features.FivePointOhBeta() {
resource.Schema["private_link_fast_path_enabled"] = &pluginsdk.Schema{
Type: pluginsdk.TypeBool,
Optional: true,
Deprecated: "'private_link_fast_path_enabled' has been deprecated as it is no longer supported by the resource and will be removed in v5.0 of the AzureRM Provider",
}
}

return resource
}

func resourceExpressRouteConnectionCreate(d *pluginsdk.ResourceData, meta interface{}) error {
Expand Down Expand Up @@ -195,14 +201,6 @@ func resourceExpressRouteConnectionCreate(d *pluginsdk.ResourceData, meta interf
},
}

privateLinkFastPath := d.GetRawConfig().AsValueMap()["private_link_fast_path_enabled"]
if !privateLinkFastPath.IsNull() {
if d.Get("private_link_fast_path_enabled").(bool) && !d.Get("express_route_gateway_bypass_enabled").(bool) {
return fmt.Errorf("`express_route_gateway_bypass_enabled` must be enabled when `private_link_fast_path_enabled` is set to `true`")
}
parameters.Properties.EnablePrivateLinkFastPath = pointer.To(d.Get("private_link_fast_path_enabled").(bool))
}

if v, ok := d.GetOk("authorization_key"); ok {
parameters.Properties.AuthorizationKey = pointer.To(v.(string))
}
Expand Down Expand Up @@ -243,7 +241,6 @@ func resourceExpressRouteConnectionRead(d *pluginsdk.ResourceData, meta interfac
d.Set("routing_weight", props.RoutingWeight)
d.Set("authorization_key", props.AuthorizationKey)
d.Set("enable_internet_security", props.EnableInternetSecurity)
d.Set("private_link_fast_path_enabled", pointer.From(props.EnablePrivateLinkFastPath))

if props.ExpressRouteGatewayBypass != nil {
d.Set("express_route_gateway_bypass_enabled", props.ExpressRouteGatewayBypass)
Expand Down Expand Up @@ -295,14 +292,6 @@ func resourceExpressRouteConnectionUpdate(d *pluginsdk.ResourceData, meta interf
},
}

privateLinkFastPath := d.GetRawConfig().AsValueMap()["private_link_fast_path_enabled"]
if !privateLinkFastPath.IsNull() {
if d.Get("private_link_fast_path_enabled").(bool) && !d.Get("express_route_gateway_bypass_enabled").(bool) {
return fmt.Errorf("`express_route_gateway_bypass_enabled` must be enabled when `private_link_fast_path_enabled` is set to `true`")
}
parameters.Properties.EnablePrivateLinkFastPath = pointer.To(d.Get("private_link_fast_path_enabled").(bool))
}

if v, ok := d.GetOk("authorization_key"); ok {
parameters.Properties.AuthorizationKey = pointer.To(v.(string))
}
Expand Down
4 changes: 4 additions & 0 deletions website/docs/5.0-upgrade-guide.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ Please follow the format in the example below for listing breaking changes in re
* The deprecated `storage_account_name` property has been removed in favour of the `storage_account_id` property.
* The deprecated `resource_manager_id` property has been removed in favour of the `id` property.

### `azurerm_express_route_connection`

* The deprecated `private_link_fast_path_enabled` property has been removed as it is no longer supported by the resource.

## Breaking Changes in Data Sources

Please follow the format in the example below for listing breaking changes in data sources:
Expand Down
2 changes: 0 additions & 2 deletions website/docs/r/express_route_connection.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ The following arguments are supported:

* `express_route_gateway_bypass_enabled` - (Optional) Specified whether Fast Path is enabled for Virtual Wan Firewall Hub. Defaults to `false`.

* `private_link_fast_path_enabled` - (Optional) Bypass the Express Route gateway when accessing private-links. When enabled `express_route_gateway_bypass_enabled` must be set to `true`.

* `routing` - (Optional) A `routing` block as defined below.

* `routing_weight` - (Optional) The routing weight associated to the Express Route Connection. Possible value is between `0` and `32000`. Defaults to `0`.
Expand Down
Loading