From 9013ff70d6943a3be9fca0ee579c271a21e61ed1 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Fri, 9 Dec 2022 16:04:40 -0800 Subject: [PATCH] `azurerm_synapse_linked_service` - add validation for `type` (#19636) --- .../synapse_linked_service_resource.go | 103 ++++++++++++++++++ .../r/synapse_linked_service.html.markdown | 10 +- 2 files changed, 112 insertions(+), 1 deletion(-) diff --git a/internal/services/synapse/synapse_linked_service_resource.go b/internal/services/synapse/synapse_linked_service_resource.go index dfed890a2a8b..11a67e164c67 100644 --- a/internal/services/synapse/synapse_linked_service_resource.go +++ b/internal/services/synapse/synapse_linked_service_resource.go @@ -60,6 +60,109 @@ func resourceSynapseLinkedService() *pluginsdk.Resource { Type: pluginsdk.TypeString, Required: true, ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(artifacts.TypeBasicLinkedServiceTypeAmazonMWS), + string(artifacts.TypeBasicLinkedServiceTypeAmazonRdsForOracle), + string(artifacts.TypeBasicLinkedServiceTypeAmazonRdsForSQLServer), + string(artifacts.TypeBasicLinkedServiceTypeAmazonRedshift), + string(artifacts.TypeBasicLinkedServiceTypeAmazonS3), + string(artifacts.TypeBasicLinkedServiceTypeAzureBatch), + string(artifacts.TypeBasicLinkedServiceTypeAzureBlobFS), + string(artifacts.TypeBasicLinkedServiceTypeAzureBlobStorage), + string(artifacts.TypeBasicLinkedServiceTypeAzureDataExplorer), + string(artifacts.TypeBasicLinkedServiceTypeAzureDataLakeAnalytics), + string(artifacts.TypeBasicLinkedServiceTypeAzureDataLakeStore), + string(artifacts.TypeBasicLinkedServiceTypeAzureDatabricks), + string(artifacts.TypeBasicLinkedServiceTypeAzureDatabricksDeltaLake), + string(artifacts.TypeBasicLinkedServiceTypeAzureFileStorage), + string(artifacts.TypeBasicLinkedServiceTypeAzureFunction), + string(artifacts.TypeBasicLinkedServiceTypeAzureKeyVault), + string(artifacts.TypeBasicLinkedServiceTypeAzureML), + string(artifacts.TypeBasicLinkedServiceTypeAzureMLService), + string(artifacts.TypeBasicLinkedServiceTypeAzureMariaDB), + string(artifacts.TypeBasicLinkedServiceTypeAzureMySQL), + string(artifacts.TypeBasicLinkedServiceTypeAzurePostgreSQL), + string(artifacts.TypeBasicLinkedServiceTypeAzureSQLDW), + string(artifacts.TypeBasicLinkedServiceTypeAzureSQLDatabase), + string(artifacts.TypeBasicLinkedServiceTypeAzureSQLMI), + string(artifacts.TypeBasicLinkedServiceTypeAzureSearch), + string(artifacts.TypeBasicLinkedServiceTypeAzureStorage), + string(artifacts.TypeBasicLinkedServiceTypeAzureTableStorage), + string(artifacts.TypeBasicLinkedServiceTypeCassandra), + string(artifacts.TypeBasicLinkedServiceTypeCommonDataServiceForApps), + string(artifacts.TypeBasicLinkedServiceTypeConcur), + string(artifacts.TypeBasicLinkedServiceTypeCosmosDb), + string(artifacts.TypeBasicLinkedServiceTypeCosmosDbMongoDbAPI), + string(artifacts.TypeBasicLinkedServiceTypeCouchbase), + string(artifacts.TypeBasicLinkedServiceTypeCustomDataSource), + string(artifacts.TypeBasicLinkedServiceTypeDb2), + string(artifacts.TypeBasicLinkedServiceTypeDrill), + string(artifacts.TypeBasicLinkedServiceTypeDynamics), + string(artifacts.TypeBasicLinkedServiceTypeDynamicsAX), + string(artifacts.TypeBasicLinkedServiceTypeDynamicsCrm), + string(artifacts.TypeBasicLinkedServiceTypeEloqua), + string(artifacts.TypeBasicLinkedServiceTypeFileServer), + string(artifacts.TypeBasicLinkedServiceTypeFtpServer), + string(artifacts.TypeBasicLinkedServiceTypeGoogleAdWords), + string(artifacts.TypeBasicLinkedServiceTypeGoogleBigQuery), + string(artifacts.TypeBasicLinkedServiceTypeGoogleCloudStorage), + string(artifacts.TypeBasicLinkedServiceTypeGreenplum), + string(artifacts.TypeBasicLinkedServiceTypeHBase), + string(artifacts.TypeBasicLinkedServiceTypeHDInsight), + string(artifacts.TypeBasicLinkedServiceTypeHDInsightOnDemand), + string(artifacts.TypeBasicLinkedServiceTypeHTTPServer), + string(artifacts.TypeBasicLinkedServiceTypeHdfs), + string(artifacts.TypeBasicLinkedServiceTypeHive), + string(artifacts.TypeBasicLinkedServiceTypeHubspot), + string(artifacts.TypeBasicLinkedServiceTypeImpala), + string(artifacts.TypeBasicLinkedServiceTypeInformix), + string(artifacts.TypeBasicLinkedServiceTypeJira), + string(artifacts.TypeBasicLinkedServiceTypeLinkedService), + string(artifacts.TypeBasicLinkedServiceTypeMagento), + string(artifacts.TypeBasicLinkedServiceTypeMariaDB), + string(artifacts.TypeBasicLinkedServiceTypeMarketo), + string(artifacts.TypeBasicLinkedServiceTypeMicrosoftAccess), + string(artifacts.TypeBasicLinkedServiceTypeMongoDb), + string(artifacts.TypeBasicLinkedServiceTypeMongoDbAtlas), + string(artifacts.TypeBasicLinkedServiceTypeMongoDbV2), + string(artifacts.TypeBasicLinkedServiceTypeMySQL), + string(artifacts.TypeBasicLinkedServiceTypeNetezza), + string(artifacts.TypeBasicLinkedServiceTypeOData), + string(artifacts.TypeBasicLinkedServiceTypeOdbc), + string(artifacts.TypeBasicLinkedServiceTypeOffice365), + string(artifacts.TypeBasicLinkedServiceTypeOracle), + string(artifacts.TypeBasicLinkedServiceTypeOracleServiceCloud), + string(artifacts.TypeBasicLinkedServiceTypePaypal), + string(artifacts.TypeBasicLinkedServiceTypePhoenix), + string(artifacts.TypeBasicLinkedServiceTypePostgreSQL), + string(artifacts.TypeBasicLinkedServiceTypePresto), + string(artifacts.TypeBasicLinkedServiceTypeQuickBooks), + string(artifacts.TypeBasicLinkedServiceTypeResponsys), + string(artifacts.TypeBasicLinkedServiceTypeRestService), + string(artifacts.TypeBasicLinkedServiceTypeSQLServer), + string(artifacts.TypeBasicLinkedServiceTypeSalesforce), + string(artifacts.TypeBasicLinkedServiceTypeSalesforceMarketingCloud), + string(artifacts.TypeBasicLinkedServiceTypeSalesforceServiceCloud), + string(artifacts.TypeBasicLinkedServiceTypeSapBW), + string(artifacts.TypeBasicLinkedServiceTypeSapCloudForCustomer), + string(artifacts.TypeBasicLinkedServiceTypeSapEcc), + string(artifacts.TypeBasicLinkedServiceTypeSapHana), + string(artifacts.TypeBasicLinkedServiceTypeSapOpenHub), + string(artifacts.TypeBasicLinkedServiceTypeSapTable), + string(artifacts.TypeBasicLinkedServiceTypeServiceNow), + string(artifacts.TypeBasicLinkedServiceTypeSftp), + string(artifacts.TypeBasicLinkedServiceTypeSharePointOnlineList), + string(artifacts.TypeBasicLinkedServiceTypeShopify), + string(artifacts.TypeBasicLinkedServiceTypeSnowflake), + string(artifacts.TypeBasicLinkedServiceTypeSpark), + string(artifacts.TypeBasicLinkedServiceTypeSquare), + string(artifacts.TypeBasicLinkedServiceTypeSybase), + string(artifacts.TypeBasicLinkedServiceTypeTeradata), + string(artifacts.TypeBasicLinkedServiceTypeVertica), + string(artifacts.TypeBasicLinkedServiceTypeWeb), + string(artifacts.TypeBasicLinkedServiceTypeXero), + string(artifacts.TypeBasicLinkedServiceTypeZoho), + }, false), }, "type_properties_json": { diff --git a/website/docs/r/synapse_linked_service.html.markdown b/website/docs/r/synapse_linked_service.html.markdown index 90138e7aa0cf..d5108a447753 100644 --- a/website/docs/r/synapse_linked_service.html.markdown +++ b/website/docs/r/synapse_linked_service.html.markdown @@ -79,7 +79,15 @@ The following arguments are supported: * `synapse_workspace_id` - (Required) The Synapse Workspace ID in which to associate the Linked Service with. Changing this forces a new Synapse Linked Service to be created. -* `type` - (Required) The type of data stores that will be connected to Synapse. For full list of supported data stores, please refer to [Azure Synapse connector](https://docs.microsoft.com/azure/data-factory/connector-overview). Changing this forces a new Synapse Linked Service to be created. +* `type` - (Required) The type of data stores that will be connected to Synapse. Valid Values include `AmazonMWS`, `AmazonRdsForOracle`, `AmazonRdsForSqlServer`, `AmazonRedshift`, `AmazonS3`, `AzureBatch`, +`AzureBlobFS`, `AzureBlobStorage`, `AzureDataExplorer`, `AzureDataLakeAnalytics`, `AzureDataLakeStore`, `AzureDatabricks`, `AzureDatabricksDeltaLake`, `AzureFileStorage`, `AzureFunction`, +`AzureKeyVault`, `AzureML`, `AzureMLService`, `AzureMariaDB`, `AzureMySql`, `AzurePostgreSql`, `AzureSqlDW`, `AzureSqlDatabase`, `AzureSqlMI`, `AzureSearch`, `AzureStorage`, +`AzureTableStorage`, `Cassandra`, `CommonDataServiceForApps`, `Concur`, `CosmosDb`, `CosmosDbMongoDbApi`, `Couchbase`, `CustomDataSource`, `Db2`, `Drill`, +`Dynamics`, `DynamicsAX`, `DynamicsCrm`, `Eloqua`, `FileServer`, `FtpServer`, `GoogleAdWords`, `GoogleBigQuery`, `GoogleCloudStorage`, `Greenplum`, `HBase`, `HDInsight`, +`HDInsightOnDemand`, `HttpServer`, `Hdfs`, `Hive`, `Hubspot`, `Impala`, `Informix`, `Jira`, `LinkedService`, `Magento`, `MariaDB`, `Marketo`, `MicrosoftAccess`, `MongoDb`, +`MongoDbAtlas`, `MongoDbV2`, `MySql`, `Netezza`, `OData`, `Odbc`, `Office365`, `Oracle`, `OracleServiceCloud`, `Paypal`, `Phoenix`, `PostgreSql`, `Presto`, `QuickBooks`, +`Responsys`, `RestService`, `SqlServer`, `Salesforce`, `SalesforceMarketingCloud`, `SalesforceServiceCloud`, `SapBW`, `SapCloudForCustomer`, `SapEcc`, `SapHana`, `SapOpenHub`, +`SapTable`, `ServiceNow`, `Sftp`, `SharePointOnlineList`, `Shopify`, `Snowflake`, `Spark`, `Square`, `Sybase`, `Teradata`, `Vertica`, `Web`, `Xero`, `Zoho`. * `type_properties_json` - (Required) A JSON object that contains the properties of the Synapse Linked Service.