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

New Resouce azurerm_network_manager_deployment #20451

Merged
merged 17 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
client.MSSQL = mssql.NewClient(o)
client.MySQL = mysql.NewClient(o)
client.NetApp = netapp.NewClient(o)
client.Network = network.NewClient(o)
if client.Network, err = network.NewClient(o); err != nil {
return fmt.Errorf("building clients for Network: %+v", err)
}
client.Nginx = nginx.NewClient(o)
client.NotificationHubs = notificationhub.NewClient(o)
client.Orbital = orbital.NewClient(o)
Expand Down
14 changes: 0 additions & 14 deletions internal/provider/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,6 @@ func schemaFeatures(supportLegacyTestSuite bool) *pluginsdk.Schema {
},
},

"network": {
Type: pluginsdk.TypeList,
Optional: true,
MaxItems: 1,
Elem: &pluginsdk.Resource{
Schema: map[string]*pluginsdk.Schema{
"relaxed_locking": {
Type: pluginsdk.TypeBool,
Required: true,
},
},
},
},

"template_deployment": {
Type: pluginsdk.TypeList,
Optional: true,
Expand Down
10 changes: 0 additions & 10 deletions internal/provider/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ func TestExpandFeatures(t *testing.T) {
"expand_without_downtime": true,
},
},
"network": []interface{}{
map[string]interface{}{
"relaxed_locking": true,
},
},
"resource_group": []interface{}{
map[string]interface{}{
"prevent_deletion_if_contains_resources": true,
Expand Down Expand Up @@ -246,11 +241,6 @@ func TestExpandFeatures(t *testing.T) {
"expand_without_downtime": false,
},
},
"network_locking": []interface{}{
map[string]interface{}{
"relaxed_locking": false,
},
},
"resource_group": []interface{}{
map[string]interface{}{
"prevent_deletion_if_contains_resources": false,
Expand Down
18 changes: 16 additions & 2 deletions internal/services/network/client/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package client

import (
"fmt"

"github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-09-01/networkmanagers"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
"github.com/tombuildsstuff/kermit/sdk/network/2022-07-01/network"
)
Expand Down Expand Up @@ -29,6 +32,7 @@ type Client struct {
ManagersClient *network.ManagersClient
ManagerAdminRulesClient *network.AdminRulesClient
ManagerAdminRuleCollectionsClient *network.AdminRuleCollectionsClient
ManagerDeploymentsClient *networkmanagers.NetworkManagersClient
ManagerConnectivityConfigurationsClient *network.ConnectivityConfigurationsClient
ManagerManagementGroupConnectionsClient *network.ManagementGroupNetworkManagerConnectionsClient
ManagerNetworkGroupsClient *network.GroupsClient
Expand Down Expand Up @@ -76,7 +80,7 @@ type Client struct {
ResourceNavigationLinkClient *network.ResourceNavigationLinksClient
}

func NewClient(o *common.ClientOptions) *Client {
func NewClient(o *common.ClientOptions) (*Client, error) {
ApplicationGatewaysClient := network.NewApplicationGatewaysClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&ApplicationGatewaysClient.Client, o.ResourceManagerAuthorizer)

Expand Down Expand Up @@ -149,6 +153,15 @@ func NewClient(o *common.ClientOptions) *Client {
ManagerConnectivityConfigurationsClient := network.NewConnectivityConfigurationsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&ManagerConnectivityConfigurationsClient.Client, o.ResourceManagerAuthorizer)

ManagerDeploymentsClient, err := networkmanagers.NewNetworkManagersClientWithBaseURI(o.Environment.ResourceManager)
if err != nil {
return nil, fmt.Errorf("building deployment client: %+v", err)
}
o.Configure(ManagerDeploymentsClient.Client, o.Authorizers.ResourceManager)

ManagerDeploymentStatusClient := network.NewManagerDeploymentStatusClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&ManagerDeploymentStatusClient.Client, o.ResourceManagerAuthorizer)

ManagerScopeConnectionsClient := network.NewScopeConnectionsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId)
o.ConfigureClient(&ManagerScopeConnectionsClient.Client, o.ResourceManagerAuthorizer)

Expand Down Expand Up @@ -306,6 +319,7 @@ func NewClient(o *common.ClientOptions) *Client {
ManagerAdminRulesClient: &ManagerAdminRulesClient,
ManagerAdminRuleCollectionsClient: &ManagerAdminRuleCollectionsClient,
ManagerConnectivityConfigurationsClient: &ManagerConnectivityConfigurationsClient,
ManagerDeploymentsClient: ManagerDeploymentsClient,
ManagerManagementGroupConnectionsClient: &ManagerManagementGroupConnectionsClient,
ManagerNetworkGroupsClient: &ManagerNetworkGroupsClient,
ManagerScopeConnectionsClient: &ManagerScopeConnectionsClient,
Expand Down Expand Up @@ -350,5 +364,5 @@ func NewClient(o *common.ClientOptions) *Client {
PrivateLinkServiceClient: &PrivateLinkServiceClient,
ServiceAssociationLinkClient: &ServiceAssociationLinkClient,
ResourceNavigationLinkClient: &ResourceNavigationLinkClient,
}
}, nil
}
Loading