This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "storage_account_name" { | |
type = string | |
description = "Azure Storage Account Name (3 to 24 characters, lowercase letters and numbers only)" | |
validation { | |
condition = length(var.storage_account_name) >= 3 && length(var.storage_account_name) <= 24 | |
error_message = "The storage_account_name variable name must be 3-24 characters in length" | |
} | |
validation { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "server_name" { | |
type = string | |
description = "Server name in letters and numbers only)" | |
validation { | |
condition = can(regex("^[0-9A-Za-z]+$", var.storage_account_name)) | |
error_message = "The server name variable must have letters and numbers only" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "app_name" { | |
type = string | |
description = "Application name in lower case" | |
validation { | |
condition = lower(var.app_name) == var.app_name | |
error_message = "Application name value must be in all lower case" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "app_name" { | |
type = string | |
description = "Application name in upper case" | |
validation { | |
condition = upper(var.app_name) == var.app_name | |
error_message = "Application name value must be in all upper case" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "ip_address" { | |
type = string | |
description = "Web Server IP address" | |
validation { | |
condition = can(regex("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",var.ip_address)) | |
error_message = "Invalid Web Server IP address provided" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "company_shortname" { | |
description = "The company name" | |
type = string | |
validation { | |
condition = (length(var.company_shortname) > 3) | |
error_message = "The company must be over 3 characters in length" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "vm_size" { | |
type = string | |
description = "VM instance size" | |
validation { | |
condition = contains(["Standard_DS3_v2", "Standard_D2s_v4", "Standard_D4s_v4", "Standard_D8s_v4"], var.vm_size) | |
error_message = "Invalid VM instance size provided" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Service Plan Variable | |
variable "service_plan_sku_name" { | |
type = string | |
description = "The SKU for the plan. Possible values include EP1, EP2 and EP3." | |
validation { | |
condition = contains(["EP1", "EP2", "EP3"], var.service_plan_sku_name) | |
error_message = "Valid values for the service_plan_sku_name variable are EP1, EP2, EP3" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update following variables to your environment | |
$TempLocation = "C:\Temp" | |
$SQLServiceAccount = "sql-packer-vm\SVC_SQLPACKERVM_SQL" #Account used for the SQL Service | |
$SQLInstance = "MSSQLSERVER" | |
# Check if temp location exists and create if it doesn't | |
IF ((Test-Path $TempLocation) -eq $false) | |
{ | |
New-Item -ItemType Directory -Force -Path $TempLocation | |
Write-Host "Folder $TempLocation created" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SQL Server Ports Firewall Rules | |
New-NetFirewallRule -DisplayName "SQL Server" -Direction Inbound –Protocol TCP –LocalPort 1433 -Action allow | |
New-NetFirewallRule -DisplayName "SQL Admin Connection" -Direction Inbound –Protocol TCP –LocalPort 1434 -Action allow | |
New-NetFirewallRule -DisplayName "SQL Server Browser" -Direction Inbound –Protocol UDP –LocalPort 1434 -Action allow | |
New-NetFirewallRule -DisplayName "SQL Service Broker" -Direction Inbound –Protocol TCP –LocalPort 4022 -Action allow | |
New-NetFirewallRule -DisplayName "Transact-SQL Debugger / RPC" -Direction Inbound –Protocol TCP –LocalPort 135 -Action allow | |
# SQL Analysis Ports Firewall Rules | |
New-NetFirewallRule -DisplayName "SQL Analysis Service" -Direction Inbound –Protocol TCP –LocalPort 2383 -Action allow | |
New-NetFirewallRule -DisplayName "SQL Analysis Browser" -Direction Inbound –Protocol TCP –LocalPort 2382 -Action allow |
NewerOlder