Manages a Synapse SQL Pool.
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_storage_account" "example" {
name = "examplestorageacc"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
account_tier = "Standard"
account_replication_type = "LRS"
account_kind = "BlobStorage"
}
resource "azurerm_storage_data_lake_gen2_filesystem" "example" {
name = "example"
storage_account_id = azurerm_storage_account.example.id
}
resource "azurerm_synapse_workspace" "example" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
storage_data_lake_gen2_filesystem_id = azurerm_storage_data_lake_gen2_filesystem.example.id
sql_administrator_login = "sqladminuser"
sql_administrator_login_password = "H@Sh1CoR3!"
identity {
type = "SystemAssigned"
}
}
resource "azurerm_synapse_sql_pool" "example" {
name = "examplesqlpool"
synapse_workspace_id = azurerm_synapse_workspace.example.id
sku_name = "DW100c"
create_mode = "Default"
storage_account_type = "GRS"
}
The following arguments are supported:
name
- (Required) The name which should be used for this Synapse SQL Pool. Changing this forces a new Synapse SQL Pool to be created.
synapse_workspace_id
- (Required) The ID of Synapse Workspace within which this SQL Pool should be created. Changing this forces a new Synapse SQL Pool to be created.
sku_name
- (Required) Specifies the SKU Name for this Synapse SQL Pool. Possible values are DW100c
, DW200c
, DW300c
, DW400c
, DW500c
, DW1000c
, DW1500c
, DW2000c
, DW2500c
, DW3000c
, DW5000c
, DW6000c
, DW7500c
, DW10000c
, DW15000c
or DW30000c
.
create_mode
- (Optional) Specifies how to create the SQL Pool. Valid values are: Default
, Recovery
or PointInTimeRestore
. Must be Default
to create a new database. Defaults to Default
. Changing this forces a new Synapse SQL Pool to be created.
collation
- (Optional) The name of the collation to use with this pool, only applicable when create_mode
is set to Default
. Azure default is SQL_LATIN1_GENERAL_CP1_CI_AS
. Changing this forces a new Synapse SQL Pool to be created.
data_encrypted
- (Optional) Is transparent data encryption enabled?
recovery_database_id
- (Optional) The ID of the Synapse SQL Pool or SQL Database which is to back up, only applicable when create_mode
is set to Recovery
. Changing this forces a new Synapse SQL Pool to be created.
restore
- (Optional) A restore
block as defined below. Only applicable when create_mode
is set to PointInTimeRestore
. Changing this forces a new Synapse SQL Pool to be created.
geo_backup_policy_enabled
- (Optional) Is geo-backup policy enabled? Possible values include true
or false
. Defaults to true
.
storage_account_type
- (Optional) The storage account type that will be used to store backups for this Synapse SQL Pool. Possible values are LRS
or GRS
. Changing this forces a new Synapse SQL Pool to be created. Defaults to GRS
.
tags
- (Optional) A mapping of tags which should be assigned to the Synapse SQL Pool.
An restore
block supports the following:
source_database_id
- (Required) The ID of the Synapse SQL Pool or SQL Database which is to restore. Changing this forces a new Synapse SQL Pool to be created.
point_in_time
- (Required) Specifies the Snapshot time to restore formatted as an RFC3339 date string. Changing this forces a new Synapse SQL Pool to be created.
In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Synapse SQL Pool.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Synapse SQL Pool.read
- (Defaults to 5 minutes) Used when retrieving the Synapse SQL Pool.update
- (Defaults to 30 minutes) Used when updating the Synapse SQL Pool.delete
- (Defaults to 30 minutes) Used when deleting the Synapse SQL Pool.Synapse SQL Pool can be imported using the resource id
, e.g.
terraform import azurerm_synapse_sql_pool.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Synapse/workspaces/workspace1/sqlPools/sqlPool1