Skip to content

Commit

Permalink
merge master -S
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte committed Apr 16, 2019
2 parents bbd5d33 + 3a0c3e0 commit 7f03c6d
Show file tree
Hide file tree
Showing 27 changed files with 1,397 additions and 29 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ FEATURES:
* **New Data Source:** `azurerm_batch_certificate` [GH-3097]
* **New Data Source:** `azurerm_firewall` [GH-3235]
* **New Data Source:** `azurerm_hdinsight_cluster` [GH-3196]
* **New Data Source:** `azurerm_stream_analytics_job` [GH-3227]
* **New Resource:** `azurerm_batch_certificate` [GH-3097]
* **New Resource:** `azurerm_data_factory` [GH-3159]
* **New Resource:** `azurerm_data_factory_dataset_sql_server_table` [GH-3236]
* **New Resource:** `azurerm_data_factory_linked_service_sql_server` [GH-3205]
* **New Resource:** `azurerm_data_factory_pipeline` [GH-3244]
* **New Resource:** `azurerm_hdinsight_kafka_cluster` [GH-3196]
* **New Resource:** `azurerm_hdinsight_kbase_cluster` [GH-3196]
* **New Resource:** `azurerm_hdinsight_hadoop_cluster` [GH-3196]
Expand All @@ -17,7 +19,13 @@ FEATURES:
* **New Resource:** `azurerm_hdinsight_rserver_cluster` [GH-3196]
* **New Resource:** `azurerm_hdinsight_spark_cluster` [GH-3196]
* **New Resource:** `azurerm_hdinsight_storm_cluster` [GH-3196]
* **New Resource:** `azurerm_public_ip_prefix` [GH-3139]
* **New Resource:** `azurerm_iothub_shared_access_policy` [GH-3009]
* **New Resource:** `azurerm_stream_analytics_job` [GH-3227]
* **New Resource:** `azurerm_stream_analytics_function_javascript_udf` [GH-3249]
* **New Resource:** `azurerm_stream_analytics_output_blob` [GH-3250]
* **New Resource:** `azurerm_stream_analytics_output_eventhub` [GH-3250]
* **New Resource:** `azurerm_stream_analytics_output_servicebus_queue` [GH-3250]

IMPROVEMENTS:

Expand All @@ -28,7 +36,9 @@ IMPROVEMENTS:
* `azurerm_container_group` - support for specifying `liveness_probe` and `readiness_probe` blocks [GH-3118]
* `azurerm_redis_cache` - support for setting `aof_backup_enabled`, `aof_storage_connection_string_0` and `aof_storage_connection_string_1` [GH-3155]
* `azurerm_key_vault_access_policy` - support for setting `storage_permissions` [GH-3153]
* `azurerm_kubernetes_cluster` - `network_policy` now supports `azure` [GH-3213]
* `azurerm_iothub` - support for configuring `ip_filter_rule` [GH-3173]
* `azurerm_public_ip` - support for attaching a `azurerm_public_ip_prefix` [GH-3139]
* `azurerm_storage_blob` - support for the `metadata` property [GH-3206]
* `azurerm_traffic_manager_profile` - support the `MultiValue` and `Weighted` values for the `traffic_routing_method` property [GH-3207]
* `azurerm_virtual_network_gateway` - support for the `VpnGw1AZ`, `VpnGw2AZ`, and `VpnGw3AZ` SKU's [GH-3171]
Expand Down
10 changes: 10 additions & 0 deletions azurerm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ type ArmClient struct {
sqlVirtualNetworkRulesClient sql.VirtualNetworkRulesClient

// Data Factory
dataFactoryPipelineClient datafactory.PipelinesClient
dataFactoryClient datafactory.FactoriesClient
dataFactoryDatasetClient datafactory.DatasetsClient
dataFactoryLinkedServiceClient datafactory.LinkedServicesClient
Expand Down Expand Up @@ -292,6 +293,7 @@ type ArmClient struct {
localNetConnClient network.LocalNetworkGatewaysClient
packetCapturesClient network.PacketCapturesClient
publicIPClient network.PublicIPAddressesClient
publicIPPrefixClient network.PublicIPPrefixesClient
routesClient network.RoutesClient
routeTablesClient network.RouteTablesClient
secGroupClient network.SecurityGroupsClient
Expand Down Expand Up @@ -907,6 +909,10 @@ func (c *ArmClient) registerDataFactoryClients(endpoint, subscriptionId string,
dataFactoryLinkedServiceClient := datafactory.NewLinkedServicesClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&dataFactoryLinkedServiceClient.Client, auth)
c.dataFactoryLinkedServiceClient = dataFactoryLinkedServiceClient

dataFactoryPipelineClient := datafactory.NewPipelinesClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&dataFactoryPipelineClient.Client, auth)
c.dataFactoryPipelineClient = dataFactoryPipelineClient
}

