Skip to content

Commit

Permalink
Merge pull request #1 from terraform-providers/master
Browse files Browse the repository at this point in the history
merge from origin
  • Loading branch information
Steven Hawkins authored Sep 18, 2018
2 parents c165188 + 3816b0a commit 5dab9e0
Show file tree
Hide file tree
Showing 51 changed files with 4,325 additions and 470 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ website/vendor
!command/test-fixtures/**/.terraform/

.env.sh

# goenv version file
.go-version
733 changes: 718 additions & 15 deletions CHANGELOG.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ type ArmClient struct {
mysqlDatabasesClient mysql.DatabasesClient
mysqlFirewallRulesClient mysql.FirewallRulesClient
mysqlServersClient mysql.ServersClient
mysqlVirtualNetworkRulesClient mysql.VirtualNetworkRulesClient
postgresqlConfigurationsClient postgresql.ConfigurationsClient
postgresqlDatabasesClient postgresql.DatabasesClient
postgresqlFirewallRulesClient postgresql.FirewallRulesClient
Expand Down Expand Up @@ -184,6 +185,7 @@ type ArmClient struct {
// Networking
applicationGatewayClient network.ApplicationGatewaysClient
applicationSecurityGroupsClient network.ApplicationSecurityGroupsClient
azureFirewallsClient network.AzureFirewallsClient
expressRouteAuthsClient network.ExpressRouteCircuitAuthorizationsClient
expressRouteCircuitClient network.ExpressRouteCircuitsClient
expressRoutePeeringsClient network.ExpressRouteCircuitPeeringsClient
Expand Down Expand Up @@ -602,6 +604,10 @@ func (c *ArmClient) registerDatabases(endpoint, subscriptionId string, auth auto
c.configureClient(&mysqlServersClient.Client, auth)
c.mysqlServersClient = mysqlServersClient

mysqlVirtualNetworkRulesClient := mysql.NewVirtualNetworkRulesClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&mysqlVirtualNetworkRulesClient.Client, auth)
c.mysqlVirtualNetworkRulesClient = mysqlVirtualNetworkRulesClient

// PostgreSQL
postgresqlConfigClient := postgresql.NewConfigurationsClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&postgresqlConfigClient.Client, auth)
Expand Down Expand Up @@ -753,6 +759,10 @@ func (c *ArmClient) registerNetworkingClients(endpoint, subscriptionId string, a
c.configureClient(&appSecurityGroupsClient.Client, auth)
c.applicationSecurityGroupsClient = appSecurityGroupsClient

azureFirewallsClient := network.NewAzureFirewallsClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&azureFirewallsClient.Client, auth)
c.azureFirewallsClient = azureFirewallsClient

expressRouteAuthsClient := network.NewExpressRouteCircuitAuthorizationsClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&expressRouteAuthsClient.Client, auth)
c.expressRouteAuthsClient = expressRouteAuthsClient
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_builtin_role_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func TestAccDataSourceAzureRMBuiltInRoleDefinition_virtualMachineContributor(t *
resource.TestCheckResourceAttrSet(dataSourceName, "description"),
resource.TestCheckResourceAttrSet(dataSourceName, "type"),
resource.TestCheckResourceAttr(dataSourceName, "permissions.#", "1"),
resource.TestCheckResourceAttr(dataSourceName, "permissions.0.actions.#", "37"),
resource.TestCheckResourceAttr(dataSourceName, "permissions.0.actions.#", "38"),
resource.TestCheckResourceAttr(dataSourceName, "permissions.0.actions.0", "Microsoft.Authorization/*/read"),
resource.TestCheckResourceAttr(dataSourceName, "permissions.0.actions.15", "Microsoft.Network/networkSecurityGroups/join/action"),
resource.TestCheckResourceAttr(dataSourceName, "permissions.0.not_actions.#", "0"),
Expand Down
42 changes: 42 additions & 0 deletions azurerm/helpers/azure/firewall.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package azure

import (
"fmt"

"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network"
)

// The API requires InternalPublicIPAddress to be set when for a CreateOrUpdate
// operation, but Get operations return the property as PublicIPAddress
// so we need to go through and copy the value to the correct property.
func FirewallFixIPConfiguration(input *[]network.AzureFirewallIPConfiguration) (*[]network.AzureFirewallIPConfiguration, error) {
if input == nil {
return nil, fmt.Errorf("`input` was nil")
}

results := make([]network.AzureFirewallIPConfiguration, 0)
for _, config := range *input {
if config.Subnet == nil || config.Subnet.ID == nil {
return nil, fmt.Errorf("`config.Subnet.ID` was nil")
}

if config.PublicIPAddress == nil || config.PublicIPAddress.ID == nil {
return nil, fmt.Errorf("`config.PublicIPAddress.ID` was nil")
}

result := network.AzureFirewallIPConfiguration{
Name: config.Name,
AzureFirewallIPConfigurationPropertiesFormat: &network.AzureFirewallIPConfigurationPropertiesFormat{
Subnet: &network.SubResource{
ID: config.Subnet.ID,
},
InternalPublicIPAddress: &network.SubResource{
ID: config.PublicIPAddress.ID,
},
},
}
results = append(results, result)
}

return &results, nil
}
105 changes: 0 additions & 105 deletions azurerm/import_arm_public_ip_test.go

This file was deleted.

32 changes: 0 additions & 32 deletions azurerm/import_arm_virtual_network_gateway_connection_test.go

This file was deleted.

3 changes: 3 additions & 0 deletions azurerm/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ func Provider() terraform.ResourceProvider {
"azurerm_automation_schedule": resourceArmAutomationSchedule(),
"azurerm_autoscale_setting": resourceArmAutoScaleSetting(),
"azurerm_availability_set": resourceArmAvailabilitySet(),
"azurerm_firewall": resourceArmFirewall(),
"azurerm_firewall_network_rule_collection": resourceArmFirewallNetworkRuleCollection(),
"azurerm_cdn_endpoint": resourceArmCdnEndpoint(),
"azurerm_cdn_profile": resourceArmCdnProfile(),
"azurerm_container_registry": resourceArmContainerRegistry(),
Expand Down Expand Up @@ -204,6 +206,7 @@ func Provider() terraform.ResourceProvider {
"azurerm_mysql_database": resourceArmMySqlDatabase(),
"azurerm_mysql_firewall_rule": resourceArmMySqlFirewallRule(),
"azurerm_mysql_server": resourceArmMySqlServer(),
"azurerm_mysql_virtual_network_rule": resourceArmMySqlVirtualNetworkRule(),
"azurerm_network_interface": resourceArmNetworkInterface(),
"azurerm_network_security_group": resourceArmNetworkSecurityGroup(),
"azurerm_network_security_rule": resourceArmNetworkSecurityRule(),
Expand Down
Loading

0 comments on commit 5dab9e0

Please sign in to comment.