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_lb, azurerm_lb_backend_address_pool, azurerm_network_interface - add supports for gateway LB #13559

Merged
merged 8 commits into from
Oct 19, 2021

Conversation

magodo
Copy link
Collaborator

@magodo magodo commented Sep 30, 2021

This PR adds support for the Gateway Loadbalancer. Checkout the Swagger definition for examples.

There are two principals in the use case of the gateway LB: the provider and the consumer. The provider is the one that provisions the gateway loadbalancer, where the loadbalancer's sku is set to Gateway and its BAP has the tunnel_interface defined. The consumer is the one that directs its traffic to the provider gateway LB. There are currently two resources can consume (point to) the gateway LB: the azurerm_lb and the azurerm_network_interface. For these two resources, this PR has added the gateway_load_balancer_frontend_ip_configuration_id to their forntend configuration block (arguably, the name of the property is a bit too verbose, while I didn't figure out another better name 😅 )

Probably related to #13453

Test

💢 TF_ACC=1 go test -timeout=3h -v ./internal/services/loadbalancer -run='TestAccBackendAddressPoolGatewaySku|TestAccAzureRMLoadBalancer_PointToGatewayLB|TestAccNetworkInterface_pointToGatewayLB'
=== RUN   TestAccBackendAddressPoolGatewaySkuBasic
=== PAUSE TestAccBackendAddressPoolGatewaySkuBasic
=== RUN   TestAccBackendAddressPoolGatewaySkuUpdate
=== PAUSE TestAccBackendAddressPoolGatewaySkuUpdate
=== RUN   TestAccAzureRMLoadBalancer_PointToGatewayLB
=== PAUSE TestAccAzureRMLoadBalancer_PointToGatewayLB
=== CONT  TestAccBackendAddressPoolGatewaySkuBasic
=== CONT  TestAccAzureRMLoadBalancer_PointToGatewayLB
=== CONT  TestAccBackendAddressPoolGatewaySkuUpdate
--- PASS: TestAccAzureRMLoadBalancer_PointToGatewayLB (167.99s)
--- PASS: TestAccBackendAddressPoolGatewaySkuBasic (210.07s)
--- PASS: TestAccBackendAddressPoolGatewaySkuUpdate (297.44s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/loadbalancer  297.470s

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add the instrudctions to the docs that are required to enable the required features?

------- Stdout: -------
=== RUN   TestAccBackendAddressPoolGatewaySkuUpdate
=== PAUSE TestAccBackendAddressPoolGatewaySkuUpdate
=== CONT  TestAccBackendAddressPoolGatewaySkuUpdate
    testcase.go:88: Step 1/6 error: Error running apply: exit status 1
        
        Error: creating/updating Load Balancer "acctestlb-210930175846005171" (Resource Group "acctestRG-210930175846005171"): network.LoadBalancersClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="SubscriptionNotRegisteredForFeature" Message="Subscription ******* is not registered for feature Microsoft.Network/AllowGatewayLoadBalancer required to carry out the requested operation." Details=[]
        
          with azurerm_lb.test,
          on terraform_plugin_test.tf line 27, in resource "azurerm_lb" "test":
          27: resource "azurerm_lb" "test" {
        
--- FAIL: TestAccBackendAddressPoolGatewaySkuUpdate (194.51s)
FAIL

@@ -103,6 +103,50 @@ func TestAccBackendAddressPoolStandardSkuRequiresImport(t *testing.T) {
})
}

func TestAccBackendAddressPoolGatewaySkuBasic(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have a _ in here

Suggested change
func TestAccBackendAddressPoolGatewaySkuBasic(t *testing.T) {
func TestAccBackendAddressPool_GatewaySkuBasic(t *testing.T) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing this so to be consistent with other test case namings in this file. I'll do the change per above suggestion though.

})
}

func TestAccBackendAddressPoolGatewaySkuUpdate(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func TestAccBackendAddressPoolGatewaySkuUpdate(t *testing.T) {
func TestAccBackendAddressPool_GatewaySkuUpdate(t *testing.T) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing this so to be consistent with other test case namings in this file. I'll do the change per above suggestion though.

@magodo
Copy link
Collaborator Author

magodo commented Oct 8, 2021

@katbyte I've updated the PR per your comment. Meanwhile, I've asked the service team to register the feature for the two Hashicorp subscriptions.

@anavinahar
Copy link

I've registered the subs last week as discussed

@katbyte katbyte added this to the v2.81.0 milestone Oct 14, 2021
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good @magodo - just needs conflicts resolved 👍

@katbyte katbyte modified the milestones: v2.81.0, v2.82.0 Oct 14, 2021
@magodo
Copy link
Collaborator Author

magodo commented Oct 15, 2021

@katbyte I've merged with the main branch, please take another look.

@katbyte katbyte merged commit 49caaf8 into hashicorp:main Oct 19, 2021
katbyte added a commit that referenced this pull request Oct 19, 2021
@github-actions
Copy link

This functionality has been released in v2.82.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

katbyte pushed a commit that referenced this pull request Oct 25, 2021
…ntend_ip_configuration_id` to prevent nilpointer (#13865)

Fixes #13858
Error introduced in #13559
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants