Skip to content

Commit 63e6703

Browse files
committed
module update
1 parent fbdb5de commit 63e6703

File tree

6 files changed

+225
-209
lines changed

6 files changed

+225
-209
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# .tfstate files
55
*.tfstate
66
*.tfstate.*
7+
*.terraform.lock.hcl
78

89
# Crash log files
910
crash.log
@@ -27,3 +28,4 @@ override.tf.json
2728

2829
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
2930
# example: *tfplan*
31+
versions.tf

README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ You can create a single database in the provisioned or serverless compute tier.
1212

1313
* [SQL Servers](https://www.terraform.io/docs/providers/azurerm/r/sql_server.html)
1414
* [SQL Database](https://www.terraform.io/docs/providers/azurerm/r/mysql_database.html)
15-
* [Storage account for diagnostics](https://www.terraform.io/docs/providers/azurerm/r/storage_account.html)
15+
* [Storage account for diagnostics](https://www.terraform.io/docs/providers/azurerm/r/storage_account.html)
1616
* [Active Directory Administrator](https://www.terraform.io/docs/providers/azurerm/r/sql_active_directory_administrator.html)
1717
* [Firewall rule for azure services, resources, and client IP](https://www.terraform.io/docs/providers/azurerm/r/sql_firewall_rule.html)
1818
* [SQL Failover Group](https://www.terraform.io/docs/providers/azurerm/r/sql_failover_group.html)
1919
* [SQL Private Endpoint](https://www.terraform.io/docs/providers/azurerm/r/private_endpoint.html)
2020
* [Private DNS zone for privatelink A records](https://www.terraform.io/docs/providers/azurerm/r/private_dns_zone.html)
2121
* [SQL Script execution to create Database](https://docs.microsoft.com/en-us/sql/ssms/scripting/sqlcmd-run-transact-sql-script-files?view=sql-server-ver15)
2222

23-
> #### *Note: If you prefer private endpoints feature, firewall rules are not relevant. However, this module can support both the Public and Private availability of the Database. Disable the firewall rules, in case you want to create the database using private endpoints only.*
23+
>*Note: If you prefer private endpoints feature, firewall rules are not relevant. However, this module can support both the Public and Private availability of the Database. Disable the firewall rules, in case you want to create the database using private endpoints only.*
2424
2525
## Module Usage
2626

27-
### Simple Azure SQL single database using private Endpoint
27+
### Simple Azure SQL single database using private Endpoint
2828

29-
Following example to create a SQL single database using private endpoints. This module also supports optional AD admin user for DB, Audit Policies, and creation of database schema using SQL script.
29+
Following example to create a SQL single database using private endpoints. This module also supports optional AD admin user for DB, Audit Policies, and creation of database schema using SQL script.
3030

3131
```
3232
module "mssql-server" {
@@ -72,9 +72,9 @@ module "mssql-server" {
7272
}
7373
```
7474

75-
### Azure SQL database creation using geo-replication with auto-failover groups
75+
### Azure SQL database creation using geo-replication with auto-failover groups
7676

77-
Following example to create a SQL database using geo-replication with auto-failover groups. This module also supports optional AD admin user for DB, Audit Policies, Firewall Rules, and creation of database schema using SQL script.
77+
Following example to create a SQL database using geo-replication with auto-failover groups. This module also supports optional AD admin user for DB, Audit Policies, Firewall Rules, and creation of database schema using SQL script.
7878

7979
```
8080
module "mssql-server" {
@@ -135,13 +135,13 @@ module "mssql-server" {
135135

136136
### Resource Group
137137

138-
By default, this module will not create a resource group and the name of an existing resource group to be given in an argument `create_resource_group`. If you want to create a new resource group, set the argument `create_resource_group = true`.
138+
By default, this module will not create a resource group and the name of an existing resource group to be given in an argument `resource_group_name`. If you want to create a new resource group, set the argument `create_resource_group = true`.
139139

140140
*If you are using an existing resource group, then this module uses the same resource group location to create all resources in this module.*
141141

142142
### VNet and Subnets
143143

144-
This module is not going to create a Vnet and corresponding services. However, this module expect you to provide VPC and Subnet address space for private end points.
144+
This module is not going to create a Vnet and corresponding services. However, this module expect you to provide VPC and Subnet address space for private end points.
145145

146146
Deploy Azure Vnet terraform module to overcome with this dependency. The [`terraform-azurerm-vnet`](https://github.com/tietoevry-cloud-infra/terraform-azurerm-vnet) module currently available from [GitHub](https://github.com/tietoevry-cloud-infra/terraform-azurerm-vnet), also aligned with this module.
147147

@@ -164,29 +164,29 @@ Advanced Threat Protection for single and pooled databases detects anomalous act
164164

165165
By default, this feature not enabled on this module. To enable the threat detection policy for the database, set the argument `enable_threat_detection_policy = true`.
166166

167-
> #### Note: Enabling `extended_auditing_policy` and `threat_detection_policy` features on SQL servers and database going to create a storage account to keep all audit logs. Log retention policy to be configured to keep the size within limits for this storage account. Note that this module creates resources that can cost money.
167+
> #### Note: Enabling `extended_auditing_policy` and `threat_detection_policy` features on SQL servers and database going to create a storage account to keep all audit logs. Log retention policy to be configured to keep the size within limits for this storage account. Note that this module creates resources that can cost money
168168
169169
## Adding Active Directory Administrator to SQL Database
170170

171-
Azure Active Directory authentication is a mechanism of connecting to Microsoft Azure SQL Database by using identities in Azure Active Directory (Azure AD). This module adds the provided Azure Active Directory user/group to SQL Database as an administrator so that the user can login to this database with Azure AD authentication.
171+
Azure Active Directory authentication is a mechanism of connecting to Microsoft Azure SQL Database by using identities in Azure Active Directory (Azure AD). This module adds the provided Azure Active Directory user/group to SQL Database as an administrator so that the user can login to this database with Azure AD authentication.
172172

173-
By default, this feature not enabled on this module. To add the Active Directory Administrator to SQL database, set the argument `enable_sql_ad_admin = true` and provide valid Azure AD user login name (`ad_admin_login_name`).
173+
By default, this feature not enabled on this module. To add the Active Directory Administrator to SQL database, set the argument `enable_sql_ad_admin = true` and provide valid Azure AD user login name (`ad_admin_login_name`).
174174

175175
## Configuring the Azure SQL Database Firewall
176176

177-
The Azure SQL Database firewall lets you decide which IP addresses may or may not have access to either your Azure SQL Server or your Azure SQL database. When creating an Azure SQL Database, the firewall needs to be configured before anyone will be able to access the database.
177+
The Azure SQL Database firewall lets you decide which IP addresses may or may not have access to either your Azure SQL Server or your Azure SQL database. When creating an Azure SQL Database, the firewall needs to be configured before anyone will be able to access the database.
178178

179-
**Server level rules:**
179+
**Server level rules:**
180180

181181
Server level rules allow access to the Azure SQL Server. Which means that the client will have access to all the databases stored on that SQL Server. As a best practice, server level access should only be given when absolutely necessary and database level rules must be used wherever possible.
182182

183-
**Database level rules:**
183+
**Database level rules:**
184184

185185
Using database level rules adds security by ensuring that clients do not have access to database that they don’t need and it also makes it easier to move databases, since the rules are contained within the database itself.
186186

187-
By default, no external access to your SQL Database will be allowed until you explicitly assign permission by creating a firewall rule. To add the firewall rules to the SQL database, set the argument `enable_firewall_rules = true` and provide the required IP ranges.
187+
By default, no external access to your SQL Database will be allowed until you explicitly assign permission by creating a firewall rule. To add the firewall rules to the SQL database, set the argument `enable_firewall_rules = true` and provide the required IP ranges.
188188

189-
> #### Additionally, If you enable Private endpoint feature, firewall rules are not relevant. It does not require adding any IP addresses to the firewall on Azure SQL Database or changing the connection string of your application for private links.
189+
> #### Additionally, If you enable Private endpoint feature, firewall rules are not relevant. It does not require adding any IP addresses to the firewall on Azure SQL Database or changing the connection string of your application for private links
190190
191191
## Azure SQL Geo-Replication and Failover Groups
192192

@@ -196,8 +196,7 @@ Microsoft Azure offers different types of business continuity solutions for thei
196196

197197
You can put several single databases on the same SQL Database server into the same failover group. If you add a single database to the failover group, it automatically creates a secondary database using the same edition and the compute size on the secondary server. You specified that server when the failover group was created.
198198

199-
By default, this feature not enabled on this module. To create SQL geo-replicated auto failover groups, set the argument `enable_failover_group = true`. This create a failover groups secondary server location `secondary_sql_server_location` to be provided.
200-
199+
By default, this feature not enabled on this module. To create SQL geo-replicated auto failover groups, set the argument `enable_failover_group = true`. This create a failover groups secondary server location `secondary_sql_server_location` to be provided.
201200

202201
## Using Failover Groups with Private Link for Azure SQL Database
203202

@@ -215,7 +214,7 @@ Clients can connect to the Private endpoint from the same VNet, peered VNet in s
215214

216215
This module uses the tool slqcmd as a local provisioner to connect and inject the SQL initialization. To enable this feature set the argument `initialize_sql_script_execution = true` and use `sqldb_init_script_file` argument to provide the path to SQL script.
217216

218-
> #### Note: To run this utility from your desktop, to create SQL database schema using SQL script requires firewall rule. Allow access to Azure services can be enabled by setting `start_ip_address` and `end_ip_address` to `0.0.0.0` and add your machine public IP to SQL firewall rules to run this feature else this will fail to run and exit the terraform plan.
217+
> #### Note: To run this utility from your desktop, to create SQL database schema using SQL script requires firewall rule. Allow access to Azure services can be enabled by setting `start_ip_address` and `end_ip_address` to `0.0.0.0` and add your machine public IP to SQL firewall rules to run this feature else this will fail to run and exit the terraform plan
219218
220219
## Tagging
221220

@@ -304,4 +303,4 @@ Module is maintained by [Kumaraswamy Vithanala](mailto:[email protected]) with
304303

305304
* [Azure SQL Database documentation](https://docs.microsoft.com/en-us/azure/sql-database/)
306305

307-
* [Terraform AzureRM Provider Documentation](https://www.terraform.io/docs/providers/azurerm/index.html)
306+
* [Terraform AzureRM Provider Documentation](https://www.terraform.io/docs/providers/azurerm/index.html)

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Add AzureRM provider to start with the module configuration. Whilst the `version
88

99
## Create resource group
1010

11-
By default, this module will not create a resource group and the name of an existing resource group to be given in an argument `create_resource_group`. If you want to create a new resource group, set the argument `create_resource_group = true`.
11+
By default, this module will not create a resource group and the name of an existing resource group to be given in an argument `resource_group_name`. If you want to create a new resource group, set the argument `create_resource_group = true`.
1212

1313
*If you are using an existing resource group, then this module uses the same resource group location to create all resources in this module.*
1414

examples/Simple_SQL_Single_Database_creation/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module "mssql-server" {
2-
source = "kumarvna/mssql-db/azurerm"
3-
version = "1.0.0"
2+
//source = "kumarvna/mssql-db/azurerm"
3+
//version = "1.0.0"
4+
source = "github.com/kumarvna/terraform-azurerm-mssql-db?ref=develop"
45

56
# Resource Group, VNet and Subnet declarations
67
create_resource_group = false

0 commit comments

Comments
 (0)