Skip to content

Commit

Permalink
typos and terrafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte committed Mar 23, 2022
1 parent 054d771 commit 48d9aad
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
16 changes: 3 additions & 13 deletions internal/services/loganalytics/log_analytics_workspace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,20 +212,10 @@ func resourceLogAnalyticsWorkspaceCreateUpdate(d *pluginsdk.ResourceData, meta i
}
}

// Handle typoed property name
propName := "reservation_capacity_in_gb_per_day"
capacityReservationLevel, ok := d.GetOk(propName)

if ok {
if strings.EqualFold(skuName, string(operationalinsights.WorkspaceSkuNameEnumCapacityReservation)) {
parameters.WorkspaceProperties.Sku.CapacityReservationLevel = utils.Int32((int32(capacityReservationLevel.(int))))
} else {
return fmt.Errorf("`%s` can only be used with the `CapacityReservation` SKU", propName)
}
if strings.EqualFold(skuName, string(operationalinsights.WorkspaceSkuNameEnumCapacityReservation)) {
parameters.WorkspaceProperties.Sku.CapacityReservationLevel = utils.Int32((int32(d.Get("reservation_capacity_in_gb_per_day").(int))))
} else {
if strings.EqualFold(skuName, string(operationalinsights.WorkspaceSkuNameEnumCapacityReservation)) {
return fmt.Errorf("`%s` must be set when using the `CapacityReservation` SKU", propName)
}
return fmt.Errorf("`reservation_capacity_in_gb_per_day` can only be used with the `CapacityReservation` SKU")
}

future, err := client.CreateOrUpdate(ctx, resourceGroup, name, parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,11 @@ resource "azurerm_resource_group" "test" {
}
resource "azurerm_log_analytics_workspace" "test" {
name = "acctestLAW-%d"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
internet_query_enabled = false
sku = "CapacityReservation"
name = "acctestLAW-%d"
location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
internet_query_enabled = false
sku = "CapacityReservation"
reservation_capacity_in_gb_per_day = %d
}
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, capacityReservation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ func flattenVpnGatewayConnectionRoutingConfiguration(input *network.RoutingConfi

return []interface{}{
map[string]interface{}{
"propagated_route_table": flattenVpnGatewayConnectionPropagatedRouteTable(input.PropagatedRouteTables),
"associated_route_table": associateRouteTable,
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@ func TestAccVPNServerConfiguration_requiresImport(t *testing.T) {
})
}

func TestAccVPNServerConfiguration_radius(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_vpn_server_configuration", "test")
r := VPNServerConfigurationResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.singleRadius(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
})
}

func TestAccVPNServerConfiguration_multipleRadius(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_vpn_server_configuration", "test")
r := VPNServerConfigurationResource{}
Expand Down

0 comments on commit 48d9aad

Please sign in to comment.