From 20e187610ca777e7824c9fde0096491ce6dabc8a Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Sat, 25 Jan 2020 13:52:58 -0500 Subject: [PATCH 01/11] Add ExpressRoute Gateway resource and tests --- .../services/network/client/client.go | 5 + .../internal/services/network/registration.go | 1 + .../resource_arm_express_route_gateway.go | 206 +++++++++++++++ ...resource_arm_express_route_gateway_test.go | 234 ++++++++++++++++++ 4 files changed, 446 insertions(+) create mode 100644 azurerm/internal/services/network/resource_arm_express_route_gateway.go create mode 100644 azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go diff --git a/azurerm/internal/services/network/client/client.go b/azurerm/internal/services/network/client/client.go index 2788d928b6a7..9794b251ef66 100644 --- a/azurerm/internal/services/network/client/client.go +++ b/azurerm/internal/services/network/client/client.go @@ -14,6 +14,7 @@ type Client struct { DDOSProtectionPlansClient *network.DdosProtectionPlansClient ExpressRouteAuthsClient *network.ExpressRouteCircuitAuthorizationsClient ExpressRouteCircuitsClient *network.ExpressRouteCircuitsClient + ExpressRouteGatewaysClient *network.ExpressRouteGatewaysClient ExpressRoutePeeringsClient *network.ExpressRouteCircuitPeeringsClient InterfacesClient *network.InterfacesClient LoadBalancersClient *network.LoadBalancersClient @@ -68,6 +69,9 @@ func NewClient(o *common.ClientOptions) *Client { ExpressRouteCircuitsClient := network.NewExpressRouteCircuitsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&ExpressRouteCircuitsClient.Client, o.ResourceManagerAuthorizer) + ExpressRouteGatewaysClient := network.NewExpressRouteGatewaysClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + o.ConfigureClient(&ExpressRouteGatewaysClient.Client, o.ResourceManagerAuthorizer) + ExpressRoutePeeringsClient := network.NewExpressRouteCircuitPeeringsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&ExpressRoutePeeringsClient.Client, o.ResourceManagerAuthorizer) @@ -158,6 +162,7 @@ func NewClient(o *common.ClientOptions) *Client { DDOSProtectionPlansClient: &DDOSProtectionPlansClient, ExpressRouteAuthsClient: &ExpressRouteAuthsClient, ExpressRouteCircuitsClient: &ExpressRouteCircuitsClient, + ExpressRouteGatewaysClient: &ExpressRouteGatewaysClient, ExpressRoutePeeringsClient: &ExpressRoutePeeringsClient, InterfacesClient: &InterfacesClient, LoadBalancersClient: &LoadBalancersClient, diff --git a/azurerm/internal/services/network/registration.go b/azurerm/internal/services/network/registration.go index fc30e925d99b..2603c9b651e1 100644 --- a/azurerm/internal/services/network/registration.go +++ b/azurerm/internal/services/network/registration.go @@ -51,6 +51,7 @@ func (r Registration) SupportedResources() map[string]*schema.Resource { "azurerm_express_route_circuit_authorization": resourceArmExpressRouteCircuitAuthorization(), "azurerm_express_route_circuit_peering": resourceArmExpressRouteCircuitPeering(), "azurerm_express_route_circuit": resourceArmExpressRouteCircuit(), + "azurerm_express_route_gateway": resourceArmExpressRouteGateway(), "azurerm_firewall_application_rule_collection": resourceArmFirewallApplicationRuleCollection(), "azurerm_firewall_nat_rule_collection": resourceArmFirewallNatRuleCollection(), "azurerm_firewall_network_rule_collection": resourceArmFirewallNetworkRuleCollection(), diff --git a/azurerm/internal/services/network/resource_arm_express_route_gateway.go b/azurerm/internal/services/network/resource_arm_express_route_gateway.go new file mode 100644 index 000000000000..b179e79b3e6b --- /dev/null +++ b/azurerm/internal/services/network/resource_arm_express_route_gateway.go @@ -0,0 +1,206 @@ +package network + +import ( + "fmt" + "log" + "time" + + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-09-01/network" + "github.com/hashicorp/go-azure-helpers/response" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +var expressRouteGatewayResourceName = "azurerm_express_route_gateway" + +func resourceArmExpressRouteGateway() *schema.Resource { + return &schema.Resource{ + Create: resourceArmExpressRouteGatewayCreateUpdate, + Read: resourceArmExpressRouteGatewayRead, + Update: resourceArmExpressRouteGatewayCreateUpdate, + Delete: resourceArmExpressRouteGatewayDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(60 * time.Minute), + Read: schema.DefaultTimeout(5 * time.Minute), + Update: schema.DefaultTimeout(60 * time.Minute), + Delete: schema.DefaultTimeout(60 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.NoEmptyStrings, + }, + + "location": azure.SchemaLocation(), + + "resource_group_name": azure.SchemaResourceGroupName(), + + "virtual_hub_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: azure.ValidateResourceID, + }, + + "scale_units": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(1, 6), + }, + + "tags": tags.Schema(), + }, + } +} + +func resourceArmExpressRouteGatewayCreateUpdate(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Network.ExpressRouteGatewaysClient + ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) + defer cancel() + + log.Println("[INFO] preparing arguments for ExpressRoute Gateway creation.") + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + + if features.ShouldResourcesBeImported() && d.IsNewResource() { + resp, err := client.Get(ctx, resourceGroup, name) + if err != nil { + if !utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Error checking for present of existing ExpressRoute Gateway %q (Resource Group %q): %+v", name, resourceGroup, err) + } + } + if resp.ID != nil && *resp.ID != "" { + return tf.ImportAsExistsError("azurerm_express_route_gateway", *resp.ID) + } + } + + location := azure.NormalizeLocation(d.Get("location").(string)) + virtualHubId := d.Get("virtual_hub_id").(string) + t := d.Get("tags").(map[string]interface{}) + + parameters := network.ExpressRouteGateway{ + Location: utils.String(location), + ExpressRouteGatewayProperties: &network.ExpressRouteGatewayProperties{ + AutoScaleConfiguration: &network.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ + Bounds: expandExpressRouteGatewayAutoScaleConfigurationBounds(d), + }, + VirtualHub: &network.VirtualHubID{ + ID: &virtualHubId, + }, + }, + Tags: tags.Expand(t), + } + + future, err := client.CreateOrUpdate(ctx, resourceGroup, name, parameters) + if err != nil { + return fmt.Errorf("Error creating ExpressRoute Gateway %q (Resource Group %q): %+v", name, resourceGroup, err) + } + if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("Error waiting for creation of ExpressRoute Gateway %q (Resource Group %q): %+v", name, resourceGroup, err) + } + + resp, err := client.Get(ctx, resourceGroup, name) + if err != nil { + return fmt.Errorf("Error retrieving ExpressRoute Gateway %q (Resource Group %q): %+v", name, resourceGroup, err) + } + if resp.ID == nil || *resp.ID == "" { + return fmt.Errorf("Cannot read ExpressRoute Gateway %q (Resource Group %q) ID", name, resourceGroup) + } + d.SetId(*resp.ID) + + return resourceArmExpressRouteGatewayRead(d, meta) +} + +func resourceArmExpressRouteGatewayRead(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Network.ExpressRouteGatewaysClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := azure.ParseAzureResourceID(d.Id()) + if err != nil { + return err + } + resourceGroup := id.ResourceGroup + name := id.Path["expressRouteGateways"] + + resp, err := client.Get(ctx, resourceGroup, name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + log.Printf("[INFO] ExpressRoute Gateway %q does not exist - removing from state", d.Id()) + d.SetId("") + return nil + } + return fmt.Errorf("Error reading ExpressRoute Gateway %q (Resource Group %q): %+v", name, resourceGroup, err) + } + + d.Set("name", resp.Name) + d.Set("resource_group_name", resourceGroup) + if location := resp.Location; location != nil { + d.Set("location", azure.NormalizeLocation(*location)) + } + + if props := resp.ExpressRouteGatewayProperties; props != nil { + d.Set("virtual_hub_id", props.VirtualHub.ID) + + if setErr := d.Set("scale_units", props.AutoScaleConfiguration.Bounds.Min); setErr != nil { + return fmt.Errorf("Error setting `scale_units`: %+v", setErr) + } + } + + return tags.FlattenAndSet(d, resp.Tags) +} + +func resourceArmExpressRouteGatewayDelete(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Network.ExpressRouteGatewaysClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := azure.ParseAzureResourceID(d.Id()) + if err != nil { + return err + } + resourceGroup := id.ResourceGroup + name := id.Path["expressRouteGateways"] + + future, err := client.Delete(ctx, resourceGroup, name) + if err != nil { + if response.WasNotFound(future.Response()) { + return nil + } + return fmt.Errorf("Error deleting ExpressRoute Gateway %q (Resource Group %q): %+v", name, resourceGroup, err) + } + + if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + if !response.WasNotFound(future.Response()) { + return fmt.Errorf("Error waiting for deleting ExpressRoute Gateway %q (Resource Group %q): %+v", name, resourceGroup, err) + } + } + + return nil +} + +func expandExpressRouteGatewayAutoScaleConfigurationBounds(d *schema.ResourceData) *network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { + + minScaleUnits := int32(d.Get("scale_units").(int)) + configuration := network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ + Min: &minScaleUnits, + } + + return &configuration +} \ No newline at end of file diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go new file mode 100644 index 000000000000..7c04aaaf32c9 --- /dev/null +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go @@ -0,0 +1,234 @@ +package tests + +import ( + "fmt" + //"net/http" + "testing" + + //"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-09-01/network" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func TestAccAzureRMExpressRouteGateway_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_express_route_gateway", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMExpressRouteGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMExpressRouteGateway_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMExpressRouteGatewayExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMExpressRouteGateway_requiresImport(t *testing.T) { + if !features.ShouldResourcesBeImported() { + t.Skip("Skipping since resources aren't required to be imported") + return + } + + data := acceptance.BuildTestData(t, "azurerm_express_route_gateway", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMExpressRouteGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMExpressRouteGateway_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMExpressRouteGatewayExists(data.ResourceName), + ), + }, + { + Config: testAccAzureRMExpressRouteGateway_requiresImport(data), + ExpectError: acceptance.RequiresImportError("azurerm_express_route_gateway"), + }, + }, + }) +} + +func TestAccAzureRMExpressRouteGateway_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_express_route_gateway", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMExpressRouteGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMExpressRouteGateway_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMExpressRouteGatewayExists(data.ResourceName), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMExpressRouteGateway_updateScaleUnits(data, 2), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMExpressRouteGatewayExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "scale_units", "2"), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMExpressRouteGateway_tags(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_express_route_gateway", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMExpressRouteGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMExpressRouteGateway_tags(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMExpressRouteGatewayExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + +func testCheckAzureRMExpressRouteGatewayExists(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).Network.ExpressRouteGatewaysClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("ExpressRoute Gateway not found: %s", resourceName) + } + + name := rs.Primary.Attributes["name"] + resourceGroup := rs.Primary.Attributes["resource_group_name"] + + if resp, err := client.Get(ctx, resourceGroup, name); err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Bad: ExpressRoute Gateway %q (Resource Group %q) does not exist", name, resourceGroup) + } + return fmt.Errorf("Bad: Get on network.ExpressRouteGatewaysClient: %+v", err) + } + + return nil + } +} + +func testCheckAzureRMExpressRouteGatewayDestroy(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).Network.ExpressRouteGatewaysClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + for _, rs := range s.RootModule().Resources { + if rs.Type != "azurerm_express_route_gateway" { + continue + } + + name := rs.Primary.Attributes["name"] + resourceGroup := rs.Primary.Attributes["resource_group_name"] + + if resp, err := client.Get(ctx, resourceGroup, name); err != nil { + if !utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Bad: Get on network.ExpressRouteGatewaysClient: %+v", err) + } + } + + return nil + } + + return nil +} + +func testAccAzureRMExpressRouteGateway_basic(data acceptance.TestData) string { + template := testAccAzureRMExpressRouteGateway_template(data) + return fmt.Sprintf(` +%s +resource "azurerm_express_route_gateway" "test" { + name = "acctestER-gateway-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + virtual_hub_id = azurerm_virtual_hub.test.id + scale_units = 1 +} +`, template, data.RandomInteger) +} + +func testAccAzureRMExpressRouteGateway_requiresImport(data acceptance.TestData) string { + template := testAccAzureRMExpressRouteGateway_basic(data) + return fmt.Sprintf(` +%s +resource "azurerm_express_route_gateway" "test" { + name = azurerm_express_route_gateway.test.name + resource_group_name = azurerm_express_route_gateway.test.name + location = azurerm_express_route_gateway.test.location + scale_units = 1 +} +`, template) +} + +func testAccAzureRMExpressRouteGateway_updateScaleUnits(data acceptance.TestData, scaleUnits int) string { + template := testAccAzureRMExpressRouteGateway_template(data) + return fmt.Sprintf(` +%s +resource "azurerm_express_route_gateway" "test" { + name = "acctestER-gateway-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + virtual_hub_id = azurerm_virtual_hub.test.id + scale_units = %d +} +`, template, data.RandomInteger, scaleUnits) +} + +func testAccAzureRMExpressRouteGateway_tags(data acceptance.TestData) string { + template := testAccAzureRMExpressRouteGateway_template(data) + return fmt.Sprintf(` +%s +resource "azurerm_express_route_gateway" "test" { + name = "acctestER-gateway-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + virtual_hub_id = azurerm_virtual_hub.test.id + scale_units = 1 + tags = { + Hello = "World" + } +} +`, template, data.RandomInteger) +} + +func testAccAzureRMExpressRouteGateway_template(data acceptance.TestData) string { + return fmt.Sprintf(` +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} +resource "azurerm_virtual_wan" "test" { + name = "acctestvwan-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location +} +resource "azurerm_virtual_hub" "test" { + name = "acctestvhub-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + virtual_wan_id = azurerm_virtual_wan.test.id + address_prefix = "10.0.1.0/24" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} \ No newline at end of file From a791cc17a7bf6fd17cd0c56fbf4b63d50d6690ef Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Sat, 25 Jan 2020 13:55:07 -0500 Subject: [PATCH 02/11] gofmt changes --- .../services/network/resource_arm_express_route_gateway.go | 2 +- .../network/tests/resource_arm_express_route_gateway_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_express_route_gateway.go b/azurerm/internal/services/network/resource_arm_express_route_gateway.go index b179e79b3e6b..84d60e5b832b 100644 --- a/azurerm/internal/services/network/resource_arm_express_route_gateway.go +++ b/azurerm/internal/services/network/resource_arm_express_route_gateway.go @@ -203,4 +203,4 @@ func expandExpressRouteGatewayAutoScaleConfigurationBounds(d *schema.ResourceDat } return &configuration -} \ No newline at end of file +} diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go index 7c04aaaf32c9..1dfcfe4ec8bd 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go @@ -231,4 +231,4 @@ resource "azurerm_virtual_hub" "test" { address_prefix = "10.0.1.0/24" } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) -} \ No newline at end of file +} From f0f39781efeacf9df159965583bd2937da5c07b9 Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Sat, 25 Jan 2020 14:09:54 -0500 Subject: [PATCH 03/11] Add documentation --- .../r/express_route_gateway.html.markdown | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 website/docs/r/express_route_gateway.html.markdown diff --git a/website/docs/r/express_route_gateway.html.markdown b/website/docs/r/express_route_gateway.html.markdown new file mode 100644 index 000000000000..ad3c41fe427b --- /dev/null +++ b/website/docs/r/express_route_gateway.html.markdown @@ -0,0 +1,76 @@ +--- +subcategory: "Network" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_express_route_gateway" +description: |- + Manages an ExpressRoute gateway. +--- + +# azurerm_express_route_gateway + +Manages an ExpressRoute gateway. + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "exprtTest" + location = "West US" +} + +resource "azurerm_virtual_wan" "example" { + name = "example-virtualwan" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location +} + +resource "azurerm_virtual_hub" "example" { + name = "example-virtualhub" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + virtual_wan_id = azurerm_virtual_wan.example.id + address_prefix = "10.0.1.0/24" +} + +resource "azurerm_express_route_gateway" "example" { + name = "expressRoute1" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + virtual_hub_id = azurerm_virtual_hub.example.id + scale_unts = 1 + + tags = { + environment = "Production" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The name of the ExpressRoute circuit. Changing this forces a new resource to be created. + +* `resource_group_name` - (Required) The name of the resource group in which to create the ExpressRoute circuit. Changing this forces a new resource to be created. + +* `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. + +* `virtual_hub_id` - (Required) The ID of a Virtual WAN within which the Virtual Hub should be created. + +* `scale_units` - (Required) The name of the peering location and **not** the Azure resource location. + +* `tags` - (Optional) A mapping of tags to assign to the resource. + +## Attributes Reference + +The following attributes are exported: + +* `id` - The Resource ID of the ExpressRoute gateway. + +## Import + +ExpressRoute gateways can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_express_route_gateway.myExpressRouteGateway /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/expressRouteGateways/myExpressRouteGateway +``` From 790752dde503059d7d501758a47bc70fc349f1ef Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Sat, 25 Jan 2020 15:25:45 -0500 Subject: [PATCH 04/11] Resolve linting errors --- .../network/resource_arm_express_route_gateway.go | 3 --- .../tests/resource_arm_express_route_gateway_test.go | 2 +- website/docs/r/express_route_gateway.html.markdown | 10 +++++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_express_route_gateway.go b/azurerm/internal/services/network/resource_arm_express_route_gateway.go index 84d60e5b832b..789babfb476b 100644 --- a/azurerm/internal/services/network/resource_arm_express_route_gateway.go +++ b/azurerm/internal/services/network/resource_arm_express_route_gateway.go @@ -19,8 +19,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) -var expressRouteGatewayResourceName = "azurerm_express_route_gateway" - func resourceArmExpressRouteGateway() *schema.Resource { return &schema.Resource{ Create: resourceArmExpressRouteGatewayCreateUpdate, @@ -196,7 +194,6 @@ func resourceArmExpressRouteGatewayDelete(d *schema.ResourceData, meta interface } func expandExpressRouteGatewayAutoScaleConfigurationBounds(d *schema.ResourceData) *network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { - minScaleUnits := int32(d.Get("scale_units").(int)) configuration := network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ Min: &minScaleUnits, diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go index 1dfcfe4ec8bd..26e34f8e44de 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go @@ -227,7 +227,7 @@ resource "azurerm_virtual_hub" "test" { name = "acctestvhub-%d" resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location - virtual_wan_id = azurerm_virtual_wan.test.id + virtual_wan_id = azurerm_virtual_wan.test.id address_prefix = "10.0.1.0/24" } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) diff --git a/website/docs/r/express_route_gateway.html.markdown b/website/docs/r/express_route_gateway.html.markdown index ad3c41fe427b..fba48c292c7e 100644 --- a/website/docs/r/express_route_gateway.html.markdown +++ b/website/docs/r/express_route_gateway.html.markdown @@ -33,11 +33,11 @@ resource "azurerm_virtual_hub" "example" { } resource "azurerm_express_route_gateway" "example" { - name = "expressRoute1" - resource_group_name = azurerm_resource_group.example.name - location = azurerm_resource_group.example.location - virtual_hub_id = azurerm_virtual_hub.example.id - scale_unts = 1 + name = "expressRoute1" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + virtual_hub_id = azurerm_virtual_hub.example.id + scale_unts = 1 tags = { environment = "Production" From 0069b65095ed48d24a95cec09612e31b574b5549 Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Sat, 25 Jan 2020 16:36:28 -0500 Subject: [PATCH 05/11] tflint fixes --- ...resource_arm_express_route_gateway_test.go | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go index 26e34f8e44de..15a4f1e57052 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go @@ -2,10 +2,8 @@ package tests import ( "fmt" - //"net/http" "testing" - //"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-09-01/network" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" @@ -158,12 +156,13 @@ func testAccAzureRMExpressRouteGateway_basic(data acceptance.TestData) string { template := testAccAzureRMExpressRouteGateway_template(data) return fmt.Sprintf(` %s + resource "azurerm_express_route_gateway" "test" { name = "acctestER-gateway-%d" resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location - virtual_hub_id = azurerm_virtual_hub.test.id - scale_units = 1 + virtual_hub_id = azurerm_virtual_hub.test.id + scale_units = 1 } `, template, data.RandomInteger) } @@ -172,11 +171,12 @@ func testAccAzureRMExpressRouteGateway_requiresImport(data acceptance.TestData) template := testAccAzureRMExpressRouteGateway_basic(data) return fmt.Sprintf(` %s + resource "azurerm_express_route_gateway" "test" { name = azurerm_express_route_gateway.test.name resource_group_name = azurerm_express_route_gateway.test.name location = azurerm_express_route_gateway.test.location - scale_units = 1 + scale_units = 1 } `, template) } @@ -185,12 +185,13 @@ func testAccAzureRMExpressRouteGateway_updateScaleUnits(data acceptance.TestData template := testAccAzureRMExpressRouteGateway_template(data) return fmt.Sprintf(` %s + resource "azurerm_express_route_gateway" "test" { name = "acctestER-gateway-%d" resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location - virtual_hub_id = azurerm_virtual_hub.test.id - scale_units = %d + virtual_hub_id = azurerm_virtual_hub.test.id + scale_units = %d } `, template, data.RandomInteger, scaleUnits) } @@ -199,12 +200,13 @@ func testAccAzureRMExpressRouteGateway_tags(data acceptance.TestData) string { template := testAccAzureRMExpressRouteGateway_template(data) return fmt.Sprintf(` %s + resource "azurerm_express_route_gateway" "test" { name = "acctestER-gateway-%d" resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location - virtual_hub_id = azurerm_virtual_hub.test.id - scale_units = 1 + virtual_hub_id = azurerm_virtual_hub.test.id + scale_units = 1 tags = { Hello = "World" } @@ -218,11 +220,13 @@ resource "azurerm_resource_group" "test" { name = "acctestRG-%d" location = "%s" } + resource "azurerm_virtual_wan" "test" { name = "acctestvwan-%d" resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location } + resource "azurerm_virtual_hub" "test" { name = "acctestvhub-%d" resource_group_name = azurerm_resource_group.test.name From 0cf5e60c6bfdddc1e6ec44686c71cfae16990b38 Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Sun, 26 Jan 2020 22:53:31 +0000 Subject: [PATCH 06/11] Resolve PR feedback --- .../resource_arm_express_route_gateway.go | 2 +- ...resource_arm_express_route_gateway_test.go | 62 ++++++------------- .../r/express_route_gateway.html.markdown | 12 ++-- 3 files changed, 25 insertions(+), 51 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_express_route_gateway.go b/azurerm/internal/services/network/resource_arm_express_route_gateway.go index 789babfb476b..e883985637ea 100644 --- a/azurerm/internal/services/network/resource_arm_express_route_gateway.go +++ b/azurerm/internal/services/network/resource_arm_express_route_gateway.go @@ -58,7 +58,7 @@ func resourceArmExpressRouteGateway() *schema.Resource { "scale_units": { Type: schema.TypeInt, Required: true, - ValidateFunc: validation.IntBetween(1, 6), + ValidateFunc: validation.IntBetween(1, 10), }, "tags": tags.Schema(), diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go index 15a4f1e57052..3455c5a922ad 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go @@ -74,27 +74,15 @@ func TestAccAzureRMExpressRouteGateway_update(t *testing.T) { }, data.ImportStep(), { - Config: testAccAzureRMExpressRouteGateway_updateScaleUnits(data, 2), + Config: testAccAzureRMExpressRouteGateway_complete(data, 10), Check: resource.ComposeTestCheckFunc( testCheckAzureRMExpressRouteGatewayExists(data.ResourceName), - resource.TestCheckResourceAttr(data.ResourceName, "scale_units", "2"), + resource.TestCheckResourceAttr(data.ResourceName, "scale_units", "10"), ), }, data.ImportStep(), - }, - }) -} - -func TestAccAzureRMExpressRouteGateway_tags(t *testing.T) { - data := acceptance.BuildTestData(t, "azurerm_express_route_gateway", "test") - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acceptance.PreCheck(t) }, - Providers: acceptance.SupportedProviders, - CheckDestroy: testCheckAzureRMExpressRouteGatewayDestroy, - Steps: []resource.TestStep{ { - Config: testAccAzureRMExpressRouteGateway_tags(data), + Config: testAccAzureRMExpressRouteGateway_basic(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMExpressRouteGatewayExists(data.ResourceName), ), @@ -167,21 +155,7 @@ resource "azurerm_express_route_gateway" "test" { `, template, data.RandomInteger) } -func testAccAzureRMExpressRouteGateway_requiresImport(data acceptance.TestData) string { - template := testAccAzureRMExpressRouteGateway_basic(data) - return fmt.Sprintf(` -%s - -resource "azurerm_express_route_gateway" "test" { - name = azurerm_express_route_gateway.test.name - resource_group_name = azurerm_express_route_gateway.test.name - location = azurerm_express_route_gateway.test.location - scale_units = 1 -} -`, template) -} - -func testAccAzureRMExpressRouteGateway_updateScaleUnits(data acceptance.TestData, scaleUnits int) string { +func testAccAzureRMExpressRouteGateway_complete(data acceptance.TestData, scaleUnits int) string { template := testAccAzureRMExpressRouteGateway_template(data) return fmt.Sprintf(` %s @@ -192,43 +166,43 @@ resource "azurerm_express_route_gateway" "test" { location = azurerm_resource_group.test.location virtual_hub_id = azurerm_virtual_hub.test.id scale_units = %d + + tags = { + Hello = "World" + } } `, template, data.RandomInteger, scaleUnits) } -func testAccAzureRMExpressRouteGateway_tags(data acceptance.TestData) string { - template := testAccAzureRMExpressRouteGateway_template(data) +func testAccAzureRMExpressRouteGateway_requiresImport(data acceptance.TestData) string { + template := testAccAzureRMExpressRouteGateway_basic(data) return fmt.Sprintf(` %s resource "azurerm_express_route_gateway" "test" { - name = "acctestER-gateway-%d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location - virtual_hub_id = azurerm_virtual_hub.test.id - scale_units = 1 - tags = { - Hello = "World" - } + name = azurerm_express_route_gateway.test.name + resource_group_name = azurerm_express_route_gateway.test.name + location = azurerm_express_route_gateway.test.location + scale_units = azurerm_express_route_gateway.test.scale_units } -`, template, data.RandomInteger) +`, template) } func testAccAzureRMExpressRouteGateway_template(data acceptance.TestData) string { return fmt.Sprintf(` resource "azurerm_resource_group" "test" { - name = "acctestRG-%d" + name = "acctestRG-express-%d" location = "%s" } resource "azurerm_virtual_wan" "test" { - name = "acctestvwan-%d" + name = "acctest-VWAN-%d" resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location } resource "azurerm_virtual_hub" "test" { - name = "acctestvhub-%d" + name = "acctest-VHUB-%d" resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location virtual_wan_id = azurerm_virtual_wan.test.id diff --git a/website/docs/r/express_route_gateway.html.markdown b/website/docs/r/express_route_gateway.html.markdown index fba48c292c7e..a40ae80de023 100644 --- a/website/docs/r/express_route_gateway.html.markdown +++ b/website/docs/r/express_route_gateway.html.markdown @@ -14,7 +14,7 @@ Manages an ExpressRoute gateway. ```hcl resource "azurerm_resource_group" "example" { - name = "exprtTest" + name = "example-resources" location = "West US" } @@ -49,15 +49,15 @@ resource "azurerm_express_route_gateway" "example" { The following arguments are supported: -* `name` - (Required) The name of the ExpressRoute circuit. Changing this forces a new resource to be created. +* `name` - (Required) The name of the ExpressRoute gateway. Changing this forces a new resource to be created. -* `resource_group_name` - (Required) The name of the resource group in which to create the ExpressRoute circuit. Changing this forces a new resource to be created. +* `resource_group_name` - (Required) The name of the resource group in which to create the ExpressRoute gateway. Changing this forces a new resource to be created. * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. -* `virtual_hub_id` - (Required) The ID of a Virtual WAN within which the Virtual Hub should be created. +* `virtual_hub_id` - (Required) The ID of a Virtual HUB within which the ExpressRoute gateway should be created. -* `scale_units` - (Required) The name of the peering location and **not** the Azure resource location. +* `scale_units` - (Required) The number of scale units with which to provision the ExpressRoute gateway. Each scale unit is equal to 2Gbps, with support for up to 10 scale units (20Gbps). * `tags` - (Optional) A mapping of tags to assign to the resource. @@ -72,5 +72,5 @@ The following attributes are exported: ExpressRoute gateways can be imported using the `resource id`, e.g. ```shell -terraform import azurerm_express_route_gateway.myExpressRouteGateway /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/expressRouteGateways/myExpressRouteGateway +terraform import azurerm_express_route_gateway.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/expressRouteGateways/myExpressRouteGateway ``` From 26c7fa123e82d305720cad768bb21481473cf932 Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Sun, 26 Jan 2020 22:56:56 +0000 Subject: [PATCH 07/11] Resize test to reasonable size --- .../network/tests/resource_arm_express_route_gateway_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go index 3455c5a922ad..155337c6743f 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go @@ -74,10 +74,10 @@ func TestAccAzureRMExpressRouteGateway_update(t *testing.T) { }, data.ImportStep(), { - Config: testAccAzureRMExpressRouteGateway_complete(data, 10), + Config: testAccAzureRMExpressRouteGateway_complete(data, 2), Check: resource.ComposeTestCheckFunc( testCheckAzureRMExpressRouteGatewayExists(data.ResourceName), - resource.TestCheckResourceAttr(data.ResourceName, "scale_units", "10"), + resource.TestCheckResourceAttr(data.ResourceName, "scale_units", "2"), ), }, data.ImportStep(), From 371aa19e1e159c7a43447a9c311858d39a158cfe Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Tue, 11 Feb 2020 23:49:42 -0500 Subject: [PATCH 08/11] Requested changes to error handling & structure Documentation fixes --- .../resource_arm_express_route_gateway.go | 31 ++++++++++++------- ...resource_arm_express_route_gateway_test.go | 2 +- .../r/express_route_gateway.html.markdown | 21 +++++++++++-- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_express_route_gateway.go b/azurerm/internal/services/network/resource_arm_express_route_gateway.go index e883985637ea..5008b5e87567 100644 --- a/azurerm/internal/services/network/resource_arm_express_route_gateway.go +++ b/azurerm/internal/services/network/resource_arm_express_route_gateway.go @@ -92,11 +92,14 @@ func resourceArmExpressRouteGatewayCreateUpdate(d *schema.ResourceData, meta int virtualHubId := d.Get("virtual_hub_id").(string) t := d.Get("tags").(map[string]interface{}) + minScaleUnits := int32(d.Get("scale_units").(int)) parameters := network.ExpressRouteGateway{ Location: utils.String(location), ExpressRouteGatewayProperties: &network.ExpressRouteGatewayProperties{ AutoScaleConfiguration: &network.ExpressRouteGatewayPropertiesAutoScaleConfiguration{ - Bounds: expandExpressRouteGatewayAutoScaleConfigurationBounds(d), + Bounds: &network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ + Min: &minScaleUnits, + }, }, VirtualHub: &network.VirtualHubID{ ID: &virtualHubId, @@ -154,11 +157,17 @@ func resourceArmExpressRouteGatewayRead(d *schema.ResourceData, meta interface{} } if props := resp.ExpressRouteGatewayProperties; props != nil { - d.Set("virtual_hub_id", props.VirtualHub.ID) + virtualHubId := "" + if props.VirtualHub != nil && props.VirtualHub.ID != nil { + virtualHubId = *props.VirtualHub.ID + } + d.Set("virtual_hub_id", virtualHubId) - if setErr := d.Set("scale_units", props.AutoScaleConfiguration.Bounds.Min); setErr != nil { - return fmt.Errorf("Error setting `scale_units`: %+v", setErr) + scaleUnits := 0 + if props.AutoScaleConfiguration != nil && props.AutoScaleConfiguration.Bounds != nil && props.AutoScaleConfiguration.Bounds.Min != nil { + scaleUnits = int(*props.AutoScaleConfiguration.Bounds.Min) } + d.Set("scale_units", scaleUnits) } return tags.FlattenAndSet(d, resp.Tags) @@ -193,11 +202,11 @@ func resourceArmExpressRouteGatewayDelete(d *schema.ResourceData, meta interface return nil } -func expandExpressRouteGatewayAutoScaleConfigurationBounds(d *schema.ResourceData) *network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { - minScaleUnits := int32(d.Get("scale_units").(int)) - configuration := network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ - Min: &minScaleUnits, - } +// func expandExpressRouteGatewayAutoScaleConfigurationBounds(d *schema.ResourceData) *network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { +// minScaleUnits := int32(d.Get("scale_units").(int)) +// configuration := network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ +// Min: &minScaleUnits, +// } - return &configuration -} +// return &configuration +// } diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go index 155337c6743f..ff468064d7fa 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go @@ -179,7 +179,7 @@ func testAccAzureRMExpressRouteGateway_requiresImport(data acceptance.TestData) return fmt.Sprintf(` %s -resource "azurerm_express_route_gateway" "test" { +resource "azurerm_express_route_gateway" "import" { name = azurerm_express_route_gateway.test.name resource_group_name = azurerm_express_route_gateway.test.name location = azurerm_express_route_gateway.test.location diff --git a/website/docs/r/express_route_gateway.html.markdown b/website/docs/r/express_route_gateway.html.markdown index a40ae80de023..27900d800de6 100644 --- a/website/docs/r/express_route_gateway.html.markdown +++ b/website/docs/r/express_route_gateway.html.markdown @@ -15,7 +15,7 @@ Manages an ExpressRoute gateway. ```hcl resource "azurerm_resource_group" "example" { name = "example-resources" - location = "West US" + location = "West Europe" } resource "azurerm_virtual_wan" "example" { @@ -65,11 +65,26 @@ The following arguments are supported: The following attributes are exported: -* `id` - The Resource ID of the ExpressRoute gateway. +* `id` - The ID of the ExpressRoute gateway. + +### Timeouts + +~> **Note:** Custom Timeouts are available [as an opt-in Beta in version 1.43 of the Azure Provider](/docs/providers/azurerm/guides/2.0-beta.html) and will be enabled by default in version 2.0 of the Azure Provider. + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 60 minutes) Used when creating the ExpressRoute Gateway. + +* `update` - (Defaults to 60 minutes) Used when updating the ExpressRoute Gateway. + +* `read` - (Defaults to 5 minutes) Used when retrieving the ExpressRoute Gateway. + +* `delete` - (Defaults to 60 minutes) Used when deleting the ExpressRoute Gateway. + ## Import -ExpressRoute gateways can be imported using the `resource id`, e.g. +ExpressRoute Gateways can be imported using the `resource id`, e.g. ```shell terraform import azurerm_express_route_gateway.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/expressRouteGateways/myExpressRouteGateway From d0864cbd2ceea2b152783e16f2fd8277629b0cea Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Tue, 11 Feb 2020 23:51:18 -0500 Subject: [PATCH 09/11] remove commented block --- .../network/resource_arm_express_route_gateway.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_express_route_gateway.go b/azurerm/internal/services/network/resource_arm_express_route_gateway.go index 5008b5e87567..731594d7fd24 100644 --- a/azurerm/internal/services/network/resource_arm_express_route_gateway.go +++ b/azurerm/internal/services/network/resource_arm_express_route_gateway.go @@ -201,12 +201,3 @@ func resourceArmExpressRouteGatewayDelete(d *schema.ResourceData, meta interface return nil } - -// func expandExpressRouteGatewayAutoScaleConfigurationBounds(d *schema.ResourceData) *network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds { -// minScaleUnits := int32(d.Get("scale_units").(int)) -// configuration := network.ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds{ -// Min: &minScaleUnits, -// } - -// return &configuration -// } From 6de712f0dfcb34176b5311f66ee4bc86f7226668 Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Wed, 12 Feb 2020 00:33:40 -0500 Subject: [PATCH 10/11] Add express_route_gateway to website sidebar --- website/azurerm.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/azurerm.erb b/website/azurerm.erb index 45745f5158f3..eb3f9efbc3f6 100644 --- a/website/azurerm.erb +++ b/website/azurerm.erb @@ -202,6 +202,10 @@ azurerm_express_route_circuit +
  • + azurerm_express_route_gateway +
  • +
  • azurerm_firewall
  • From 3123d0212ab58b4ab445e14ba0e2506fe6b42391 Mon Sep 17 00:00:00 2001 From: Brent Harrison Date: Wed, 12 Feb 2020 00:40:48 -0500 Subject: [PATCH 11/11] Correct sidebar location --- website/azurerm.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/azurerm.erb b/website/azurerm.erb index eb3f9efbc3f6..a00c87244b48 100644 --- a/website/azurerm.erb +++ b/website/azurerm.erb @@ -202,10 +202,6 @@ azurerm_express_route_circuit -
  • - azurerm_express_route_gateway -
  • -
  • azurerm_firewall
  • @@ -1721,6 +1717,10 @@ azurerm_express_route_circuit_peering +
  • + azurerm_express_route_gateway +
  • +
  • azurerm_firewall