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_express_route_circuit - add support for the rate_limiting_enabled property #28659

Merged
merged 12 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from 8 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: 11 additions & 0 deletions internal/services/network/express_route_circuit_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ func resourceExpressRouteCircuit() *pluginsdk.Resource {
ValidateFunc: expressrouteports.ValidateExpressRoutePortID,
},

"enable_rate_limiting": {
catriona-m marked this conversation as resolved.
Show resolved Hide resolved
Type: pluginsdk.TypeBool,
Optional: true,
Default: false,
},

"service_provider_provisioning_state": {
Type: pluginsdk.TypeString,
Computed: true,
Expand Down Expand Up @@ -294,6 +300,10 @@ func resourceExpressRouteCircuitUpdate(d *pluginsdk.ResourceData, meta interface
payload.Properties.AllowClassicOperations = pointer.To(d.Get("allow_classic_operations").(bool))
}

if d.HasChange("enable_rate_limiting") {
payload.Properties.EnableDirectPortRateLimit = pointer.To(d.Get("enable_rate_limiting").(bool))
}

if d.HasChange("bandwidth_in_gbps") {
payload.Properties.BandwidthInGbps = utils.Float(d.Get("bandwidth_in_gbps").(float64))
}
Expand Down Expand Up @@ -373,6 +383,7 @@ func resourceExpressRouteCircuitRead(d *pluginsdk.ResourceData, meta interface{}
d.Set("service_provider_provisioning_state", string(pointer.From(props.ServiceProviderProvisioningState)))
d.Set("service_key", props.ServiceKey)
d.Set("allow_classic_operations", props.AllowClassicOperations)
d.Set("enable_rate_limiting", props.EnableDirectPortRateLimit)

if serviceProviderProps := props.ServiceProviderProperties; serviceProviderProps != nil {
d.Set("service_provider_name", serviceProviderProps.ServiceProviderName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ resource "azurerm_express_route_circuit" "test" {
resource_group_name = azurerm_resource_group.test.name
express_route_port_id = azurerm_express_route_port.test.id
bandwidth_in_gbps = 5
enable_rate_limiting = false

sku {
tier = "Standard"
Expand Down Expand Up @@ -624,6 +625,7 @@ resource "azurerm_express_route_circuit" "test" {
resource_group_name = azurerm_resource_group.test.name
express_route_port_id = azurerm_express_route_port.test.id
bandwidth_in_gbps = 5
enable_rate_limiting = true

sku {
tier = "Standard"
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/express_route_circuit.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ The following arguments are supported:

* `authorization_key` - (Optional) The authorization key. This can be used to set up an ExpressRoute Circuit with an ExpressRoute Port from another subscription.

* `enable_rate_limiting` - (Optional) Enable [rate limiting](https://learn.microsoft.com/en-us/azure/expressroute/rate-limit) for the circuit. Only works with ExpressRoute Ports. Defaults to `false`.

* `tags` - (Optional) A mapping of tags to assign to the resource.

---
Expand Down
Loading