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

Virtual network gateway connection #35

Merged
13 changes: 9 additions & 4 deletions azurestack/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ type ArmClient struct {
zonesClient dns.ZonesClient

// Networking
ifaceClient network.InterfacesClient
localNetConnClient network.LocalNetworkGatewaysClient
secRuleClient network.SecurityRulesClient
vnetGatewayClient network.VirtualNetworkGatewaysClient
ifaceClient network.InterfacesClient
localNetConnClient network.LocalNetworkGatewaysClient
secRuleClient network.SecurityRulesClient
vnetGatewayClient network.VirtualNetworkGatewaysClient
vnetGatewayConnectionsClient network.VirtualNetworkGatewayConnectionsClient

// Resources
providersClient resources.ProvidersClient
Expand Down Expand Up @@ -227,6 +228,10 @@ func (c *ArmClient) registerNetworkingClients(endpoint, subscriptionId string, a
c.configureClient(&gatewaysClient.Client, auth)
c.vnetGatewayClient = gatewaysClient

gatewayConnectionsClient := network.NewVirtualNetworkGatewayConnectionsClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&gatewayConnectionsClient.Client, auth)
c.vnetGatewayConnectionsClient = gatewayConnectionsClient

localNetworkGatewaysClient := network.NewLocalNetworkGatewaysClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&localNetworkGatewaysClient.Client, auth)
c.localNetConnClient = localNetworkGatewaysClient
Expand Down
53 changes: 27 additions & 26 deletions azurestack/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,32 +76,33 @@ func Provider() terraform.ResourceProvider {
},

ResourcesMap: map[string]*schema.Resource{
"azurestack_availability_set": resourceArmAvailabilitySet(),
"azurestack_dns_zone": resourceArmDnsZone(),
"azurestack_dns_a_record": resourceArmDnsARecord(),
"azurestack_network_interface": resourceArmNetworkInterface(),
"azurestack_network_security_group": resourceArmNetworkSecurityGroup(),
"azurestack_network_security_rule": resourceArmNetworkSecurityRule(),
"azurestack_local_network_gateway": resourceArmLocalNetworkGateway(),
"azurestack_lb": resourceArmLoadBalancer(),
"azurestack_lb_backend_address_pool": resourceArmLoadBalancerBackendAddressPool(),
"azurestack_lb_nat_rule": resourceArmLoadBalancerNatRule(),
"azurestack_lb_probe": resourceArmLoadBalancerProbe(),
"azurestack_lb_nat_pool": resourceArmLoadBalancerNatPool(),
"azurestack_lb_rule": resourceArmLoadBalancerRule(),
"azurestack_public_ip": resourceArmPublicIp(),
"azurestack_resource_group": resourceArmResourceGroup(),
"azurestack_route": resourceArmRoute(),
"azurestack_route_table": resourceArmRouteTable(),
"azurestack_storage_account": resourceArmStorageAccount(),
"azurestack_storage_blob": resourceArmStorageBlob(),
"azurestack_storage_container": resourceArmStorageContainer(),
"azurestack_subnet": resourceArmSubnet(),
"azurestack_template_deployment": resourceArmTemplateDeployment(),
"azurestack_virtual_network": resourceArmVirtualNetwork(),
"azurestack_virtual_network_gateway": resourceArmVirtualNetworkGateway(),
"azurestack_virtual_machine": resourceArmVirtualMachine(),
"azurestack_virtual_machine_extension": resourceArmVirtualMachineExtensions(),
"azurestack_availability_set": resourceArmAvailabilitySet(),
"azurestack_dns_zone": resourceArmDnsZone(),
"azurestack_dns_a_record": resourceArmDnsARecord(),
"azurestack_network_interface": resourceArmNetworkInterface(),
"azurestack_network_security_group": resourceArmNetworkSecurityGroup(),
"azurestack_network_security_rule": resourceArmNetworkSecurityRule(),
"azurestack_local_network_gateway": resourceArmLocalNetworkGateway(),
"azurestack_lb": resourceArmLoadBalancer(),
"azurestack_lb_backend_address_pool": resourceArmLoadBalancerBackendAddressPool(),
"azurestack_lb_nat_rule": resourceArmLoadBalancerNatRule(),
"azurestack_lb_probe": resourceArmLoadBalancerProbe(),
"azurestack_lb_nat_pool": resourceArmLoadBalancerNatPool(),
"azurestack_lb_rule": resourceArmLoadBalancerRule(),
"azurestack_public_ip": resourceArmPublicIp(),
"azurestack_resource_group": resourceArmResourceGroup(),
"azurestack_route": resourceArmRoute(),
"azurestack_route_table": resourceArmRouteTable(),
"azurestack_storage_account": resourceArmStorageAccount(),
"azurestack_storage_blob": resourceArmStorageBlob(),
"azurestack_storage_container": resourceArmStorageContainer(),
"azurestack_subnet": resourceArmSubnet(),
"azurestack_template_deployment": resourceArmTemplateDeployment(),
"azurestack_virtual_network": resourceArmVirtualNetwork(),
"azurestack_virtual_network_gateway": resourceArmVirtualNetworkGateway(),
"azurestack_virtual_machine": resourceArmVirtualMachine(),
"azurestack_virtual_machine_extension": resourceArmVirtualMachineExtensions(),
"azurestack_virtual_network_gateway_connection": resourceArmVirtualNetworkGatewayConnection(),
},
}

Expand Down
4 changes: 4 additions & 0 deletions azurestack/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func testLocation() string {
return os.Getenv("ARM_TEST_LOCATION")
}

func testAltLocation() string {
return os.Getenv("ARM_TEST_LOCATION_ALT")
}

func testGetAzureConfig(t *testing.T) *authentication.Config {
if os.Getenv(resource.TestEnvVar) == "" {
t.Skip(fmt.Sprintf("Integration test skipped unless env '%s' set", resource.TestEnvVar))
Expand Down
Loading