Compare commits
298 Commits
QCS-IP-Fix
...
qdcfromsna
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ffde50de5 | ||
|
|
c7ba210353 | ||
|
|
94a86a7c90 | ||
|
|
774c830b54 | ||
|
|
49c9a074d7 | ||
|
|
90e6b51b07 | ||
|
|
bf49b1f77a | ||
|
|
d5353404d1 | ||
|
|
a718b33d80 | ||
|
|
389ad44fd8 | ||
|
|
95a30c81fc | ||
|
|
2c40916b71 | ||
|
|
901d37562d | ||
|
|
a5c751d370 | ||
|
|
bbc5e6c4bb | ||
|
|
4e0a345dd4 | ||
|
|
c4b7f48a0f | ||
|
|
9bd1424918 | ||
|
|
911425349f | ||
|
|
960a75c8e4 | ||
|
|
ca692fe1e8 | ||
|
|
71e53779bd | ||
|
|
5643cdf978 | ||
|
|
dddbcd22f0 | ||
|
|
ead10611be | ||
|
|
9e48d68747 | ||
|
|
ca19eed877 | ||
|
|
466d2c716c | ||
|
|
60be43edd1 | ||
|
|
ac87bf7e85 | ||
|
|
02778f9f7c | ||
|
|
6097dbbd2d | ||
|
|
6131f0b0b2 | ||
|
|
2d883e0e4b | ||
|
|
0c29596f50 | ||
|
|
e898c4c419 | ||
|
|
322e8040a5 | ||
|
|
5110a1c496 | ||
|
|
1fbf62fe34 | ||
|
|
71b11c1f9f | ||
|
|
15a2b05ea1 | ||
|
|
8dc4b02d41 | ||
|
|
3e8d909ed3 | ||
|
|
9604dbc3a2 | ||
|
|
46b12edbe6 | ||
|
|
32a95369ae | ||
|
|
43681e2ae2 | ||
|
|
f71d1a5944 | ||
|
|
24742a4090 | ||
|
|
e03f55ecb4 | ||
|
|
aac1ff01e4 | ||
|
|
2f1024cebb | ||
|
|
3ed11b39db | ||
|
|
d9cb1d966c | ||
|
|
803f2c6b2f | ||
|
|
d75dcd580c | ||
|
|
78cbe3ee01 | ||
|
|
c04dc22750 | ||
|
|
5b39c50466 | ||
|
|
8071308381 | ||
|
|
f0dddeabc4 | ||
|
|
13f371f418 | ||
|
|
a4eadee036 | ||
|
|
ecf73556e0 | ||
|
|
4ff6833368 | ||
|
|
d6f2e26992 | ||
|
|
998cf86fd9 | ||
|
|
a59f5d962d | ||
|
|
b55f66e2ea | ||
|
|
9501ffe76d | ||
|
|
f5c7f64d54 | ||
|
|
5e2c06e89e | ||
|
|
72183a9605 | ||
|
|
cb16a00a13 | ||
|
|
80bd9c73e1 | ||
|
|
659383f72a | ||
|
|
46ba8615b2 | ||
|
|
658ee7896c | ||
|
|
3f2632c685 | ||
|
|
defcd288a4 | ||
|
|
a1f3f29469 | ||
|
|
7985fb47b7 | ||
|
|
83d3b64519 | ||
|
|
c8e5e98f03 | ||
|
|
56a4580317 | ||
|
|
a30251ded4 | ||
|
|
c5e764ed5b | ||
|
|
351b2088d7 | ||
|
|
edbf87a5be | ||
|
|
2cb0310e83 | ||
|
|
3bf24ea2ab | ||
|
|
bd1449bef3 | ||
|
|
810e9d9573 | ||
|
|
651b70c834 | ||
|
|
425ee32047 | ||
|
|
8a4a2f071f | ||
|
|
813475834d | ||
|
|
8e45a20fc6 | ||
|
|
7e05a74872 | ||
|
|
2c2c909d2e | ||
|
|
1bc2e4c376 | ||
|
|
1c0e63276d | ||
|
|
f520c96420 | ||
|
|
fd929f7194 | ||
|
|
d009c551bd | ||
|
|
4f2d90ecb2 | ||
|
|
fbdce09018 | ||
|
|
e4bf3dfd82 | ||
|
|
bd1d0f6065 | ||
|
|
7663ab8154 | ||
|
|
aa72322913 | ||
|
|
5a2d6cbd92 | ||
|
|
ec9bb447a1 | ||
|
|
82665c4699 | ||
|
|
db9ce96cde | ||
|
|
f5ca220e42 | ||
|
|
a44f73f952 | ||
|
|
61ccde0daf | ||
|
|
42178709c7 | ||
|
|
53ea09ed05 | ||
|
|
b1da03a65d | ||
|
|
850d71e0a4 | ||
|
|
dd969602d7 | ||
|
|
a30a52a7cf | ||
|
|
8efa8bd0f3 | ||
|
|
f67b3ef689 | ||
|
|
d1d299e7c5 | ||
|
|
bbd5a1ad60 | ||
|
|
44ed495ad0 | ||
|
|
aca68d82ff | ||
|
|
242477e6dd | ||
|
|
bb431488fb | ||
|
|
420170796f | ||
|
|
1b04d1269e | ||
|
|
6183ffa7f6 | ||
|
|
fbe63234ff | ||
|
|
84ca5dd016 | ||
|
|
05c7bf9373 | ||
|
|
cc0a15dc8f | ||
|
|
7decb7fc16 | ||
|
|
c067881354 | ||
|
|
e9eb3ce341 | ||
|
|
b73d1df468 | ||
|
|
a4b9496491 | ||
|
|
2480912c08 | ||
|
|
54253902d4 | ||
|
|
de145652b2 | ||
|
|
885638cd2d | ||
|
|
75274581ce | ||
|
|
ab5c7c0181 | ||
|
|
42562fa4b5 | ||
|
|
dd4cab744d | ||
|
|
851fe5b443 | ||
|
|
4da209b4a7 | ||
|
|
c18e0d700a | ||
|
|
1b9045f910 | ||
|
|
784053b700 | ||
|
|
ca83f73b4f | ||
|
|
5b6724b7eb | ||
|
|
f1025fbf97 | ||
|
|
995554bcbb | ||
|
|
7bfef1c95e | ||
|
|
a266590605 | ||
|
|
3692acf6a6 | ||
|
|
b198d958d9 | ||
|
|
7340df95bd | ||
|
|
6c400cc47f | ||
|
|
6e604fb5c0 | ||
|
|
586a19fe6c | ||
|
|
1546708c8b | ||
|
|
d603b28f90 | ||
|
|
c8fffb1478 | ||
|
|
7250dc8f2f | ||
|
|
df1a6d7058 | ||
|
|
f6b0ed6452 | ||
|
|
34d9ea13f6 | ||
|
|
c76e6cbf63 | ||
|
|
a594eb5cca | ||
|
|
78ca0175f7 | ||
|
|
86929762ef | ||
|
|
4b8cb4c2e9 | ||
|
|
8d7a157c1e | ||
|
|
da51add4eb | ||
|
|
0eb5d30f44 | ||
|
|
e6b94e02e4 | ||
|
|
d1763235b1 | ||
|
|
f912622c1b | ||
|
|
0cb630375b | ||
|
|
ce95c17cc2 | ||
|
|
e178232ded | ||
|
|
187b0f83e3 | ||
|
|
5c1588dbcc | ||
|
|
83aade0d3b | ||
|
|
e696c92463 | ||
|
|
341f1043c5 | ||
|
|
c0a3101e45 | ||
|
|
15c5188f9a | ||
|
|
0381fa0315 | ||
|
|
dba1a8aa86 | ||
|
|
d73e346d38 | ||
|
|
4ddc58df00 | ||
|
|
44892b3f5d | ||
|
|
909b127456 | ||
|
|
4ea3b10868 | ||
|
|
29bef068fa | ||
|
|
74611c92e8 | ||
|
|
1d0671528c | ||
|
|
bf50096199 | ||
|
|
bf726e8042 | ||
|
|
a595a452bc | ||
|
|
e4178f1861 | ||
|
|
7a655ccd84 | ||
|
|
3d51f3fdae | ||
|
|
309433cbc5 | ||
|
|
250a9ab085 | ||
|
|
f2fb39727d | ||
|
|
092cb6a0b4 | ||
|
|
570fd8a8d8 | ||
|
|
f3a991f116 | ||
|
|
3ce72ba3c1 | ||
|
|
cd1c12f965 | ||
|
|
f74acbbcbc | ||
|
|
28af27e589 | ||
|
|
7c936f7618 | ||
|
|
24c7d8f9ea | ||
|
|
725c6175a0 | ||
|
|
8e9b31ba84 | ||
|
|
d0c4ada8a0 | ||
|
|
24b88be4ee | ||
|
|
61296bcf68 | ||
|
|
afcd2b3d16 | ||
|
|
4843d2efea | ||
|
|
e866a3abfd | ||
|
|
a468236d3d | ||
|
|
1b59ceb21e | ||
|
|
e1e34d5c72 | ||
|
|
9ee3ccdd57 | ||
|
|
1a3b387986 | ||
|
|
b77e708e48 | ||
|
|
7c60c62063 | ||
|
|
1227e5606a | ||
|
|
3112b773fb | ||
|
|
7b671cf3a6 | ||
|
|
599988d258 | ||
|
|
a9faa42834 | ||
|
|
e50991ecdf | ||
|
|
68d23b048c | ||
|
|
18b88c3fcd | ||
|
|
01b1f61cb9 | ||
|
|
6e1a620316 | ||
|
|
10e802d0e9 | ||
|
|
42de589fad | ||
|
|
c549bd21e4 | ||
|
|
9216d9a157 | ||
|
|
990cd34cc4 | ||
|
|
b18f790d95 | ||
|
|
c9dacaa56e | ||
|
|
b10e2a1a97 | ||
|
|
a3a6f48c0f | ||
|
|
36cebdf9a8 | ||
|
|
56f170a959 | ||
|
|
b4b3d0d583 | ||
|
|
d0ae500db8 | ||
|
|
051101b8a2 | ||
|
|
41c8bc8761 | ||
|
|
6f65e1c8ac | ||
|
|
39e1591752 | ||
|
|
1192f32a71 | ||
|
|
56046adcc5 | ||
|
|
6bb5c15be1 | ||
|
|
b5c76a727a | ||
|
|
d031982ca8 | ||
|
|
9829af81c4 | ||
|
|
fb4658f545 | ||
|
|
590c2e07ac | ||
|
|
3a8632116f | ||
|
|
b2a3f578e9 | ||
|
|
14cb4bc48b | ||
|
|
c6bf73af58 | ||
|
|
b9faff92ad | ||
|
|
0965bd6a0f | ||
|
|
d7cc357f22 | ||
|
|
af3031818e | ||
|
|
8e7b27df19 | ||
|
|
62e85069bf | ||
|
|
5b98c45241 | ||
|
|
b3daa2a2c1 | ||
|
|
70fe163fe9 | ||
|
|
9c11b1fe66 | ||
|
|
88c6971753 | ||
|
|
dfff10e39e | ||
|
|
39535cb9ef | ||
|
|
88cf6011ce | ||
|
|
b2ccd71c1f | ||
|
|
13f32c2b78 | ||
|
|
573131b641 | ||
|
|
85244fc43b | ||
|
|
c4b6d91b0a |
@@ -13,14 +13,8 @@ locals {
|
||||
redirect_configuration_80 = "${var.appgw_hostname}-80redirect"
|
||||
}
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-password" {
|
||||
name = "star-qmi-qlikpoc-com-password"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-data" {
|
||||
name = "star-qmi-qlikpoc-com-data"
|
||||
data "azurerm_key_vault_certificate" "qmi-cert" {
|
||||
name = "star-qmi-qlikpoc-com-cert"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
@@ -45,6 +39,11 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
resource_group_name = var.app_gw_rg
|
||||
location = var.location
|
||||
|
||||
identity {
|
||||
type = "UserAssigned"
|
||||
identity_ids = ["/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/AppGW_RG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/QMIMainIDY"]
|
||||
}
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
@@ -87,8 +86,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
|
||||
ssl_certificate {
|
||||
name = var.cert_name
|
||||
password = data.azurerm_key_vault_secret.cert-password.value
|
||||
data = data.azurerm_key_vault_secret.cert-data.value
|
||||
key_vault_secret_id = data.azurerm_key_vault_certificate.qmi-cert.secret_id
|
||||
}
|
||||
|
||||
ssl_policy {
|
||||
|
||||
@@ -45,14 +45,8 @@ locals {
|
||||
|
||||
}
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-password" {
|
||||
name = "star-qmi-qlikpoc-com-password"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-data" {
|
||||
name = "star-qmi-qlikpoc-com-data"
|
||||
data "azurerm_key_vault_certificate" "qmi-cert" {
|
||||
name = "star-qmi-qlikpoc-com-cert"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
@@ -77,6 +71,11 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
resource_group_name = var.app_gw_rg
|
||||
location = var.location
|
||||
|
||||
identity {
|
||||
type = "UserAssigned"
|
||||
identity_ids = ["/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/AppGW_RG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/QMIMainIDY"]
|
||||
}
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
@@ -205,8 +204,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
|
||||
ssl_certificate {
|
||||
name = var.cert_name
|
||||
password = data.azurerm_key_vault_secret.cert-password.value
|
||||
data = data.azurerm_key_vault_secret.cert-data.value
|
||||
key_vault_secret_id = data.azurerm_key_vault_certificate.qmi-cert.secret_id
|
||||
}
|
||||
|
||||
ssl_policy {
|
||||
|
||||
@@ -37,14 +37,8 @@ locals {
|
||||
|
||||
}
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-password" {
|
||||
name = "star-qmi-qlikpoc-com-password"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-data" {
|
||||
name = "star-qmi-qlikpoc-com-data"
|
||||
data "azurerm_key_vault_certificate" "qmi-cert" {
|
||||
name = "star-qmi-qlikpoc-com-cert"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
@@ -70,6 +64,11 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
resource_group_name = var.app_gw_rg
|
||||
location = var.location
|
||||
|
||||
identity {
|
||||
type = "UserAssigned"
|
||||
identity_ids = ["/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/AppGW_RG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/QMIMainIDY"]
|
||||
}
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
@@ -189,8 +188,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
|
||||
ssl_certificate {
|
||||
name = var.cert_name
|
||||
password = data.azurerm_key_vault_secret.cert-password.value
|
||||
data = data.azurerm_key_vault_secret.cert-data.value
|
||||
key_vault_secret_id = data.azurerm_key_vault_certificate.qmi-cert.secret_id
|
||||
}
|
||||
|
||||
ssl_policy {
|
||||
|
||||
@@ -11,14 +11,8 @@ locals {
|
||||
|
||||
}
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-password" {
|
||||
name = "star-qmi-qlikpoc-com-password"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-data" {
|
||||
name = "star-qmi-qlikpoc-com-data"
|
||||
data "azurerm_key_vault_certificate" "qmi-cert" {
|
||||
name = "star-qmi-qlikpoc-com-cert"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
@@ -43,6 +37,11 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
resource_group_name = var.app_gw_rg
|
||||
location = var.location
|
||||
|
||||
identity {
|
||||
type = "UserAssigned"
|
||||
identity_ids = ["/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/AppGW_RG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/QMIMainIDY"]
|
||||
}
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
@@ -80,8 +79,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
|
||||
ssl_certificate {
|
||||
name = var.cert_name
|
||||
password = data.azurerm_key_vault_secret.cert-password.value
|
||||
data = data.azurerm_key_vault_secret.cert-data.value
|
||||
key_vault_secret_id = data.azurerm_key_vault_certificate.qmi-cert.secret_id
|
||||
}
|
||||
|
||||
ssl_policy {
|
||||
|
||||
@@ -35,14 +35,8 @@ locals {
|
||||
|
||||
}
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-password" {
|
||||
name = "star-qmi-qlikpoc-com-password"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-data" {
|
||||
name = "star-qmi-qlikpoc-com-data"
|
||||
data "azurerm_key_vault_certificate" "qmi-cert" {
|
||||
name = "star-qmi-qlikpoc-com-cert"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
@@ -67,6 +61,11 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
resource_group_name = var.app_gw_rg
|
||||
location = var.location
|
||||
|
||||
identity {
|
||||
type = "UserAssigned"
|
||||
identity_ids = ["/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/AppGW_RG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/QMIMainIDY"]
|
||||
}
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
@@ -140,10 +139,10 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
}
|
||||
|
||||
# This is needed for NPrinting
|
||||
disabled_rule_group {
|
||||
/*disabled_rule_group {
|
||||
rule_group_name = "REQUEST-920-PROTOCOL-ENFORCEMENT"
|
||||
rules = ["920270", "920271"]
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@@ -186,8 +185,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
|
||||
ssl_certificate {
|
||||
name = var.cert_name
|
||||
password = data.azurerm_key_vault_secret.cert-password.value
|
||||
data = data.azurerm_key_vault_secret.cert-data.value
|
||||
key_vault_secret_id = data.azurerm_key_vault_certificate.qmi-cert.secret_id
|
||||
}
|
||||
|
||||
ssl_policy {
|
||||
@@ -272,6 +270,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
unhealthy_threshold = 3
|
||||
|
||||
match {
|
||||
body = null
|
||||
status_code = ["200-401"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@ Import-Module "Carbon"
|
||||
$secpasswd = ConvertTo-SecureString $Pass -AsPlainText -Force
|
||||
$cred = New-Object System.Management.Automation.PSCredential ($Username, $secpasswd)
|
||||
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
Write-Log "Done! Setting new password to user $Username"
|
||||
@@ -13,7 +13,7 @@ Import-Module "Carbon"
|
||||
### create Qlik User
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-MyCredential -user "Qlik" -pass "Qlik1234"
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
|
||||
### Grant Remote Admin Rights to Qlik User
|
||||
Write-Log -Message "Granting Qlik account Remote Interactive Logon Right"
|
||||
|
||||
@@ -54,7 +54,7 @@ New-QlikTag -name "QVD Catalog" | Out-Null
|
||||
Import-Module "Carbon"
|
||||
Write-Log -Message "Adding 'podium' user to Windows system"
|
||||
$cred = New-Credential "podium" "Qlik1234"
|
||||
Install-User -Credential $cred | Out-Null
|
||||
Install-CUser -Credential $cred | Out-Null
|
||||
|
||||
|
||||
Write-Log -Message "Creating Qlik Sense data connection for C:\QVDs"
|
||||
|
||||
@@ -114,7 +114,7 @@ Grant-SmbShareAccess -Name certs -AccountName Everyone -AccessRight Read -Force
|
||||
Import-Module "Carbon"
|
||||
Write-Log -Message "Adding 'podium' user to Windows system"
|
||||
$cred = New-Credential "podium" "Qlik1234"
|
||||
Install-User -Credential $cred | Out-Null
|
||||
Install-CUser -Credential $cred | Out-Null
|
||||
|
||||
#gci cert:\CurrentUser\My | where {$_.issuer -eq $cert} | Connect-Qlik -Username $env:COMPUTERNAME\podium -Computername $env:COMPUTERNAME
|
||||
#gci cert:\CurrentUser\My | where {$_.issuer -eq $cert} | Connect-Qlik -Computername $env:COMPUTERNAME
|
||||
|
||||
@@ -34,7 +34,7 @@ function New-Credential($u,$p) {
|
||||
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-Credential "Qlik" $QlikUserPwd
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
|
||||
|
||||
Write-Log -Message "Starting qs-post-cfg.ps1"
|
||||
|
||||
@@ -8,5 +8,5 @@ Import-Module "Carbon"
|
||||
$secpasswd = ConvertTo-SecureString $Pass -AsPlainText -Force
|
||||
$cred = New-Object System.Management.Automation.PSCredential ($Username, $secpasswd)
|
||||
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
Write-Log "Done! Setting new password to user $Username"
|
||||
@@ -13,7 +13,7 @@ Import-Module "Carbon"
|
||||
### create Qlik User
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-MyCredential -user "Qlik" -pass "Qlik1234"
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
|
||||
### Grant Remote Admin Rights to Qlik User
|
||||
Write-Log -Message "Granting Qlik account Remote Interactive Logon Right"
|
||||
|
||||
@@ -137,7 +137,7 @@ resource "azurerm_virtual_machine" "vm" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/qs-post-cfg.ps1 -Hostname ${var.resource_group_name}.qmi.qlik-poc.com -CertPwd ${data.azurerm_key_vault_secret.cert-password.value} -QlikUserPwd ${random_password.qlikpassword.result}",
|
||||
"powershell.exe -File C:/provision/qs-post-cfg.ps1 -Hostname ${var.resource_group_name}.qmi.qlik-poc.com -CertPwd \"${data.azurerm_key_vault_secret.cert-password.value}\" -QlikUserPwd ${random_password.qlikpassword.result}",
|
||||
"powershell.exe -File C:/provision/np-post.ps1"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ function New-Credential($u,$p) {
|
||||
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-Credential "Qlik" $QlikUserPwd
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
|
||||
Write-Log -Message "Starting qs-post-cfg.ps1"
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ resource "null_resource" "install" {
|
||||
https = false
|
||||
timeout = "30m"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
source = "${path.module}/main"
|
||||
destination = "C:/provision/compose-install"
|
||||
}
|
||||
|
||||
@@ -46,10 +46,11 @@ resource "null_resource" "install" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/compose-install/prep-files.ps1",
|
||||
"powershell.exe -File C:/provision/compose-install/di-compose-getBinary.ps1 -url ${var.download_url}",
|
||||
"powershell.exe -File C:/provision/compose-install/di-compose-install.ps1 -url ${var.download_url} -version ${var.c_version}",
|
||||
"powershell.exe -File C:/provision/compose-install/di-compose-setlicense.ps1 -composeLicense \"${local.composeLicense}\" -version ${var.c_version}",
|
||||
"powershell.exe -File C:/provision/compose-install/di-compose-installQMICertificate.ps1 -CertPwd ${data.azurerm_key_vault_secret.cert-password.value} -version ${var.c_version}",
|
||||
"powershell.exe -File C:/provision/compose-install/di-compose-installQMICertificate.ps1 -CertPwd \"${data.azurerm_key_vault_secret.cert-password.value}\" -version ${var.c_version}",
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
30
compose-install/main/prep-files.ps1
Normal file
30
compose-install/main/prep-files.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
Param(
|
||||
[string] $repo="qmi-cloud-tf-modules",
|
||||
[string] $branch="master",
|
||||
[string] $scenario="compose-install",
|
||||
[string] $path="scripts"
|
||||
)
|
||||
|
||||
$pathIs="$scenario/$path"
|
||||
|
||||
$DownloadUrl="https://gitlab.com/qmi/$repo/-/archive/$branch/$repo-$branch.zip?path=$pathIs"
|
||||
|
||||
Write-Host "--- Boostrap# Downloading repository files ($DownloadUrl) from branch ($branch)..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Temp | Out-Null
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
(New-Object System.Net.WebClient).DownloadFile($DownloadUrl, "C:\Temp\$scenario.zip")
|
||||
|
||||
Expand-Archive "C:\Temp\$scenario.zip" -DestinationPath "C:\Temp" -Force
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Provision | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path C:\Provision\compose-install | Out-Null
|
||||
|
||||
Copy-Item -Path "C:\Temp\$repo-$branch-$scenario-scripts\$scenario\$path\*" -Destination "C:\Provision\compose-install" -Recurse -Force
|
||||
|
||||
Remove-Item "C:\Temp\$repo-$branch-$scenario-scripts" -Recurse
|
||||
Remove-Item "C:\Temp\$scenario.zip" -Recurse
|
||||
7
compose-install/output.tf
Normal file
7
compose-install/output.tf
Normal file
@@ -0,0 +1,7 @@
|
||||
output "finished" {
|
||||
value = true
|
||||
|
||||
depends_on = [
|
||||
null_resource.install
|
||||
]
|
||||
}
|
||||
25
compose-install/scripts/Compose_install_2021.2.0.iss
Normal file
25
compose-install/scripts/Compose_install_2021.2.0.iss
Normal file
@@ -0,0 +1,25 @@
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-DlgOrder]
|
||||
Dlg0={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdWelcome-0
|
||||
Count=5
|
||||
Dlg1={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdLicense2Rtf-0
|
||||
Dlg2={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdAskDestPath-0
|
||||
Dlg3={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdStartCopy-0
|
||||
Dlg4={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdFinish-0
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdWelcomeMaint-0]
|
||||
Result=1
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-MessageBox-0]
|
||||
Result=6
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdFinish-0]
|
||||
Result=1
|
||||
bOpt1=0
|
||||
bOpt2=0
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdWelcome-0]
|
||||
Result=1
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdLicense2Rtf-0]
|
||||
Result=1
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdAskDestPath-0]
|
||||
szDir=C:\Program Files\Qlik\Compose\
|
||||
Result=1
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdStartCopy-0]
|
||||
Result=1
|
||||
|
||||
20
compose-install/scripts/Compose_install_2021.8.0.iss
Normal file
20
compose-install/scripts/Compose_install_2021.8.0.iss
Normal file
@@ -0,0 +1,20 @@
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-DlgOrder]
|
||||
Dlg0={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdWelcome-0
|
||||
Count=5
|
||||
Dlg1={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdLicenseAgreement-0
|
||||
Dlg2={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdAskDestPath-0
|
||||
Dlg3={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdStartCopy-0
|
||||
Dlg4={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdFinish-0
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdWelcome-0]
|
||||
Result=1
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdLicenseAgreement-0]
|
||||
Result=1
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdAskDestPath-0]
|
||||
szDir=C:\Program Files\Qlik\Compose\
|
||||
Result=1
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdStartCopy-0]
|
||||
Result=1
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdFinish-0]
|
||||
Result=1
|
||||
bOpt1=0
|
||||
bOpt2=0
|
||||
@@ -1,20 +1,20 @@
|
||||
[{AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-DlgOrder]
|
||||
Dlg0={AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-SdWelcome-0
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-DlgOrder]
|
||||
Dlg0={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdWelcome-0
|
||||
Count=5
|
||||
Dlg1={AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-SdLicense2Rtf-0
|
||||
Dlg2={AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-SdAskDestPath-0
|
||||
Dlg3={AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-SdStartCopy-0
|
||||
Dlg4={AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-SdFinish-0
|
||||
[{AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-SdWelcome-0]
|
||||
Dlg1={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdLicenseAgreement-0
|
||||
Dlg2={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdAskDestPath-0
|
||||
Dlg3={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdStartCopy-0
|
||||
Dlg4={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdFinish-0
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdWelcome-0]
|
||||
Result=1
|
||||
[{AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-SdLicense2Rtf-0]
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdLicenseAgreement-0]
|
||||
Result=1
|
||||
[{AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-SdAskDestPath-0]
|
||||
szDir=C:\Program Files\Attunity\Compose for Data Warehouses\
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdAskDestPath-0]
|
||||
szDir=C:\Program Files\Qlik\Compose\
|
||||
Result=1
|
||||
[{AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-SdStartCopy-0]
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdStartCopy-0]
|
||||
Result=1
|
||||
[{AE6E976D-5485-4F2E-87CC-39CBEF87E47D}-SdFinish-0]
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdFinish-0]
|
||||
Result=1
|
||||
bOpt1=0
|
||||
bOpt2=0
|
||||
|
||||
@@ -22,10 +22,11 @@ Write-Host "Binary Path $($bin)"
|
||||
Write-Host "Starting di-c4dw-install.ps1"
|
||||
$issFile = "Compose_install.iss"
|
||||
|
||||
if ( $version -eq "c4dw" ) {
|
||||
$issFile = "Compose_install_c4dw.iss"
|
||||
if ( $version -ne "gen2" ) {
|
||||
$issFile = "Compose_install_$version.iss"
|
||||
}
|
||||
|
||||
|
||||
Write-Host $bin\$fileName
|
||||
|
||||
If ((Test-Path $bin\$fileName))
|
||||
|
||||
@@ -11,18 +11,18 @@ try {
|
||||
$thumb=$($sslCert.Thumbprint)
|
||||
Write-Host "Set SSL qmi_qlik-poc_com for Compose"
|
||||
|
||||
if ( $version -eq "gen2" ) {
|
||||
Stop-Service QlikCompose
|
||||
Start-Process -FilePath "C:\Program Files\Qlik\Compose\bin\ComposeCtl.exe" -ArgumentList "certificate clean" -Wait -NoNewWindow
|
||||
netsh http add sslcert ipport=0.0.0.0:443 certhash=$thumb appid='{4dc3e181-e14b-4a21-b022-59fc669b0914}'
|
||||
|
||||
Start-Service QlikCompose
|
||||
} else {
|
||||
if ( $version -eq "c4dw" ) {
|
||||
Stop-Service AttunityComposeForDataWarehouses
|
||||
Start-Process -FilePath "C:\Program Files\Attunity\Compose for Data Warehouses\bin\ComposeCtl.exe" -ArgumentList "certificate clean" -Wait -NoNewWindow
|
||||
netsh http add sslcert ipport=0.0.0.0:443 certhash=$thumb appid='{4dc3e181-e14b-4a21-b022-59fc669b0914}'
|
||||
|
||||
Start-Service AttunityComposeForDataWarehouses
|
||||
} else {
|
||||
Stop-Service QlikCompose
|
||||
Start-Process -FilePath "C:\Program Files\Qlik\Compose\bin\ComposeCtl.exe" -ArgumentList "certificate clean" -Wait -NoNewWindow
|
||||
netsh http add sslcert ipport=0.0.0.0:443 certhash=$thumb appid='{4dc3e181-e14b-4a21-b022-59fc669b0914}'
|
||||
|
||||
Start-Service QlikCompose
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -25,11 +25,20 @@ if ( $version -eq "c4dw" ) {
|
||||
}
|
||||
$bin = $bin -replace ' ','` '
|
||||
|
||||
Write-Host "Connect to Compose"
|
||||
$cmd = "$($bin)ComposeCli.exe connect"
|
||||
Write-Host "Connect to Compose: $($cmd)"
|
||||
$cmd = "$($bin)ComposeCli.exe connect"
|
||||
Invoke-Expression $cmd
|
||||
|
||||
Write-Host "Apply Compose License"
|
||||
$cmd = "$($bin)ComposeCli.exe register_license --req @$PSScriptRoot\compose-license.txt"
|
||||
Start-Sleep 5
|
||||
|
||||
if ( $version -eq "2021.8.0" ) {
|
||||
$cmd = "$($bin)ComposeCli.exe register_license --infile $PSScriptRoot\compose-license.txt"
|
||||
} else {
|
||||
$cmd = "$($bin)ComposeCli.exe register_license --req @$PSScriptRoot\compose-license.txt"
|
||||
}
|
||||
Write-Host "Apply Compose License: $($cmd)"
|
||||
Invoke-Expression $cmd
|
||||
|
||||
Start-Sleep 5
|
||||
|
||||
|
||||
Binary file not shown.
@@ -11,7 +11,8 @@ variable "vm_admin_password" {
|
||||
}
|
||||
|
||||
variable "download_url" {
|
||||
default = "https://da3hntz84uekx.cloudfront.net/QlikReplicate/7.0.0/5/_MSI/AttunityReplicate_7.0.0.514_X64.zip"
|
||||
//default = "https://da3hntz84uekx.cloudfront.net/QlikCompose/2021.8.0/139/_MSI/Qlik_Compose_2021.8.0.139.zip"
|
||||
default = "https://github.com/qlik-download/compose/releases/download/v2021.8.0.465/Qlik_Compose_2021.8.0.465.zip"
|
||||
}
|
||||
|
||||
variable "key_vault_id" {
|
||||
@@ -21,4 +22,8 @@ variable "key_vault_id" {
|
||||
variable "c_version" {
|
||||
default = "gen2"
|
||||
description = "'c4dw' or 'gen2'"
|
||||
}
|
||||
|
||||
variable "trigger_done" {
|
||||
default = null
|
||||
}
|
||||
155
databases/aws-kinesis/main.tf
Normal file
155
databases/aws-kinesis/main.tf
Normal file
@@ -0,0 +1,155 @@
|
||||
|
||||
terraform {
|
||||
|
||||
required_version = ">= 0.13"
|
||||
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 3.69.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "aws" {
|
||||
region = var.region
|
||||
access_key = var.aws_provider_access_key
|
||||
secret_key = var.aws_provider_access_secret
|
||||
}
|
||||
|
||||
provider "aws" {
|
||||
|
||||
region = var.region
|
||||
access_key = var.aws_provider_access_key
|
||||
secret_key = var.aws_provider_access_secret
|
||||
|
||||
alias = "myaws"
|
||||
|
||||
}
|
||||
|
||||
locals {
|
||||
myRegex = "/[^[:alpha:]]/"
|
||||
splitLower = split(" ", lower(var.user_id))
|
||||
np0 = replace(element(local.splitLower,0), local.myRegex, "")
|
||||
np1 = replace(element(local.splitLower,1), local.myRegex, "")
|
||||
container_n1 = substr(local.np0, 0, 3)
|
||||
container_n2 = substr(local.np1, 0, 1)
|
||||
container_n3 = substr(strrev(local.np1), 0, 1)
|
||||
|
||||
scnamelower = "${local.container_n1}${local.container_n2}${local.container_n3}"
|
||||
|
||||
}
|
||||
|
||||
resource "aws_kinesis_stream" "attrep_apply_exceptions" {
|
||||
provider = aws.myaws
|
||||
|
||||
name = "${local.scnamelower}.attrep_apply_exceptions"
|
||||
shard_count = 1
|
||||
|
||||
/*stream_mode_details {
|
||||
stream_mode = "PROVISIONED"
|
||||
}*/
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_kinesis_stream" "semployees" {
|
||||
provider = aws.myaws
|
||||
|
||||
name = "${local.scnamelower}.EMPLOYEES"
|
||||
shard_count = 3
|
||||
|
||||
/*stream_mode_details {
|
||||
stream_mode = "PROVISIONED"
|
||||
}*/
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_kinesis_stream" "sjobs" {
|
||||
provider = aws.myaws
|
||||
|
||||
name = "${local.scnamelower}.JOBS"
|
||||
shard_count = 3
|
||||
|
||||
/*stream_mode_details {
|
||||
stream_mode = "PROVISIONED"
|
||||
}*/
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_kinesis_stream" "metadata" {
|
||||
provider = aws.myaws
|
||||
|
||||
name = "${local.scnamelower}.metadata"
|
||||
shard_count = 1
|
||||
|
||||
/*stream_mode_details {
|
||||
stream_mode = "PROVISIONED"
|
||||
}*/
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
module "iam_user" {
|
||||
source = "terraform-aws-modules/iam/aws//modules/iam-user"
|
||||
|
||||
providers = {
|
||||
aws = aws.myaws
|
||||
}
|
||||
|
||||
version = "~> 3.0"
|
||||
|
||||
name = "qmi-user-${var.provision_id}"
|
||||
force_destroy = true
|
||||
|
||||
create_iam_user_login_profile = false
|
||||
#pgp_key = "keybase:test"
|
||||
|
||||
password_reset_required = false
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resource "aws_iam_user_policy" "kinesis_pol" {
|
||||
|
||||
provider = aws.myaws
|
||||
|
||||
name = "kinesis_policy_${module.iam_user.this_iam_user_name}"
|
||||
user = module.iam_user.this_iam_user_name
|
||||
|
||||
# Terraform's "jsonencode" function converts a
|
||||
# Terraform expression result to valid JSON syntax.
|
||||
policy = jsonencode({
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": "kinesis:*",
|
||||
"Resource": "*"
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
27
databases/aws-kinesis/output.tf
Normal file
27
databases/aws-kinesis/output.tf
Normal file
@@ -0,0 +1,27 @@
|
||||
output "arn_metadata" {
|
||||
value = aws_kinesis_stream.metadata.arn
|
||||
}
|
||||
|
||||
output "arn_employees" {
|
||||
value = aws_kinesis_stream.semployees.arn
|
||||
}
|
||||
|
||||
output "arn_jobs" {
|
||||
value = aws_kinesis_stream.sjobs.arn
|
||||
}
|
||||
|
||||
output "arn_attrep_apply_exceptions" {
|
||||
value = aws_kinesis_stream.attrep_apply_exceptions.arn
|
||||
}
|
||||
|
||||
output "iam_name" {
|
||||
value = module.iam_user.this_iam_user_name
|
||||
}
|
||||
|
||||
output "iam_access_key" {
|
||||
value = module.iam_user.this_iam_access_key_id
|
||||
}
|
||||
|
||||
output "iam_access_secret" {
|
||||
value = module.iam_user.this_iam_access_key_secret
|
||||
}
|
||||
16
databases/aws-kinesis/variables.tf
Normal file
16
databases/aws-kinesis/variables.tf
Normal file
@@ -0,0 +1,16 @@
|
||||
variable "aws_provider_access_key" {
|
||||
}
|
||||
|
||||
variable "aws_provider_access_secret" {
|
||||
}
|
||||
|
||||
variable "region" {
|
||||
default = "us-east-1"
|
||||
}
|
||||
|
||||
variable "provision_id" {
|
||||
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
}
|
||||
@@ -28,10 +28,10 @@ locals {
|
||||
subnet_ids = (var.region == "eu-west-1") ? var.subnet_ids_eu : (var.region == "us-east-1") ? var.subnet_ids_us : var.subnet_ids_ap
|
||||
port = (var.engine == "oracle-se2") ? "1521" : (var.engine == "postgres") ? "5432" : (var.engine == "aurora-postgresql") ? "5432" : (var.engine == "sqlserver-ex") ? "1433" : "3306"
|
||||
name = (var.engine == "sqlserver-ex") ? null : (var.engine == "oracle-se2") ? "ora${local.provid5}" : "qmi${var.provision_id}"
|
||||
license = (local.aurora == true) ? "general-public-license" : (var.engine == "mariadb") ? "general-public-license" : "license-included"
|
||||
engine_version = (var.engine == "oracle-se2") ? "engine_version=19.0.0.0.ru-2021-04.rur-2021-04.r1" : (var.engine == "postgres") ? "13.3" : (var.engine == "mysql") ? "8.0.25" : (var.engine == "aurora-postgresql") ? "12.6" : (var.engine == "aurora-mysql") ? "5.7.mysql_aurora.2.10.0" : (var.engine == "sqlserver-ex") ? "15.00.4073.23.v1" : "10.5" #mariaDB
|
||||
major_engine_version = (var.engine == "oracle-se2") ? "19.0" : (var.engine == "postgres") ? "13" : (var.engine == "mysql") ? "8.0" : (var.engine == "aurora-postgresql") ? "12" : (var.engine == "aurora-mysql") ? "5.7" : (var.engine == "sqlserver-ex") ? "15.00" : "10.5" #mariaDB
|
||||
family = (var.engine == "oracle-se2") ? "oracle-se2-19" : (var.engine == "postgres") ? "postgres13" : (var.engine == "mysql") ? "mysql8.0" : (var.engine == "aurora-postgresql") ? "aurora-postgresql12" : (var.engine == "aurora-mysql") ? "aurora-mysql5.7" : (var.engine == "sqlserver-ex") ? "sqlserver-ex-15.0" : "mariadb10.5" #mariaDB
|
||||
license = (local.aurora == true) ? "general-public-license" : (var.engine == "mariadb") ? "general-public-license" : (var.engine == "postgres") ? "postgresql-license" : (var.engine == "mysql") ? "general-public-license" : "license-included"
|
||||
engine_version = (var.engine == "oracle-se2") ? "19.0.0.0.ru-2021-04.rur-2021-04.r1" : (var.engine == "postgres") ? "13.3" : (var.engine == "mysql") ? "8.0.25" : (var.engine == "aurora-postgresql") ? "12.6" : (var.engine == "aurora-mysql") ? "5.7.mysql_aurora.2.10.0" : (var.engine == "sqlserver-ex") ? "15.00.4073.23.v1" : "10.5" #mariaDB
|
||||
major_engine_version = (var.engine == "oracle-se2") ? "19" : (var.engine == "postgres") ? "13" : (var.engine == "mysql") ? "8.0" : (var.engine == "aurora-postgresql") ? "12" : (var.engine == "aurora-mysql") ? "5.7" : (var.engine == "sqlserver-ex") ? "15.00" : "10.5" #mariaDB
|
||||
family = (var.engine == "oracle-se2") ? "oracle-se2-19" : (var.engine == "postgres") ? "postgres13" : (var.engine == "mysql") ? "mysql8.0" : (var.engine == "aurora-postgresql") ? "aurora-postgresql12" : (var.engine == "aurora-mysql") ? "aurora-mysql5.7" : (var.engine == "sqlserver-ex") ? "sqlserver-ex-15.0" : "mariadb10.5" #mariaDB
|
||||
tags = {
|
||||
QMI_user = var.user_id
|
||||
ProvID = var.provision_id
|
||||
@@ -40,6 +40,9 @@ locals {
|
||||
|
||||
|
||||
module "security_group" {
|
||||
|
||||
count = var.enabled? 1 : 0
|
||||
|
||||
# SGs created here as Ports differ per Engine. Only Azure Firewall IPs added for now.
|
||||
source = "terraform-aws-modules/security-group/aws"
|
||||
version = "~> 4.3"
|
||||
@@ -55,7 +58,45 @@ module "security_group" {
|
||||
|
||||
# ingress
|
||||
|
||||
ingress_cidr_blocks = ["52.249.189.38/32", "13.67.39.86/32", "20.67.110.207/32", "14.98.59.168/29", "182.74.33.8/29", "188.65.156.32/28", "212.73.252.96/29", "194.90.96.176/29", "213.57.84.160/29", "4.4.97.104/29", "206.196.17.32/27", "18.205.71.36", "18.232.32.199", "34.237.68.254", "34.247.21.179", "52.31.212.214", "54.154.95.18", "13.210.43.241", "13.236.104.42", "13.236.206.172"]
|
||||
ingress_cidr_blocks = [
|
||||
"52.249.189.38/32",
|
||||
"13.67.39.86/32",
|
||||
"20.67.110.207/32",
|
||||
"14.98.59.168/29",
|
||||
"182.74.33.8/29",
|
||||
"188.65.156.32/28",
|
||||
"212.73.252.96/29",
|
||||
"194.90.96.176/29",
|
||||
"213.57.84.160/29",
|
||||
"4.4.97.104/29",
|
||||
"206.196.17.32/27",
|
||||
#QCS
|
||||
"18.205.71.36/32",
|
||||
"18.232.32.199/32",
|
||||
"34.237.68.254/32",
|
||||
"34.247.21.179/32",
|
||||
"52.31.212.214/32",
|
||||
"54.154.95.18/32",
|
||||
"13.210.43.241/32",
|
||||
"13.236.104.42/32",
|
||||
"13.236.206.172/32",
|
||||
"18.138.163.172/32",
|
||||
"18.142.157.182/32",
|
||||
"54.179.13.251/32",
|
||||
#QAA
|
||||
"54.216.156.88/32",
|
||||
"3.248.156.131/32",
|
||||
"52.213.44.55/32",
|
||||
"18.235.133.252/32",
|
||||
"3.217.244.242/32",
|
||||
"18.214.8.201/32",
|
||||
"54.206.158.27/32",
|
||||
"3.104.137.20/32",
|
||||
"3.24.52.178/32",
|
||||
"54.169.84.213/32",
|
||||
"13.213.173.37/32",
|
||||
"13.213.113.162/32"
|
||||
]
|
||||
|
||||
ingress_with_cidr_blocks = [
|
||||
{
|
||||
@@ -69,7 +110,45 @@ module "security_group" {
|
||||
|
||||
# egress
|
||||
|
||||
egress_cidr_blocks = ["52.249.189.38/32", "13.67.39.86/32", "20.67.110.207/32", "14.98.59.168/29", "182.74.33.8/29", "188.65.156.32/28", "212.73.252.96/29", "194.90.96.176/29", "213.57.84.160/29", "4.4.97.104/29", "206.196.17.32/27", "18.205.71.36", "18.232.32.199", "34.237.68.254", "34.247.21.179", "52.31.212.214", "54.154.95.18", "13.210.43.241", "13.236.104.42", "13.236.206.172"]
|
||||
egress_cidr_blocks = [
|
||||
"52.249.189.38/32",
|
||||
"13.67.39.86/32",
|
||||
"20.67.110.207/32",
|
||||
"14.98.59.168/29",
|
||||
"182.74.33.8/29",
|
||||
"188.65.156.32/28",
|
||||
"212.73.252.96/29",
|
||||
"194.90.96.176/29",
|
||||
"213.57.84.160/29",
|
||||
"4.4.97.104/29",
|
||||
"206.196.17.32/27",
|
||||
#QCS
|
||||
"18.205.71.36/32",
|
||||
"18.232.32.199/32",
|
||||
"34.237.68.254/32",
|
||||
"34.247.21.179/32",
|
||||
"52.31.212.214/32",
|
||||
"54.154.95.18/32",
|
||||
"13.210.43.241/32",
|
||||
"13.236.104.42/32",
|
||||
"13.236.206.172/32",
|
||||
"18.138.163.172/32",
|
||||
"18.142.157.182/32",
|
||||
"54.179.13.251/32",
|
||||
#QAA
|
||||
"54.216.156.88/32",
|
||||
"3.248.156.131/32",
|
||||
"52.213.44.55/32",
|
||||
"18.235.133.252/32",
|
||||
"3.217.244.242/32",
|
||||
"18.214.8.201/32",
|
||||
"54.206.158.27/32",
|
||||
"3.104.137.20/32",
|
||||
"3.24.52.178/32",
|
||||
"54.169.84.213/32",
|
||||
"13.213.173.37/32",
|
||||
"13.213.113.162/32"
|
||||
]
|
||||
|
||||
egress_with_cidr_blocks = [
|
||||
{
|
||||
@@ -88,7 +167,7 @@ module "common_rds_instance" {
|
||||
source = "terraform-aws-modules/rds/aws"
|
||||
version = "~> 3.3"
|
||||
|
||||
count = local.aurora ? 0 : 1
|
||||
count = local.aurora? 0 : var.enabled? 1 : 0
|
||||
|
||||
providers = {
|
||||
aws = aws.myaws
|
||||
@@ -113,7 +192,7 @@ module "common_rds_instance" {
|
||||
|
||||
multi_az = false
|
||||
subnet_ids = local.subnet_ids
|
||||
vpc_security_group_ids = [module.security_group.security_group_id]
|
||||
vpc_security_group_ids = [module.security_group[0].security_group_id]
|
||||
publicly_accessible = true
|
||||
|
||||
maintenance_window = "Mon:00:00-Mon:03:00"
|
||||
@@ -131,7 +210,7 @@ module "aurora_rds_instance" {
|
||||
source = "terraform-aws-modules/rds-aurora/aws"
|
||||
version = "~> 5.2"
|
||||
|
||||
count = local.aurora ? 1 : 0
|
||||
count = (local.aurora && var.enabled)? 1 : 0
|
||||
|
||||
providers = {
|
||||
aws = aws.myaws
|
||||
@@ -145,7 +224,7 @@ module "aurora_rds_instance" {
|
||||
vpc_id = local.vpc_id
|
||||
subnets = local.subnet_ids
|
||||
create_security_group = false
|
||||
vpc_security_group_ids = [module.security_group.security_group_id]
|
||||
vpc_security_group_ids = [module.security_group[0].security_group_id]
|
||||
port = local.port
|
||||
publicly_accessible = true
|
||||
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
output "db_username" {
|
||||
description = "The master username for the database"
|
||||
value = local.aurora ? module.aurora_rds_instance[0].rds_cluster_master_username : module.common_rds_instance[0].db_instance_username
|
||||
value = (local.aurora && var.enabled)? module.aurora_rds_instance[0].rds_cluster_master_username : var.enabled? module.common_rds_instance[0].db_instance_username : null
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
output "db_instance_password" {
|
||||
description = "The database password (this password may be old, because Terraform doesn't track it after initial creation)"
|
||||
value = local.aurora ? module.aurora_rds_instance[0].rds_cluster_master_password : module.common_rds_instance[0].db_instance_password
|
||||
value = (local.aurora && var.enabled)? module.aurora_rds_instance[0].rds_cluster_master_password : var.enabled? module.common_rds_instance[0].db_instance_password : null
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
output "db_instance_port" {
|
||||
description = "The database port"
|
||||
value = local.aurora ? module.aurora_rds_instance[0].rds_cluster_port : module.common_rds_instance[0].db_instance_port
|
||||
value = (local.aurora && var.enabled)? module.aurora_rds_instance[0].rds_cluster_port : var.enabled? module.common_rds_instance[0].db_instance_port : null
|
||||
}
|
||||
|
||||
output "db_instance_endpoint" {
|
||||
description = "The connection endpoint"
|
||||
value = local.aurora ? module.aurora_rds_instance[0].rds_cluster_instance_endpoint : module.common_rds_instance[0].db_instance_endpoint
|
||||
value = (local.aurora && var.enabled)? module.aurora_rds_instance[0].rds_cluster_endpoint : var.enabled? module.common_rds_instance[0].db_instance_endpoint : null
|
||||
}
|
||||
|
||||
output "db_instance_name" {
|
||||
value = (var.enabled)? local.name : null
|
||||
}
|
||||
|
||||
@@ -66,3 +66,7 @@ variable "instance_size" {
|
||||
variable "storage" {
|
||||
default = "20"
|
||||
}
|
||||
|
||||
variable "enabled" {
|
||||
default = true
|
||||
}
|
||||
|
||||
209
databases/aws-redshift/main.tf
Normal file
209
databases/aws-redshift/main.tf
Normal file
@@ -0,0 +1,209 @@
|
||||
terraform {
|
||||
|
||||
required_version = ">= 0.13"
|
||||
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 3.49.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "aws" {
|
||||
|
||||
region = var.region
|
||||
access_key = var.aws_provider_access_key
|
||||
secret_key = var.aws_provider_access_secret
|
||||
|
||||
alias = "myaws"
|
||||
|
||||
}
|
||||
|
||||
resource "random_password" "password" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!"
|
||||
min_numeric = 1
|
||||
upper = true
|
||||
lower = true
|
||||
number = true
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
locals {
|
||||
provid5 = substr(var.provision_id, 0, 5)
|
||||
vpc_id = (var.region == "eu-west-1") ? var.vpc_id_eu : (var.region == "us-east-1") ? var.vpc_id_us : var.vpc_id_ap
|
||||
subnet_ids = (var.region == "eu-west-1") ? var.subnet_ids_eu : (var.region == "us-east-1") ? var.subnet_ids_us : var.subnet_ids_ap
|
||||
port = "5439"
|
||||
tags = {
|
||||
QMI_user = var.user_id
|
||||
ProvID = var.provision_id
|
||||
}
|
||||
}
|
||||
|
||||
module "security_group" {
|
||||
# SGs created here as Ports differ per Engine. Only Azure Firewall IPs added for now.
|
||||
source = "terraform-aws-modules/security-group/aws"
|
||||
version = "~> 4.3"
|
||||
|
||||
providers = {
|
||||
aws = aws.myaws
|
||||
}
|
||||
|
||||
name = "${var.provision_id}-SG"
|
||||
description = "${var.provision_id}-SG"
|
||||
vpc_id = local.vpc_id
|
||||
|
||||
|
||||
# ingress
|
||||
|
||||
ingress_cidr_blocks = [
|
||||
"52.249.189.38/32",
|
||||
"13.67.39.86/32",
|
||||
"20.67.110.207/32",
|
||||
"14.98.59.168/29",
|
||||
"182.74.33.8/29",
|
||||
"188.65.156.32/28",
|
||||
"212.73.252.96/29",
|
||||
"194.90.96.176/29",
|
||||
"213.57.84.160/29",
|
||||
"4.4.97.104/29",
|
||||
"206.196.17.32/27",
|
||||
#QCS
|
||||
"18.205.71.36/32",
|
||||
"18.232.32.199/32",
|
||||
"34.237.68.254/32",
|
||||
"34.247.21.179/32",
|
||||
"52.31.212.214/32",
|
||||
"54.154.95.18/32",
|
||||
"13.210.43.241/32",
|
||||
"13.236.104.42/32",
|
||||
"13.236.206.172/32",
|
||||
"18.138.163.172/32",
|
||||
"18.142.157.182/32",
|
||||
"54.179.13.251/32",
|
||||
#QAA
|
||||
"54.216.156.88/32",
|
||||
"3.248.156.131/32",
|
||||
"52.213.44.55/32",
|
||||
"18.235.133.252/32",
|
||||
"3.217.244.242/32",
|
||||
"18.214.8.201/32",
|
||||
"54.206.158.27/32",
|
||||
"3.104.137.20/32",
|
||||
"3.24.52.178/32",
|
||||
"54.169.84.213/32",
|
||||
"13.213.173.37/32",
|
||||
"13.213.113.162/32"
|
||||
]
|
||||
|
||||
ingress_with_cidr_blocks = [
|
||||
{
|
||||
from_port = local.port
|
||||
to_port = local.port
|
||||
protocol = "tcp"
|
||||
description = "Redshift"
|
||||
|
||||
},
|
||||
]
|
||||
|
||||
# egress
|
||||
|
||||
egress_cidr_blocks = [
|
||||
"52.249.189.38/32",
|
||||
"13.67.39.86/32",
|
||||
"20.67.110.207/32",
|
||||
"14.98.59.168/29",
|
||||
"182.74.33.8/29",
|
||||
"188.65.156.32/28",
|
||||
"212.73.252.96/29",
|
||||
"194.90.96.176/29",
|
||||
"213.57.84.160/29",
|
||||
"4.4.97.104/29",
|
||||
"206.196.17.32/27",
|
||||
#QCS
|
||||
"18.205.71.36/32",
|
||||
"18.232.32.199/32",
|
||||
"34.237.68.254/32",
|
||||
"34.247.21.179/32",
|
||||
"52.31.212.214/32",
|
||||
"54.154.95.18/32",
|
||||
"13.210.43.241/32",
|
||||
"13.236.104.42/32",
|
||||
"13.236.206.172/32",
|
||||
"18.138.163.172/32",
|
||||
"18.142.157.182/32",
|
||||
"54.179.13.251/32",
|
||||
#QAA
|
||||
"54.216.156.88/32",
|
||||
"3.248.156.131/32",
|
||||
"52.213.44.55/32",
|
||||
"18.235.133.252/32",
|
||||
"3.217.244.242/32",
|
||||
"18.214.8.201/32",
|
||||
"54.206.158.27/32",
|
||||
"3.104.137.20/32",
|
||||
"3.24.52.178/32",
|
||||
"54.169.84.213/32",
|
||||
"13.213.173.37/32",
|
||||
"13.213.113.162/32"
|
||||
]
|
||||
|
||||
|
||||
egress_with_cidr_blocks = [
|
||||
{
|
||||
from_port = local.port
|
||||
to_port = local.port
|
||||
protocol = "tcp"
|
||||
description = "Redshift"
|
||||
|
||||
},
|
||||
]
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
module "redshift" {
|
||||
|
||||
providers = {
|
||||
aws = aws.myaws
|
||||
}
|
||||
|
||||
source = "terraform-aws-modules/redshift/aws"
|
||||
version = "~> 3.0"
|
||||
|
||||
cluster_identifier = "qmi-${var.provision_id}"
|
||||
cluster_node_type = "dc2.large" #"dc1.large"
|
||||
cluster_number_of_nodes = 1
|
||||
|
||||
cluster_database_name = var.cluster_database_name
|
||||
cluster_master_username = var.cluster_master_username
|
||||
cluster_master_password = random_password.password.result
|
||||
|
||||
# Group parameters
|
||||
#wlm_json_configuration = "[{\"query_concurrency\": 5}]"
|
||||
|
||||
# DB Subnet Group Inputs
|
||||
subnets = local.subnet_ids
|
||||
vpc_security_group_ids = [module.security_group.security_group_id]
|
||||
publicly_accessible = true
|
||||
|
||||
# IAM Roles
|
||||
#cluster_iam_roles = ["arn:aws:iam::225367859851:role/developer"]
|
||||
|
||||
tags = local.tags
|
||||
|
||||
}
|
||||
|
||||
module "qmi-s3-bucket" {
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//s3-bucket"
|
||||
|
||||
provision_id = var.provision_id
|
||||
region = var.region
|
||||
aws_provider_access_key = var.aws_provider_access_key
|
||||
aws_provider_access_secret = var.aws_provider_access_secret
|
||||
user_id = var.user_id
|
||||
}
|
||||
47
databases/aws-redshift/outputs.tf
Normal file
47
databases/aws-redshift/outputs.tf
Normal file
@@ -0,0 +1,47 @@
|
||||
output "redshift_cluster_id" {
|
||||
description = "The availability zone of the RDS instance"
|
||||
value = module.redshift.redshift_cluster_id
|
||||
}
|
||||
|
||||
output "redshift_cluster_endpoint" {
|
||||
description = "Redshift endpoint"
|
||||
value = module.redshift.redshift_cluster_endpoint
|
||||
}
|
||||
|
||||
output "redshift_cluster_hostname" {
|
||||
description = "Redshift hostname"
|
||||
value = module.redshift.redshift_cluster_hostname
|
||||
}
|
||||
|
||||
output "redshift_cluster_port" {
|
||||
description = "Redshift port"
|
||||
value = module.redshift.redshift_cluster_port
|
||||
}
|
||||
|
||||
output "redshift_cluster_database_name" {
|
||||
value = module.redshift.redshift_cluster_database_name
|
||||
}
|
||||
|
||||
output "redshift_cluster_master_username" {
|
||||
value = var.cluster_master_username
|
||||
}
|
||||
|
||||
output "redshift_cluster_master_password" {
|
||||
value = random_password.password.result
|
||||
}
|
||||
|
||||
output "s3_bucket_name" {
|
||||
value = module.qmi-s3-bucket.bucket.s3_bucket_id
|
||||
}
|
||||
|
||||
output "s3_bucket_region" {
|
||||
value = module.qmi-s3-bucket.bucket.s3_bucket_region
|
||||
}
|
||||
|
||||
output "s3_iam_user_access_key" {
|
||||
value = module.qmi-s3-bucket.iam_access_key
|
||||
}
|
||||
|
||||
output "s3_iam_user_access_secret" {
|
||||
value = module.qmi-s3-bucket.iam_access_secret
|
||||
}
|
||||
48
databases/aws-redshift/variables.tf
Normal file
48
databases/aws-redshift/variables.tf
Normal file
@@ -0,0 +1,48 @@
|
||||
variable "aws_provider_access_key" {
|
||||
}
|
||||
|
||||
variable "aws_provider_access_secret" {
|
||||
}
|
||||
|
||||
variable "region" {
|
||||
default = "us-east-1"
|
||||
}
|
||||
|
||||
variable "provision_id" {
|
||||
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
}
|
||||
|
||||
variable "vpc_id_ap" {
|
||||
default = "vpc-22ee2844"
|
||||
}
|
||||
|
||||
variable "vpc_id_eu" {
|
||||
default = "vpc-73f0500a"
|
||||
}
|
||||
|
||||
variable "vpc_id_us" {
|
||||
default = "vpc-c079f5bd"
|
||||
}
|
||||
|
||||
variable "subnet_ids_ap" {
|
||||
default = ["subnet-658aec3c", "subnet-e030eba8", "subnet-94309bf2"]
|
||||
}
|
||||
|
||||
variable "subnet_ids_eu" {
|
||||
default = ["subnet-4d441b17", "subnet-95c22fde", "subnet-70938116"]
|
||||
}
|
||||
|
||||
variable "subnet_ids_us" {
|
||||
default = ["subnet-4d26552b", "subnet-0414685b", "subnet-c97f7c84", "subnet-7f695c71", "subnet-96acd2b7", "subnet-88ab2cb9"]
|
||||
}
|
||||
|
||||
variable "cluster_database_name" {
|
||||
default = "qmi_rs_db"
|
||||
}
|
||||
|
||||
variable "cluster_master_username" {
|
||||
default = "qmi"
|
||||
}
|
||||
71
databases/azure-eventhub/main.tf
Normal file
71
databases/azure-eventhub/main.tf
Normal file
@@ -0,0 +1,71 @@
|
||||
locals {
|
||||
myRegex = "/[^[:alpha:]]/"
|
||||
splitLower = split(" ", lower(var.user_id))
|
||||
np0 = replace(element(local.splitLower,0), local.myRegex, "")
|
||||
np1 = replace(element(local.splitLower,1), local.myRegex, "")
|
||||
container_n1 = substr(local.np0, 0, 3)
|
||||
container_n2 = substr(local.np1, 0, 1)
|
||||
container_n3 = substr(strrev(local.np1), 0, 1)
|
||||
|
||||
scnamelower = "${local.container_n1}${local.container_n2}${local.container_n3}"
|
||||
|
||||
}
|
||||
|
||||
|
||||
resource "azurerm_eventhub_namespace" "ehbnamespace" {
|
||||
name = "qlik${local.scnamelower}ns"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
sku = "Standard"
|
||||
capacity = 1
|
||||
auto_inflate_enabled = true
|
||||
maximum_throughput_units = 2
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
|
||||
network_rulesets {
|
||||
|
||||
default_action = "Deny"
|
||||
trusted_service_access_enabled = true
|
||||
|
||||
virtual_network_rule {
|
||||
subnet_id = var.subnet_id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_eventhub" "attrep_apply_exceptions" {
|
||||
name = "attrep_apply_exceptions"
|
||||
namespace_name = azurerm_eventhub_namespace.ehbnamespace.name
|
||||
resource_group_name = var.resource_group_name
|
||||
partition_count = 1
|
||||
message_retention = 1
|
||||
}
|
||||
|
||||
resource "azurerm_eventhub" "hr_employees" {
|
||||
name = "hr.employees"
|
||||
namespace_name = azurerm_eventhub_namespace.ehbnamespace.name
|
||||
resource_group_name = var.resource_group_name
|
||||
partition_count = 1
|
||||
message_retention = 1
|
||||
}
|
||||
|
||||
resource "azurerm_eventhub" "hr_jobs" {
|
||||
name = "hr.jobs"
|
||||
namespace_name = azurerm_eventhub_namespace.ehbnamespace.name
|
||||
resource_group_name = var.resource_group_name
|
||||
partition_count = 1
|
||||
message_retention = 1
|
||||
}
|
||||
|
||||
resource "azurerm_eventhub" "metadatahub" {
|
||||
name = "metadatahub"
|
||||
namespace_name = azurerm_eventhub_namespace.ehbnamespace.name
|
||||
resource_group_name = var.resource_group_name
|
||||
partition_count = 1
|
||||
message_retention = 1
|
||||
}
|
||||
12
databases/azure-eventhub/outputs.tf
Normal file
12
databases/azure-eventhub/outputs.tf
Normal file
@@ -0,0 +1,12 @@
|
||||
output "default_primary_connection_string" {
|
||||
value = azurerm_eventhub_namespace.ehbnamespace.default_primary_connection_string
|
||||
}
|
||||
|
||||
output "default_primary_key" {
|
||||
value = azurerm_eventhub_namespace.ehbnamespace.default_primary_key
|
||||
}
|
||||
|
||||
output "namespace_name" {
|
||||
value = "qlik${local.scnamelower}ns"
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
variable "resource_group_name" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
|
||||
variable "provision_id" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "subnet_id" {
|
||||
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
type = string
|
||||
default = "EAST US"
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
|
||||
}
|
||||
|
||||
variable "administrator_login" {
|
||||
}
|
||||
|
||||
variable "administrator_login_password" {
|
||||
type = string
|
||||
}
|
||||
293
databases/azure-rds-mysql/main.tf
Normal file
293
databases/azure-rds-mysql/main.tf
Normal file
@@ -0,0 +1,293 @@
|
||||
|
||||
/*resource "azurerm_resource_group" "mysql-rg" {
|
||||
name = "mysql-${var.provision_id}"
|
||||
location = var.location
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
}*/
|
||||
|
||||
resource "random_password" "password" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!@"
|
||||
upper = true
|
||||
lower = true
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
resource "azurerm_mysql_server" "mysql-server" {
|
||||
name = "qmi-mysql-${var.provision_id}"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
|
||||
administrator_login = var.admin_login
|
||||
administrator_login_password = random_password.password.result
|
||||
|
||||
sku_name = var.mysql-sku-name
|
||||
version = var.mysql-version
|
||||
|
||||
storage_mb = var.mysql-storage
|
||||
auto_grow_enabled = true
|
||||
|
||||
backup_retention_days = 7
|
||||
geo_redundant_backup_enabled = false
|
||||
public_network_access_enabled = true
|
||||
ssl_enforcement_enabled = false
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resource "azurerm_mysql_database" "mysql-db" {
|
||||
name = "QlikDB"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
charset = "utf8"
|
||||
collation = "utf8_unicode_ci"
|
||||
}
|
||||
|
||||
resource "azurerm_mysql_firewall_rule" "all-azure-services" {
|
||||
name = "AllAzureServices"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "0.0.0.0"
|
||||
end_ip_address = "0.0.0.0"
|
||||
}
|
||||
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-ITG-rule1" {
|
||||
name = "ITG"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "188.65.156.32"
|
||||
end_ip_address = "188.65.156.47"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-ITG-rule2" {
|
||||
name = "ITG1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "212.73.252.96"
|
||||
end_ip_address = "212.73.252.103"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-kfar_saba-rule1" {
|
||||
name = "Kfar_Saba"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "194.90.96.176"
|
||||
end_ip_address = "194.90.96.183"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-kfar_saba-rule2" {
|
||||
name = "Kfar_Saba1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "213.57.84.160"
|
||||
end_ip_address = "213.57.84.167"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-Peak_10-rule1" {
|
||||
name = "Peak_10"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "4.4.97.104"
|
||||
end_ip_address = "4.4.97.111"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-Peak_10-rule2" {
|
||||
name = "Peak_101"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "206.196.17.32"
|
||||
end_ip_address = "206.196.17.63"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-Bangalore-rule1" {
|
||||
name = "Bangalore"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "14.98.59.168"
|
||||
end_ip_address = "14.98.59.175"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-Bangalore-rule2" {
|
||||
name = "Bangalore1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "182.74.33.8"
|
||||
end_ip_address = "182.74.33.15"
|
||||
}
|
||||
|
||||
# QCS
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSUS1" {
|
||||
name = "QCSUS1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "18.205.71.36"
|
||||
end_ip_address = "18.205.71.36"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSUS2" {
|
||||
name = "QCSUS2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "18.232.32.199"
|
||||
end_ip_address = "18.232.32.199"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSUS3" {
|
||||
name = "QCSUS3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "34.237.68.254"
|
||||
end_ip_address = "34.237.68.254"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSEU1" {
|
||||
name = "QCSEU1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "34.247.21.179"
|
||||
end_ip_address = "34.247.21.179"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSEU2" {
|
||||
name = "QCSEU2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "52.31.212.214"
|
||||
end_ip_address = "52.31.212.214"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCS3" {
|
||||
name = "QCSEU3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "54.154.95.18"
|
||||
end_ip_address = "54.154.95.18"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSAPAC1" {
|
||||
name = "QCSAPAC1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "13.210.43.241"
|
||||
end_ip_address = "13.210.43.241"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSAPAC2" {
|
||||
name = "QCSAPAC2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "13.236.104.42"
|
||||
end_ip_address = "13.236.104.42"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSAPAC3" {
|
||||
name = "QCSAPAC3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "13.236.206.172"
|
||||
end_ip_address = "13.236.206.172"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSSingapore1" {
|
||||
name = "QCSSingapore1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "18.138.163.172"
|
||||
end_ip_address = "18.138.163.172"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSSingapore2" {
|
||||
name = "QCSSingapore2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "18.142.157.182"
|
||||
end_ip_address = "18.142.157.182"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QCSSingapore3" {
|
||||
name = "QCSSingapore3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "54.179.13.251"
|
||||
end_ip_address = "54.179.13.251"
|
||||
}
|
||||
|
||||
# QAA
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAeu1" {
|
||||
name = "QAAeu1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "54.216.156.88"
|
||||
end_ip_address = "54.216.156.88"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAeu2" {
|
||||
name = "QAAeu2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "3.248.156.131"
|
||||
end_ip_address = "3.248.156.131"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAeu3" {
|
||||
name = "QAAeu3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "52.213.44.55"
|
||||
end_ip_address = "52.213.44.55"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAus1" {
|
||||
name = "QAAus1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "18.235.133.252"
|
||||
end_ip_address = "18.235.133.252"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAus2" {
|
||||
name = "QAAus2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "3.217.244.242"
|
||||
end_ip_address = "3.217.244.242"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAus3" {
|
||||
name = "QAAus3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "18.214.8.201"
|
||||
end_ip_address = "18.214.8.201"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAapac1" {
|
||||
name = "QAAapac1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "54.206.158.27"
|
||||
end_ip_address = "54.206.158.27"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAapac2" {
|
||||
name = "QAAapac2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "3.104.137.20"
|
||||
end_ip_address = "3.104.137.20"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAapac3" {
|
||||
name = "QAAapac3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "3.24.52.178"
|
||||
end_ip_address = "3.24.52.178"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAsing1" {
|
||||
name = "QAAsing1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "54.169.84.213"
|
||||
end_ip_address = "54.169.84.213"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAsing2" {
|
||||
name = "QAAsing2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "13.213.173.37"
|
||||
end_ip_address = "13.213.173.37"
|
||||
}
|
||||
resource "azurerm_mysql_firewall_rule" "mysql-fw-QAAsing3" {
|
||||
name = "QAAsing3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_server.mysql-server.name
|
||||
start_ip_address = "13.213.113.162"
|
||||
end_ip_address = "13.213.113.162"
|
||||
}
|
||||
11
databases/azure-rds-mysql/output.tf
Normal file
11
databases/azure-rds-mysql/output.tf
Normal file
@@ -0,0 +1,11 @@
|
||||
output "db_server_fqdn" {
|
||||
value = azurerm_mysql_server.mysql-server.fqdn
|
||||
}
|
||||
|
||||
output "root_username" {
|
||||
value = "${var.admin_login}@qmi-mysql-${var.provision_id}"
|
||||
}
|
||||
|
||||
output "root_username_password" {
|
||||
value = random_password.password.result
|
||||
}
|
||||
39
databases/azure-rds-mysql/variables.tf
Normal file
39
databases/azure-rds-mysql/variables.tf
Normal file
@@ -0,0 +1,39 @@
|
||||
variable "resource_group_name" {
|
||||
|
||||
}
|
||||
|
||||
variable "provision_id" {
|
||||
type = string
|
||||
description = "(optional) describe your variable"
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
type = string
|
||||
description = "(optional) describe your variable"
|
||||
default = "EAST US"
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
}
|
||||
|
||||
variable "admin_login" {
|
||||
type = string
|
||||
description = "Login to authenticate to MySQL Server"
|
||||
default = "qmi"
|
||||
}
|
||||
|
||||
variable "mysql-version" {
|
||||
type = string
|
||||
description = "MySQL Server version to deploy"
|
||||
default = "5.7"
|
||||
}
|
||||
variable "mysql-sku-name" {
|
||||
type = string
|
||||
description = "MySQL SKU Name"
|
||||
default = "GP_Gen5_8"
|
||||
}
|
||||
variable "mysql-storage" {
|
||||
type = string
|
||||
description = "MySQL Storage in MB"
|
||||
default = "5120"
|
||||
}
|
||||
285
databases/azure-rds-postgres/main.tf
Normal file
285
databases/azure-rds-postgres/main.tf
Normal file
@@ -0,0 +1,285 @@
|
||||
resource "random_password" "password" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!@"
|
||||
upper = true
|
||||
lower = true
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
|
||||
resource "azurerm_postgresql_server" "postgresql-server" {
|
||||
name = "qmi-postgresql-${var.provision_id}"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
|
||||
administrator_login = var.admin_login
|
||||
administrator_login_password = random_password.password.result
|
||||
|
||||
sku_name = var.postgresql-sku-name
|
||||
version = var.postgresql-version
|
||||
|
||||
storage_mb = var.postgresql-storage
|
||||
auto_grow_enabled = true
|
||||
|
||||
backup_retention_days = 7
|
||||
geo_redundant_backup_enabled = false
|
||||
public_network_access_enabled = true
|
||||
ssl_enforcement_enabled = false
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
resource "azurerm_postgresql_database" "postgresql-db" {
|
||||
name = "QlikPostgresqlDB"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
charset = "utf8"
|
||||
collation = "English_United States.1252"
|
||||
}
|
||||
|
||||
|
||||
resource "azurerm_postgresql_firewall_rule" "all-azure-services" {
|
||||
name = "AllAzureServices"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "0.0.0.0"
|
||||
end_ip_address = "0.0.0.0"
|
||||
}
|
||||
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-ITG-rule1" {
|
||||
name = "ITG"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "188.65.156.32"
|
||||
end_ip_address = "188.65.156.47"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-ITG-rule2" {
|
||||
name = "ITG1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "212.73.252.96"
|
||||
end_ip_address = "212.73.252.103"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-kfar_saba-rule1" {
|
||||
name = "Kfar_Saba"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "194.90.96.176"
|
||||
end_ip_address = "194.90.96.183"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-kfar_saba-rule2" {
|
||||
name = "Kfar_Saba1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "213.57.84.160"
|
||||
end_ip_address = "213.57.84.167"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-Peak_10-rule1" {
|
||||
name = "Peak_10"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "4.4.97.104"
|
||||
end_ip_address = "4.4.97.111"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-Peak_10-rule2" {
|
||||
name = "Peak_101"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "206.196.17.32"
|
||||
end_ip_address = "206.196.17.63"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-Bangalore-rule1" {
|
||||
name = "Bangalore"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "14.98.59.168"
|
||||
end_ip_address = "14.98.59.175"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-Bangalore-rule2" {
|
||||
name = "Bangalore1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "182.74.33.8"
|
||||
end_ip_address = "182.74.33.15"
|
||||
}
|
||||
|
||||
#QCS
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSUS1" {
|
||||
name = "QCSUS1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "18.205.71.36"
|
||||
end_ip_address = "18.205.71.36"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSUS2" {
|
||||
name = "QCSUS2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "18.232.32.199"
|
||||
end_ip_address = "18.232.32.199"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSUS3" {
|
||||
name = "QCSUS3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "34.237.68.254"
|
||||
end_ip_address = "34.237.68.254"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSEU1" {
|
||||
name = "QCSEU1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "34.247.21.179"
|
||||
end_ip_address = "34.247.21.179"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSEU2" {
|
||||
name = "QCSEU2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "52.31.212.214"
|
||||
end_ip_address = "52.31.212.214"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCS3" {
|
||||
name = "QCSEU3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "54.154.95.18"
|
||||
end_ip_address = "54.154.95.18"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSAPAC1" {
|
||||
name = "QCSAPAC1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "13.210.43.241"
|
||||
end_ip_address = "13.210.43.241"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSAPAC2" {
|
||||
name = "QCSAPAC2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "13.236.104.42"
|
||||
end_ip_address = "13.236.104.42"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSAPAC3" {
|
||||
name = "QCSAPAC3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "13.236.206.172"
|
||||
end_ip_address = "13.236.206.172"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSSingapore1" {
|
||||
name = "QCSSingapore1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "18.138.163.172"
|
||||
end_ip_address = "18.138.163.172"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSSingapore2" {
|
||||
name = "QCSSingapore2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "18.142.157.182"
|
||||
end_ip_address = "18.142.157.182"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QCSSingapore3" {
|
||||
name = "QCSSingapore3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "54.179.13.251"
|
||||
end_ip_address = "54.179.13.251"
|
||||
}
|
||||
|
||||
# QAA
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAeu1" {
|
||||
name = "QAAeu1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "54.216.156.88"
|
||||
end_ip_address = "54.216.156.88"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAeu2" {
|
||||
name = "QAAeu2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "3.248.156.131"
|
||||
end_ip_address = "3.248.156.131"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAeu3" {
|
||||
name = "QAAeu3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "52.213.44.55"
|
||||
end_ip_address = "52.213.44.55"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAus1" {
|
||||
name = "QAAus1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "18.235.133.252"
|
||||
end_ip_address = "18.235.133.252"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAus2" {
|
||||
name = "QAAus2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "3.217.244.242"
|
||||
end_ip_address = "3.217.244.242"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAus3" {
|
||||
name = "QAAus3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "18.214.8.201"
|
||||
end_ip_address = "18.214.8.201"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAapac1" {
|
||||
name = "QAAapac1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "54.206.158.27"
|
||||
end_ip_address = "54.206.158.27"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAapac2" {
|
||||
name = "QAAapac2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "3.104.137.20"
|
||||
end_ip_address = "3.104.137.20"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAapac3" {
|
||||
name = "QAAapac3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "3.24.52.178"
|
||||
end_ip_address = "3.24.52.178"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAsing1" {
|
||||
name = "QAAsing1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "54.169.84.213"
|
||||
end_ip_address = "54.169.84.213"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAsing2" {
|
||||
name = "QAAsing2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "13.213.173.37"
|
||||
end_ip_address = "13.213.173.37"
|
||||
}
|
||||
resource "azurerm_postgresql_firewall_rule" "postgresql-fw-QAAsing3" {
|
||||
name = "QAAsing3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_postgresql_server.postgresql-server.name
|
||||
start_ip_address = "13.213.113.162"
|
||||
end_ip_address = "13.213.113.162"
|
||||
}
|
||||
15
databases/azure-rds-postgres/output.tf
Normal file
15
databases/azure-rds-postgres/output.tf
Normal file
@@ -0,0 +1,15 @@
|
||||
/*output "postgresql_server" {
|
||||
value = azurerm_postgresql_server.postgresql-server
|
||||
}*/
|
||||
|
||||
output "db_server_fqdn" {
|
||||
value = azurerm_postgresql_server.postgresql-server.fqdn
|
||||
}
|
||||
|
||||
output "root_username" {
|
||||
value = "${var.admin_login}@qmi-postgresql-${var.provision_id}"
|
||||
}
|
||||
|
||||
output "root_username_password" {
|
||||
value = random_password.password.result
|
||||
}
|
||||
41
databases/azure-rds-postgres/variables.tf
Normal file
41
databases/azure-rds-postgres/variables.tf
Normal file
@@ -0,0 +1,41 @@
|
||||
variable "resource_group_name" {
|
||||
|
||||
}
|
||||
|
||||
variable "provision_id" {
|
||||
type = string
|
||||
description = "(optional) describe your variable"
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
type = string
|
||||
description = "(optional) describe your variable"
|
||||
default = "EAST US"
|
||||
}
|
||||
|
||||
|
||||
variable "admin_login" {
|
||||
type = string
|
||||
description = "Login to authenticate to PostgreSQL Server"
|
||||
default = "qmi"
|
||||
}
|
||||
|
||||
variable "postgresql-version" {
|
||||
type = string
|
||||
description = "PostgreSQL Server version to deploy"
|
||||
default = "11"
|
||||
}
|
||||
variable "postgresql-sku-name" {
|
||||
type = string
|
||||
description = "PostgreSQL SKU Name"
|
||||
default = "GP_Gen5_8"
|
||||
}
|
||||
variable "postgresql-storage" {
|
||||
type = string
|
||||
description = "PostgreSQL Storage in MB"
|
||||
default = "5120"
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
|
||||
}
|
||||
@@ -7,13 +7,29 @@ resource "random_id" "randomServerId" {
|
||||
byte_length = 2
|
||||
}
|
||||
|
||||
resource "random_password" "password" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!@"
|
||||
upper = true
|
||||
lower = true
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
locals {
|
||||
sql_administrator_login_password = var.sql_administrator_login_password != null? var.sql_administrator_login_password : random_password.password.result
|
||||
provision_id = var.provision_id != null? var.provision_id : random_id.randomServerId.hex
|
||||
}
|
||||
|
||||
resource "azurerm_sql_server" "sqlserver" {
|
||||
name = "sqlserver-${random_id.randomServerId.hex}"
|
||||
name = "sqlserver-${local.provision_id}"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
version = "12.0"
|
||||
administrator_login = var.sql_administrator_login
|
||||
administrator_login_password = var.sql_administrator_login_password
|
||||
administrator_login_password = local.sql_administrator_login_password
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
@@ -26,13 +42,250 @@ resource "azurerm_sql_server" "sqlserver" {
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_sql_firewall_rule" "all-azure-services" {
|
||||
name = "AllAzureServices"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "0.0.0.0"
|
||||
end_ip_address = "0.0.0.0"
|
||||
}
|
||||
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-ITG-rule1" {
|
||||
name = "ITG"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "188.65.156.32"
|
||||
end_ip_address = "188.65.156.47"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-ITG-rule2" {
|
||||
name = "ITG1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "212.73.252.96"
|
||||
end_ip_address = "212.73.252.103"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-kfar_saba-rule1" {
|
||||
name = "Kfar_Saba"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "194.90.96.176"
|
||||
end_ip_address = "194.90.96.183"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-kfar_saba-rule2" {
|
||||
name = "Kfar_Saba1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "213.57.84.160"
|
||||
end_ip_address = "213.57.84.167"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-Peak_10-rule1" {
|
||||
name = "Peak_10"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "4.4.97.104"
|
||||
end_ip_address = "4.4.97.111"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-Peak_10-rule2" {
|
||||
name = "Peak_101"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "206.196.17.32"
|
||||
end_ip_address = "206.196.17.63"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-Bangalore-rule1" {
|
||||
name = "Bangalore"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "14.98.59.168"
|
||||
end_ip_address = "14.98.59.175"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-Bangalore-rule2" {
|
||||
name = "Bangalore1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "182.74.33.8"
|
||||
end_ip_address = "182.74.33.15"
|
||||
}
|
||||
|
||||
# QCS
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSUS1" {
|
||||
name = "QCSUS1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "18.205.71.36"
|
||||
end_ip_address = "18.205.71.36"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSUS2" {
|
||||
name = "QCSUS2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "18.232.32.199"
|
||||
end_ip_address = "18.232.32.199"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSUS3" {
|
||||
name = "QCSUS3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "34.237.68.254"
|
||||
end_ip_address = "34.237.68.254"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSEU1" {
|
||||
name = "QCSEU1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "34.247.21.179"
|
||||
end_ip_address = "34.247.21.179"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSEU2" {
|
||||
name = "QCSEU2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "52.31.212.214"
|
||||
end_ip_address = "52.31.212.214"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCS3" {
|
||||
name = "QCSEU3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "54.154.95.18"
|
||||
end_ip_address = "54.154.95.18"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSAPAC1" {
|
||||
name = "QCSAPAC1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "13.210.43.241"
|
||||
end_ip_address = "13.210.43.241"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSAPAC2" {
|
||||
name = "QCSAPAC2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "13.236.104.42"
|
||||
end_ip_address = "13.236.104.42"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSAPAC3" {
|
||||
name = "QCSAPAC3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "13.236.206.172"
|
||||
end_ip_address = "13.236.206.172"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSSingapore1" {
|
||||
name = "QCSSingapore1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "18.138.163.172"
|
||||
end_ip_address = "18.138.163.172"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSSingapore2" {
|
||||
name = "QCSSingapore2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "18.142.157.182"
|
||||
end_ip_address = "18.142.157.182"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QCSSingapore3" {
|
||||
name = "QCSSingapore3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "54.179.13.251"
|
||||
end_ip_address = "54.179.13.251"
|
||||
}
|
||||
|
||||
resource "azurerm_sql_virtual_network_rule" "sqlvnetrule" {
|
||||
name = "sql-vnet-rule-${random_id.randomServerId.hex}"
|
||||
name = "sql-vnet-rule-${local.provision_id}"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
subnet_id = var.subnet_id
|
||||
}
|
||||
|
||||
# QAA
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAeu1" {
|
||||
name = "QAAeu1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "54.216.156.88"
|
||||
end_ip_address = "54.216.156.88"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAeu2" {
|
||||
name = "QAAeu2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "3.248.156.131"
|
||||
end_ip_address = "3.248.156.131"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAeu3" {
|
||||
name = "QAAeu3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "52.213.44.55"
|
||||
end_ip_address = "52.213.44.55"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAus1" {
|
||||
name = "QAAus1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "18.235.133.252"
|
||||
end_ip_address = "18.235.133.252"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAus2" {
|
||||
name = "QAAus2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "3.217.244.242"
|
||||
end_ip_address = "3.217.244.242"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAus3" {
|
||||
name = "QAAus3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "18.214.8.201"
|
||||
end_ip_address = "18.214.8.201"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAapac1" {
|
||||
name = "QAAapac1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "54.206.158.27"
|
||||
end_ip_address = "54.206.158.27"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAapac2" {
|
||||
name = "QAAapac2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "3.104.137.20"
|
||||
end_ip_address = "3.104.137.20"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAapac3" {
|
||||
name = "QAAapac3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "3.24.52.178"
|
||||
end_ip_address = "3.24.52.178"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAsing1" {
|
||||
name = "QAAsing1"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "54.169.84.213"
|
||||
end_ip_address = "54.169.84.213"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAsing2" {
|
||||
name = "QAAsing2"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "13.213.173.37"
|
||||
end_ip_address = "13.213.173.37"
|
||||
}
|
||||
resource "azurerm_sql_firewall_rule" "azuresql-fw-QAAsing3" {
|
||||
name = "QAAsing3"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
start_ip_address = "13.213.113.162"
|
||||
end_ip_address = "13.213.113.162"
|
||||
}
|
||||
|
||||
resource "azurerm_sql_database" "db" {
|
||||
name = "demoDB"
|
||||
resource_group_name = var.resource_group_name
|
||||
@@ -45,5 +298,32 @@ resource "azurerm_sql_database" "db" {
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
# FOR QDI scenario
|
||||
resource "azurerm_sql_database" "dbname_source" {
|
||||
name = "source"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
create_mode = "Default"
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
}
|
||||
resource "azurerm_sql_database" "dbname_target" {
|
||||
name = "target"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
server_name = azurerm_sql_server.sqlserver.name
|
||||
create_mode = "Default"
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ output "sqlserver_id" {
|
||||
}
|
||||
|
||||
output "sqlserver_name" {
|
||||
value = "qliksyn-${random_id.randomServerId.hex}"
|
||||
value = azurerm_sql_server.sqlserver.name
|
||||
}
|
||||
|
||||
output "sqlserver_fully_qualified_domain_name" {
|
||||
@@ -19,7 +19,7 @@ output "administrator_login" {
|
||||
}
|
||||
|
||||
output "administrator_login_password" {
|
||||
value = var.sql_administrator_login_password
|
||||
value = local.sql_administrator_login_password
|
||||
}
|
||||
|
||||
output "principal_id" {
|
||||
|
||||
@@ -5,6 +5,10 @@ variable "location" {
|
||||
|
||||
}
|
||||
|
||||
variable "provision_id" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "subnet_id" {
|
||||
|
||||
}
|
||||
@@ -18,5 +22,5 @@ variable "sql_administrator_login" {
|
||||
}
|
||||
|
||||
variable "sql_administrator_login_password" {
|
||||
default = "Attunity123123123"
|
||||
default = null
|
||||
}
|
||||
@@ -10,12 +10,25 @@ terraform {
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
myRegex = "/[^[:alpha:]]/"
|
||||
splitLower = split(" ", lower(var.user_id))
|
||||
np0 = replace(element(local.splitLower,0), local.myRegex, "")
|
||||
np1 = replace(element(local.splitLower,1), local.myRegex, "")
|
||||
c_n1 = substr(local.np0, 0, 3)
|
||||
c_n2 = substr(local.np1, 0, 1)
|
||||
c_n3 = substr(strrev(local.np1), 0, 1)
|
||||
|
||||
cluster_name = var.cluster_name != null? var.cluster_name : "${local.c_n1}${local.c_n2}${local.c_n3}"
|
||||
|
||||
}
|
||||
|
||||
resource "azurerm_databricks_workspace" "dbricksws" {
|
||||
|
||||
count = var.enabled == true? 1 : 0
|
||||
|
||||
location = var.location
|
||||
name = "${var.cluster_name}-qlikdbricks-ws"
|
||||
name = "${local.cluster_name}-qlikdbricks-ws"
|
||||
resource_group_name = var.resource_group_name
|
||||
sku = "standard"
|
||||
|
||||
@@ -41,10 +54,58 @@ provider "databricks" {
|
||||
|
||||
azure_workspace_resource_id = var.enabled == true? azurerm_databricks_workspace.dbricksws[0].id : null
|
||||
azure_client_id = var.enabled == true? "9b4761fd-4823-4f9d-ab3a-a95af38e7c29" : null
|
||||
azure_client_secret = var.enabled == true? "akj0Wb9ALe7Q_23RN63~J2EmZW~Lr5Yfl-" : null
|
||||
azure_client_secret = var.enabled == true? "FWH7Q~ByC.U5zNh0BaIDdK_poyxoy4SxW8hi1" : null
|
||||
azure_tenant_id = var.enabled == true? "c21eeb5f-f5a6-44e8-a997-124f2f7a497c" : null
|
||||
}
|
||||
|
||||
/*resource "databricks_workspace_conf" "this" {
|
||||
|
||||
count = var.enabled == true? 1 : 0
|
||||
|
||||
provider = databricks.mws
|
||||
|
||||
custom_config = {
|
||||
"enableIpAccessLists" : true
|
||||
}
|
||||
}
|
||||
|
||||
resource "databricks_ip_access_list" "allowed-list" {
|
||||
|
||||
count = var.enabled == true? 1 : 0
|
||||
|
||||
provider = databricks.mws
|
||||
|
||||
label = "allow_in"
|
||||
list_type = "ALLOW"
|
||||
ip_addresses = [
|
||||
"52.249.189.38/32",
|
||||
"13.67.39.86/32",
|
||||
"20.67.110.207/32",
|
||||
"14.98.59.168/29",
|
||||
"182.74.33.8/29",
|
||||
"188.65.156.32/28",
|
||||
"212.73.252.96/29",
|
||||
"194.90.96.176/29",
|
||||
"213.57.84.160/29",
|
||||
"4.4.97.104/29",
|
||||
"206.196.17.32/27",
|
||||
#QCS
|
||||
"18.205.71.36/32",
|
||||
"18.232.32.199/32",
|
||||
"34.237.68.254/32",
|
||||
"34.247.21.179/32",
|
||||
"52.31.212.214/32",
|
||||
"54.154.95.18/32",
|
||||
"13.210.43.241/32",
|
||||
"13.236.104.42/32",
|
||||
"13.236.206.172/32",
|
||||
"18.138.163.172/32",
|
||||
"18.142.157.182/32",
|
||||
"54.179.13.251/32"
|
||||
]
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
resource "databricks_user" "me" {
|
||||
provider = databricks.mws
|
||||
@@ -72,15 +133,15 @@ resource "databricks_token" "pat" {
|
||||
lifetime_seconds = 8640000
|
||||
}
|
||||
|
||||
/*resource "databricks_cluster" "dbrickscluster" {
|
||||
resource "databricks_cluster" "dbrickscluster" {
|
||||
provider = databricks.mws
|
||||
count = var.enabled == true? 1 : 0
|
||||
count = (var.enabled == true && var.create_cluster == true)? 1 : 0
|
||||
|
||||
depends_on = [
|
||||
azurerm_role_assignment.contributor-dbricks
|
||||
]
|
||||
|
||||
cluster_name = "cluster-${var.cluster_name}"
|
||||
cluster_name = "cluster-${local.cluster_name}"
|
||||
spark_version = "7.3.x-scala2.12"
|
||||
node_type_id = "Standard_DS3_v2"
|
||||
|
||||
@@ -102,4 +163,4 @@ resource "databricks_token" "pat" {
|
||||
}
|
||||
|
||||
autotermination_minutes = 120
|
||||
}*/
|
||||
}
|
||||
@@ -4,4 +4,8 @@ output "databricks_workspace_url" {
|
||||
|
||||
output "databricks_token" {
|
||||
value = var.enabled? databricks_token.pat[0].token_value : null
|
||||
}
|
||||
|
||||
output "cluster_name" {
|
||||
value = "cluster-${local.cluster_name}"
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
variable "location" {
|
||||
|
||||
default = "East US"
|
||||
}
|
||||
|
||||
variable "resource_group_name" {
|
||||
|
||||
}
|
||||
|
||||
variable "cluster_name" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "storage_account_name" {
|
||||
@@ -21,9 +23,14 @@ variable "user_email" {
|
||||
}
|
||||
|
||||
variable "app_registration_principal_id" {
|
||||
|
||||
description = "tpm"
|
||||
default = "163a72e3-8ce3-4e33-baae-954383f87e3e"
|
||||
}
|
||||
|
||||
variable "enabled" {
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "create_cluster" {
|
||||
default = false
|
||||
}
|
||||
136
databases/synapse-ws/firewall.tf
Normal file
136
databases/synapse-ws/firewall.tf
Normal file
@@ -0,0 +1,136 @@
|
||||
resource "azurerm_synapse_firewall_rule" "azureservices" {
|
||||
name = "AllowAllWindowsAzureIps"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
// https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/synapse_firewall_rule
|
||||
start_ip_address = "0.0.0.0"
|
||||
end_ip_address = "0.0.0.0"
|
||||
}
|
||||
|
||||
resource "azurerm_synapse_firewall_rule" "fw-a-rule1" {
|
||||
name = "a1"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "52.249.189.38"
|
||||
end_ip_address = "52.249.189.38"
|
||||
}
|
||||
|
||||
resource "azurerm_synapse_firewall_rule" "fw-a-rule2" {
|
||||
name = "a2"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "13.67.39.86"
|
||||
end_ip_address = "13.67.39.86"
|
||||
}
|
||||
|
||||
resource "azurerm_synapse_firewall_rule" "fw-a-rule3" {
|
||||
name = "a3"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "20.67.110.207"
|
||||
end_ip_address = "20.67.110.207"
|
||||
}
|
||||
|
||||
resource "azurerm_synapse_firewall_rule" "fw-ITG-rule1" {
|
||||
name = "ITG"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "188.65.156.32"
|
||||
end_ip_address = "188.65.156.47"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "fw-ITG-rule2" {
|
||||
name = "ITG1"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "212.73.252.96"
|
||||
end_ip_address = "212.73.252.103"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "fw-kfar_saba-rule1" {
|
||||
name = "Kfar_Saba"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "194.90.96.176"
|
||||
end_ip_address = "194.90.96.183"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "fw-kfar_saba-rule2" {
|
||||
name = "Kfar_Saba1"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "213.57.84.160"
|
||||
end_ip_address = "213.57.84.167"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "fw-Peak_10-rule1" {
|
||||
name = "Peak_10"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "4.4.97.104"
|
||||
end_ip_address = "4.4.97.111"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "fw-Peak_10-rule2" {
|
||||
name = "Peak_101"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "206.196.17.32"
|
||||
end_ip_address = "206.196.17.63"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "fw-Bangalore-rule1" {
|
||||
name = "Bangalore"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "14.98.59.168"
|
||||
end_ip_address = "14.98.59.175"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "fw-Bangalore-rule2" {
|
||||
name = "Bangalore1"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "182.74.33.8"
|
||||
end_ip_address = "182.74.33.15"
|
||||
}
|
||||
|
||||
# QCS US
|
||||
resource "azurerm_synapse_firewall_rule" "qcs_us_1" {
|
||||
name = "QCS_US_1"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "18.205.71.36"
|
||||
end_ip_address = "18.205.71.36"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "qcs_us_2" {
|
||||
name = "QCS_US_2"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "18.232.32.199"
|
||||
end_ip_address = "18.232.32.199"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "qcs_us_3" {
|
||||
name = "QCS_US_3"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "34.237.68.254"
|
||||
end_ip_address = "34.237.68.254"
|
||||
}
|
||||
|
||||
# QCS EU
|
||||
resource "azurerm_synapse_firewall_rule" "qcs_eu_1" {
|
||||
name = "QCS_EU_1"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "34.247.21.179"
|
||||
end_ip_address = "34.247.21.179"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "qcs_eu_2" {
|
||||
name = "QCS_EU_2"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "52.31.212.214"
|
||||
end_ip_address = "52.31.212.214"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "qcs_eu_3" {
|
||||
name = "QCS_EU_3"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "54.154.95.18"
|
||||
end_ip_address = "54.154.95.18"
|
||||
}
|
||||
# QCS AP
|
||||
resource "azurerm_synapse_firewall_rule" "qcs_ap_1" {
|
||||
name = "QCS_AP_1"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "13.210.43.241"
|
||||
end_ip_address = "13.210.43.241"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "qcs_ap_2" {
|
||||
name = "QCS_AP_2"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "13.236.104.42"
|
||||
end_ip_address = "13.236.104.42"
|
||||
}
|
||||
resource "azurerm_synapse_firewall_rule" "qcs_ap_3" {
|
||||
name = "QCS_AP_3"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
start_ip_address = "13.236.206.172"
|
||||
end_ip_address = "13.236.206.172"
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
locals {
|
||||
myRegex = "/[^[:alpha:]]/"
|
||||
container_name1 = split(" ", lower(var.user_id))
|
||||
container_namePart1 = substr(element(local.container_name1,0), 0, 3)
|
||||
container_namePart2 = substr(element(local.container_name1,1), 0, 1)
|
||||
container_namePart3 = substr(strrev(element(local.container_name1,1)), 0, 1)
|
||||
container_name = "${local.container_namePart1}${local.container_namePart2}${local.container_namePart3}"
|
||||
np0 = replace(element(local.container_name1,0), local.myRegex, "")
|
||||
np1 = replace(element(local.container_name1,1), local.myRegex, "")
|
||||
container_n1 = substr(local.np0, 0, 3)
|
||||
container_n2 = substr(local.np1, 0, 1)
|
||||
container_n3 = substr(strrev(local.np1), 0, 1)
|
||||
container_name = "${local.container_n1}${local.container_n2}${local.container_n3}"
|
||||
container_name_upper = upper(local.container_name)
|
||||
|
||||
}
|
||||
@@ -39,14 +42,6 @@ resource "azurerm_synapse_workspace" "synapsews" {
|
||||
|
||||
}
|
||||
|
||||
resource "azurerm_synapse_firewall_rule" "azureservices" {
|
||||
name = "AllowAllWindowsAzureIps"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
// https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/synapse_firewall_rule
|
||||
start_ip_address = "0.0.0.0"
|
||||
end_ip_address = "0.0.0.0"
|
||||
}
|
||||
|
||||
resource "azurerm_synapse_sql_pool" "db" {
|
||||
name = "${local.container_name_upper}DEMOPOOL"
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
@@ -62,3 +57,62 @@ resource "azurerm_synapse_sql_pool" "db" {
|
||||
|
||||
}
|
||||
|
||||
resource "azurerm_synapse_role_assignment" "sqladministrator_aor" {
|
||||
|
||||
depends_on = [
|
||||
azurerm_synapse_firewall_rule.azureservices
|
||||
/*,
|
||||
azurerm_synapse_firewall_rule.fw-a-rule1,
|
||||
azurerm_synapse_firewall_rule.fw-a-rule2,
|
||||
azurerm_synapse_firewall_rule.fw-a-rule3,
|
||||
azurerm_synapse_firewall_rule.fw-ITG-rule1,
|
||||
azurerm_synapse_firewall_rule.fw-ITG-rule2,
|
||||
azurerm_synapse_firewall_rule.fw-kfar_saba-rule1,
|
||||
azurerm_synapse_firewall_rule.fw-kfar_saba-rule2,
|
||||
azurerm_synapse_firewall_rule.fw-Peak_10-rule1,
|
||||
azurerm_synapse_firewall_rule.fw-Peak_10-rule2,
|
||||
azurerm_synapse_firewall_rule.fw-Bangalore-rule1,
|
||||
azurerm_synapse_firewall_rule.fw-Bangalore-rule2*/
|
||||
]
|
||||
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
role_name = "Synapse Administrator"
|
||||
principal_id = "c583b5aa-2844-4baf-b8bf-b6a1ae0b1520"
|
||||
|
||||
}
|
||||
|
||||
resource "azurerm_synapse_role_assignment" "sqladministrator" {
|
||||
|
||||
count = (var.user_oid != null && var.user_oid != "c583b5aa-2844-4baf-b8bf-b6a1ae0b1520") ? 1 : 0
|
||||
|
||||
depends_on = [
|
||||
azurerm_synapse_firewall_rule.azureservices/*,
|
||||
azurerm_synapse_firewall_rule.fw-a-rule1,
|
||||
azurerm_synapse_firewall_rule.fw-a-rule2,
|
||||
azurerm_synapse_firewall_rule.fw-a-rule3,
|
||||
azurerm_synapse_firewall_rule.fw-ITG-rule1,
|
||||
azurerm_synapse_firewall_rule.fw-ITG-rule2,
|
||||
azurerm_synapse_firewall_rule.fw-kfar_saba-rule1,
|
||||
azurerm_synapse_firewall_rule.fw-kfar_saba-rule2,
|
||||
azurerm_synapse_firewall_rule.fw-Peak_10-rule1,
|
||||
azurerm_synapse_firewall_rule.fw-Peak_10-rule2,
|
||||
azurerm_synapse_firewall_rule.fw-Bangalore-rule1,
|
||||
azurerm_synapse_firewall_rule.fw-Bangalore-rule2*/
|
||||
]
|
||||
|
||||
synapse_workspace_id = azurerm_synapse_workspace.synapsews.id
|
||||
role_name = "Synapse Administrator"
|
||||
principal_id = var.user_oid != null? var.user_oid : "c583b5aa-2844-4baf-b8bf-b6a1ae0b1520"
|
||||
|
||||
}
|
||||
|
||||
resource "azurerm_role_assignment" "role-user-reader-for-synapse" {
|
||||
|
||||
count = (var.user_oid != null && var.user_oid != "c583b5aa-2844-4baf-b8bf-b6a1ae0b1520") ? 1 : 0
|
||||
|
||||
scope = azurerm_synapse_workspace.synapsews.id
|
||||
role_definition_name = "Reader"
|
||||
principal_id = var.user_oid
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@ variable "user_id" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "user_oid" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "sql_administrator_login" {
|
||||
default = "scdemoadmin"
|
||||
}
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
locals {
|
||||
container_name1 = split(" ", lower(var.user_id))
|
||||
container_namePart1 = substr(element(local.container_name1,0), 0, 3)
|
||||
container_namePart2 = substr(element(local.container_name1,1), 0, 1)
|
||||
container_namePart3 = substr(strrev(element(local.container_name1,1)), 0, 1)
|
||||
container_name = "${local.container_namePart1}${local.container_namePart2}${local.container_namePart3}"
|
||||
container_name_upper = upper(local.container_name)
|
||||
|
||||
}
|
||||
|
||||
resource "random_id" "randomServerId" {
|
||||
keepers = {
|
||||
# Generate a new ID only when a new resource group is defined
|
||||
resource_group = var.resource_group_name
|
||||
}
|
||||
|
||||
byte_length = 2
|
||||
}
|
||||
|
||||
/*resource "azurerm_storage_account" "sasql" {
|
||||
name = "saccountsql${random_id.randomServerId.hex}"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
account_tier = "Standard"
|
||||
account_replication_type = "LRS"
|
||||
}*/
|
||||
|
||||
resource "azurerm_sql_server" "synapse" {
|
||||
name = "qliksyn-${random_id.randomServerId.hex}"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
version = "12.0"
|
||||
administrator_login = var.administrator_login
|
||||
administrator_login_password = var.administrator_login_password
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
|
||||
identity {
|
||||
type = "SystemAssigned"
|
||||
}
|
||||
}
|
||||
|
||||
/*resource "azurerm_mssql_server_extended_auditing_policy" "auditing_policy_server" {
|
||||
server_id = azurerm_sql_server.synapse.id
|
||||
storage_endpoint = azurerm_storage_account.sasql.primary_blob_endpoint
|
||||
storage_account_access_key = azurerm_storage_account.sasql.primary_access_key
|
||||
storage_account_access_key_is_secondary = false
|
||||
retention_in_days = 6
|
||||
}*/
|
||||
|
||||
resource "azurerm_sql_virtual_network_rule" "sqlvnetrule" {
|
||||
name = "sql-vnet-rule-${random_id.randomServerId.hex}"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_sql_server.synapse.name
|
||||
subnet_id = var.subnet_id
|
||||
}
|
||||
|
||||
resource "azurerm_sql_database" "db" {
|
||||
name = "${local.container_name_upper}DEMOPOOL"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
server_name = azurerm_sql_server.synapse.name
|
||||
create_mode = "Default"
|
||||
edition = "DataWarehouse"
|
||||
collation = "SQL_LATIN1_GENERAL_CP1_CI_AS"
|
||||
max_size_bytes = 268435456000
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
ADAAutomation = "SQLDWSuspend"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resource "azurerm_sql_database" "db2" {
|
||||
name = "demoDB"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
server_name = azurerm_sql_server.synapse.name
|
||||
create_mode = "Default"
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*resource "azurerm_mssql_database_extended_auditing_policy" "auditing_policy_db" {
|
||||
database_id = azurerm_sql_database.db.id
|
||||
storage_endpoint = azurerm_storage_account.sasql.primary_blob_endpoint
|
||||
storage_account_access_key = azurerm_storage_account.sasql.primary_access_key
|
||||
storage_account_access_key_is_secondary = false
|
||||
retention_in_days = 6
|
||||
}*/
|
||||
|
||||
|
||||
/*resource "azurerm_storage_account_network_rules" "sasynapsenetrules" {
|
||||
|
||||
depends_on = [azurerm_mssql_database_extended_auditing_policy.auditing_policy_db]
|
||||
|
||||
resource_group_name = var.resource_group_name
|
||||
storage_account_name = azurerm_storage_account.sasql.name
|
||||
|
||||
default_action = "Deny"
|
||||
ip_rules = ["52.170.21.101", "206.196.17.36", "188.65.156.34"]
|
||||
virtual_network_subnet_ids = [var.subnet_id]
|
||||
bypass = ["AzureServices", "Metrics"]
|
||||
}*/
|
||||
@@ -1,33 +0,0 @@
|
||||
output "sqlserver_id" {
|
||||
value = azurerm_sql_server.synapse.id
|
||||
}
|
||||
|
||||
output "sqlserver_name" {
|
||||
value = "qliksyn-${random_id.randomServerId.hex}"
|
||||
}
|
||||
|
||||
output "sqlserver_fully_qualified_domain_name" {
|
||||
value = azurerm_sql_server.synapse.fully_qualified_domain_name
|
||||
}
|
||||
|
||||
output "dbname" {
|
||||
value = azurerm_sql_database.db.name
|
||||
}
|
||||
|
||||
output "dbname2" {
|
||||
value = azurerm_sql_database.db2.name
|
||||
}
|
||||
|
||||
output "administrator_login" {
|
||||
value = var.administrator_login
|
||||
}
|
||||
|
||||
output "administrator_login_password" {
|
||||
value = var.administrator_login_password
|
||||
}
|
||||
|
||||
output "principal_id" {
|
||||
value = azurerm_sql_server.synapse.identity.0.principal_id
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ resource "null_resource" "prep" {
|
||||
https = false
|
||||
timeout = "30m"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
source = "${path.module}/main"
|
||||
destination = "C:/provision/replicate-install"
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ resource "null_resource" "prep" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/replicate-install/prep-files.ps1",
|
||||
"powershell.exe -File C:/provision/replicate-install/di-database-prep.ps1",
|
||||
]
|
||||
}
|
||||
@@ -60,7 +61,7 @@ resource "null_resource" "install" {
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/replicate-install/di-replicate-getBinary.ps1 -url ${var.download_url}",
|
||||
"powershell.exe -File C:/provision/replicate-install/di-replicate-install.ps1 -url ${var.download_url}",
|
||||
"powershell.exe -File C:/provision/replicate-install/di-replicate-installQMICertificate.ps1 -CertPwd ${data.azurerm_key_vault_secret.cert-password.value}",
|
||||
"powershell.exe -File C:/provision/replicate-install/di-replicate-installQMICertificate.ps1 -CertPwd \"${data.azurerm_key_vault_secret.cert-password.value}\"",
|
||||
"powershell.exe -File C:/provision/replicate-install/di-em-register-replicate.ps1 -user ${var.vm_admin_username} -pass ${var.vm_admin_password} -domain ${local.domain}",
|
||||
]
|
||||
|
||||
|
||||
30
replicate-install/main/prep-files.ps1
Normal file
30
replicate-install/main/prep-files.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
Param(
|
||||
[string] $repo="qmi-cloud-tf-modules",
|
||||
[string] $branch="master",
|
||||
[string] $scenario="replicate-install",
|
||||
[string] $path="scripts"
|
||||
)
|
||||
|
||||
$pathIs="$scenario/$path"
|
||||
|
||||
$DownloadUrl="https://gitlab.com/qmi/$repo/-/archive/$branch/$repo-$branch.zip?path=$pathIs"
|
||||
|
||||
Write-Host "--- Boostrap# Downloading repository files ($DownloadUrl) from branch ($branch)..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Temp | Out-Null
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
(New-Object System.Net.WebClient).DownloadFile($DownloadUrl, "C:\Temp\$scenario.zip")
|
||||
|
||||
Expand-Archive "C:\Temp\$scenario.zip" -DestinationPath "C:\Temp" -Force
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Provision | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path C:\Provision\replicate-install | Out-Null
|
||||
|
||||
Copy-Item -Path "C:\Temp\$repo-$branch-$scenario-scripts\$scenario\$path\*" -Destination "C:\Provision\replicate-install" -Recurse -Force
|
||||
|
||||
Remove-Item "C:\Temp\$repo-$branch-$scenario-scripts" -Recurse
|
||||
Remove-Item "C:\Temp\$scenario.zip" -Recurse
|
||||
7
replicate-install/output.tf
Normal file
7
replicate-install/output.tf
Normal file
@@ -0,0 +1,7 @@
|
||||
output "finished" {
|
||||
value = true
|
||||
|
||||
depends_on = [
|
||||
null_resource.install
|
||||
]
|
||||
}
|
||||
@@ -38,4 +38,4 @@ Write-Host "--- Registering Replicate server in Enterprise Manager with name '$r
|
||||
Invoke-RestMethod -Uri "https://di.qmi.qlik-poc.com/attunityenterprisemanager/api/v1/servers/$replsrvName/def" -Method "PUT" -Headers $Headers2 -Body $body_json
|
||||
|
||||
Write-Host "--- Setting Replicate server license through EM API"
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://di.qmi.qlik-poc.com/attunityenterprisemanager/api/v1/servers/$replsrvName/license/def" -Method "PUT" -Infile "$PSScriptRoot\license_exp2021-09-30_ser60020486.txt" -Headers $Headers2
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://di.qmi.qlik-poc.com/attunityenterprisemanager/api/v1/servers/$replsrvName/license/def" -Method "PUT" -Infile "$PSScriptRoot\replicate_license_exp2022-12-31_ser60026541.txt" -Headers $Headers2
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#
|
||||
# Attunity License
|
||||
# Generated on 30-Nov-2020 19:36:15.5200+02:00
|
||||
# License Comment:
|
||||
#
|
||||
license_type=EVALUATION_LICENSE
|
||||
licensed_to=ADA Demo License 2021
|
||||
licensed_by=Attunity US
|
||||
serial_no=60021240
|
||||
expiration_date=2021-12-31
|
||||
hosts=
|
||||
source_types=
|
||||
target_types=
|
||||
features=
|
||||
version=7.0
|
||||
issue_date=2020-11-30
|
||||
checksum=5ERRJ-EQ395-79QQ8-C92F2
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#
|
||||
# Qlik License
|
||||
# Generated on 07-Dec-2021 18:01:15.5540+02:00
|
||||
# License Comment: For internal Qlik use only
|
||||
#
|
||||
license_type=EVALUATION_LICENSE
|
||||
licensed_to=Attunity Americas
|
||||
licensed_by=Attunity US
|
||||
serial_no=60026541
|
||||
expiration_date=2022-12-31
|
||||
hosts=
|
||||
source_types=
|
||||
target_types=
|
||||
features=
|
||||
version=2021.11
|
||||
issue_date=2021-12-07
|
||||
checksum=5Q9FQ-27467-KRC52-77598
|
||||
|
||||
Binary file not shown.
@@ -11,7 +11,8 @@ variable "vm_admin_password" {
|
||||
}
|
||||
|
||||
variable "download_url" {
|
||||
default = "https://da3hntz84uekx.cloudfront.net/QlikReplicate/7.0.0/5/_MSI/AttunityReplicate_7.0.0.514_X64.zip"
|
||||
//default = "https://da3hntz84uekx.cloudfront.net/QlikReplicate/2021.5/3/_MSI/AttunityReplicate_2021.5.0.924_X64.zip"
|
||||
default = "https://github.com/qlik-download/replicate/releases/download/v2021.11.1/QlikReplicate_2021.11.0.165_X64.zip"
|
||||
}
|
||||
|
||||
variable "key_vault_id" {
|
||||
|
||||
@@ -5,7 +5,7 @@ terraform {
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 3.37.0"
|
||||
version = "= 3.74.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,10 +56,10 @@ module "ec2_cluster" {
|
||||
#associate_public_ip_address = true
|
||||
|
||||
root_block_device = [{
|
||||
iops = 32000
|
||||
iops = (var.volume_type == "io2")? 32000 : (var.volume_type == "io1")? 6400 : 16000
|
||||
volume_size = "128"
|
||||
throughput = "1000"
|
||||
volume_type = "io2"
|
||||
throughput = (var.volume_type == "io2" || var.volume_type == "io1" )? null : "1000"
|
||||
volume_type = (var.volume_type != null)? var.volume_type : "gp3"
|
||||
}]
|
||||
|
||||
tags = {
|
||||
|
||||
@@ -23,6 +23,10 @@ variable "instance_type" {
|
||||
default = "t2.2xlarge"
|
||||
}
|
||||
|
||||
variable "volume_type" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "ami_eu" {
|
||||
default = "ami-0b29542f4855536ee"
|
||||
}
|
||||
|
||||
91
vm-fort-az/main.tf
Normal file
91
vm-fort-az/main.tf
Normal file
@@ -0,0 +1,91 @@
|
||||
resource "random_id" "randomMachineId" {
|
||||
keepers = {
|
||||
# Generate a new ID only when a new resource group is defined
|
||||
resource_group = var.resource_group_name
|
||||
}
|
||||
|
||||
byte_length = 2
|
||||
}
|
||||
|
||||
resource "random_password" "password" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!@"
|
||||
upper = true
|
||||
lower = true
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
locals {
|
||||
virtual_machine_name = "${var.prefix}-${random_id.randomMachineId.hex}"
|
||||
admin_username = var.admin_username
|
||||
admin_password = random_password.password.result
|
||||
}
|
||||
|
||||
module "qmi-nic" {
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//qmi-nic"
|
||||
|
||||
prefix = local.virtual_machine_name
|
||||
location = var.location
|
||||
subnet_id = var.subnet_id
|
||||
|
||||
resource_group_name = var.resource_group_name
|
||||
user_id = var.user_id
|
||||
}
|
||||
|
||||
resource "azurerm_linux_virtual_machine" "vm" {
|
||||
name = local.virtual_machine_name
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
size = var.vm_type
|
||||
admin_username = local.admin_username
|
||||
admin_password = local.admin_password
|
||||
network_interface_ids = [ module.qmi-nic.id ]
|
||||
disable_password_authentication = false
|
||||
|
||||
os_disk {
|
||||
name = "${local.virtual_machine_name}-osdisk"
|
||||
caching = "ReadWrite"
|
||||
storage_account_type = var.managed_disk_type
|
||||
disk_size_gb = var.disk_size_gb
|
||||
}
|
||||
|
||||
#source_image_id = var.image_reference
|
||||
|
||||
/*dynamic plan {
|
||||
for_each = var.location != "eastus" ? [1] : []
|
||||
|
||||
content {
|
||||
name = "qlik_forts"
|
||||
publisher = "qlik"
|
||||
product = "qlik_forts"
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
plan {
|
||||
name = "qlik_forts"
|
||||
publisher = "qlik"
|
||||
product = "qlik_forts"
|
||||
}
|
||||
|
||||
|
||||
source_image_reference {
|
||||
publisher = "qlik"
|
||||
offer = "qlik_forts"
|
||||
sku = "qlik_forts"
|
||||
version = "latest"
|
||||
}
|
||||
|
||||
tags = {
|
||||
"Deployment" = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
"ProvId" = var.provId != null? var.provId : null
|
||||
"QMI_user" = var.user_id != null? var.user_id : null
|
||||
"24x7" = var.is_24x7 == true? "" : null
|
||||
"ShutdownTime": var.is_24x7 == false? var.shutdownTime : null
|
||||
"StartupTime": var.is_24x7 == false? var.startupTime : null
|
||||
}
|
||||
}
|
||||
27
vm-fort-az/outputs.tf
Normal file
27
vm-fort-az/outputs.tf
Normal file
@@ -0,0 +1,27 @@
|
||||
output "virtual_machine_id" {
|
||||
value = azurerm_linux_virtual_machine.vm.id
|
||||
}
|
||||
|
||||
output "virtual_machine_name" {
|
||||
value = azurerm_linux_virtual_machine.vm.name
|
||||
}
|
||||
|
||||
output "admin_username" {
|
||||
value = var.admin_username
|
||||
}
|
||||
|
||||
output "admin_password" {
|
||||
value = random_password.password.result
|
||||
}
|
||||
|
||||
output "nic_id" {
|
||||
value = module.qmi-nic.id
|
||||
}
|
||||
|
||||
output "nic_private_ip_address" {
|
||||
value = module.qmi-nic.private_ip_address
|
||||
}
|
||||
|
||||
output "nic_ip_configuration_name" {
|
||||
value = module.qmi-nic.ip_configuration_name
|
||||
}
|
||||
59
vm-fort-az/variables.tf
Normal file
59
vm-fort-az/variables.tf
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
variable "subnet_id" {
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-infra-vnet/providers/Microsoft.Network/virtualNetworks/QMI-Automation-Vnet/subnets/QMI-VM-Deployments"
|
||||
}
|
||||
|
||||
variable "prefix" {
|
||||
description = "The Prefix used for all resources in this example"
|
||||
default = "QMI-FORT"
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
default = "East US"
|
||||
}
|
||||
|
||||
variable "image_reference" {
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/images/win-base-24022020"
|
||||
}
|
||||
|
||||
variable "resource_group_name" {
|
||||
}
|
||||
|
||||
variable "vm_type" {
|
||||
default = "Standard_D8s_v3"
|
||||
}
|
||||
|
||||
variable "managed_disk_type" {
|
||||
default = "Premium_LRS"
|
||||
}
|
||||
|
||||
variable "disk_size_gb" {
|
||||
default = "128"
|
||||
}
|
||||
|
||||
variable "admin_username" {
|
||||
default = "qlikfort"
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "provId" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "is_24x7"{
|
||||
type = bool
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "shutdownTime"{
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "startupTime"{
|
||||
default = null
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ locals {
|
||||
virtual_machine_name = (var.virtual_machine_name != null)? var.virtual_machine_name : "${var.prefix}-${random_id.randomMachineId.hex}"
|
||||
admin_username = var.admin_username
|
||||
admin_password = random_password.password.result
|
||||
storage_account_id = var.location == "westeurope"? "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Storage/storageAccounts/machinesnapshotsweu" : "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Storage/storageAccounts/machinesnapshots"
|
||||
snaploc = (var.location == "westeurope")? "weu" : (var.location == "eastus")? "" : "sea"
|
||||
storage_account_id = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Storage/storageAccounts/machinesnapshots${local.snaploc}"
|
||||
}
|
||||
|
||||
resource "azurerm_managed_disk" "md-import" {
|
||||
|
||||
@@ -144,7 +144,7 @@ resource "null_resource" "post-vm-fromsnapshot-win" {
|
||||
https = false
|
||||
timeout = "10m"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
source = "${path.module}/main"
|
||||
destination = "C:/tmp/provision"
|
||||
}
|
||||
|
||||
@@ -161,6 +161,7 @@ resource "null_resource" "post-vm-fromsnapshot-win" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/tmp/provision/prep-files.ps1",
|
||||
"powershell.exe -File C:/tmp/provision/bootstrap.ps1",
|
||||
"powershell.exe -File C:/tmp/provision/password.ps1 -Username ${local.admin_username} -Pass ${local.admin_password}"
|
||||
]
|
||||
@@ -175,7 +176,7 @@ resource "null_resource" "post-vm-fromsnapshot-win" {
|
||||
password = local.admin_password
|
||||
port = 5985
|
||||
https = false
|
||||
timeout = "10m"
|
||||
timeout = "20m"
|
||||
}
|
||||
|
||||
inline = [
|
||||
@@ -186,7 +187,7 @@ resource "null_resource" "post-vm-fromsnapshot-win" {
|
||||
}
|
||||
|
||||
provisioner "local-exec" {
|
||||
command = "sleep 30"
|
||||
command = "echo 'Waiting ${var.waitAfterRestartSecs} seconds after restart'; sleep ${var.waitAfterRestartSecs};"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
30
vm-fromsnapshot-win/main/prep-files.ps1
Normal file
30
vm-fromsnapshot-win/main/prep-files.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
Param(
|
||||
[string] $repo="qmi-cloud-tf-modules",
|
||||
[string] $branch="master",
|
||||
[string] $scenario="vm-fromsnapshot-win",
|
||||
[string] $path="scripts"
|
||||
)
|
||||
|
||||
$pathIs="$scenario/$path"
|
||||
|
||||
$DownloadUrl="https://gitlab.com/qmi/$repo/-/archive/$branch/$repo-$branch.zip?path=$pathIs"
|
||||
|
||||
Write-Host "--- Boostrap# Downloading repository files ($DownloadUrl) from branch ($branch)..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Temp | Out-Null
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
(New-Object System.Net.WebClient).DownloadFile($DownloadUrl, "C:\Temp\$scenario.zip")
|
||||
|
||||
Expand-Archive "C:\Temp\$scenario.zip" -DestinationPath "C:\Temp" -Force
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\tmp | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path C:\tmp\provision | Out-Null
|
||||
|
||||
Copy-Item -Path "C:\Temp\$repo-$branch-$scenario-scripts\$scenario\$path\*" -Destination "C:\tmp\provision" -Recurse -Force
|
||||
|
||||
Remove-Item "C:\Temp\$repo-$branch-$scenario-scripts" -Recurse
|
||||
Remove-Item "C:\Temp\$scenario.zip" -Recurse
|
||||
@@ -2,6 +2,10 @@ output "virtual_machine_id" {
|
||||
value = azurerm_virtual_machine.vm.id
|
||||
}
|
||||
|
||||
output "qmi_machine_id" {
|
||||
value = random_id.randomMachineId.hex
|
||||
}
|
||||
|
||||
output "virtual_machine_name" {
|
||||
value = azurerm_virtual_machine.vm.name
|
||||
}
|
||||
|
||||
@@ -8,5 +8,5 @@ Import-Module "Carbon"
|
||||
$secpasswd = ConvertTo-SecureString $Pass -AsPlainText -Force
|
||||
$cred = New-Object System.Management.Automation.PSCredential ($Username, $secpasswd)
|
||||
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
Write-Log "Done! Setting new password to user $Username"
|
||||
@@ -13,7 +13,7 @@ Import-Module "Carbon"
|
||||
### create Qlik User
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-MyCredential -user "Qlik" -pass "Qlik1234"
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
|
||||
### Grant Remote Admin Rights to Qlik User
|
||||
Write-Log -Message "Granting Qlik account Remote Interactive Logon Right"
|
||||
|
||||
@@ -54,7 +54,7 @@ New-QlikTag -name "QVD Catalog" | Out-Null
|
||||
Import-Module "Carbon"
|
||||
Write-Log -Message "Adding 'podium' user to Windows system"
|
||||
$cred = New-Credential "podium" "Qlik1234"
|
||||
Install-User -Credential $cred | Out-Null
|
||||
Install-CUser -Credential $cred | Out-Null
|
||||
|
||||
|
||||
Write-Log -Message "Creating Qlik Sense data connection for C:\QVDs"
|
||||
|
||||
@@ -114,7 +114,7 @@ Grant-SmbShareAccess -Name certs -AccountName Everyone -AccessRight Read -Force
|
||||
Import-Module "Carbon"
|
||||
Write-Log -Message "Adding 'podium' user to Windows system"
|
||||
$cred = New-Credential "podium" "Qlik1234"
|
||||
Install-User -Credential $cred | Out-Null
|
||||
Install-CUser -Credential $cred | Out-Null
|
||||
|
||||
#gci cert:\CurrentUser\My | where {$_.issuer -eq $cert} | Connect-Qlik -Username $env:COMPUTERNAME\podium -Computername $env:COMPUTERNAME
|
||||
#gci cert:\CurrentUser\My | where {$_.issuer -eq $cert} | Connect-Qlik -Computername $env:COMPUTERNAME
|
||||
|
||||
@@ -34,7 +34,7 @@ function New-Credential($u,$p) {
|
||||
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-Credential "Qlik" $QlikUserPwd
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
|
||||
|
||||
Write-Log -Message "Starting qs-post-cfg.ps1"
|
||||
|
||||
@@ -73,4 +73,8 @@ variable "restartAfterRename" {
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "waitAfterRestartSecs" {
|
||||
default = 30
|
||||
}
|
||||
|
||||
|
||||
|
||||
105
vm-qdc/main.tf
105
vm-qdc/main.tf
@@ -28,7 +28,7 @@ locals {
|
||||
admin_username = var.admin_username
|
||||
admin_password = random_password.password.result
|
||||
}
|
||||
|
||||
/*
|
||||
module "qmi-nic" {
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//qmi-nic"
|
||||
|
||||
@@ -40,9 +40,32 @@ module "qmi-nic" {
|
||||
user_id = var.user_id
|
||||
|
||||
isExternal = var.isExternal
|
||||
}*/
|
||||
|
||||
module "vm-qdc-fromsnapshot" {
|
||||
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//vm-fromsnapshot-linux"
|
||||
|
||||
subnet_id = var.subnet_id
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
snapshot_id = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/QMI-Machines/providers/Microsoft.Compute/snapshots/QDC-Install-VM-Feb2022"
|
||||
#snapshot_uri = "https://${local.source_container}.blob.core.windows.net/${var.image_reference}"
|
||||
vm_type = var.vm_type
|
||||
disk_size_gb = var.disk_size_gb
|
||||
provId = var.provId
|
||||
is_24x7 = var.is_24x7
|
||||
startupTime = var.startupTime
|
||||
shutdownTime = var.shutdownTime
|
||||
prefix = var.prefix
|
||||
|
||||
admin_username = "qmi"
|
||||
initial_password = "pcZr_UoJYg05D!Vz"
|
||||
|
||||
user_id = var.user_id
|
||||
}
|
||||
|
||||
resource "azurerm_linux_virtual_machine" "vm" {
|
||||
/*resource "azurerm_linux_virtual_machine" "vm" {
|
||||
name = local.virtual_machine_name
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
@@ -72,14 +95,54 @@ resource "azurerm_linux_virtual_machine" "vm" {
|
||||
"ShutdownTime": var.is_24x7 == false? var.shutdownTime : null
|
||||
"StartupTime": var.is_24x7 == false? var.startupTime : null
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
module "linux-common" {
|
||||
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//linux-common"
|
||||
|
||||
depends_on = [
|
||||
module.vm-qdc-fromsnapshot
|
||||
]
|
||||
|
||||
os_type = "centos"
|
||||
private_ip_address = module.vm-qdc-fromsnapshot.nic_private_ip_address
|
||||
admin_username = module.vm-qdc-fromsnapshot.admin_username
|
||||
admin_password = module.vm-qdc-fromsnapshot.admin_password
|
||||
|
||||
}
|
||||
|
||||
|
||||
resource "null_resource" "post-qdc-fromsnapshot" {
|
||||
|
||||
depends_on = [
|
||||
module.vm-qdc-fromsnapshot,
|
||||
module.linux-common
|
||||
]
|
||||
|
||||
provisioner "remote-exec" {
|
||||
connection {
|
||||
type = "ssh"
|
||||
host = module.vm-qdc-fromsnapshot.nic_private_ip_address
|
||||
user = module.vm-qdc-fromsnapshot.admin_username
|
||||
password = module.vm-qdc-fromsnapshot.admin_password
|
||||
timeout = "3m"
|
||||
#private_key = "${file("~/.ssh/id_rsa")}"
|
||||
}
|
||||
|
||||
inline = [
|
||||
"echo 'HOLA'",
|
||||
]
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
connection {
|
||||
type = "ssh"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = local.admin_username
|
||||
password = local.admin_password
|
||||
timeout = "60s"
|
||||
host = module.vm-qdc-fromsnapshot.nic_private_ip_address
|
||||
user = module.vm-qdc-fromsnapshot.admin_username
|
||||
password = module.vm-qdc-fromsnapshot.admin_password
|
||||
timeout = "10m"
|
||||
#private_key = "${file("~/.ssh/id_rsa")}"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
@@ -89,34 +152,22 @@ resource "azurerm_linux_virtual_machine" "vm" {
|
||||
provisioner "remote-exec" {
|
||||
connection {
|
||||
type = "ssh"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = local.admin_username
|
||||
password = local.admin_password
|
||||
host = module.vm-qdc-fromsnapshot.nic_private_ip_address
|
||||
user = module.vm-qdc-fromsnapshot.admin_username
|
||||
password = module.vm-qdc-fromsnapshot.admin_password
|
||||
timeout = "3m"
|
||||
#private_key = "${file("~/.ssh/id_rsa")}"
|
||||
}
|
||||
|
||||
inline = [
|
||||
"echo ${local.admin_password} | sudo -S chmod a+x /home/${local.admin_username}/scripts/feb2021/*.sh",
|
||||
"sudo /home/${local.admin_username}/scripts/feb2021/qdc-nextgen-xml.sh '${module.qmi-nic.private_ip_address}' ${var.image_reference}",
|
||||
"sudo /home/${local.admin_username}/scripts/feb2021/core_env_setup.sh",
|
||||
"sudo /home/${local.admin_username}/scripts/feb2021/set-license.sh '${data.azurerm_key_vault_secret.license-sept20.value}'"
|
||||
"echo ${module.vm-qdc-fromsnapshot.admin_password} | sudo -S chmod a+x /home/${module.vm-qdc-fromsnapshot.admin_username}/scripts/feb2021/*.sh",
|
||||
"echo ${module.vm-qdc-fromsnapshot.admin_password} | sudo -S chmod a+x /home/${module.vm-qdc-fromsnapshot.admin_username}/scripts/feb2022/*.sh",
|
||||
"sudo /home/${module.vm-qdc-fromsnapshot.admin_username}/scripts/feb2022/qdc-prereqs.sh /home/${module.vm-qdc-fromsnapshot.admin_username}/scripts/feb2022/qdc-scenario-config.sh",
|
||||
"sudo /home/${module.vm-qdc-fromsnapshot.admin_username}/scripts/feb2021/qdc-nextgen-xml.sh '${module.vm-qdc-fromsnapshot.nic_private_ip_address}' ${var.image_reference}",
|
||||
"sudo /home/${module.vm-qdc-fromsnapshot.admin_username}/scripts/feb2021/core_env_setup.sh",
|
||||
"sudo /home/${module.vm-qdc-fromsnapshot.admin_username}/scripts/feb2021/set-license.sh '${data.azurerm_key_vault_secret.license-sept20.value}'"
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module "linux-common" {
|
||||
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//linux-common"
|
||||
|
||||
depends_on = [
|
||||
azurerm_linux_virtual_machine.vm
|
||||
]
|
||||
|
||||
os_type = "centos"
|
||||
private_ip_address = module.qmi-nic.private_ip_address
|
||||
admin_username = local.admin_username
|
||||
admin_password = local.admin_password
|
||||
|
||||
}
|
||||
@@ -1,29 +1,29 @@
|
||||
output "virtual_machine_id" {
|
||||
value = azurerm_linux_virtual_machine.vm.id
|
||||
value = module.vm-qdc-fromsnapshot.virtual_machine_id
|
||||
}
|
||||
|
||||
output "virtual_machine_name" {
|
||||
value = "${var.prefix}-${random_id.randomMachineId.hex}"
|
||||
value = module.vm-qdc-fromsnapshot.virtual_machine_name
|
||||
}
|
||||
|
||||
output "admin_username" {
|
||||
value = var.admin_username
|
||||
value = module.vm-qdc-fromsnapshot.admin_username
|
||||
}
|
||||
|
||||
output "admin_password" {
|
||||
value = random_password.password.result
|
||||
value = module.vm-qdc-fromsnapshot.admin_password
|
||||
}
|
||||
|
||||
output "nic_id" {
|
||||
value = module.qmi-nic.id
|
||||
value = module.vm-qdc-fromsnapshot.nic_id
|
||||
}
|
||||
|
||||
output "nic_private_ip_address" {
|
||||
value = module.qmi-nic.private_ip_address
|
||||
value = module.vm-qdc-fromsnapshot.nic_private_ip_address
|
||||
}
|
||||
|
||||
output "nic_ip_configuration_name" {
|
||||
value = module.qmi-nic.ip_configuration_name
|
||||
value = module.vm-qdc-fromsnapshot.nic_ip_configuration_name
|
||||
}
|
||||
|
||||
output "mysql_root_password" {
|
||||
@@ -38,12 +38,12 @@ output "mysql_demo_password" {
|
||||
value = "Qlik1234!"
|
||||
}
|
||||
|
||||
output "nic_fqdn" {
|
||||
/*output "nic_fqdn" {
|
||||
value = var.isExternal? module.qmi-nic.fqdn : null
|
||||
}
|
||||
|
||||
output "nic_public_ip_address" {
|
||||
value = var.isExternal? module.qmi-nic.public_ip_address : null
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
|
||||
rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
|
||||
|
||||
#Import new Key
|
||||
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
|
||||
|
||||
#Install MySql
|
||||
yum -y install mysql-server
|
||||
|
||||
|
||||
@@ -97,9 +97,9 @@
|
||||
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
|
||||
maxThreads="150" scheme="https" secure="true"
|
||||
clientAuth="false" sslProtocol="TLS"
|
||||
keystoreFile="/usr/local/qdc/certs/wildcard_qmi_qlik-poc_com.pfx"
|
||||
keystoreFile="/usr/local/qdc/wildcard_qmi_qlik-poc_com.pfx"
|
||||
keystoreType="PKCS12"
|
||||
keystorePass="1S3h*!PzWGdt" />
|
||||
keystorePass="QJ]5M$>m,X)t=_:BNNt:mwFks7NqocSMbR@/zA" />
|
||||
|
||||
<!--
|
||||
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
|
||||
|
||||
@@ -10,6 +10,8 @@ if [[ $2 == *"4.9.0"* ]]; then
|
||||
sudo cp /home/qmi/scripts/feb2021/tomcat.service /etc/systemd/system/
|
||||
fi
|
||||
|
||||
sudo cp /home/qmi/scripts/wildcard_qmi_qlik-poc_com.pfx /usr/local/qdc
|
||||
|
||||
|
||||
FILE=/usr/local/qdc/qlikcore/docker-compose-qlikContainers.yml
|
||||
if [ -f "$FILE" ]; then
|
||||
@@ -52,7 +54,7 @@ if [ -f "$FILE" ]; then
|
||||
|
||||
|
||||
|
||||
echo "Stopping Tomcat"
|
||||
echo "Replacing server.xml for Tomcat - Stopping Tomcat"
|
||||
sudo systemctl stop tomcat.service
|
||||
mv $TOMCAT_HOME/conf/server.xml $TOMCAT_HOME/conf/server.xml_backup
|
||||
cp $BASEDIR/nextgen-xml_server.xml $TOMCAT_HOME/conf/server.xml
|
||||
|
||||
BIN
vm-qdc/scripts/wildcard_qmi_qlik-poc_com.pfx
Normal file
BIN
vm-qdc/scripts/wildcard_qmi_qlik-poc_com.pfx
Normal file
Binary file not shown.
@@ -127,7 +127,7 @@ resource "azurerm_windows_virtual_machine" "vm" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/qs-post-cfg.ps1 -Hostname ${var.resource_group_name}.qmi.qlik-poc.com -CertPwd ${data.azurerm_key_vault_secret.cert-password.value} -QlikUserPwd ${random_password.qlikpassword.result}",
|
||||
"powershell.exe -File C:/provision/qs-post-cfg.ps1 -Hostname ${var.resource_group_name}.qmi.qlik-poc.com -CertPwd \"${data.azurerm_key_vault_secret.cert-password.value}\" -QlikUserPwd ${random_password.qlikpassword.result}",
|
||||
"powershell.exe -File C:/provision/bootstrap-qa/qa.ps1 -IsExternal ${local.is_external} -Url ${var.resource_group_name}.qmi.qlik-poc.com",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ function New-Credential($u,$p) {
|
||||
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-Credential "Qlik" $QlikUserPwd
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
|
||||
Write-Log -Message "Starting qs-post-cfg.ps1"
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ resource "azurerm_windows_virtual_machine" "vm" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/qs-post-cfg.ps1 -Hostname ${var.resource_group_name}.qmi.qlik-poc.com -CertPwd ${data.azurerm_key_vault_secret.cert-password.value} -QlikUserPwd ${random_password.qlikpassword.result}",
|
||||
"powershell.exe -File C:/provision/qs-post-cfg.ps1 -Hostname ${var.resource_group_name}.qmi.qlik-poc.com -CertPwd \"${data.azurerm_key_vault_secret.cert-password.value}\" -QlikUserPwd ${random_password.qlikpassword.result}",
|
||||
"powershell.exe -File C:/provision/bootstrap-qib/qib.ps1 -ExternalDomain ${var.resource_group_name}.qmi.qlik-poc.com -IsExternalAccess ${var.is_external_access} -ImageReference ${var.image_reference}",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ function New-Credential($u,$p) {
|
||||
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-Credential "Qlik" $QlikUserPwd
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
|
||||
|
||||
Write-Log -Message "Starting qs-post-cfg.ps1"
|
||||
|
||||
@@ -94,7 +94,7 @@ resource "azurerm_windows_virtual_machine" "vm" {
|
||||
https = false
|
||||
timeout = "3m"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
source = "${path.module}/main"
|
||||
destination = "C:/provision"
|
||||
}
|
||||
|
||||
@@ -110,6 +110,7 @@ resource "azurerm_windows_virtual_machine" "vm" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/prep-files.ps1",
|
||||
"powershell.exe -File C:/provision/bootstrap-qs.ps1 -ModuleName vm-qs",
|
||||
"powershell.exe -File C:/provision/gen-jwt.ps1"
|
||||
]
|
||||
@@ -127,7 +128,7 @@ resource "azurerm_windows_virtual_machine" "vm" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/qs-post-cfg.ps1 -Hostname ${var.resource_group_name}.qmi.qlik-poc.com -Serial ${data.azurerm_key_vault_secret.serial.value} -Control ${data.azurerm_key_vault_secret.control.value} -CertPwd ${data.azurerm_key_vault_secret.cert-password.value} -QlikUserPwd ${random_password.qlikpassword.result}",
|
||||
"powershell.exe -File C:/provision/qs-post-cfg.ps1 -Hostname ${var.resource_group_name}.qmi.qlik-poc.com -Serial ${data.azurerm_key_vault_secret.serial.value} -Control ${data.azurerm_key_vault_secret.control.value} -CertPwd \"${data.azurerm_key_vault_secret.cert-password.value}\" -QlikUserPwd ${random_password.qlikpassword.result}",
|
||||
"powershell.exe -File C:/provision/webconnectors/q-WebConnectors.ps1",
|
||||
]
|
||||
}
|
||||
|
||||
29
vm-qs/main/prep-files.ps1
Normal file
29
vm-qs/main/prep-files.ps1
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
Param(
|
||||
[string] $repo="qmi-cloud-tf-modules",
|
||||
[string] $branch="master",
|
||||
[string] $scenario="vm-qs",
|
||||
[string] $path="scripts"
|
||||
)
|
||||
|
||||
$pathIs="$scenario/$path"
|
||||
|
||||
$DownloadUrl="https://gitlab.com/qmi/$repo/-/archive/$branch/$repo-$branch.zip?path=$pathIs"
|
||||
|
||||
Write-Host "--- Boostrap# Downloading repository files from branch ($branch)..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Temp | Out-Null
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
(New-Object System.Net.WebClient).DownloadFile($DownloadUrl, "C:\Temp\$scenario.zip")
|
||||
|
||||
Expand-Archive "C:\Temp\$scenario.zip" -DestinationPath "C:\Temp" -Force
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Provision | Out-Null
|
||||
|
||||
Copy-Item -Path "C:\Temp\$repo-$branch-$scenario-scripts\$scenario\$path\*" -Destination "C:\Provision" -Recurse -Force
|
||||
|
||||
Remove-Item "C:\Temp\$repo-$branch-$scenario-scripts" -Recurse
|
||||
Remove-Item "C:\Temp\$scenario.zip" -Recurse
|
||||
@@ -54,7 +54,7 @@ New-QlikTag -name "QVD Catalog" | Out-Null
|
||||
Import-Module "Carbon"
|
||||
Write-Log -Message "Adding 'podium' user to Windows system"
|
||||
$cred = New-Credential "podium" "Qlik1234"
|
||||
Install-User -Credential $cred | Out-Null
|
||||
Install-CUser -Credential $cred | Out-Null
|
||||
|
||||
|
||||
Write-Log -Message "Creating Qlik Sense data connection for C:\QVDs"
|
||||
|
||||
@@ -114,7 +114,7 @@ Grant-SmbShareAccess -Name certs -AccountName Everyone -AccessRight Read -Force
|
||||
Import-Module "Carbon"
|
||||
Write-Log -Message "Adding 'podium' user to Windows system"
|
||||
$cred = New-Credential "podium" "Qlik1234"
|
||||
Install-User -Credential $cred | Out-Null
|
||||
Install-CUser -Credential $cred | Out-Null
|
||||
|
||||
#gci cert:\CurrentUser\My | where {$_.issuer -eq $cert} | Connect-Qlik -Username $env:COMPUTERNAME\podium -Computername $env:COMPUTERNAME
|
||||
#gci cert:\CurrentUser\My | where {$_.issuer -eq $cert} | Connect-Qlik -Computername $env:COMPUTERNAME
|
||||
|
||||
@@ -36,7 +36,7 @@ function New-Credential($u,$p) {
|
||||
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-Credential "Qlik" $QlikUserPwd
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
|
||||
Write-Log -Message "Starting qs-post-cfg.ps1"
|
||||
|
||||
@@ -247,7 +247,7 @@ try {
|
||||
$secpasswd = ConvertTo-SecureString $CertPwd -AsPlainText -Force
|
||||
$sslCert=Import-PfxCertificate -FilePath C:/provision/wildcard_qmi_qlik-poc_com.pfx -CertStoreLocation Cert:\LocalMachine\My -Password $secpasswd
|
||||
|
||||
Write-Log -Message "Setting Thumbprint from QMI certificate in Qlik Sense"
|
||||
Write-Log -Message "Setting Thumbprint from QMI certificate in Qlik Sense: $($sslCert.Thumbprint)"
|
||||
Update-QlikProxy -SslBrowserCertificateThumbprint $sslCert.Thumbprint -id (Get-QlikProxy).id | Out-Null
|
||||
Start-Sleep -s 15
|
||||
Update-QlikVirtualProxy -id (Get-QlikVirtualProxy).id -websocketCrossOriginWhiteList $Hostname | Out-Null
|
||||
|
||||
BIN
vm-qs/scripts/wildcard_qmi_qlik-poc_com.pfx
Normal file
BIN
vm-qs/scripts/wildcard_qmi_qlik-poc_com.pfx
Normal file
Binary file not shown.
@@ -73,7 +73,7 @@ resource "azurerm_windows_virtual_machine" "vm" {
|
||||
https = false
|
||||
timeout = "3m"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
source = "${path.module}/main"
|
||||
destination = "C:/provision"
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ resource "azurerm_windows_virtual_machine" "vm" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/prep-files.ps1",
|
||||
"powershell.exe -File C:/provision/bootstrap.ps1"
|
||||
]
|
||||
}
|
||||
|
||||
29
vm-win/main/prep-files.ps1
Normal file
29
vm-win/main/prep-files.ps1
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
Param(
|
||||
[string] $repo="qmi-cloud-tf-modules",
|
||||
[string] $branch="master",
|
||||
[string] $scenario="vm-win",
|
||||
[string] $path="scripts"
|
||||
)
|
||||
|
||||
$pathIs="$scenario/$path"
|
||||
|
||||
$DownloadUrl="https://gitlab.com/qmi/$repo/-/archive/$branch/$repo-$branch.zip?path=$pathIs"
|
||||
|
||||
Write-Host "--- Boostrap# Downloading repository files from branch ($branch)..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Temp | Out-Null
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
(New-Object System.Net.WebClient).DownloadFile($DownloadUrl, "C:\Temp\$scenario.zip")
|
||||
|
||||
Expand-Archive "C:\Temp\$scenario.zip" -DestinationPath "C:\Temp" -Force
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Provision | Out-Null
|
||||
|
||||
Copy-Item -Path "C:\Temp\$repo-$branch-$scenario-scripts\$scenario\$path\*" -Destination "C:\Provision" -Recurse -Force
|
||||
|
||||
Remove-Item "C:\Temp\$repo-$branch-$scenario-scripts" -Recurse
|
||||
Remove-Item "C:\Temp\$scenario.zip" -Recurse
|
||||
@@ -33,7 +33,7 @@ Import-Module "Carbon"
|
||||
### create Qlik User
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-Credential "Qlik" "Qlik1234"
|
||||
Install-User -Credential $cred
|
||||
Install-CUser -Credential $cred
|
||||
|
||||
### Grant Remote Admin Rights to Qlik User
|
||||
Write-Log -Message "Granting Qlik account Remote Interactive Logon Right"
|
||||
|
||||
@@ -15,7 +15,7 @@ resource "null_resource" "post-win-vm" {
|
||||
https = false
|
||||
timeout = "30m"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
source = "${path.module}/main"
|
||||
destination = "C:/provision/win-common"
|
||||
}
|
||||
|
||||
@@ -31,9 +31,10 @@ resource "null_resource" "post-win-vm" {
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/win-common/prep-files.ps1",
|
||||
"powershell.exe -File C:/provision/win-common/resize-disk-tomax.ps1",
|
||||
"powershell.exe -File C:/provision/win-common/disable-ie-sec.ps1",
|
||||
"powershell.exe -File C:/provision/win-common/carbonblack-install.ps1 -SensorSettings '${data.azurerm_key_vault_secret.sensorsettings.value}'",
|
||||
#"powershell.exe -File C:/provision/win-common/carbonblack-install.ps1 -SensorSettings '${data.azurerm_key_vault_secret.sensorsettings.value}'",
|
||||
]
|
||||
}
|
||||
}
|
||||
30
win-common/main/prep-files.ps1
Normal file
30
win-common/main/prep-files.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
Param(
|
||||
[string] $repo="qmi-cloud-tf-modules",
|
||||
[string] $branch="master",
|
||||
[string] $scenario="win-common",
|
||||
[string] $path="scripts"
|
||||
)
|
||||
|
||||
$pathIs="$scenario/$path"
|
||||
|
||||
$DownloadUrl="https://gitlab.com/qmi/$repo/-/archive/$branch/$repo-$branch.zip?path=$pathIs"
|
||||
|
||||
Write-Host "--- Boostrap# Downloading repository files from branch ($branch)..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Temp | Out-Null
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
(New-Object System.Net.WebClient).DownloadFile($DownloadUrl, "C:\Temp\$scenario.zip")
|
||||
|
||||
Expand-Archive "C:\Temp\$scenario.zip" -DestinationPath "C:\Temp" -Force
|
||||
|
||||
New-Item -ItemType Directory -Force -Path C:\Provision | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path C:\Provision\win-common | Out-Null
|
||||
|
||||
Copy-Item -Path "C:\Temp\$repo-$branch-$scenario-scripts\$scenario\$path\*" -Destination "C:\Provision\win-common" -Recurse -Force
|
||||
|
||||
Remove-Item "C:\Temp\$repo-$branch-$scenario-scripts" -Recurse
|
||||
Remove-Item "C:\Temp\$scenario.zip" -Recurse
|
||||
137
win-common/scripts/linage-demo/linage-demo.ps1
Normal file
137
win-common/scripts/linage-demo/linage-demo.ps1
Normal file
@@ -0,0 +1,137 @@
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
Write-Host "--- Downloading QLC demo content..."
|
||||
|
||||
New-Item -ItemType Directory -Force -Path "C:\Temp" | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path "C:\QLC_Setup" | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path "C:\QLC_Setup\QlikSense Demo" | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path "C:\Qlik" | Out-Null
|
||||
|
||||
|
||||
$url = "https://d7ipctdjxxii4.cloudfront.net/QLCDemo/Classicmodels3.zip"
|
||||
Invoke-WebRequest -Uri $url -OutFile "C:\Temp\Classicmodels.zip"
|
||||
|
||||
$url = "https://d7ipctdjxxii4.cloudfront.net/QLCDemo/ExampleStructure.zip"
|
||||
Invoke-WebRequest -Uri $url -OutFile "C:\Temp\ExampleStructure.zip"
|
||||
|
||||
#$url = "https://d7ipctdjxxii4.cloudfront.net/QLCDemo/QlikLineageConnectorSetup.msi"
|
||||
#$url = "https://github.com/qlik-download/lineage-connector/releases/download/v1.0.0/QlikLineageConnectorSetup.msi"
|
||||
$url = "https://github.com/qlik-download/lineage-connector/releases/download/v1.1.0/QlikLineageConnectorSetup.msi"
|
||||
Invoke-WebRequest -Uri $url -OutFile "C:\QLC_Setup\QlikLineageConnectorSetup.msi"
|
||||
|
||||
$url = "https://d7ipctdjxxii4.cloudfront.net/QLCDemo/QLC_Installation and Settings.docx"
|
||||
Invoke-WebRequest -Uri $url -OutFile "C:\QLC_Setup\QLC_Installation and Settings.docx"
|
||||
|
||||
Expand-Archive -LiteralPath C:\Temp\Classicmodels.zip -DestinationPath "C:\QLC_Setup\QlikSense Demo" -Force | Out-Null
|
||||
Expand-Archive -LiteralPath C:\Temp\ExampleStructure.zip -DestinationPath "C:\Qlik" -Force | Out-Null
|
||||
|
||||
$wshshell = New-Object -ComObject WScript.Shell
|
||||
$lnk = $wshshell.CreateShortcut("C:\Users\Public\Desktop\QLC_Setup.lnk")
|
||||
$lnk.TargetPath ="c:\QLC_Setup"
|
||||
$lnk.Save()
|
||||
|
||||
$wshshell2 = New-Object -ComObject WScript.Shell
|
||||
$urllnk = $wshshell2.CreateShortcut("C:\Users\Public\Desktop\QLC_Installation and Settings.lnk")
|
||||
$urllnk.TargetPath = $wshshell2.ExpandEnvironmentStrings("C:\Program Files\Google\Chrome\Application\chrome.exe")
|
||||
$urllnk.Arguments = "https://qliktechnologies365-my.sharepoint.com/:w:/g/personal/ves_qlik_com/EW4zTx_x-PtNgd_rBUX4oz0BBPRHzTyhwHQiVIVBrpRg6g?e=fpNsvE"
|
||||
$urllnk.Save()
|
||||
|
||||
|
||||
$wshshell3 = New-Object -ComObject WScript.Shell
|
||||
$urllnk2 = $wshshell3.CreateShortcut("C:\QLC_Setup\QLC_Installation and Settings.lnk")
|
||||
$urllnk2.TargetPath = $wshshell3.ExpandEnvironmentStrings("C:\Program Files\Google\Chrome\Application\chrome.exe")
|
||||
$urllnk2.Arguments = "https://qliktechnologies365-my.sharepoint.com/:w:/g/personal/ves_qlik_com/EW4zTx_x-PtNgd_rBUX4oz0BBPRHzTyhwHQiVIVBrpRg6g?e=fpNsvE"
|
||||
$urllnk2.Save()
|
||||
|
||||
|
||||
Write-Host "--- Importing Qlik Sense apps..."
|
||||
Function restartQse {
|
||||
Write-Host "Checking Engine Service has started..."
|
||||
$qse = Get-Service QlikSenseEngineService
|
||||
Write-Host "The engine is currently $($qse.Status)"
|
||||
if ($qse.Status -eq "Stopped") {
|
||||
Write-Host "Starting Qlik Sense Engine and waiting 60 seconds";
|
||||
Start-Service QlikSenseEngineService;
|
||||
Restart-Service QlikSenseServiceDispatcher;
|
||||
start-sleep -s 60
|
||||
}
|
||||
Write-Host "The engine is currently $($qse.Status)"
|
||||
}
|
||||
|
||||
Import-Module Qlik-Cli
|
||||
|
||||
|
||||
### Connect to the Qlik Sense Repository Service with Qlik-Cli
|
||||
do {
|
||||
Write-Host "--- Connecting to Qlik Sense Repository"; start-sleep 5
|
||||
}
|
||||
While( (Connect-Qlik $($env:COMPUTERNAME) -TrustAllCerts -UseDefaultCredentials -ErrorAction SilentlyContinue).length -eq 0 )
|
||||
|
||||
|
||||
### Import scenario extensions
|
||||
<#Write-Host "Importing extensions from C:\Temp\qs-import\Extensions"
|
||||
if ( Test-Path "C:\Temp\qs-import\Extensions" ) {
|
||||
gci C:\\Temp\\qs-import\\Extensions\\*.zip | foreach {
|
||||
try {
|
||||
Write-Host "Importing $_";
|
||||
Import-QlikExtension -ExtensionPath $_.FullName | Out-Null
|
||||
} catch {
|
||||
Write-Host $_.Exception.Message -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
}#>
|
||||
|
||||
|
||||
|
||||
### Import scenario applications
|
||||
Write-Host "Connecting as user Qlik to QRS..."
|
||||
try {
|
||||
$cert = "CN=$env:COMPUTERNAME-ca"
|
||||
gci cert:\CurrentUser\My | where {$_.issuer -eq $cert} | Connect-Qlik -username "$env:COMPUTERNAME\qlik" | Out-Null
|
||||
} catch {
|
||||
Write-Host $_.Exception.Message -ForegroundColor Red
|
||||
}
|
||||
|
||||
### Creating data connection
|
||||
try {
|
||||
Write-Host "Creating data connection..."
|
||||
New-QlikDataConnection -connectionstring "C:\QLC_Setup\QlikSense Demo\Classicmodels" -name "Classicmodels" -type "folder" | Out-Null
|
||||
} catch {
|
||||
Write-Host $_.Exception.Message -ForegroundColor Red
|
||||
}
|
||||
|
||||
Write-Host "Importing applications from C:\QLC_Setup\QlikSense Demo ..."
|
||||
|
||||
If (Test-Path "C:\QLC_Setup\QlikSense Demo\") {
|
||||
|
||||
$files = gci "C:\QLC_Setup\QlikSense Demo\*.qvf" -File
|
||||
|
||||
$EveryoneStreamId = $(Get-QlikStream -filter "name eq 'Everyone'").id
|
||||
|
||||
foreach ($file in $files) {
|
||||
try {
|
||||
Write-Host "Importing $($file.FullName)";
|
||||
Import-QlikApp -name $file.BaseName -file $file.FullName -upload | Out-Null;
|
||||
$appId = $(Get-QlikApp -filter "name eq '$($file.BaseName)'").id
|
||||
|
||||
Write-Host "Reloading App: $($file.BaseName) ..."
|
||||
New-QlikTask -appId $appId -name "$($file.BaseName)" | Start-QlikTask
|
||||
|
||||
Start-Sleep -s 5
|
||||
|
||||
Write-Host "Publishing App: $($file.BaseName) ..."
|
||||
Publish-QlikApp -id $appId -stream $EveryoneStreamId -name $file.BaseName | Out-Null
|
||||
|
||||
|
||||
|
||||
} catch {
|
||||
Write-Host $_.Exception.Message -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user