Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MS SQL Database module #58

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add MS SQL Database module #58

wants to merge 2 commits into from

Conversation

CDA0
Copy link
Contributor

@CDA0 CDA0 commented Jan 20, 2024

No description provided.

@@ -0,0 +1,38 @@
# MS SQL Database

This module creates a [MS SQL Database](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mssql_database) and associated [Diagnostic Setting](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_diagnostic_setting).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This module creates a [MS SQL Database](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mssql_database) and associated [Diagnostic Setting](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_diagnostic_setting).
This module creates an [MS SQL Database](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mssql_database) and associated [Diagnostic Setting](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_diagnostic_setting).

Comment on lines +3 to +9
server_id = var.sql_server_id
max_size_gb = var.max_size_gb
sku_name = var.sql_database_sku
collation = var.sql_database_collation

min_capacity = var.serverless_min_capacity
auto_pause_delay_in_minutes = var.serverless_auto_pause_delay
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we match the var names?

state = "Enabled"
retention_days = var.threat_detection_policy.retention_days
email_account_admins = var.threat_detection_policy.email_account_admins
email_addresses = var.threat_detection_policy.security_alert_email_addresses
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
email_addresses = var.threat_detection_policy.security_alert_email_addresses
email_addresses = var.threat_detection_policy.email_addresses

Comment on lines +24 to +27

lifecycle {
prevent_destroy = true
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lifecycle {
prevent_destroy = true
}

name = "log-analytics"
target_resource_id = azurerm_mssql_database.main.id
log_analytics_workspace_id = var.log_analytics_workspace_id
log_analytics_destination_type = "AzureDiagnostics"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log_analytics_destination_type = "AzureDiagnostics"


variable "metric_categories" {
type = list(string)
default = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
default = []
default = [
"AllMetrics",
]

variable "serverless_min_capacity" {
type = string
default = null
description = "Minimum capacity for serverless SKUs. Minimum value is 0.5 (vCore)."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "Minimum capacity for serverless SKUs. Minimum value is 0.5 (vCore)."

variable "serverless_auto_pause_delay" {
type = string
default = null
description = "The auto-pause delay for serverless SKUs. Minimum value is 60 (minutes)."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "The auto-pause delay for serverless SKUs. Minimum value is 60 (minutes)."

features {}
}

module "mssql-server" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
module "mssql-server" {
module "mssql_database" {

@@ -0,0 +1,10 @@
terraform {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file in src, too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants