Skip to content

Commit

Permalink
Merge pull request #3236 from terraform-providers/f-data-factory-dataset
Browse files Browse the repository at this point in the history
New Resource: `azurerm_data_factory_dataset_sql_server_table`
  • Loading branch information
mbfrahry authored Apr 12, 2019
2 parents 1571905 + feba3d5 commit e91181a
Show file tree
Hide file tree
Showing 9 changed files with 806 additions and 76 deletions.
5 changes: 5 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 {

// Data Factory
dataFactoryClient datafactory.FactoriesClient
dataFactoryDatasetClient datafactory.DatasetsClient
dataFactoryLinkedServiceClient datafactory.LinkedServicesClient

// Data Lake Store
Expand Down Expand Up @@ -891,6 +892,10 @@ func (c *ArmClient) registerDataFactoryClients(endpoint, subscriptionId string,
c.configureClient(&dataFactoryClient.Client, auth)
c.dataFactoryClient = dataFactoryClient

dataFactoryDatasetClient := datafactory.NewDatasetsClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&dataFactoryDatasetClient.Client, auth)
c.dataFactoryDatasetClient = dataFactoryDatasetClient

dataFactoryLinkedServiceClient := datafactory.NewLinkedServicesClientWithBaseURI(endpoint, subscriptionId)
c.configureClient(&dataFactoryLinkedServiceClient.Client, auth)
c.dataFactoryLinkedServiceClient = dataFactoryLinkedServiceClient
Expand Down
54 changes: 54 additions & 0 deletions azurerm/data_factory.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package azurerm

import (
"log"

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

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

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

return output
}

func flattenDataFactoryParameters(input map[string]*datafactory.ParameterSpecification) 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 parameter %q since it's not a string", k)
}

output[k] = val
}
}

return output
}

func flattenDataFactoryAnnotations(input *[]interface{}) []string {
annotations := make([]string, 0)
if input == nil {
return annotations
}

for _, annotation := range *input {
val, ok := annotation.(string)
if !ok {
log.Printf("[DEBUG] Skipping annotation %q since it's not a string", val)
}
annotations = append(annotations, val)
}
return annotations
}
1 change: 1 addition & 0 deletions azurerm/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ func Provider() terraform.ResourceProvider {
"azurerm_container_service": resourceArmContainerService(),
"azurerm_cosmosdb_account": resourceArmCosmosDBAccount(),
"azurerm_data_factory": resourceArmDataFactory(),
"azurerm_data_factory_dataset_sql_server_table": resourceArmDataFactoryDatasetSQLServerTable(),
"azurerm_data_factory_linked_service_sql_server": resourceArmDataFactoryLinkedServiceSQLServer(),
"azurerm_data_lake_analytics_account": resourceArmDataLakeAnalyticsAccount(),
"azurerm_data_lake_analytics_firewall_rule": resourceArmDataLakeAnalyticsFirewallRule(),
Expand Down
Loading

0 comments on commit e91181a

Please sign in to comment.