func (c *ArmClient) registerDataLakeStoreClients(endpoint, subscriptionId string, auth autorest.Authorizer) {
Expand Down Expand Up @@ -1132,6 +1138,10 @@ func (c *ArmClient) registerNetworkingClients(endpoint, subscriptionId string, a
c.configureClient(&publicIPAddressesClient.Client, auth)
c.publicIPClient = publicIPAddressesClient

publicIPPrefixesClient := network.NewPublicIPPrefixesClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&publicIPPrefixesClient.Client, auth)
c.publicIPPrefixClient = publicIPPrefixesClient

routesClient := network.NewRoutesClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&routesClient.Client, auth)
c.routesClient = routesClient
Expand Down
31 changes: 31 additions & 0 deletions azurerm/data_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,34 @@ func flattenDataFactoryAnnotations(input *[]interface{}) []string {
}
return annotations
}

func expandDataFactoryVariables(input map[string]interface{}) map[string]*datafactory.VariableSpecification {
output := make(map[string]*datafactory.VariableSpecification)

for k, v := range input {
output[k] = &datafactory.VariableSpecification{
Type: datafactory.VariableTypeString,
DefaultValue: v.(string),
}
}

return output
}

func flattenDataFactoryVariables(input map[string]*datafactory.VariableSpecification) map[string]interface{} {
output := make(map[string]interface{})

for k, v := range input {
if v != nil {
// we only support string parameters at this time
val, ok := v.DefaultValue.(string)
if !ok {
log.Printf("[DEBUG] Skipping variable %q since it's not a string", k)
}

output[k] = val
}
}

return output
}
4 changes: 2 additions & 2 deletions azurerm/data_source_batch_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestAccDataSourceAzureRMBatchAccount_complete(t *testing.T) {
func testAccDataSourceAzureRMBatchAccount_basic(rInt int, rString string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "testaccbatch%d"
name = "testaccRG-%d-batch"
location = "%s"
}
Expand All @@ -81,7 +81,7 @@ data "azurerm_batch_account" "test" {
func testAccDataSourceAzureRMBatchAccount_complete(rInt int, rString string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "testaccbatch%d"
name = "testaccRG-%d-batch"
location = "%s"
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/data_source_batch_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func TestAccDataSourceAzureRMBatchPool_complete(t *testing.T) {
func testAccDataSourceAzureRMBatchPool_complete(rInt int, rString string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "testaccbatch%d"
name = "testaccRG-%d-batch"
location = "%s"
}
Expand Down
86 changes: 86 additions & 0 deletions azurerm/data_source_kubernetes_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,37 @@ func TestAccDataSourceAzureRMKubernetesCluster_advancedNetworkingAzureCalicoPoli
})
}

func TestAccDataSourceAzureRMKubernetesCluster_advancedNetworkingAzureNPMPolicy(t *testing.T) {
dataSourceName := "data.azurerm_kubernetes_cluster.test"
ri := tf.AccRandTimeInt()
clientId := os.Getenv("ARM_CLIENT_ID")
clientSecret := os.Getenv("ARM_CLIENT_SECRET")
location := testLocation()
config := testAccDataSourceAzureRMKubernetesCluster_advancedNetworkingAzureNPMPolicy(ri, clientId, clientSecret, location)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMKubernetesClusterDestroy,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMKubernetesClusterExists(dataSourceName),
resource.TestCheckResourceAttrSet(dataSourceName, "agent_pool_profile.0.vnet_subnet_id"),
resource.TestCheckResourceAttr(dataSourceName, "network_profile.0.network_plugin", "azure"),
resource.TestCheckResourceAttr(dataSourceName, "network_profile.0.network_policy", "azure"),
resource.TestCheckResourceAttrSet(dataSourceName, "network_profile.0.network_plugin"),
resource.TestCheckResourceAttrSet(dataSourceName, "network_profile.0.network_policy"),
resource.TestCheckResourceAttrSet(dataSourceName, "network_profile.0.dns_service_ip"),
resource.TestCheckResourceAttrSet(dataSourceName, "network_profile.0.docker_bridge_cidr"),
resource.TestCheckResourceAttrSet(dataSourceName, "network_profile.0.service_cidr"),
),
},
},
})
}

func TestAccDataSourceAzureRMKubernetesCluster_advancedNetworkingAzureComplete(t *testing.T) {
dataSourceName := "data.azurerm_kubernetes_cluster.test"
ri := tf.AccRandTimeInt()
Expand Down Expand Up @@ -243,6 +274,37 @@ func TestAccDataSourceAzureRMKubernetesCluster_advancedNetworkingAzureCalicoPoli
})
}

func TestAccDataSourceAzureRMKubernetesCluster_advancedNetworkingAzureNPMPolicyComplete(t *testing.T) {
dataSourceName := "data.azurerm_kubernetes_cluster.test"
ri := tf.AccRandTimeInt()
clientId := os.Getenv("ARM_CLIENT_ID")
clientSecret := os.Getenv("ARM_CLIENT_SECRET")
location := testLocation()
config := testAccDataSourceAzureRMKubernetesCluster_advancedNetworkingAzureNPMPolicyComplete(ri, clientId, clientSecret, location)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMKubernetesClusterDestroy,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMKubernetesClusterExists(dataSourceName),
resource.TestCheckResourceAttrSet(dataSourceName, "agent_pool_profile.0.vnet_subnet_id"),
resource.TestCheckResourceAttr(dataSourceName, "network_profile.0.network_plugin", "azure"),
resource.TestCheckResourceAttr(dataSourceName, "network_profile.0.network_policy", "azure"),
resource.TestCheckResourceAttrSet(dataSourceName, "network_profile.0.network_plugin"),
resource.TestCheckResourceAttrSet(dataSourceName, "network_profile.0.network_policy"),
resource.TestCheckResourceAttrSet(dataSourceName, "network_profile.0.dns_service_ip"),
resource.TestCheckResourceAttrSet(dataSourceName, "network_profile.0.docker_bridge_cidr"),
resource.TestCheckResourceAttrSet(dataSourceName, "network_profile.0.service_cidr"),
),
},
},
})
}

func TestAccDataSourceAzureRMKubernetesCluster_advancedNetworkingKubenet(t *testing.T) {
dataSourceName := "data.azurerm_kubernetes_cluster.test"
ri := tf.AccRandTimeInt()
Expand Down Expand Up @@ -427,6 +489,18 @@ data "azurerm_kubernetes_cluster" "test" {
`, r)
}

func testAccDataSourceAzureRMKubernetesCluster_advancedNetworkingAzureNPMPolicy(rInt int, clientId string, clientSecret string, location string) string {
r := testAccAzureRMKubernetesCluster_advancedNetworkingWithPolicy(rInt, clientId, clientSecret, location, "azure", "azure")
return fmt.Sprintf(`
%s
data "azurerm_kubernetes_cluster" "test" {
name = "${azurerm_kubernetes_cluster.test.name}"
resource_group_name = "${azurerm_kubernetes_cluster.test.resource_group_name}"
}
`, r)
}

func testAccDataSourceAzureRMKubernetesCluster_advancedNetworkingAzureComplete(rInt int, clientId string, clientSecret string, location string) string {
r := testAccAzureRMKubernetesCluster_advancedNetworkingComplete(rInt, clientId, clientSecret, location, "azure")
return fmt.Sprintf(`
Expand All @@ -451,6 +525,18 @@ data "azurerm_kubernetes_cluster" "test" {
`, r)
}

func testAccDataSourceAzureRMKubernetesCluster_advancedNetworkingAzureNPMPolicyComplete(rInt int, clientId string, clientSecret string, location string) string {
r := testAccAzureRMKubernetesCluster_advancedNetworkingWithPolicyComplete(rInt, clientId, clientSecret, location, "azure", "azure")
return fmt.Sprintf(`
%s
data "azurerm_kubernetes_cluster" "test" {
name = "${azurerm_kubernetes_cluster.test.name}"
resource_group_name = "${azurerm_kubernetes_cluster.test.resource_group_name}"
}
`, r)
}

func testAccDataSourceAzureRMKubernetesCluster_advancedNetworkingKubenet(rInt int, clientId string, clientSecret string, location string) string {
r := testAccAzureRMKubernetesCluster_advancedNetworking(rInt, clientId, clientSecret, location, "kubenet")
return fmt.Sprintf(`
Expand Down
2 changes: 1 addition & 1 deletion azurerm/helpers/azure/hdinsight.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func SchemaHDInsightsStorageAccounts() *schema.Schema {
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateFunc: ValidateResourceID,
ValidateFunc: validate.NoEmptyStrings,
},
"is_default": {
Type: schema.TypeBool,
Expand Down
2 changes: 2 additions & 0 deletions azurerm/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ func Provider() terraform.ResourceProvider {
"azurerm_data_factory": resourceArmDataFactory(),
"azurerm_data_factory_dataset_sql_server_table": resourceArmDataFactoryDatasetSQLServerTable(),
"azurerm_data_factory_linked_service_sql_server": resourceArmDataFactoryLinkedServiceSQLServer(),
"azurerm_data_factory_pipeline": resourceArmDataFactoryPipeline(),
"azurerm_data_lake_analytics_account": resourceArmDataLakeAnalyticsAccount(),
"azurerm_data_lake_analytics_firewall_rule": resourceArmDataLakeAnalyticsFirewallRule(),
"azurerm_data_lake_store_file": resourceArmDataLakeStoreFile(),
Expand Down Expand Up @@ -338,6 +339,7 @@ func Provider() terraform.ResourceProvider {
"azurerm_postgresql_server": resourceArmPostgreSQLServer(),
"azurerm_postgresql_virtual_network_rule": resourceArmPostgreSQLVirtualNetworkRule(),
"azurerm_public_ip": resourceArmPublicIp(),
"azurerm_public_ip_prefix": resourceArmPublicIpPrefix(),
"azurerm_recovery_services_protected_vm": resourceArmRecoveryServicesProtectedVm(),
"azurerm_recovery_services_protection_policy_vm": resourceArmRecoveryServicesProtectionPolicyVm(),
"azurerm_recovery_services_vault": resourceArmRecoveryServicesVault(),
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_batch_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func testCheckAzureRMBatchAccountDestroy(s *terraform.State) error {
func testAccAzureRMBatchAccount_basic(rInt int, batchAccountSuffix string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "testaccbatch%d"
name = "testaccRG-%d-batchaccount"
location = "%s"
}
Expand Down Expand Up @@ -215,7 +215,7 @@ resource "azurerm_batch_account" "import" {
func testAccAzureRMBatchAccount_complete(rInt int, rString string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "testaccbatch%d"
name = "testaccRG-%d-batchaccount"
location = "%s"
}
Expand Down Expand Up @@ -244,7 +244,7 @@ resource "azurerm_batch_account" "test" {
func testAccAzureRMBatchAccount_completeUpdated(rInt int, rString string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "testaccbatch%d"
name = "testaccRG-%d-batchaccount"
location = "%s"
}
Expand Down
8 changes: 4 additions & 4 deletions azurerm/resource_arm_batch_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func testCheckAzureRMBatchPoolDestroy(s *terraform.State) error {
func testaccAzureRMBatchPool_fixedScale_complete(rInt int, rString string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "testaccbatch%d"
name = "testaccRG-%d-batchpool"
location = "%s"
}
Expand Down Expand Up @@ -385,7 +385,7 @@ resource "azurerm_batch_pool" "test" {
func testaccAzureRMBatchPool_autoScale_complete(rInt int, rString string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "testaccbatch%d"
name = "testaccRG-%d-batchpool"
location = "%s"
}
Expand Down Expand Up @@ -442,7 +442,7 @@ EOF
func testaccAzureRMBatchPool_basic(rInt int, rString string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "testaccbatch%d"
name = "testaccRG-%d-batchpool"
location = "%s"
}
Expand Down Expand Up @@ -501,7 +501,7 @@ resource "azurerm_batch_pool" "import" {
func testaccAzureRMBatchPoolStartTask_basic(rInt int, rString string, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "testaccbatch%d"
name = "testaccRG-%d-batchpool"
location = "%s"
}
Expand Down
Loading

0 comments on commit 7f03c6d

Please sign in to comment.