github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/azurerm/r/sql_database.html.markdown (about)

     1  ---
     2  layout: "azurerm"
     3  page_title: "Azure Resource Manager: azurerm_sql_database"
     4  sidebar_current: "docs-azurerm-resource-sql-database"
     5  description: |-
     6    Create a SQL Database.
     7  ---
     8  
     9  # azurerm\_sql\_database
    10  
    11  Allows you to manage an Azure SQL Database
    12  
    13  ## Example Usage
    14  
    15  ```hcl
    16  resource "azurerm_resource_group" "test" {
    17    name     = "acceptanceTestResourceGroup1"
    18    location = "West US"
    19  }
    20  
    21  resource "azurerm_sql_database" "test" {
    22    name                = "MySQLDatabase"
    23    resource_group_name = "${azurerm_resource_group.test.name}"
    24    location            = "West US"
    25  
    26    tags {
    27      environment = "production"
    28    }
    29  }
    30  ```
    31  ## Argument Reference
    32  
    33  The following arguments are supported:
    34  
    35  * `name` - (Required) The name of the database.
    36  
    37  * `resource_group_name` - (Required) The name of the resource group in which to create the database.  This must be the same as Database Server resource group currently.
    38  
    39  * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
    40  
    41  * `server_name` - (Required) The name of the SQL Server on which to create the database.
    42  
    43  * `create_mode` - (Optional) Specifies the type of database to create. Defaults to `Default`. See below for the accepted values/
    44  
    45  * `source_database_id` - (Optional) The URI of the source database if `create_mode` value is not `Default`.
    46  
    47  * `restore_point_in_time` - (Optional) The point in time for the restore. Only applies if `create_mode` is `PointInTimeRestore` e.g. 2013-11-08T22:00:40Z
    48  
    49  * `edition` - (Optional) The edition of the database to be created. Applies only if `create_mode` is `Default`. Valid values are: `Basic`, `Standard`, `Premium`, or `DataWarehouse`. Please see [Azure SQL Database Service Tiers](https://azure.microsoft.com/en-gb/documentation/articles/sql-database-service-tiers/).
    50  
    51  * `collation` - (Optional) The name of the collation. Applies only if `create_mode` is `Default`.  Azure default is `SQL_LATIN1_GENERAL_CP1_CI_AS`
    52  
    53  * `max_size_bytes` - (Optional) The maximum size that the database can grow to. Applies only if `create_mode` is `Default`.  Please see [Azure SQL Database Service Tiers](https://azure.microsoft.com/en-gb/documentation/articles/sql-database-service-tiers/).
    54  
    55  * `requested_service_objective_id` - (Optional) Use `requested_service_objective_id` or `requested_service_objective_name` to set the performance level for the database.
    56   Valid values are: `S0`, `S1`, `S2`, `S3`, `P1`, `P2`, `P4`, `P6`, `P11` and `ElasticPool`.  Please see [Azure SQL Database Service Tiers](https://azure.microsoft.com/en-gb/documentation/articles/sql-database-service-tiers/).
    57  
    58  * `requested_service_objective_name` - (Optional) Use `requested_service_objective_name` or `requested_service_objective_id` to set the performance level for the database.  Please see [Azure SQL Database Service Tiers](https://azure.microsoft.com/en-gb/documentation/articles/sql-database-service-tiers/).
    59  
    60  * `source_database_deletion_date` - (Optional) The deletion date time of the source database. Only applies to deleted databases where `create_mode` is `PointInTimeRestore`.
    61  
    62  * `elastic_pool_name` - (Optional) The name of the elastic database pool.
    63  
    64  * `tags` - (Optional) A mapping of tags to assign to the resource.
    65  
    66  ## Attributes Reference
    67  
    68  The following attributes are exported:
    69  
    70  * `id` - The SQL Database ID.
    71  * `creation_data` - The creation date of the SQL Database.
    72  * `default_secondary_location` - The default secondary location of the SQL Database.