Skip to content

Commit

Permalink
Test Shim: Network i->l and r->s (#10185)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfrahry authored Jan 14, 2021
1 parent a4f5cf3 commit 0510026
Show file tree
Hide file tree
Showing 17 changed files with 851 additions and 1,201 deletions.
6 changes: 3 additions & 3 deletions azurerm/internal/services/network/ip_group_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

func dataSourceArmIpGroup() *schema.Resource {
func dataSourceIpGroup() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmIpGroupRead,
Read: dataSourceIpGroupRead,

Timeouts: &schema.ResourceTimeout{
Read: schema.DefaultTimeout(5 * time.Minute),
Expand Down Expand Up @@ -42,7 +42,7 @@ func dataSourceArmIpGroup() *schema.Resource {
}
}

func dataSourceArmIpGroupRead(d *schema.ResourceData, meta interface{}) error {
func dataSourceIpGroupRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.IPGroupsClient
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down
18 changes: 9 additions & 9 deletions azurerm/internal/services/network/ip_group_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

func resourceArmIpGroup() *schema.Resource {
func resourceIpGroup() *schema.Resource {
return &schema.Resource{
Create: resourceArmIpGroupCreateUpdate,
Read: resourceArmIpGroupRead,
Update: resourceArmIpGroupCreateUpdate,
Delete: resourceArmIpGroupDelete,
Create: resourceIpGroupCreateUpdate,
Read: resourceIpGroupRead,
Update: resourceIpGroupCreateUpdate,
Delete: resourceIpGroupDelete,

Importer: azSchema.ValidateResourceIDPriorToImport(func(id string) error {
_, err := parse.IpGroupID(id)
Expand Down Expand Up @@ -63,7 +63,7 @@ func resourceArmIpGroup() *schema.Resource {
}
}

func resourceArmIpGroupCreateUpdate(d *schema.ResourceData, meta interface{}) error {
func resourceIpGroupCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.IPGroupsClient
ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down Expand Up @@ -116,10 +116,10 @@ func resourceArmIpGroupCreateUpdate(d *schema.ResourceData, meta interface{}) er

d.SetId(*read.ID)

return resourceArmIpGroupRead(d, meta)
return resourceIpGroupRead(d, meta)
}

func resourceArmIpGroupRead(d *schema.ResourceData, meta interface{}) error {
func resourceIpGroupRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.IPGroupsClient
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down Expand Up @@ -156,7 +156,7 @@ func resourceArmIpGroupRead(d *schema.ResourceData, meta interface{}) error {
return tags.FlattenAndSet(d, resp.Tags)
}

func resourceArmIpGroupDelete(d *schema.ResourceData, meta interface{}) error {
func resourceIpGroupDelete(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.IPGroupsClient
ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

func resourceArmLocalNetworkGateway() *schema.Resource {
func resourceLocalNetworkGateway() *schema.Resource {
return &schema.Resource{
Create: resourceArmLocalNetworkGatewayCreateUpdate,
Read: resourceArmLocalNetworkGatewayRead,
Update: resourceArmLocalNetworkGatewayCreateUpdate,
Delete: resourceArmLocalNetworkGatewayDelete,
Create: resourceLocalNetworkGatewayCreateUpdate,
Read: resourceLocalNetworkGatewayRead,
Update: resourceLocalNetworkGatewayCreateUpdate,
Delete: resourceLocalNetworkGatewayDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Expand Down Expand Up @@ -93,7 +93,7 @@ func resourceArmLocalNetworkGateway() *schema.Resource {
}
}

func resourceArmLocalNetworkGatewayCreateUpdate(d *schema.ResourceData, meta interface{}) error {
func resourceLocalNetworkGatewayCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.LocalNetworkGatewaysClient
ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down Expand Up @@ -168,10 +168,10 @@ func resourceArmLocalNetworkGatewayCreateUpdate(d *schema.ResourceData, meta int

d.SetId(*read.ID)

return resourceArmLocalNetworkGatewayRead(d, meta)
return resourceLocalNetworkGatewayRead(d, meta)
}

func resourceArmLocalNetworkGatewayRead(d *schema.ResourceData, meta interface{}) error {
func resourceLocalNetworkGatewayRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.LocalNetworkGatewaysClient
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down Expand Up @@ -213,7 +213,7 @@ func resourceArmLocalNetworkGatewayRead(d *schema.ResourceData, meta interface{}
return tags.FlattenAndSet(d, resp.Tags)
}

func resourceArmLocalNetworkGatewayDelete(d *schema.ResourceData, meta interface{}) error {
func resourceLocalNetworkGatewayDelete(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.LocalNetworkGatewaysClient
ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down
16 changes: 8 additions & 8 deletions azurerm/internal/services/network/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (r Registration) SupportedDataSources() map[string]*schema.Resource {
return map[string]*schema.Resource{
"azurerm_application_security_group": dataSourceApplicationSecurityGroup(),
"azurerm_express_route_circuit": dataSourceExpressRouteCircuit(),
"azurerm_ip_group": dataSourceArmIpGroup(),
"azurerm_ip_group": dataSourceIpGroup(),
"azurerm_nat_gateway": dataSourceArmNatGateway(),
"azurerm_network_ddos_protection_plan": dataSourceNetworkDDoSProtectionPlan(),
"azurerm_network_interface": dataSourceArmNetworkInterface(),
Expand All @@ -35,8 +35,8 @@ func (r Registration) SupportedDataSources() map[string]*schema.Resource {
"azurerm_public_ip": dataSourceArmPublicIP(),
"azurerm_public_ips": dataSourceArmPublicIPs(),
"azurerm_public_ip_prefix": dataSourceArmPublicIpPrefix(),
"azurerm_route_filter": dataSourceArmRouteFilter(),
"azurerm_route_table": dataSourceArmRouteTable(),
"azurerm_route_filter": dataSourceRouteFilter(),
"azurerm_route_table": dataSourceRouteTable(),
"azurerm_network_service_tags": dataSourceNetworkServiceTags(),
"azurerm_subnet": dataSourceArmSubnet(),
"azurerm_virtual_hub": dataSourceArmVirtualHub(),
Expand All @@ -58,8 +58,8 @@ func (r Registration) SupportedResources() map[string]*schema.Resource {
"azurerm_express_route_circuit_peering": resourceExpressRouteCircuitPeering(),
"azurerm_express_route_circuit": resourceExpressRouteCircuit(),
"azurerm_express_route_gateway": resourceExpressRouteGateway(),
"azurerm_ip_group": resourceArmIpGroup(),
"azurerm_local_network_gateway": resourceArmLocalNetworkGateway(),
"azurerm_ip_group": resourceIpGroup(),
"azurerm_local_network_gateway": resourceLocalNetworkGateway(),
"azurerm_nat_gateway": resourceArmNatGateway(),
"azurerm_network_connection_monitor": resourceArmNetworkConnectionMonitor(),
"azurerm_network_ddos_protection_plan": resourceArmNetworkDDoSProtectionPlan(),
Expand All @@ -82,9 +82,9 @@ func (r Registration) SupportedResources() map[string]*schema.Resource {
"azurerm_network_security_rule": resourceArmNetworkSecurityRule(),
"azurerm_network_watcher_flow_log": resourceArmNetworkWatcherFlowLog(),
"azurerm_network_watcher": resourceArmNetworkWatcher(),
"azurerm_route_filter": resourceArmRouteFilter(),
"azurerm_route_table": resourceArmRouteTable(),
"azurerm_route": resourceArmRoute(),
"azurerm_route_filter": resourceRouteFilter(),
"azurerm_route_table": resourceRouteTable(),
"azurerm_route": resourceRoute(),
"azurerm_virtual_hub_security_partner_provider": resourceArmVirtualHubSecurityPartnerProvider(),
"azurerm_subnet_service_endpoint_storage_policy": resourceArmSubnetServiceEndpointStoragePolicy(),
"azurerm_subnet_network_security_group_association": resourceArmSubnetNetworkSecurityGroupAssociation(),
Expand Down
6 changes: 3 additions & 3 deletions azurerm/internal/services/network/route_filter_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

func dataSourceArmRouteFilter() *schema.Resource {
func dataSourceRouteFilter() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmRouteFilterRead,
Read: dataSourceRouteFilterRead,

Timeouts: &schema.ResourceTimeout{
Read: schema.DefaultTimeout(5 * time.Minute),
Expand Down Expand Up @@ -69,7 +69,7 @@ func dataSourceArmRouteFilter() *schema.Resource {
}
}

func dataSourceArmRouteFilterRead(d *schema.ResourceData, meta interface{}) error {
func dataSourceRouteFilterRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RouteFiltersClient
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down
18 changes: 9 additions & 9 deletions azurerm/internal/services/network/route_filter_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

func resourceArmRouteFilter() *schema.Resource {
func resourceRouteFilter() *schema.Resource {
return &schema.Resource{
Create: resourceArmRouteFilterCreateUpdate,
Read: resourceArmRouteFilterRead,
Update: resourceArmRouteFilterCreateUpdate,
Delete: resourceArmRouteFilterDelete,
Create: resourceRouteFilterCreateUpdate,
Read: resourceRouteFilterRead,
Update: resourceRouteFilterCreateUpdate,
Delete: resourceRouteFilterDelete,

Importer: azSchema.ValidateResourceIDPriorToImport(func(id string) error {
_, err := parse.RouteFilterID(id)
Expand Down Expand Up @@ -97,7 +97,7 @@ func resourceArmRouteFilter() *schema.Resource {
}
}

func resourceArmRouteFilterCreateUpdate(d *schema.ResourceData, meta interface{}) error {
func resourceRouteFilterCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RouteFiltersClient
ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down Expand Up @@ -151,10 +151,10 @@ func resourceArmRouteFilterCreateUpdate(d *schema.ResourceData, meta interface{}

d.SetId(*read.ID)

return resourceArmRouteFilterRead(d, meta)
return resourceRouteFilterRead(d, meta)
}

func resourceArmRouteFilterRead(d *schema.ResourceData, meta interface{}) error {
func resourceRouteFilterRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RouteFiltersClient
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down Expand Up @@ -188,7 +188,7 @@ func resourceArmRouteFilterRead(d *schema.ResourceData, meta interface{}) error
return tags.FlattenAndSet(d, resp.Tags)
}

func resourceArmRouteFilterDelete(d *schema.ResourceData, meta interface{}) error {
func resourceRouteFilterDelete(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RouteFiltersClient
ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down
18 changes: 9 additions & 9 deletions azurerm/internal/services/network/route_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

func resourceArmRoute() *schema.Resource {
func resourceRoute() *schema.Resource {
return &schema.Resource{
Create: resourceArmRouteCreateUpdate,
Read: resourceArmRouteRead,
Update: resourceArmRouteCreateUpdate,
Delete: resourceArmRouteDelete,
Create: resourceRouteCreateUpdate,
Read: resourceRouteRead,
Update: resourceRouteCreateUpdate,
Delete: resourceRouteDelete,

Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
Expand Down Expand Up @@ -79,7 +79,7 @@ func resourceArmRoute() *schema.Resource {
}
}

func resourceArmRouteCreateUpdate(d *schema.ResourceData, meta interface{}) error {
func resourceRouteCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RoutesClient
ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down Expand Up @@ -137,10 +137,10 @@ func resourceArmRouteCreateUpdate(d *schema.ResourceData, meta interface{}) erro
}
d.SetId(*read.ID)

return resourceArmRouteRead(d, meta)
return resourceRouteRead(d, meta)
}

func resourceArmRouteRead(d *schema.ResourceData, meta interface{}) error {
func resourceRouteRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RoutesClient
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down Expand Up @@ -175,7 +175,7 @@ func resourceArmRouteRead(d *schema.ResourceData, meta interface{}) error {
return nil
}

func resourceArmRouteDelete(d *schema.ResourceData, meta interface{}) error {
func resourceRouteDelete(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RoutesClient
ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down
6 changes: 3 additions & 3 deletions azurerm/internal/services/network/route_table_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

func dataSourceArmRouteTable() *schema.Resource {
func dataSourceRouteTable() *schema.Resource {
return &schema.Resource{
Read: dataSourceArmRouteTableRead,
Read: dataSourceRouteTableRead,

Timeouts: &schema.ResourceTimeout{
Read: schema.DefaultTimeout(5 * time.Minute),
Expand Down Expand Up @@ -73,7 +73,7 @@ func dataSourceArmRouteTable() *schema.Resource {
}
}

func dataSourceArmRouteTableRead(d *schema.ResourceData, meta interface{}) error {
func dataSourceRouteTableRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RouteTablesClient
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down
18 changes: 9 additions & 9 deletions azurerm/internal/services/network/route_table_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import (

var routeTableResourceName = "azurerm_route_table"

func resourceArmRouteTable() *schema.Resource {
func resourceRouteTable() *schema.Resource {
return &schema.Resource{
Create: resourceArmRouteTableCreateUpdate,
Read: resourceArmRouteTableRead,
Update: resourceArmRouteTableCreateUpdate,
Delete: resourceArmRouteTableDelete,
Create: resourceRouteTableCreateUpdate,
Read: resourceRouteTableRead,
Update: resourceRouteTableCreateUpdate,
Delete: resourceRouteTableDelete,

Importer: azSchema.ValidateResourceIDPriorToImport(func(id string) error {
_, err := ParseRouteTableID(id)
Expand Down Expand Up @@ -111,7 +111,7 @@ func resourceArmRouteTable() *schema.Resource {
}
}

func resourceArmRouteTableCreateUpdate(d *schema.ResourceData, meta interface{}) error {
func resourceRouteTableCreateUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RouteTablesClient
ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down Expand Up @@ -166,10 +166,10 @@ func resourceArmRouteTableCreateUpdate(d *schema.ResourceData, meta interface{})

d.SetId(*read.ID)

return resourceArmRouteTableRead(d, meta)
return resourceRouteTableRead(d, meta)
}

func resourceArmRouteTableRead(d *schema.ResourceData, meta interface{}) error {
func resourceRouteTableRead(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RouteTablesClient
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down Expand Up @@ -208,7 +208,7 @@ func resourceArmRouteTableRead(d *schema.ResourceData, meta interface{}) error {
return tags.FlattenAndSet(d, resp.Tags)
}

func resourceArmRouteTableDelete(d *schema.ResourceData, meta interface{}) error {
func resourceRouteTableDelete(d *schema.ResourceData, meta interface{}) error {
client := meta.(*clients.Client).Network.RouteTablesClient
ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d)
defer cancel()
Expand Down
Loading

0 comments on commit 0510026

Please sign in to comment.