Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metadevpro/terraform-azurerm-sqlserver-seed
Terraform module for creating an Azure SQL Server Database and initialize it with a SQL script.
https://github.com/metadevpro/terraform-azurerm-sqlserver-seed
azurerm db-initialize db-seed sqlserver terraform-module
Last synced: 26 days ago
JSON representation
Terraform module for creating an Azure SQL Server Database and initialize it with a SQL script.
- Host: GitHub
- URL: https://github.com/metadevpro/terraform-azurerm-sqlserver-seed
- Owner: metadevpro
- License: other
- Created: 2017-10-27T17:41:02.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-12T16:33:50.000Z (about 1 year ago)
- Last Synced: 2024-09-30T12:41:29.628Z (about 1 month ago)
- Topics: azurerm, db-initialize, db-seed, sqlserver, terraform-module
- Language: HCL
- Size: 7.81 KB
- Stars: 8
- Watchers: 4
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-terraform - terraform-azurerm-sqlserver - Create SQl Server Database on Azure. (Community Modules / Miscellaneous)
- jimsghstars - metadevpro/terraform-azurerm-sqlserver-seed - Terraform module for creating an Azure SQL Server Database and initialize it with a SQL script. (HCL)
- awesome-tf - terraform-azurerm-sqlserver - Create SQl Server Database on Azure. (Community Modules / Miscellaneous)
README
# Create an Azure SQL Server Database with a SQL script initialization
This **Terraform module** creates an SQL Server Database on Azure allowing to execute a SQL script to setup and initialize the database such as: users, schemas and data.
The database **server** must be created beforehand. This module is not going to create the server if does not exist, it will only create the database plus initialization.
## Prerequisites
This module uses the tool `slqcmd` as a local provisioner to connect and inject the SQL initialization.
Therefore, the following dependencies must be installed beforehand on your machine:
1. Microsoft [OBDC Driver 13.1](https://www.microsoft.com/en-us/download/details.aspx?id=53339).
2. Install the Microsoft [sqlcmd](https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility) utility.## Usage
```hcl
module "azurerm_sql_sever_init" {
source = "Azure/database-seed/azurerm"
location = "westeurope"
resource_group = "myresourcegroup007"
db_server_fqdn = "${azurerm_sql_server.db1.fully_qualified_domain_name}"
sql_admin_username = "${azurerm_sql_server.db1.administrator_login}"
sql_admin_password = "${azurerm_sql_server.db1.administrator_login_password}"
db_name = "mydatabase"
init_script_file = "mydatabase.init.sql"
log_file = "mydatabase.init.log"tags = {
environment = "qa"
project = "acme"
provisioner = "terraform"
}
}
```
## LicenseApache v. 2.0
## Authors
[Pedro J. Molina, PhD.](https://github.com/pjmolina) @ [Metadev](https://metadev.pro)