Compare commits
1018 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
102e18b11d | ||
|
|
8515a07ea5 | ||
|
|
5977b92864 | ||
|
|
5ed2dbf33c | ||
|
|
607cbcba22 | ||
|
|
85cf7dcb4c | ||
|
|
562633fae6 | ||
|
|
39327d588f | ||
|
|
f41ad12d32 | ||
|
|
3c7a6776b9 | ||
|
|
a063f7aff8 | ||
|
|
7d2e8b5392 | ||
|
|
2c0dce9e64 | ||
|
|
0b9ec65257 | ||
|
|
bd12bc268c | ||
|
|
5b218ad1c7 | ||
|
|
dddc1fd9bd | ||
|
|
624b174278 | ||
|
|
424a6d92b1 | ||
|
|
c052fcc4a7 | ||
|
|
c4753042e8 | ||
|
|
ccde388566 | ||
|
|
50f1ae9bd8 | ||
|
|
cc0842d080 | ||
|
|
30ebbe30d6 | ||
|
|
869885c3ff | ||
|
|
d579e2fbf3 | ||
|
|
7b6b3ab5f8 | ||
|
|
46a57a5291 | ||
|
|
508c38d999 | ||
|
|
861c96dbfc | ||
|
|
c8d456ff4e | ||
|
|
68ceb85e28 | ||
|
|
937af2601e | ||
|
|
7daeb50b08 | ||
|
|
84d95552a7 | ||
|
|
76e03011e8 | ||
|
|
c31db57242 | ||
|
|
c7d97b12ed | ||
|
|
83e8ec48f7 | ||
|
|
16028ebcfc | ||
|
|
3f5a46b64a | ||
|
|
035ca9123b | ||
|
|
386063a5c2 | ||
|
|
14093ace85 | ||
|
|
93fe72d49a | ||
|
|
8140c91e6c | ||
|
|
6f8d9410f2 | ||
|
|
7de2f7f0e5 | ||
|
|
603c1a2ae1 | ||
|
|
5a99837659 | ||
|
|
9018d5fcab | ||
|
|
93e78a315d | ||
|
|
b8ba7a0d04 | ||
|
|
52b6c5ba10 | ||
|
|
ebc1486687 | ||
|
|
a0b31de154 | ||
|
|
a1a6f0277f | ||
|
|
62bb7d4f05 | ||
|
|
cc70fcdb92 | ||
|
|
5f37c6d6ad | ||
|
|
0a801ce68b | ||
|
|
1e8ea73154 | ||
|
|
dd90fcab2e | ||
|
|
8caebc2f89 | ||
|
|
14fb967644 | ||
|
|
a02c4ec3d6 | ||
|
|
a9180be1ec | ||
|
|
c6081032ca | ||
|
|
f1cb6ae7b9 | ||
|
|
854ac82f53 | ||
|
|
bf03689cc2 | ||
|
|
ca78e75340 | ||
|
|
99b0fc3b16 | ||
|
|
2b36526ed1 | ||
|
|
4c1e8a8801 | ||
|
|
47d11fdbb4 | ||
|
|
5f54fabcba | ||
|
|
47c785a60e | ||
|
|
d636d8c887 | ||
|
|
5921359b93 | ||
|
|
ebceffa20d | ||
|
|
3e4cfca251 | ||
|
|
5d048a714d | ||
|
|
235ba7cbe6 | ||
|
|
13732c1677 | ||
|
|
c9f60bc1da | ||
|
|
270b72acbc | ||
|
|
7b995ae7d8 | ||
|
|
8da495281d | ||
|
|
4ba09619df | ||
|
|
f65b4123b5 | ||
|
|
e544443bd4 | ||
|
|
7cce3a8032 | ||
|
|
b78c4e05c1 | ||
|
|
6e06ad3a74 | ||
|
|
8b10de0665 | ||
|
|
b8825e9431 | ||
|
|
fd89b6691f | ||
|
|
e60c5316c0 | ||
|
|
49b9245ee3 | ||
|
|
a484063109 | ||
|
|
b1138fe9aa | ||
|
|
36f886488e | ||
|
|
29f418de57 | ||
|
|
68d5dd432c | ||
|
|
c7a98c8e3e | ||
|
|
22062d0440 | ||
|
|
bba97c85ba | ||
|
|
860941db2e | ||
|
|
c70eb7ed77 | ||
|
|
b148f51139 | ||
|
|
d3170815bb | ||
|
|
a4cd430547 | ||
|
|
97e01c0456 | ||
|
|
b13d886686 | ||
|
|
c3dfb0fd5e | ||
|
|
81e83f2d35 | ||
|
|
0495a2c7e7 | ||
|
|
914c01d5b6 | ||
|
|
18c8d8594a | ||
|
|
dba1462b82 | ||
|
|
332c862426 | ||
|
|
8301ef19c8 | ||
|
|
3be2b8521b | ||
|
|
72188c31d9 | ||
|
|
863c353251 | ||
|
|
73ec094ea9 | ||
|
|
73a41216f4 | ||
|
|
603aeb5e88 | ||
|
|
779b956d9f | ||
|
|
eeb0b1d050 | ||
|
|
03f0583f27 | ||
|
|
a2e80b7766 | ||
|
|
810363e332 | ||
|
|
6ba4d99fa6 | ||
|
|
e67f438bf1 | ||
|
|
86cf3382e4 | ||
|
|
7677ac35d5 | ||
|
|
080d3b06b2 | ||
|
|
acbb0d0f02 | ||
|
|
cbf29b0c7b | ||
|
|
0bdb8098f6 | ||
|
|
285bbfd0ab | ||
|
|
124758235e | ||
|
|
3f2ab9e395 | ||
|
|
1831f87093 | ||
|
|
1b162bbb80 | ||
|
|
e2653b162a | ||
|
|
7d15e4e2b3 | ||
|
|
42f63b9dd7 | ||
|
|
8699ecb8ba | ||
|
|
8d4e5f093c | ||
|
|
a3bb140dd1 | ||
|
|
4f257dfe75 | ||
|
|
0f48c67682 | ||
|
|
3a4b0bd80c | ||
|
|
b3cf48ffe0 | ||
|
|
ba653b84dc | ||
|
|
941914fb4b | ||
|
|
355ff49501 | ||
|
|
e12470936a | ||
|
|
2dec335a42 | ||
|
|
face5690f3 | ||
|
|
2965316e45 | ||
|
|
6d5f3836de | ||
|
|
a2f162108e | ||
|
|
8729b28232 | ||
|
|
7673592afc | ||
|
|
cef090b34e | ||
|
|
8683c0c571 | ||
|
|
4fbb10cd88 | ||
|
|
b972b37c18 | ||
|
|
3166ad4733 | ||
|
|
3762e16c46 | ||
|
|
0dd6eeca7b | ||
|
|
99561e6db9 | ||
|
|
54e6a2e712 | ||
|
|
8ee4a307a4 | ||
|
|
d2e7d36db8 | ||
|
|
a985fa804c | ||
|
|
75eacd3cbf | ||
|
|
6dd6ea18d8 | ||
|
|
ce1a3232a8 | ||
|
|
cf4403625d | ||
|
|
30043d9f92 | ||
|
|
a09a64a44c | ||
|
|
a31e962836 | ||
|
|
52e6a3144e | ||
|
|
fd00d959af | ||
|
|
2495d55f68 | ||
|
|
8296fe803f | ||
|
|
f39acf0a66 | ||
|
|
2f993e3428 | ||
|
|
a9d1cb3bcf | ||
|
|
0ea7ad64cf | ||
|
|
3de68cb7b8 | ||
|
|
c2757a741a | ||
|
|
863ce9a598 | ||
|
|
afc6f11fa5 | ||
|
|
582fa8bcea | ||
|
|
2c9b3d4b5e | ||
|
|
c20dfbd402 | ||
|
|
01b8bf0c50 | ||
|
|
0a6869857d | ||
|
|
f6c39d7472 | ||
|
|
07b5053038 | ||
|
|
eba8fa9e87 | ||
|
|
4d11b3f187 | ||
|
|
dc24b43cd8 | ||
|
|
61fe528976 | ||
|
|
a19a607856 | ||
|
|
78d4e8309a | ||
|
|
783d0151de | ||
|
|
d30de56058 | ||
|
|
52a9d5981e | ||
|
|
66b38d1584 | ||
|
|
7dbb98d316 | ||
|
|
bfc4848d3d | ||
|
|
b98a37ea3f | ||
|
|
3bc60d000f | ||
|
|
24ae1a51b5 | ||
|
|
40a5e25411 | ||
|
|
2e38ef0613 | ||
|
|
b579d373fc | ||
|
|
c2e33e1594 | ||
|
|
5d2a8cb27e | ||
|
|
153e73b0cf | ||
|
|
00422d205d | ||
|
|
4e9bdd67cc | ||
|
|
c22aa6425b | ||
|
|
272019806a | ||
|
|
adba72a956 | ||
|
|
8d99cd8f9a | ||
|
|
b5307a8a3a | ||
|
|
c6425d1a71 | ||
|
|
14af06102d | ||
|
|
bc3e8af1d1 | ||
|
|
5022a62679 | ||
|
|
f4cffe61b1 | ||
|
|
0c12ad445d | ||
|
|
3e83036494 | ||
|
|
1cf0a975e4 | ||
|
|
3b04a25f1b | ||
|
|
1bb88d6a57 | ||
|
|
46b4467fa3 | ||
|
|
9f08b34e2f | ||
|
|
e33256edb7 | ||
|
|
09d36ebfc6 | ||
|
|
ac62da66f7 | ||
|
|
ddd5fb70d8 | ||
|
|
3239434774 | ||
|
|
82ef25250e | ||
|
|
f82d4c93e7 | ||
|
|
bfde497467 | ||
|
|
44aa5d4840 | ||
|
|
830d321411 | ||
|
|
d5f28530b9 | ||
|
|
8f4ea9a5e8 | ||
|
|
872eae5c27 | ||
|
|
76670e32c5 | ||
|
|
a11b617374 | ||
|
|
17ae8ad1c6 | ||
|
|
10c761d7db | ||
|
|
e7b5bdbf56 | ||
|
|
1ff96cf2e7 | ||
|
|
e3d80097de | ||
|
|
edf63f2984 | ||
|
|
fca41d6699 | ||
|
|
1c023f1366 | ||
|
|
134c27de95 | ||
|
|
c8446c4572 | ||
|
|
f7584fc615 | ||
|
|
8e08550954 | ||
|
|
26dfef4a69 | ||
|
|
0c41ea5ae4 | ||
|
|
a6c05ae63b | ||
|
|
2eea32f7d2 | ||
|
|
fe01e6021a | ||
|
|
c366ad375d | ||
|
|
ac9a9b10ce | ||
|
|
a158fe1630 | ||
|
|
b91b55c2f9 | ||
|
|
ba238b4088 | ||
|
|
e5c998b68e | ||
|
|
05b315b1ce | ||
|
|
6ee54f1f37 | ||
|
|
566ca1a41b | ||
|
|
cfdbc04931 | ||
|
|
78a966b9a3 | ||
|
|
00c3385aa0 | ||
|
|
6a8f980d05 | ||
|
|
0ed37bbfdc | ||
|
|
38a17a38df | ||
|
|
5a47d57d92 | ||
|
|
73cbeca7c1 | ||
|
|
01c8bfdcee | ||
|
|
15c03dfd4c | ||
|
|
0c7985c188 | ||
|
|
f99af254dd | ||
|
|
05acfb8673 | ||
|
|
19f8da742d | ||
|
|
0df688e641 | ||
|
|
a86a328b88 | ||
|
|
1387c15194 | ||
|
|
2125c15b4e | ||
|
|
7d35ce588e | ||
|
|
40843fd65c | ||
|
|
3042b873e1 | ||
|
|
d2eb231002 | ||
|
|
1902175e0b | ||
|
|
750ed46bc1 | ||
|
|
f18d5129e7 | ||
|
|
d410e5a24f | ||
|
|
8864aa4b79 | ||
|
|
c74fa8f2bd | ||
|
|
2237232cc8 | ||
|
|
98b5f4ff9c | ||
|
|
1e306f9efe | ||
|
|
6b2eaa6d19 | ||
|
|
cb633dda5e | ||
|
|
8728f8b109 | ||
|
|
c0d76a2b1d | ||
|
|
a2c0735f14 | ||
|
|
a1f0414512 | ||
|
|
2d17f418b0 | ||
|
|
e1fb80ff4a | ||
|
|
e062728fae | ||
|
|
3ff07f37b6 | ||
|
|
2484a5c090 | ||
|
|
57bfb366c1 | ||
|
|
4176f45593 | ||
|
|
c4dbff136b | ||
|
|
d56290caa4 | ||
|
|
1fc4c1b57c | ||
|
|
9a2518885d | ||
|
|
28c93c8905 | ||
|
|
84030db306 | ||
|
|
1f87ab4ea2 | ||
|
|
a47a85a528 | ||
|
|
26e0bbaed0 | ||
|
|
a2d9fa3134 | ||
|
|
5f1d8aec59 | ||
|
|
30f6d1de65 | ||
|
|
7ff8a4710d | ||
|
|
b662c7b975 | ||
|
|
91fd8697b6 | ||
|
|
6b3d69f50c | ||
|
|
7112f091a2 | ||
|
|
13ae7eb9b4 | ||
|
|
6796c53c93 | ||
|
|
3716a29365 | ||
|
|
e1b7a5f5c7 | ||
|
|
50df71d2ee | ||
|
|
3c6687a2c6 | ||
|
|
c6e9e4c102 | ||
|
|
4f9322c060 | ||
|
|
0ecfa30952 | ||
|
|
8a83983993 | ||
|
|
80577ffdd9 | ||
|
|
cde377b833 | ||
|
|
a5639963c3 | ||
|
|
947503e2e5 | ||
|
|
26f1175499 | ||
|
|
342e3c87e1 | ||
|
|
125ead99e0 | ||
|
|
3ac84a4e3b | ||
|
|
c0373165a5 | ||
|
|
a7d9bcfeb2 | ||
|
|
012d88b700 | ||
|
|
2e19e9852f | ||
|
|
1eea6a6b1f | ||
|
|
582fdb35a1 | ||
|
|
28a1bc9189 | ||
|
|
7a06b4d018 | ||
|
|
d26cf488c4 | ||
|
|
b24ddd6f17 | ||
|
|
216895356d | ||
|
|
5758e59956 | ||
|
|
cb308ee99c | ||
|
|
1186fd5fdb | ||
|
|
36a6c55634 | ||
|
|
72b7a0489e | ||
|
|
44f59e7c65 | ||
|
|
f261798ea7 | ||
|
|
9e1e16f8a4 | ||
|
|
91e69720a0 | ||
|
|
c690b93c21 | ||
|
|
aa447d82e7 | ||
|
|
3c2678a4ed | ||
|
|
d7053152de | ||
|
|
9b437effc8 | ||
|
|
0b7aa244f7 | ||
|
|
c65aeb895c | ||
|
|
df5f5ede63 | ||
|
|
9e35559484 | ||
|
|
9c43fb0365 | ||
|
|
cb3de5f0b6 | ||
|
|
aa3e804f05 | ||
|
|
f1a74bbfb9 | ||
|
|
79729e75ff | ||
|
|
0f2c045643 | ||
|
|
ee8faa93a4 | ||
|
|
d38f0fe08d | ||
|
|
46b1ace1b0 | ||
|
|
e94765d9fb | ||
|
|
9aaa01cedf | ||
|
|
66182ef502 | ||
|
|
5e41dead77 | ||
|
|
7dfb8fdc59 | ||
|
|
b2df480402 | ||
|
|
d2578e7120 | ||
|
|
fc7a2a545d | ||
|
|
26fef17a85 | ||
|
|
dec9adb9d9 | ||
|
|
50e49bb3d1 | ||
|
|
631af14f36 | ||
|
|
d3f3b784c0 | ||
|
|
c405c6148c | ||
|
|
0b1fddaaa0 | ||
|
|
01546f7160 | ||
|
|
449d7d20e3 | ||
|
|
5758d49d7b | ||
|
|
0c3465287e | ||
|
|
1421afec44 | ||
|
|
39156376f7 | ||
|
|
4b952e7933 | ||
|
|
f89ebdc1a5 | ||
|
|
0eb6599293 | ||
|
|
1e35a4b115 | ||
|
|
46578fa00b | ||
|
|
4525a19abe | ||
|
|
52a53cf37a | ||
|
|
c6f54ca313 | ||
|
|
681eeac771 | ||
|
|
e2d4a51172 | ||
|
|
69cfc21c00 | ||
|
|
cb26f07af6 | ||
|
|
37c71a8302 | ||
|
|
c26e2319a7 | ||
|
|
86a777ca97 | ||
|
|
f485d7b36d | ||
|
|
323d72de18 | ||
|
|
ed6697b4f4 | ||
|
|
61eab3a2ab | ||
|
|
ecbb6d529f | ||
|
|
67da030660 | ||
|
|
f43765fbc8 | ||
|
|
aee47a6b7e | ||
|
|
58c585e55a | ||
|
|
9e1bfe328b | ||
|
|
62c57e1459 | ||
|
|
0840e4c009 | ||
|
|
67d45cfe58 | ||
|
|
2e11a9454d | ||
|
|
0fc85807ae | ||
|
|
cc8a73a4c3 | ||
|
|
726fbae134 | ||
|
|
2cbcef3396 | ||
|
|
7dac9d2c42 | ||
|
|
2927a01619 | ||
|
|
ac4a245401 | ||
|
|
ff8907b213 | ||
|
|
0714311ae8 | ||
|
|
8c6437418e | ||
|
|
89f16c8410 | ||
|
|
7ddf8a1df7 | ||
|
|
e323705007 | ||
|
|
d84d4b1f4b | ||
|
|
a6506d4595 | ||
|
|
819d0b10a2 | ||
|
|
4ea88d1cbc | ||
|
|
654596f6af | ||
|
|
53ec331153 | ||
|
|
30bffa482e | ||
|
|
a2b249be6a | ||
|
|
6c44031813 | ||
|
|
2db1e41016 | ||
|
|
33662a64bc | ||
|
|
ea8a7db5da | ||
|
|
11b3ef2c83 | ||
|
|
92f41db6da | ||
|
|
fd03d0fb78 | ||
|
|
8cdc80da72 | ||
|
|
ed07c8ebaf | ||
|
|
53850cd0ac | ||
|
|
e03e98ef27 | ||
|
|
e7afb0d9b5 | ||
|
|
e92e2c3501 | ||
|
|
900ae07307 | ||
|
|
b00e4877e2 | ||
|
|
2ff0cf6dbe | ||
|
|
6cec04aedc | ||
|
|
fa0fc77b88 | ||
|
|
b3386b21f8 | ||
|
|
c52079c850 | ||
|
|
a305af55cc | ||
|
|
fb2c6bbadc | ||
|
|
0b876830e5 | ||
|
|
0888a591b5 | ||
|
|
2123fc40dd | ||
|
|
45c6dc8ba7 | ||
|
|
30cd69f22c | ||
|
|
c42cbc6428 | ||
|
|
34c23d363f | ||
|
|
da2f3e0d84 | ||
|
|
7bcd7a765d | ||
|
|
5aa0e7dec5 | ||
|
|
c6c678ae88 | ||
|
|
aced77efba | ||
|
|
906569c476 | ||
|
|
97faefed04 | ||
|
|
989002cb32 | ||
|
|
d22d992ab8 | ||
|
|
a0dae20911 | ||
|
|
9e27bb15bd | ||
|
|
a4b9abb15e | ||
|
|
9f4db8b3ce | ||
|
|
7fcefed82f | ||
|
|
0e51697a81 | ||
|
|
d92960d513 | ||
|
|
6370ff8b18 | ||
|
|
c96e8a5567 | ||
|
|
5f2422165b | ||
|
|
4c3821f84c | ||
|
|
11f9bb336f | ||
|
|
40e3d8ef10 | ||
|
|
119f7914af | ||
|
|
2ac5289b62 | ||
|
|
8c7f63aab3 | ||
|
|
b5b57eb47f | ||
|
|
8c5650f334 | ||
|
|
7d957013ba | ||
|
|
30ccc0e79a | ||
|
|
bfb865cf1d | ||
|
|
3507ef2470 | ||
|
|
19c009546f | ||
|
|
1497221318 | ||
|
|
76d2e6f1da | ||
|
|
9d6748d352 | ||
|
|
40f2344e34 | ||
|
|
9d642599ba | ||
|
|
332eeaf884 | ||
|
|
fda20a7312 | ||
|
|
1b02ad1d0d | ||
|
|
b697607c88 | ||
|
|
f4ba3d95c1 | ||
|
|
9553c7de64 | ||
|
|
e88277bc75 | ||
|
|
fbabeb35e0 | ||
|
|
c17c01eda3 | ||
|
|
e41f783169 | ||
|
|
e3272d6568 | ||
|
|
c3ae2f11da | ||
|
|
6e802d294b | ||
|
|
ce4bffa4ca | ||
|
|
855575a84f | ||
|
|
87c0e9c5d6 | ||
|
|
daabb30341 | ||
|
|
9532239240 | ||
|
|
1716e2fb29 | ||
|
|
da1db39acc | ||
|
|
74154351ee | ||
|
|
837bea5722 | ||
|
|
25c2bdde85 | ||
|
|
e562151517 | ||
|
|
97cb7d71a2 | ||
|
|
e5621a7b5c | ||
|
|
3db03c4ee7 | ||
|
|
364e648c4b | ||
|
|
fca1cdafd1 | ||
|
|
306edce019 | ||
|
|
b34555e5bf | ||
|
|
e9ca65f03f | ||
|
|
403231a3c2 | ||
|
|
2d55d3e414 | ||
|
|
638a5b43d5 | ||
|
|
1e024c7993 | ||
|
|
007f95a4c3 | ||
|
|
6563cbca2d | ||
|
|
92ea2ee599 | ||
|
|
43481a04e2 | ||
|
|
320f73f98b | ||
|
|
1cbb97796b | ||
|
|
a47fd5a20e | ||
|
|
564feba2b5 | ||
|
|
7e8237d089 | ||
|
|
a35bc7a563 | ||
|
|
4ab2153f19 | ||
|
|
121dd4ad4f | ||
|
|
e3492ccbe1 | ||
|
|
c171430424 | ||
|
|
f86e14bafa | ||
|
|
fc8442b156 | ||
|
|
781c3b7599 | ||
|
|
d86602aca0 | ||
|
|
c17b27a989 | ||
|
|
fd7055b87e | ||
|
|
33d65569c7 | ||
|
|
4832d5ad9b | ||
|
|
20454340ce | ||
|
|
28ba162595 | ||
|
|
34d8165feb | ||
|
|
4eb0ce7131 | ||
|
|
ed73767d68 | ||
|
|
9a1454a710 | ||
|
|
56889333d3 | ||
|
|
3dbd31db69 | ||
|
|
1530c3a13d | ||
|
|
67d9310a5f | ||
|
|
e63b320745 | ||
|
|
82aa02642c | ||
|
|
1a0990ab07 | ||
|
|
7e4cb57570 | ||
|
|
ab13cc61b2 | ||
|
|
121441fbde | ||
|
|
f9e05f832d | ||
|
|
06bd553bbe | ||
|
|
4d45de5a9a | ||
|
|
a116a398bd | ||
|
|
161c8c250a | ||
|
|
55fa5a3a13 | ||
|
|
a016fe4069 | ||
|
|
5d8caa948d | ||
|
|
0935315dbf | ||
|
|
0c03e43f34 | ||
|
|
9113836f1f | ||
|
|
16956d8e22 | ||
|
|
07b824df61 | ||
|
|
0cf9c11da9 | ||
|
|
685085165b | ||
|
|
43ac9058c3 | ||
|
|
f5bcc2d34a | ||
|
|
60759b72b1 | ||
|
|
9fb6d6c387 | ||
|
|
95bb012dfd | ||
|
|
87062aee0a | ||
|
|
15ddd1f60f | ||
|
|
72fc17210b | ||
|
|
12831518c0 | ||
|
|
e2926ea3e9 | ||
|
|
0633464e02 | ||
|
|
525b315de3 | ||
|
|
6b45debc92 | ||
|
|
ccaba79395 | ||
|
|
30ce58ef9b | ||
|
|
305ab66625 | ||
|
|
917ddaf0ab | ||
|
|
972a3353cc | ||
|
|
dd7768902f | ||
|
|
68b7d33536 | ||
|
|
ec555d0f5b | ||
|
|
642b4c980c | ||
|
|
012984fe82 | ||
|
|
e46bbbee3f | ||
|
|
6f3ce45da8 | ||
|
|
774f20260a | ||
|
|
a0f2946d12 | ||
|
|
c05e4c2bc7 | ||
|
|
b44abe8e29 | ||
|
|
258a09ad40 | ||
|
|
e1acdeaaff | ||
|
|
e1e5b47a5f | ||
|
|
e985eb449b | ||
|
|
fb25b595c3 | ||
|
|
9eff8f08c0 | ||
|
|
90b9dcc23e | ||
|
|
3ef7bd75e5 | ||
|
|
3a3d854cc4 | ||
|
|
4361d9fc37 | ||
|
|
4a491668de | ||
|
|
4112e41617 | ||
|
|
3f712b9b17 | ||
|
|
c401881070 | ||
|
|
fd8cc875fc | ||
|
|
8590c53c2e | ||
|
|
3e72c1c5e4 | ||
|
|
31ef78621c | ||
|
|
459bf82e15 | ||
|
|
e695ef5dc1 | ||
|
|
089db45c15 | ||
|
|
1575c07c97 | ||
|
|
a9c13f3fed | ||
|
|
8b707cdb66 | ||
|
|
efa7ec59d7 | ||
|
|
68f016e00d | ||
|
|
5cb1157069 | ||
|
|
6fe1bbf034 | ||
|
|
5d0347dc8e | ||
|
|
01d72e3033 | ||
|
|
5cebc24cdd | ||
|
|
de4ad7b679 | ||
|
|
f876098fd5 | ||
|
|
a2c2a6bb86 | ||
|
|
7f2485e5c1 | ||
|
|
0d8c792e9f | ||
|
|
ba78baf7da | ||
|
|
d226082c8d | ||
|
|
3a80543097 | ||
|
|
112ca59a48 | ||
|
|
e815fe15c0 | ||
|
|
5a1344fb8e | ||
|
|
b839bae693 | ||
|
|
1dec0dced4 | ||
|
|
d8bf486a30 | ||
|
|
1a034fdd29 | ||
|
|
da261ce43f | ||
|
|
b60a06afb6 | ||
|
|
87e241bea2 | ||
|
|
9c1a8f4203 | ||
|
|
14e8b134d2 | ||
|
|
8820405b16 | ||
|
|
4c8eb2d682 | ||
|
|
ef72aac27d | ||
|
|
8be11ee087 | ||
|
|
2ee07d8df6 | ||
|
|
4379d54f03 | ||
|
|
1d4cca8d70 | ||
|
|
0a3c94800e | ||
|
|
f71f479c6a | ||
|
|
2987feb750 | ||
|
|
058122c10e | ||
|
|
7d8676885a | ||
|
|
a0f6a81fb4 | ||
|
|
8c2a4481ee | ||
|
|
80819e10c0 | ||
|
|
f8fc2b06b5 | ||
|
|
2d09ea84dc | ||
|
|
8221c18302 | ||
|
|
3a07cc55f3 | ||
|
|
df7877c42c | ||
|
|
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 | ||
|
|
3a24782e1a | ||
|
|
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 | ||
|
|
88cf6011ce | ||
|
|
13f32c2b78 |
70
adls/main.tf
Normal file
70
adls/main.tf
Normal file
@@ -0,0 +1,70 @@
|
||||
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 = 5
|
||||
}
|
||||
|
||||
|
||||
resource "azurerm_storage_account" "saccount" {
|
||||
|
||||
name = var.storage_account_name != null? var.storage_account_name : "qmiadlsgen2${random_id.randomMachineId.hex}"
|
||||
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
|
||||
account_kind = "StorageV2"
|
||||
account_replication_type = var.account_replication_type != null? var.account_replication_type : "RAGRS"
|
||||
account_tier = "Standard"
|
||||
access_tier = "Hot"
|
||||
|
||||
is_hns_enabled = "true"
|
||||
|
||||
tags = var.tags
|
||||
}
|
||||
|
||||
resource "azurerm_storage_container" "scontainer" {
|
||||
|
||||
name = var.container_name != null? var.container_name : "qmicontainer"
|
||||
storage_account_name = azurerm_storage_account.saccount.name
|
||||
#container_access_type = "container"
|
||||
}
|
||||
|
||||
resource "azurerm_role_assignment" "data-contributor-role" {
|
||||
scope = azurerm_storage_account.saccount.id
|
||||
role_definition_name = "Contributor"
|
||||
principal_id = var.tpm_app_registration_principal_id
|
||||
}
|
||||
|
||||
resource "azurerm_role_assignment" "data-contributor-role2" {
|
||||
scope = azurerm_storage_account.saccount.id
|
||||
role_definition_name = "Storage Blob Data Contributor"
|
||||
principal_id = var.tpm_app_registration_principal_id
|
||||
}
|
||||
|
||||
|
||||
resource "azurerm_role_assignment" "data-contributor-dbricksapp1" {
|
||||
scope = azurerm_storage_account.saccount.id
|
||||
role_definition_name = "Contributor"
|
||||
principal_id = var.dbricks_app_registration_principal_id
|
||||
}
|
||||
|
||||
resource "azurerm_role_assignment" "data-contributor-dbricksapp2" {
|
||||
scope = azurerm_storage_account.saccount.id
|
||||
role_definition_name = "Storage Blob Data Contributor"
|
||||
principal_id = var.dbricks_app_registration_principal_id
|
||||
}
|
||||
|
||||
|
||||
###### EXTRA ASSIGN ROLE #######
|
||||
|
||||
resource "azurerm_role_assignment" "machine_role_assignment" {
|
||||
|
||||
count = var.principal_id_storage_blob_contributor != null? 1 : 0
|
||||
|
||||
scope = azurerm_storage_account.saccount.id
|
||||
role_definition_name = "Storage Blob Data Contributor"
|
||||
principal_id = var.principal_id_storage_blob_contributor
|
||||
}
|
||||
35
adls/outputs.tf
Normal file
35
adls/outputs.tf
Normal file
@@ -0,0 +1,35 @@
|
||||
output "StorageAccount-Scope" {
|
||||
value = azurerm_storage_account.saccount.id
|
||||
}
|
||||
|
||||
output "StorageAccount-AccessKey" {
|
||||
value = nonsensitive(azurerm_storage_account.saccount.primary_access_key)
|
||||
}
|
||||
|
||||
output "StorageAccount-ConnectionString" {
|
||||
value = nonsensitive(azurerm_storage_account.saccount.primary_connection_string)
|
||||
}
|
||||
|
||||
output "StorageAccount-Name" {
|
||||
value = azurerm_storage_account.saccount.name
|
||||
}
|
||||
|
||||
output "StorageAccount-ContainerName" {
|
||||
value = azurerm_storage_container.scontainer.name
|
||||
}
|
||||
|
||||
output "StorageAccount-ContainerId" {
|
||||
value = azurerm_storage_container.scontainer.id
|
||||
}
|
||||
|
||||
output "Azure_Active_Directory_Tenant_ID" {
|
||||
value = "c21eeb5f-f5a6-44e8-a997-124f2f7a497c"
|
||||
}
|
||||
|
||||
output "Azure_Application_Registration_Client_ID" {
|
||||
value = var.dbricks_app_registration_application_id
|
||||
}
|
||||
|
||||
output "Azure_Application_Registration_Secret" {
|
||||
value = "i3F8Q~FxhoyOP1-4r9sstaohnjxXaf~ulhVJFav_"
|
||||
}
|
||||
46
adls/variable.tf
Normal file
46
adls/variable.tf
Normal file
@@ -0,0 +1,46 @@
|
||||
variable "resource_group_name" {
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
description = "The Azure Region in which the resources in this example should exist"
|
||||
default = "East US"
|
||||
}
|
||||
|
||||
variable "storage_account_name" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "container_name" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "tags" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "tpm_app_registration_principal_id" {
|
||||
description = "tpm"
|
||||
default = "163a72e3-8ce3-4e33-baae-954383f87e3e"
|
||||
}
|
||||
|
||||
variable "dbricks_app_registration_principal_id" {
|
||||
description = "databricks-qmi"
|
||||
default = "efeee17c-d2b3-4e7c-a163-9995b7d281e2"
|
||||
}
|
||||
|
||||
variable "dbricks_app_registration_application_id" {
|
||||
description = "databricks-qmi"
|
||||
default = "9ccb0d99-3bba-4695-aa47-df77bf512084"
|
||||
}
|
||||
|
||||
variable "principal_id_storage_blob_contributor" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "sa_config_type" {
|
||||
default = "1"
|
||||
}
|
||||
|
||||
variable "account_replication_type" {
|
||||
default = null
|
||||
}
|
||||
23
appgateways/appgw-443-only/logs.tf
Normal file
23
appgateways/appgw-443-only/logs.tf
Normal file
@@ -0,0 +1,23 @@
|
||||
resource "azurerm_monitor_diagnostic_setting" "example" {
|
||||
|
||||
name = "${local.appgw_name}-${var.provision_id}-diagsettings"
|
||||
target_resource_id = azurerm_application_gateway.qmi-app-gw.id
|
||||
|
||||
log_analytics_workspace_id = var.log_analytics_workspace_id
|
||||
|
||||
enabled_log {
|
||||
category = "ApplicationGatewayAccessLog"
|
||||
|
||||
retention_policy {
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
|
||||
enabled_log {
|
||||
category = "ApplicationGatewayFirewallLog"
|
||||
|
||||
retention_policy {
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -36,6 +30,7 @@ resource "azurerm_public_ip" "appgw-ip" {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,10 +40,16 @@ 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"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
|
||||
sku {
|
||||
@@ -87,8 +88,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 {
|
||||
@@ -153,6 +153,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_https
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_443
|
||||
priority = 1
|
||||
}
|
||||
|
||||
|
||||
@@ -169,6 +170,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_http
|
||||
redirect_configuration_name = local.redirect_configuration_80
|
||||
priority = 2
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,5 +11,5 @@ output "appgw_public_ip" {
|
||||
}
|
||||
|
||||
output "appgw_backend_address_pool_0_id" {
|
||||
value = azurerm_application_gateway.qmi-app-gw.backend_address_pool[0].id
|
||||
value = tolist(azurerm_application_gateway.qmi-app-gw.backend_address_pool).0.id
|
||||
}
|
||||
@@ -38,3 +38,7 @@ variable "user_id" {
|
||||
variable "probe_path" {
|
||||
default = "/"
|
||||
}
|
||||
|
||||
variable "log_analytics_workspace_id" {
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/appgw_rg/providers/Microsoft.OperationalInsights/workspaces/qmi-log-analytics"
|
||||
}
|
||||
|
||||
@@ -5,23 +5,19 @@ resource "azurerm_monitor_diagnostic_setting" "example" {
|
||||
|
||||
log_analytics_workspace_id = var.log_analytics_workspace_id
|
||||
|
||||
log {
|
||||
enabled_log {
|
||||
category = "ApplicationGatewayAccessLog"
|
||||
enabled = true
|
||||
|
||||
retention_policy {
|
||||
enabled = true
|
||||
days = 7
|
||||
}
|
||||
}
|
||||
|
||||
log {
|
||||
enabled_log {
|
||||
category = "ApplicationGatewayFirewallLog"
|
||||
enabled = true
|
||||
|
||||
retention_policy {
|
||||
enabled = true
|
||||
days = 7
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -68,6 +62,7 @@ resource "azurerm_public_ip" "appgw-ip" {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,10 +72,16 @@ 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"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
|
||||
sku {
|
||||
@@ -205,8 +206,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 {
|
||||
@@ -418,6 +418,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_https
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_443
|
||||
priority = 1
|
||||
}
|
||||
|
||||
|
||||
@@ -428,6 +429,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_8443
|
||||
backend_address_pool_name = local.backend_address_pool_qdc
|
||||
backend_http_settings_name = local.http_setting_name_8443
|
||||
priority = 2
|
||||
}
|
||||
|
||||
# NPrinting routing rules
|
||||
@@ -437,6 +439,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4993
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4993
|
||||
priority = 3
|
||||
}
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_4994
|
||||
@@ -444,6 +447,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4994
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4994
|
||||
priority = 4
|
||||
}
|
||||
|
||||
|
||||
@@ -453,6 +457,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4552
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4552
|
||||
priority = 5
|
||||
}
|
||||
|
||||
|
||||
@@ -463,6 +468,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4435
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4435
|
||||
priority = 6
|
||||
}
|
||||
|
||||
|
||||
@@ -479,6 +485,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_http
|
||||
redirect_configuration_name = local.redirect_configuration_80
|
||||
priority = 7
|
||||
}
|
||||
|
||||
# Redirect QDC 8080 to 8443
|
||||
@@ -494,6 +501,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_8080
|
||||
redirect_configuration_name = local.redirect_configuration_8080
|
||||
priority = 8
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ variable "app_gw_subnet" {
|
||||
}
|
||||
|
||||
variable "log_analytics_workspace_id" {
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourcegroups/appgw_rg/providers/microsoft.operationalinsights/workspaces/qmi-log-analytics"
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/appgw_rg/providers/Microsoft.OperationalInsights/workspaces/qmi-log-analytics"
|
||||
}
|
||||
|
||||
variable "cert_name" {
|
||||
|
||||
@@ -5,23 +5,19 @@ resource "azurerm_monitor_diagnostic_setting" "example" {
|
||||
|
||||
log_analytics_workspace_id = var.log_analytics_workspace_id
|
||||
|
||||
log {
|
||||
enabled_log {
|
||||
category = "ApplicationGatewayAccessLog"
|
||||
enabled = true
|
||||
|
||||
retention_policy {
|
||||
enabled = true
|
||||
days = 7
|
||||
}
|
||||
}
|
||||
|
||||
log {
|
||||
enabled_log {
|
||||
category = "ApplicationGatewayFirewallLog"
|
||||
enabled = true
|
||||
|
||||
retention_policy {
|
||||
enabled = true
|
||||
days = 7
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -60,6 +54,7 @@ resource "azurerm_public_ip" "appgw-ip" {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
|
||||
}
|
||||
@@ -70,10 +65,16 @@ 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"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
|
||||
sku {
|
||||
@@ -189,8 +190,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 {
|
||||
@@ -359,6 +359,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_https
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_443
|
||||
priority = 1
|
||||
}
|
||||
|
||||
|
||||
@@ -369,6 +370,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_8443
|
||||
backend_address_pool_name = local.backend_address_pool_qdc
|
||||
backend_http_settings_name = local.http_setting_name_8443
|
||||
priority = 2
|
||||
}
|
||||
|
||||
# NPrinting routing rules
|
||||
@@ -378,6 +380,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4993
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4993
|
||||
priority = 3
|
||||
}
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_4994
|
||||
@@ -385,6 +388,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4994
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4994
|
||||
priority = 4
|
||||
}
|
||||
|
||||
# QIB routing rule
|
||||
@@ -394,6 +398,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4435
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4435
|
||||
priority = 5
|
||||
}
|
||||
|
||||
|
||||
@@ -410,6 +415,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_http
|
||||
redirect_configuration_name = local.redirect_configuration_80
|
||||
priority = 6
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,444 +0,0 @@
|
||||
locals {
|
||||
appgw_hostname = "${var.appgw_hostname}.${var.domain}"
|
||||
appgw_name = "qmi-appgw-qdc-qs"
|
||||
|
||||
# Qlik Sense
|
||||
backend_address_pool_qs = "${var.appgw_hostname}-qs-bp"
|
||||
http_setting_name_443 = "${var.appgw_hostname}-http-setting"
|
||||
listener_name_http = "${var.appgw_hostname}-http"
|
||||
listener_name_https = "${var.appgw_hostname}-https"
|
||||
qs_probe_name = "${var.appgw_hostname}-probe"
|
||||
request_routing_rule_https = "${var.appgw_hostname}-https-rule"
|
||||
request_routing_rule_http = "${var.appgw_hostname}-http-rule"
|
||||
redirect_configuration_80 = "${var.appgw_hostname}-80redirect"
|
||||
|
||||
# NPrinting
|
||||
http_setting_name_4993 = "${var.appgw_hostname}-4993-setting"
|
||||
http_setting_name_4994 = "${var.appgw_hostname}-4994-setting"
|
||||
listener_name_4993 = "${var.appgw_hostname}-4993"
|
||||
listener_name_4994 = "${var.appgw_hostname}-4994"
|
||||
request_routing_rule_4993 = "${var.appgw_hostname}-4993-rule"
|
||||
request_routing_rule_4994 = "${var.appgw_hostname}-4994-rule"
|
||||
|
||||
|
||||
# QIB
|
||||
http_setting_name_4435 = "${var.appgw_hostname}-4435-setting"
|
||||
qs_probe_name_4435 = "${var.appgw_hostname}-probe-4435"
|
||||
listener_name_4435 = "${var.appgw_hostname}-4435"
|
||||
request_routing_rule_4435 = "${var.appgw_hostname}-4435-rule"
|
||||
|
||||
|
||||
# QDC
|
||||
backend_address_pool_qdc = "${var.appgw_hostname}-qdc-bp"
|
||||
http_setting_name_8443 = "${var.appgw_hostname}-8443-setting"
|
||||
qdc_probe_name = "${var.appgw_hostname}-qdcprobe"
|
||||
listener_name_8080 = "${var.appgw_hostname}-8080"
|
||||
listener_name_8443 = "${var.appgw_hostname}-8443"
|
||||
request_routing_rule_8443 = "${var.appgw_hostname}-8443-rule"
|
||||
request_routing_rule_8080 = "${var.appgw_hostname}-8080-rule"
|
||||
redirect_configuration_8080 = "${var.appgw_hostname}-8080redirect"
|
||||
|
||||
}
|
||||
|
||||
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"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
resource "azurerm_public_ip" "appgw-ip" {
|
||||
|
||||
name = "${local.appgw_name}-ip-${var.provision_id}"
|
||||
resource_group_name = var.app_gw_rg
|
||||
sku = "Standard"
|
||||
location = var.location
|
||||
allocation_method = "Static"
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
|
||||
name = "${local.appgw_name}-${var.provision_id}"
|
||||
resource_group_name = var.app_gw_rg
|
||||
location = var.location
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
|
||||
sku {
|
||||
name = "WAF_v2"
|
||||
tier = "WAF_v2"
|
||||
capacity = 1
|
||||
}
|
||||
|
||||
gateway_ip_configuration {
|
||||
name = "app-gw-subnet"
|
||||
subnet_id = var.app_gw_subnet
|
||||
}
|
||||
|
||||
waf_configuration {
|
||||
enabled = true
|
||||
firewall_mode = "Prevention"
|
||||
rule_set_type = "OWASP"
|
||||
rule_set_version = "3.0"
|
||||
file_upload_limit_mb = "500"
|
||||
|
||||
exclusion {
|
||||
match_variable = "RequestCookieNames"
|
||||
selector_match_operator = "Equals"
|
||||
selector = "qvla_invite"
|
||||
}
|
||||
|
||||
exclusion {
|
||||
match_variable = "RequestCookieNames"
|
||||
selector_match_operator = "Contains"
|
||||
selector = "parsely"
|
||||
}
|
||||
|
||||
exclusion {
|
||||
match_variable = "RequestCookieNames"
|
||||
selector_match_operator = "Contains"
|
||||
selector = "mixpanel"
|
||||
}
|
||||
|
||||
exclusion {
|
||||
match_variable = "RequestCookieNames"
|
||||
selector_match_operator = "Contains"
|
||||
selector = "optimizely"
|
||||
}
|
||||
|
||||
exclusion {
|
||||
match_variable = "RequestArgNames"
|
||||
selector_match_operator = "Equals"
|
||||
selector = "reloadUri"
|
||||
}
|
||||
|
||||
exclusion {
|
||||
match_variable = "RequestCookieNames"
|
||||
selector_match_operator = "Contains"
|
||||
selector = "NPWEBCONSOLE"
|
||||
}
|
||||
|
||||
exclusion {
|
||||
match_variable = "RequestCookieNames"
|
||||
selector_match_operator = "Contains"
|
||||
selector = "NPNEWSSTAND"
|
||||
}
|
||||
|
||||
exclusion {
|
||||
match_variable = "RequestCookieNames"
|
||||
selector_match_operator = "Contains"
|
||||
selector = "Vizlib"
|
||||
}
|
||||
|
||||
# This is needed for NPrinting
|
||||
/*disabled_rule_group {
|
||||
rule_group_name = "REQUEST-920-PROTOCOL-ENFORCEMENT"
|
||||
rules = ["920270", "920271"]
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
# Qlik Sense fe ports
|
||||
frontend_port {
|
||||
name = "443"
|
||||
port = 443
|
||||
}
|
||||
frontend_port {
|
||||
name = "80"
|
||||
port = 80
|
||||
}
|
||||
|
||||
# NPrinting fe ports
|
||||
frontend_port {
|
||||
name = "4993"
|
||||
port = 4993
|
||||
}
|
||||
frontend_port {
|
||||
name = "4994"
|
||||
port = 4994
|
||||
}
|
||||
|
||||
# QIB fe ports
|
||||
frontend_port {
|
||||
name = "4435"
|
||||
port = 4435
|
||||
}
|
||||
|
||||
# QDC fe ports
|
||||
frontend_port {
|
||||
name = "8443"
|
||||
port = 8443
|
||||
}
|
||||
frontend_port {
|
||||
name = "8080"
|
||||
port = 8080
|
||||
}
|
||||
|
||||
frontend_ip_configuration {
|
||||
name = "app-gw-front-end-ip-config"
|
||||
public_ip_address_id = azurerm_public_ip.appgw-ip.id
|
||||
}
|
||||
|
||||
ssl_certificate {
|
||||
name = var.cert_name
|
||||
password = data.azurerm_key_vault_secret.cert-password.value
|
||||
data = data.azurerm_key_vault_secret.cert-data.value
|
||||
}
|
||||
|
||||
ssl_policy {
|
||||
policy_type = "Predefined"
|
||||
policy_name = "AppGwSslPolicy20170401"
|
||||
}
|
||||
|
||||
|
||||
# Backend pool for QS, QIB and NP
|
||||
backend_address_pool {
|
||||
name = local.backend_address_pool_qs
|
||||
}
|
||||
|
||||
# Backend pool for QDC
|
||||
backend_address_pool {
|
||||
name = local.backend_address_pool_qdc
|
||||
}
|
||||
|
||||
|
||||
# Qlik Sense
|
||||
backend_http_settings {
|
||||
name = local.http_setting_name_443
|
||||
cookie_based_affinity = "Disabled"
|
||||
port = 443
|
||||
protocol = "Https"
|
||||
request_timeout = 7600
|
||||
probe_name = local.qs_probe_name
|
||||
}
|
||||
|
||||
# NPrinting
|
||||
backend_http_settings {
|
||||
name = local.http_setting_name_4993
|
||||
cookie_based_affinity = "Disabled"
|
||||
port = 4993
|
||||
protocol = "Https"
|
||||
request_timeout = 7600
|
||||
probe_name = local.qs_probe_name
|
||||
}
|
||||
backend_http_settings {
|
||||
name = local.http_setting_name_4994
|
||||
cookie_based_affinity = "Disabled"
|
||||
port = 4994
|
||||
protocol = "Https"
|
||||
request_timeout = 7600
|
||||
probe_name = local.qs_probe_name
|
||||
}
|
||||
|
||||
# QIB
|
||||
backend_http_settings {
|
||||
name = local.http_setting_name_4435
|
||||
cookie_based_affinity = "Disabled"
|
||||
port = 4435
|
||||
protocol = "Https"
|
||||
request_timeout = 7600
|
||||
probe_name = local.qs_probe_name_4435
|
||||
}
|
||||
|
||||
# QDC
|
||||
backend_http_settings {
|
||||
name = local.http_setting_name_8443
|
||||
cookie_based_affinity = "Disabled"
|
||||
port = 8080
|
||||
protocol = "Http"
|
||||
request_timeout = 7600
|
||||
probe_name = local.qdc_probe_name
|
||||
}
|
||||
|
||||
# QS Prob
|
||||
probe {
|
||||
name = local.qs_probe_name
|
||||
protocol = "Https"
|
||||
host = local.appgw_hostname
|
||||
interval = 30
|
||||
path = "/"
|
||||
timeout = 30
|
||||
unhealthy_threshold = 3
|
||||
}
|
||||
|
||||
# QDC Prob
|
||||
probe {
|
||||
name = local.qdc_probe_name
|
||||
protocol = "Http"
|
||||
host = local.appgw_hostname
|
||||
interval = 30
|
||||
path = "/qdc"
|
||||
timeout = 30
|
||||
unhealthy_threshold = 3
|
||||
}
|
||||
|
||||
# QIB Probe
|
||||
probe {
|
||||
name = local.qs_probe_name_4435
|
||||
protocol = "Https"
|
||||
host = local.appgw_hostname
|
||||
interval = 30
|
||||
path = "/"
|
||||
timeout = 30
|
||||
unhealthy_threshold = 3
|
||||
|
||||
match {
|
||||
status_code = ["200-401"]
|
||||
}
|
||||
}
|
||||
|
||||
# Qlik Sense listener
|
||||
http_listener {
|
||||
name = local.listener_name_https
|
||||
host_name = local.appgw_hostname
|
||||
ssl_certificate_name = var.cert_name
|
||||
frontend_ip_configuration_name = "app-gw-front-end-ip-config"
|
||||
frontend_port_name = "443"
|
||||
protocol = "Https"
|
||||
|
||||
}
|
||||
http_listener {
|
||||
name = local.listener_name_http
|
||||
host_name = local.appgw_hostname
|
||||
frontend_ip_configuration_name = "app-gw-front-end-ip-config"
|
||||
frontend_port_name = "80"
|
||||
protocol = "Http"
|
||||
}
|
||||
|
||||
# NPrinting listeners
|
||||
http_listener {
|
||||
name = local.listener_name_4993
|
||||
ssl_certificate_name = var.cert_name
|
||||
host_name = local.appgw_hostname
|
||||
frontend_ip_configuration_name = "app-gw-front-end-ip-config"
|
||||
frontend_port_name = "4993"
|
||||
protocol = "Https"
|
||||
}
|
||||
http_listener {
|
||||
name = local.listener_name_4994
|
||||
ssl_certificate_name = var.cert_name
|
||||
host_name = local.appgw_hostname
|
||||
frontend_ip_configuration_name = "app-gw-front-end-ip-config"
|
||||
frontend_port_name = "4994"
|
||||
protocol = "Https"
|
||||
}
|
||||
|
||||
# QIB listener
|
||||
http_listener {
|
||||
name = local.listener_name_4435
|
||||
ssl_certificate_name = var.cert_name
|
||||
frontend_ip_configuration_name = "app-gw-front-end-ip-config"
|
||||
frontend_port_name = "4435"
|
||||
protocol = "Https"
|
||||
|
||||
}
|
||||
|
||||
# QDC listeners
|
||||
http_listener {
|
||||
name = local.listener_name_8443
|
||||
ssl_certificate_name = var.cert_name
|
||||
host_name = local.appgw_hostname
|
||||
frontend_ip_configuration_name = "app-gw-front-end-ip-config"
|
||||
frontend_port_name = "8443"
|
||||
protocol = "Https"
|
||||
|
||||
}
|
||||
http_listener {
|
||||
name = local.listener_name_8080
|
||||
host_name = local.appgw_hostname
|
||||
frontend_ip_configuration_name = "app-gw-front-end-ip-config"
|
||||
frontend_port_name = "8080"
|
||||
protocol = "Http"
|
||||
}
|
||||
|
||||
# Qlik Sense routing rules
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_https
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_https
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_443
|
||||
}
|
||||
|
||||
|
||||
# QDC routing rules
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_8443
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_8443
|
||||
backend_address_pool_name = local.backend_address_pool_qdc
|
||||
backend_http_settings_name = local.http_setting_name_8443
|
||||
}
|
||||
|
||||
# NPrinting routing rules
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_4993
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_4993
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4993
|
||||
}
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_4994
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_4994
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4994
|
||||
}
|
||||
|
||||
# QIB routing rule
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_4435
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_4435
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4435
|
||||
}
|
||||
|
||||
|
||||
# Redirect QS 80 to 443
|
||||
redirect_configuration {
|
||||
name = local.redirect_configuration_80
|
||||
target_listener_name = local.listener_name_https
|
||||
redirect_type = "Permanent"
|
||||
include_path = true
|
||||
include_query_string = true
|
||||
}
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_http
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_http
|
||||
redirect_configuration_name = local.redirect_configuration_80
|
||||
}
|
||||
|
||||
# Redirect QDC 8080 to 8443
|
||||
redirect_configuration {
|
||||
name = local.redirect_configuration_8080
|
||||
target_listener_name = local.listener_name_8443
|
||||
redirect_type = "Permanent"
|
||||
include_path = true
|
||||
include_query_string = true
|
||||
}
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_8080
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_8080
|
||||
redirect_configuration_name = local.redirect_configuration_8080
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,10 +10,14 @@ output "appgw_public_ip" {
|
||||
value = azurerm_public_ip.appgw-ip.ip_address
|
||||
}
|
||||
|
||||
locals {
|
||||
backend_pools = tolist(azurerm_application_gateway.qmi-app-gw.backend_address_pool)
|
||||
}
|
||||
|
||||
output "appgw_backend_address_pool_0_id" {
|
||||
value = azurerm_application_gateway.qmi-app-gw.backend_address_pool[0].id
|
||||
value = local.backend_pools[index(local.backend_pools.*.name, "${var.appgw_hostname}-qs-bp")].id
|
||||
}
|
||||
|
||||
output "appgw_backend_address_pool_1_id" {
|
||||
value = azurerm_application_gateway.qmi-app-gw.backend_address_pool[1].id
|
||||
value = local.backend_pools[index(local.backend_pools.*.name, "${var.appgw_hostname}-qdc-bp")].id
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ variable "app_gw_subnet" {
|
||||
}
|
||||
|
||||
variable "log_analytics_workspace_id" {
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourcegroups/appgw_rg/providers/microsoft.operationalinsights/workspaces/qmi-log-analytics"
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/appgw_rg/providers/Microsoft.OperationalInsights/workspaces/qmi-log-analytics"
|
||||
}
|
||||
|
||||
variable "cert_name" {
|
||||
|
||||
@@ -5,23 +5,19 @@ resource "azurerm_monitor_diagnostic_setting" "example" {
|
||||
|
||||
log_analytics_workspace_id = var.log_analytics_workspace_id
|
||||
|
||||
log {
|
||||
enabled_log {
|
||||
category = "ApplicationGatewayAccessLog"
|
||||
enabled = true
|
||||
|
||||
retention_policy {
|
||||
enabled = true
|
||||
days = 7
|
||||
}
|
||||
}
|
||||
|
||||
log {
|
||||
enabled_log {
|
||||
category = "ApplicationGatewayFirewallLog"
|
||||
enabled = true
|
||||
|
||||
retention_policy {
|
||||
enabled = true
|
||||
days = 7
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -34,6 +28,7 @@ resource "azurerm_public_ip" "appgw-ip" {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,10 +38,16 @@ 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"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
|
||||
sku {
|
||||
@@ -80,8 +81,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 {
|
||||
@@ -129,6 +129,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_8443
|
||||
backend_address_pool_name = local.backend_address_pool_qdc
|
||||
backend_http_settings_name = local.http_setting_name_8443
|
||||
priority = 1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
|
||||
locals {
|
||||
appgw_hostname = "${var.appgw_hostname}.${var.domain}"
|
||||
appgw_name = "qmi-appgw-qdc"
|
||||
|
||||
backend_address_pool_qdc = "${var.appgw_hostname}-qdc-bp"
|
||||
http_setting_name_8443 = "${var.appgw_hostname}-8443-setting"
|
||||
qdc_probe_name = "${var.appgw_hostname}-qdcprobe"
|
||||
listener_name_8080 = "${var.appgw_hostname}-8080"
|
||||
listener_name_8443 = "${var.appgw_hostname}-8443"
|
||||
request_routing_rule_https = "${var.appgw_hostname}-https-rule"
|
||||
request_routing_rule_8443 = "${var.appgw_hostname}-8443-rule"
|
||||
redirect_configuration_8080 = "${var.appgw_hostname}-8080redirect"
|
||||
request_routing_rule_8080 = "${var.appgw_hostname}-8080-rule"
|
||||
|
||||
}
|
||||
|
||||
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"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
resource "azurerm_public_ip" "appgw-ip" {
|
||||
|
||||
name = "${local.appgw_name}-ip-${var.provision_id}"
|
||||
resource_group_name = var.app_gw_rg
|
||||
sku = "Standard"
|
||||
location = var.location
|
||||
allocation_method = "Static"
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
|
||||
name = "${local.appgw_name}-${var.provision_id}"
|
||||
resource_group_name = var.app_gw_rg
|
||||
location = var.location
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
}
|
||||
|
||||
sku {
|
||||
name = "WAF_v2"
|
||||
tier = "WAF_v2"
|
||||
capacity = 1
|
||||
}
|
||||
|
||||
waf_configuration {
|
||||
enabled = true
|
||||
firewall_mode = "Prevention"
|
||||
rule_set_type = "OWASP"
|
||||
rule_set_version = "3.0"
|
||||
|
||||
}
|
||||
|
||||
gateway_ip_configuration {
|
||||
name = "app-gw-subnet"
|
||||
subnet_id = var.app_gw_subnet
|
||||
}
|
||||
|
||||
frontend_port {
|
||||
name = "8443"
|
||||
port = 8443
|
||||
}
|
||||
|
||||
frontend_port {
|
||||
name = "8080"
|
||||
port = 8080
|
||||
}
|
||||
|
||||
frontend_ip_configuration {
|
||||
name = "app-gw-front-end-ip-config"
|
||||
public_ip_address_id = azurerm_public_ip.appgw-ip.id
|
||||
}
|
||||
|
||||
ssl_certificate {
|
||||
name = var.cert_name
|
||||
password = data.azurerm_key_vault_secret.cert-password.value
|
||||
data = data.azurerm_key_vault_secret.cert-data.value
|
||||
}
|
||||
|
||||
ssl_policy {
|
||||
policy_type = "Predefined"
|
||||
policy_name = "AppGwSslPolicy20170401"
|
||||
}
|
||||
|
||||
backend_address_pool {
|
||||
name = local.backend_address_pool_qdc
|
||||
}
|
||||
|
||||
backend_http_settings {
|
||||
name = local.http_setting_name_8443
|
||||
cookie_based_affinity = "Disabled"
|
||||
port = 8080
|
||||
protocol = "Http"
|
||||
request_timeout = 7600
|
||||
probe_name = local.qdc_probe_name
|
||||
}
|
||||
|
||||
probe {
|
||||
name = local.qdc_probe_name
|
||||
protocol = "Http"
|
||||
host = local.appgw_hostname
|
||||
interval = 30
|
||||
path = "/qdc"
|
||||
timeout = 30
|
||||
unhealthy_threshold = 3
|
||||
}
|
||||
|
||||
http_listener {
|
||||
name = local.listener_name_8443
|
||||
ssl_certificate_name = var.cert_name
|
||||
host_name = local.appgw_hostname
|
||||
frontend_ip_configuration_name = "app-gw-front-end-ip-config"
|
||||
frontend_port_name = "8443"
|
||||
protocol = "Https"
|
||||
|
||||
}
|
||||
|
||||
http_listener {
|
||||
name = local.listener_name_8080
|
||||
host_name = local.appgw_hostname
|
||||
frontend_ip_configuration_name = "app-gw-front-end-ip-config"
|
||||
frontend_port_name = "8080"
|
||||
protocol = "Http"
|
||||
}
|
||||
|
||||
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_8443
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_8443
|
||||
backend_address_pool_name = local.backend_address_pool_qdc
|
||||
backend_http_settings_name = local.http_setting_name_8443
|
||||
}
|
||||
|
||||
|
||||
redirect_configuration {
|
||||
name = local.redirect_configuration_8080
|
||||
target_listener_name = local.listener_name_8443
|
||||
redirect_type = "Permanent"
|
||||
include_path = true
|
||||
include_query_string = true
|
||||
}
|
||||
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_8080
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_8080
|
||||
redirect_configuration_name = local.redirect_configuration_8080
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,6 @@ output "appgw_public_ip" {
|
||||
}
|
||||
|
||||
output "appgw_backend_address_pool_0_id" {
|
||||
value = azurerm_application_gateway.qmi-app-gw.backend_address_pool[0].id
|
||||
value = tolist(azurerm_application_gateway.qmi-app-gw.backend_address_pool).0.id
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ variable "app_gw_subnet" {
|
||||
}
|
||||
|
||||
variable "log_analytics_workspace_id" {
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourcegroups/appgw_rg/providers/microsoft.operationalinsights/workspaces/qmi-log-analytics"
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/appgw_rg/providers/Microsoft.OperationalInsights/workspaces/qmi-log-analytics"
|
||||
}
|
||||
|
||||
variable "cert_name" {
|
||||
|
||||
@@ -5,23 +5,19 @@ resource "azurerm_monitor_diagnostic_setting" "example" {
|
||||
|
||||
log_analytics_workspace_id = var.log_analytics_workspace_id
|
||||
|
||||
log {
|
||||
enabled_log {
|
||||
category = "ApplicationGatewayAccessLog"
|
||||
enabled = true
|
||||
|
||||
retention_policy {
|
||||
enabled = true
|
||||
days = 7
|
||||
}
|
||||
}
|
||||
|
||||
log {
|
||||
enabled_log {
|
||||
category = "ApplicationGatewayFirewallLog"
|
||||
enabled = true
|
||||
|
||||
retention_policy {
|
||||
enabled = true
|
||||
days = 7
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -58,6 +52,7 @@ resource "azurerm_public_ip" "appgw-ip" {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,10 +62,16 @@ 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"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
|
||||
sku {
|
||||
@@ -186,8 +187,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 +272,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
unhealthy_threshold = 3
|
||||
|
||||
match {
|
||||
body = null
|
||||
status_code = ["200-401"]
|
||||
}
|
||||
}
|
||||
@@ -339,6 +340,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_https
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_443
|
||||
priority = 1
|
||||
}
|
||||
|
||||
|
||||
@@ -349,6 +351,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4993
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4993
|
||||
priority = 2
|
||||
}
|
||||
request_routing_rule {
|
||||
name = local.request_routing_rule_4994
|
||||
@@ -356,6 +359,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4994
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4994
|
||||
priority = 3
|
||||
}
|
||||
|
||||
# QIB routing rule (needs QIB using qmi.qlik-poc.com certs)
|
||||
@@ -365,6 +369,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4435
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4435
|
||||
priority = 4
|
||||
}
|
||||
|
||||
# Qlik Alerting routing rule (needs Qlik Alerting using qmi.qlik-poc.com certs)
|
||||
@@ -374,6 +379,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
http_listener_name = local.listener_name_4552
|
||||
backend_address_pool_name = local.backend_address_pool_qs
|
||||
backend_http_settings_name = local.http_setting_name_4552
|
||||
priority = 5
|
||||
}
|
||||
|
||||
|
||||
@@ -390,6 +396,7 @@ resource "azurerm_application_gateway" "qmi-app-gw" {
|
||||
rule_type = "Basic"
|
||||
http_listener_name = local.listener_name_http
|
||||
redirect_configuration_name = local.redirect_configuration_80
|
||||
priority = 6
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,5 +11,5 @@ output "appgw_public_ip" {
|
||||
}
|
||||
|
||||
output "appgw_backend_address_pool_0_id" {
|
||||
value = azurerm_application_gateway.qmi-app-gw.backend_address_pool[0].id
|
||||
value = tolist(azurerm_application_gateway.qmi-app-gw.backend_address_pool).0.id
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ variable "app_gw_subnet" {
|
||||
}
|
||||
|
||||
variable "log_analytics_workspace_id" {
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourcegroups/appgw_rg/providers/microsoft.operationalinsights/workspaces/qmi-log-analytics"
|
||||
default = "/subscriptions/62ebff8f-c40b-41be-9239-252d6c0c8ad9/resourceGroups/appgw_rg/providers/Microsoft.OperationalInsights/workspaces/qmi-log-analytics"
|
||||
}
|
||||
|
||||
variable "cert_name" {
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
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.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
|
||||
notrename = (var.notrename != null)? "-NotApply" : ""
|
||||
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"
|
||||
}
|
||||
|
||||
resource "azurerm_managed_disk" "copy" {
|
||||
|
||||
name = "Disk-${var.prefix}-${random_id.randomMachineId.hex}"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
storage_account_type = "Premium_LRS"
|
||||
create_option = "Import"
|
||||
storage_account_id = local.storage_account_id
|
||||
source_uri = var.snapshot_id
|
||||
|
||||
disk_size_gb = var.disk_size_gb
|
||||
|
||||
tags = {
|
||||
"Deployment" = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
"QMI_user" = var.user_id != null? var.user_id : null
|
||||
}
|
||||
}
|
||||
|
||||
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_virtual_machine" "vm" {
|
||||
name = local.virtual_machine_name
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
network_interface_ids = [ module.qmi-nic.id ]
|
||||
vm_size = var.vm_type
|
||||
|
||||
|
||||
storage_os_disk {
|
||||
name = azurerm_managed_disk.copy.name
|
||||
os_type = "Windows"
|
||||
managed_disk_id = azurerm_managed_disk.copy.id
|
||||
managed_disk_type = "Premium_LRS"
|
||||
create_option = "Attach"
|
||||
}
|
||||
|
||||
os_profile_windows_config {
|
||||
|
||||
provision_vm_agent = true
|
||||
enable_automatic_upgrades = false
|
||||
|
||||
winrm {
|
||||
protocol = "http"
|
||||
}
|
||||
}
|
||||
|
||||
identity {
|
||||
type = "SystemAssigned"
|
||||
}
|
||||
|
||||
/*os_profile {
|
||||
computer_name = local.virtual_machine_name
|
||||
admin_username = local.admin_username
|
||||
}*/
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resource "null_resource" "post-vm-fromsnapshot-win" {
|
||||
|
||||
count = var.initial_password != null? 1 : 0
|
||||
|
||||
depends_on = [
|
||||
azurerm_virtual_machine.vm
|
||||
]
|
||||
|
||||
provisioner "file" {
|
||||
connection {
|
||||
type = "winrm"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = local.admin_username
|
||||
password = var.initial_password
|
||||
port = 5985
|
||||
https = false
|
||||
timeout = "10m"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
destination = "C:/tmp/provision"
|
||||
}
|
||||
|
||||
|
||||
provisioner "remote-exec" {
|
||||
connection {
|
||||
type = "winrm"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = local.admin_username
|
||||
password = var.initial_password
|
||||
port = 5985
|
||||
https = false
|
||||
timeout = "10m"
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/tmp/provision/bootstrap.ps1",
|
||||
"powershell.exe -File C:/tmp/provision/password.ps1 -Username ${local.admin_username} -Pass ${local.admin_password}"
|
||||
]
|
||||
}
|
||||
|
||||
# Rename Computer
|
||||
provisioner "remote-exec" {
|
||||
connection {
|
||||
type = "winrm"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = local.admin_username
|
||||
password = local.admin_password
|
||||
port = 5985
|
||||
https = false
|
||||
timeout = "10m"
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/tmp/provision/RenameComputer.ps1 -NewName ${local.virtual_machine_name} ${local.notrename}"
|
||||
]
|
||||
|
||||
on_failure = continue
|
||||
}
|
||||
|
||||
provisioner "local-exec" {
|
||||
command = "sleep 30"
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
Param(
|
||||
[string] $NewName,
|
||||
[switch] $NotApply = $False
|
||||
)
|
||||
|
||||
|
||||
|
||||
if ($NotApply){
|
||||
Write-Host "Not renaming machine"
|
||||
} else {
|
||||
Write-Host "Machine is going to be renamed as $NewName"
|
||||
Rename-Computer -NewName $NewName -PassThru -Force -Restart
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
Param(
|
||||
[string] $Username,
|
||||
[string] $Pass
|
||||
)
|
||||
|
||||
Import-Module "Carbon"
|
||||
|
||||
$secpasswd = ConvertTo-SecureString $Pass -AsPlainText -Force
|
||||
$cred = New-Object System.Management.Automation.PSCredential ($Username, $secpasswd)
|
||||
|
||||
Install-User -Credential $cred
|
||||
Write-Log "Done! Setting new password to user $Username"
|
||||
@@ -1,29 +0,0 @@
|
||||
Write-Log "Starting q-user-setup.ps1"
|
||||
|
||||
Trap {
|
||||
Write-Log -Message $_.Exception.Message -Severity "Error"
|
||||
Break
|
||||
}
|
||||
|
||||
### Install Carbon PowerShell Module
|
||||
Write-Log -Message "Installing carbon"
|
||||
choco install carbon -y | Out-Null
|
||||
Import-Module "Carbon"
|
||||
|
||||
### create Qlik User
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-MyCredential -user "Qlik" -pass "Qlik1234"
|
||||
Install-User -Credential $cred
|
||||
|
||||
### Grant Remote Admin Rights to Qlik User
|
||||
Write-Log -Message "Granting Qlik account Remote Interactive Logon Right"
|
||||
Grant-Privilege -Identity $env:COMPUTERNAME\qlik -Privilege SeRemoteInteractiveLogonRight
|
||||
|
||||
Write-Log -Message "Adding Qlik user to Remote Desktop Users"
|
||||
Add-GroupMember -Name 'Remote Desktop Users' -Member $env:COMPUTERNAME\qlik
|
||||
|
||||
Write-Log -Message "Adding Qlik user to local Administrators"
|
||||
Add-GroupMember -Name 'Administrators' -Member $env:COMPUTERNAME\qlik
|
||||
|
||||
$regPath = "HKLM:\SYSTEM\CurrentControlSet\Control"
|
||||
Set-ItemProperty $regPath -Name "ServicesPipeTimeout" -Type DWord -Value 180000
|
||||
@@ -1,150 +0,0 @@
|
||||
Param(
|
||||
[string] $QDC_HOST = "QMI-QDC-SN",
|
||||
[string] $QDC_PUBLIC_HOST
|
||||
)
|
||||
|
||||
function New-Credential($u,$p) {
|
||||
$secpasswd = ConvertTo-SecureString $p -AsPlainText -Force
|
||||
return New-Object System.Management.Automation.PSCredential ($u, $secpasswd)
|
||||
}
|
||||
|
||||
Write-Log -Message "Setting up QDC pre-requisites in Qlik Sense"
|
||||
|
||||
Import-Module Qlik-Cli
|
||||
|
||||
### Connect to the Qlik Sense Repository Service with Qlik-Cli
|
||||
do {write-log -Message "Connecting to Qlik Sense Repository..."; start-sleep 15}
|
||||
While( (Connect-Qlik $($env:COMPUTERNAME) -TrustAllCerts -UseDefaultCredentials -ErrorAction SilentlyContinue).length -eq 0 )
|
||||
|
||||
#-----------
|
||||
|
||||
# Load variables
|
||||
. $PSScriptRoot\qdc-scenario-config.ps1
|
||||
|
||||
Write-Log -Message "Creating QDC virtual proxy"
|
||||
$jwtcert = Get-Content -raw 'C:\ProgramData\Qlik\Sense\Repository\Exported Certificates\.Local Certificates\server.pem'
|
||||
New-QlikVirtualProxy -description "Qlik Data Catalyst" -sessionCookieHeaderName "X-Qlik-QDC-Session" -authenticationMethod JWT `
|
||||
-prefix qdc -loadBalancingServerNodes $(Get-QlikNode -filter "name eq 'Central'").id `
|
||||
-jwtAttributeUserDirectory "[QLIK-EXTERNAL-SERVICE]" -jwtAttributeUserId "name" -jwtPublicKeyCertificate $jwtcert -websocketCrossOriginWhiteList $QDC_PUBLIC_HOST | Out-Null
|
||||
|
||||
Add-QlikProxy -ProxyId $(Get-QlikProxy -filter "serverNodeConfiguration.hostName eq '$($env:COMPUTERNAME)'").id -VirtualProxyId $(Get-QlikVirtualProxy -filter "description eq 'Qlik Data Catalyst'").id | Out-Null
|
||||
|
||||
Start-Sleep -s 10
|
||||
|
||||
Write-Log -Message "Downloading qdc_proxy_artifacts - This will create 'qlik-data-catalyst' qliksense user"
|
||||
Write-Log -Message "PROXY_ARTIFACTS = $PROXY_ARTIFACTS"
|
||||
|
||||
$ENV:PATH += ";C:\Program Files\Qlik\Sense\ServiceDispatcher\Node"
|
||||
cd $env:TEMP
|
||||
(New-Object System.Net.WebClient).DownloadFile($PROXY_ARTIFACTS, "$env:TEMP\qdc_proxy_artifacts.zip")
|
||||
#Invoke-WebRequest -UseBasicParsing -OutFile qdc_proxy_artifacts.zip -Uri $PROXY_ARTIFACTS
|
||||
Expand-Archive .\qdc_proxy_artifacts.zip .
|
||||
cd qs-virtual-proxy
|
||||
(Get-Content .\check-proxy.js).replace("ducks-sense1.ad.podiumdata.net", "$($env:COMPUTERNAME)") | Set-Content .\check-proxy.js
|
||||
Copy-Item "C:\ProgramData\Qlik\Sense\Repository\Exported Certificates\.Local Certificates\qdc.jwt" .
|
||||
|
||||
ls
|
||||
|
||||
Get-QlikUser
|
||||
|
||||
node .\check-proxy.js
|
||||
|
||||
Get-QlikUser -filter "name eq 'qlik-data-catalyst'"
|
||||
|
||||
Write-Log -Message "Waiting 20 secs"
|
||||
Start-Sleep -s 20
|
||||
|
||||
Write-Log -Message "Set 'qlik-data-catalyst' as AuditAdmin"
|
||||
Update-QlikUser -id $(Get-QlikUser -filter "name eq 'qlik-data-catalyst'").id -roles AuditAdmin | Out-Null
|
||||
|
||||
Write-Log -Message "Creating security rule for access by QLIK-EXTERNAL-SERVICE"
|
||||
New-QlikRule -Name "Security rule for access by QLIK-EXTERNAL-SERVICE" -resourceFilter "DataConnection_*,App_*" `
|
||||
-actions 2 -rule '((user.userDirectory="QLIK-EXTERNAL-SERVICE"))' -rulecontext both -category Security | Out-Null
|
||||
|
||||
|
||||
Write-Log -Message "Adding qvd-mock to service dispatcher"
|
||||
$dir = pwd
|
||||
cd "C:\Program Files\Qlik\Sense"
|
||||
Expand-Archive $dir\qvd-mock.zip .
|
||||
Copy-Item $dir\qvd-mock.json "C:\Program Files\Qlik\Sense\BrokerService\service-configs\"
|
||||
|
||||
$mock=@"
|
||||
|
||||
[qvd-mock]
|
||||
Identity=Qlik.qvd-mock
|
||||
DisplayName=QVD Mock
|
||||
ExePath=Node\node.exe
|
||||
Script=..\qvd-mock\server.js
|
||||
"@
|
||||
|
||||
Add-Content "C:\Program Files\Qlik\Sense\ServiceDispatcher\services.conf" $mock
|
||||
|
||||
Restart-Service QlikSenseServiceDispatcher
|
||||
|
||||
Write-Log -Message "Creating 'QVD Catalog' tag"
|
||||
New-QlikTag -name "QVD Catalog" | Out-Null
|
||||
|
||||
Write-Log -Message "Creating 'c:\QVDs' folder and set SMB"
|
||||
New-Item "C:\QVDs" -type directory | Out-Null
|
||||
New-SMBShare -Name "qvds" -Path "C:\QVDs" | Out-Null
|
||||
Grant-SmbShareAccess -Name qvds -AccountName Everyone -AccessRight Change -Force | Out-Null
|
||||
|
||||
Write-Log -Message "Creating Qlik Sense data connection for C:\QVDs"
|
||||
# ---- Workaround qlik-cli QS April 2020
|
||||
# Qlik CLI New-QlikDataConnection fails with only 1 tag, that's why I create and use FakeTag too.
|
||||
New-QlikTag -name "FakeTag" | Out-Null
|
||||
$qvdsDC = New-QlikDataConnection -connectionstring "\\$($env:COMPUTERNAME)\qvds" -name "QVDs" -tags "QVD Catalog","FakeTag" -type "folder"
|
||||
# ----
|
||||
|
||||
Write-Log -Message "Grant access to all user to this connection"
|
||||
New-QlikRule -name "QVDs allow to all" -comment "Allow QVDs Connection to all users" -category "Security" -resourceFilter "DataConnection_$($qvdsDC.id)" -actions 23 -rule '((user.name like "*"))' | Out-Null
|
||||
|
||||
|
||||
Write-Log -Message "Setting firewall rules for QDC"
|
||||
New-NetFirewallRule -DisplayName "QDC QVD Metadata" -Action allow -LocalPort 7007 -Protocol TCP | Out-Null
|
||||
New-NetFirewallRule -DisplayName "pub2qlik" -Action allow -LocalPort 4243,4747 -Protocol TCP | Out-Null
|
||||
|
||||
# certs needed for qdc
|
||||
Write-Log -Message "SMB Qlik Sense certificates folder"
|
||||
New-SMBShare -Name "certs" -Path "C:\ProgramData\Qlik\Sense\Repository\Exported Certificates\.Local Certificates" | Out-Null
|
||||
Grant-SmbShareAccess -Name certs -AccountName Everyone -AccessRight Read -Force | Out-Null
|
||||
|
||||
|
||||
# create podium user
|
||||
Import-Module "Carbon"
|
||||
Write-Log -Message "Adding 'podium' user to Windows system"
|
||||
$cred = New-Credential "podium" "Qlik1234"
|
||||
Install-User -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
|
||||
#Update-QlikUser -id $(Get-QlikUser -filter "name eq 'podium'").id -roles RootAdmin
|
||||
|
||||
#gci cert:\CurrentUser\My | where {$_.issuer -eq $cert} | Connect-Qlik -Username $env:COMPUTERNAME\podium -Computername $env:COMPUTERNAME
|
||||
|
||||
Write-Log -Message "Creating 'podium_dist' postgres connection"
|
||||
$cred = New-Credential "postgres" "postgres"
|
||||
$podiumDistDC = New-QlikDataConnection -connectionstring "'CUSTOM CONNECT TO `"provider=QvOdbcConnectorPackage.exe;driver=postgres;host=$QDC_HOST;port=5432;db=podium_dist;SSLMode=prefer;UseSystemTrustStore=false;ByteaAsLongVarBinary=0;TextAsLongVarchar=0;UseUnicode=1;FetchTSWTZasTimestamp=1;MaxVarcharSize=262144;UseDeclareFetch=1;Fetch=200;EnableTableTypes=1;MoneyAsDecimal=1;QueryTimeout=30;`"" `
|
||||
-name podium_dist -type 'QvOdbcConnectorPackage.exe' -Credential $cred
|
||||
|
||||
Write-Log -Message "Grant access to all user to this connection"
|
||||
New-QlikRule -name "Podium_Dist allow to all" -comment "Allow Podium_Dist Connection to all users" -category "Security" -resourceFilter "DataConnection_$($podiumDistDC.id)" -actions 23 -rule '((user.name like "*"))' | Out-Null
|
||||
|
||||
|
||||
|
||||
Write-Log "Copy Sample QVDs into C:/QVDs folder"
|
||||
Copy-Item $PSScriptRoot\*.qvd C:\QVDs
|
||||
|
||||
$x=1
|
||||
$files = Get-ChildItem C:\QVDs\*.qvd|sort LastWriteTime
|
||||
foreach ($file in $files) #{ echo $file }
|
||||
{
|
||||
|
||||
if ($x -lt 3) {
|
||||
Set-ItemProperty -Path $file -Name LastWriteTime -Value (get-date)
|
||||
sleep 2
|
||||
}
|
||||
$x= $x +1
|
||||
}
|
||||
|
||||
Write-Log "QDC Config Completed."
|
||||
@@ -1,131 +0,0 @@
|
||||
Param(
|
||||
[string] $ModuleName = "vm-qs"
|
||||
)
|
||||
|
||||
Write-Log "Resize Partition C to max size"
|
||||
$size = Get-PartitionSupportedSize -DriveLetter C
|
||||
Resize-Partition -DriveLetter C -Size $size.SizeMax | Out-Null
|
||||
|
||||
|
||||
# Helper Functions
|
||||
# ----------------
|
||||
function New-Credential($u,$p) {
|
||||
$secpasswd = ConvertTo-SecureString $p -AsPlainText -Force
|
||||
return New-Object System.Management.Automation.PSCredential ($u, $secpasswd)
|
||||
}
|
||||
|
||||
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f
|
||||
|
||||
#Write-Log "Deleting old certificates files..."
|
||||
#Get-ChildItem "$($env:ProgramData)\Qlik\Sense\Repository\Exported Certificates\" | Remove-Item -Recurse
|
||||
|
||||
|
||||
Set-Service -Name "QlikLoggingService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseServiceDispatcher" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseProxyService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseEngineService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSensePrintingService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseSchedulerService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseRepositoryService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseRepositoryDatabase" -StartupType Automatic
|
||||
|
||||
|
||||
Write-Log "Starting QlikSenseRepositoryDatabase and QlikSenseServiceDispatcher..."
|
||||
Start-Service QlikSenseRepositoryDatabase
|
||||
Start-Service QlikSenseServiceDispatcher
|
||||
|
||||
#Delete certificates
|
||||
Write-Log "Deleting old certificates from keyStore..."
|
||||
$Certs = Get-ChildItem cert:"CurrentUser\My"
|
||||
$Certs | ForEach-Object{Remove-Item -path $_.PSPath -recurse -Force}
|
||||
$Certs = Get-ChildItem cert:"LocalMachine\My"
|
||||
$Certs | ForEach-Object{Remove-Item -path $_.PSPath -recurse -Force}
|
||||
$Certs = Get-ChildItem cert:"LocalMachine\Root" | Where-Object { $_.Subject -match 'GEN-QS' -or $_.Subject -match 'QMI-QS' -or $_.Subject -match 'QMI-E2E' }
|
||||
$Certs | ForEach-Object{Remove-Item -path $_.PSPath -recurse -Force}
|
||||
|
||||
Write-Log "Setting new hostname ($($env:computername)) in to Host.cfg file..."
|
||||
$enchostname = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$($env:computername)"))
|
||||
Set-Content -Path C:\ProgramData\Qlik\Sense\Host.cfg -Value $enchostname
|
||||
|
||||
Write-Log "Bootstraping Qlik Sense ..."
|
||||
Write-Log "Executing ... Repository.exe -bootstrap -standalone -restorehostname"
|
||||
$waiting=20
|
||||
if ( $env:USERNAME -eq "qservice" ) {
|
||||
$waiting=50
|
||||
Write-Log "The user executing this script is already 'qservice'"
|
||||
Start-Process powershell.exe -ArgumentList "Start-Process cmd.exe -Verb runAs -ArgumentList '/k C:\PROGRA~1\Qlik\Sense\Repository\Repository.exe -bootstrap -standalone -restorehostname'"
|
||||
|
||||
} else {
|
||||
Write-Log "The user executing this script is NOT 'qservice'"
|
||||
$cred = New-Credential "qservice" "Qlik1234"
|
||||
Start-Process powershell.exe -Credential $cred -ArgumentList "Start-Process cmd.exe -Verb runAs -ArgumentList '/k C:\PROGRA~1\Qlik\Sense\Repository\Repository.exe -bootstrap -standalone -restorehostname'"
|
||||
}
|
||||
|
||||
$waiting=50
|
||||
Write-Log "Waiting $waiting secs ..."
|
||||
Start-Sleep -s $waiting
|
||||
|
||||
Write-Log "Restarting Service Dispatcher"
|
||||
Restart-Service QlikSenseServiceDispatcher -Force
|
||||
|
||||
Start-Sleep -s 20
|
||||
|
||||
Write-Log "New Certs: CurrentUser\My"
|
||||
Get-ChildItem cert:"CurrentUser\My"
|
||||
Write-Log "New Certs: LocalMachine\My"
|
||||
Get-ChildItem cert:"LocalMachine\My"
|
||||
Write-Log "New Certs: LocalMachine\Root"
|
||||
Get-ChildItem cert:"LocalMachine\Root" | Where-Object { $_.Subject -match 'QMI' }
|
||||
$NewCerts = Get-ChildItem cert:"LocalMachine\Root" | Where-Object { $_.Subject -match 'QMI' }
|
||||
|
||||
if ($NewCerts) {
|
||||
Write-Log "Restarting all Qlik Sense services"
|
||||
Restart-Service QlikSenseServiceDispatcher -Force
|
||||
Restart-Service QlikLoggingService -Force
|
||||
Restart-Service QlikSenseRepositoryService -Force
|
||||
Restart-Service QlikSenseProxyService -Force
|
||||
Restart-Service QlikSenseEngineService -Force
|
||||
Restart-Service QlikSenseSchedulerService -Force
|
||||
Restart-Service QlikSensePrintingService -Force
|
||||
|
||||
if ( $ModuleName -ne "vm-qs" ) {
|
||||
Start-Sleep -s 20
|
||||
Write-Log "Recovering Qlik Sense users"
|
||||
Start-Process powershell.exe -ArgumentList "Start-Process cmd.exe -Verb runAs -ArgumentList '/c $PSScriptRoot\qs-reset-users.bat'"
|
||||
Restart-Service QlikSenseRepositoryService -Force
|
||||
}
|
||||
|
||||
} else {
|
||||
Write-Error "Error: Qlik Sense Certs not recreated!"
|
||||
throw "Error: Qlik Sense Certs not recreated!"
|
||||
}
|
||||
|
||||
#### Recreate QS desktop shortcuts
|
||||
Write-Log "Recreate QS desktop shortcuts"
|
||||
$sourcepath="C:\Users\Public\Desktop\Qlik Management Console.lnk"
|
||||
$destination="C:\Users\Public\Desktop\Qlik Management Console2.lnk"
|
||||
Copy-Item $sourcepath $destination ## Get the lnk we want to use as a template
|
||||
Remove-Item -Path $sourcepath -Force
|
||||
$shell = New-Object -COM WScript.Shell
|
||||
$shortcut = $shell.CreateShortcut($destination) ## Open the lnk
|
||||
$shortcut.TargetPath = "https://$env:computername/qmc" ## Make changes
|
||||
$shortcut.Save() ## Save
|
||||
Rename-Item -Path $destination -NewName "Qlik Management Console.lnk"
|
||||
|
||||
$sourcepath="C:\Users\Public\Desktop\Qlik Sense Hub.lnk"
|
||||
$destination="C:\Users\Public\Desktop\Qlik Sense Hub2.lnk"
|
||||
Copy-Item $sourcepath $destination ## Get the lnk we want to use as a template
|
||||
Remove-Item -Path $sourcepath -Force
|
||||
$shell = New-Object -COM WScript.Shell
|
||||
$shortcut = $shell.CreateShortcut($destination) ## Open the lnk
|
||||
$shortcut.TargetPath = "https://$env:computername/hub" ## Make changes
|
||||
$shortcut.Save() ## Save
|
||||
Rename-Item -Path $destination -NewName "Qlik Sense Hub.lnk"
|
||||
####
|
||||
|
||||
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 5 /f
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
<#
|
||||
Module: qs-post-cfg
|
||||
Author: Clint Carr
|
||||
Modified by: -
|
||||
Modification History:
|
||||
- Fixed connect as user logic (qlik-cli change)
|
||||
- Added logic to accomodate for Professional/Analyzer or User licenses
|
||||
- Added a loop into the Connect-Qlik statement to remove an abort error
|
||||
- Added Logging
|
||||
- Added comments
|
||||
- Error checking
|
||||
- Modified service connection for Qlik Sense from endless loop to a set number of attempts.
|
||||
- Added a service restart at the end of the Central Node (seems to resolve an issue with April 2018)
|
||||
last updated: 10/18/2019
|
||||
Intent: Configure the Qlik Sense environment with applications and Security Rules.
|
||||
#>
|
||||
|
||||
Param(
|
||||
[string] $Hostname,
|
||||
[string] $CertPwd,
|
||||
[string] $QlikUserPwd
|
||||
|
||||
)
|
||||
|
||||
Import-Module Qlik-Cli
|
||||
Import-Module "Carbon"
|
||||
|
||||
# Helper Functions
|
||||
# ----------------
|
||||
function New-Credential($u,$p) {
|
||||
$secpasswd = ConvertTo-SecureString $p -AsPlainText -Force
|
||||
return New-Object System.Management.Automation.PSCredential ($u, $secpasswd)
|
||||
}
|
||||
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-Credential "Qlik" $QlikUserPwd
|
||||
Install-User -Credential $cred
|
||||
|
||||
|
||||
Write-Log -Message "Starting qs-post-cfg.ps1"
|
||||
|
||||
### Waiting for Qlik Sense installation to complete
|
||||
#-----------
|
||||
Function restartQse
|
||||
{
|
||||
Write-Log "Checking Engine Service has started..."
|
||||
$qse = get-service QlikSenseEngineService
|
||||
write-log -Message "The engine is currently $($qse.Status)"
|
||||
if ($qse.Status -eq "Stopped") {
|
||||
Write-Log -Message "Starting Qlik Sense Engine and waiting 120 seconds" -Severity "Warn";
|
||||
Start-Service QlikSenseEngineService ;
|
||||
Restart-Service QlikSenseServiceDispatcher;
|
||||
start-sleep -s 120
|
||||
}
|
||||
write-log -Message "The engine is currently $($qse.Status)"
|
||||
}
|
||||
|
||||
Function connQSR
|
||||
{
|
||||
$i = 1
|
||||
$statusCode = 0
|
||||
while ($statusCode -ne 200 -and $i -le 10)
|
||||
{
|
||||
try {$statusCode = (Invoke-WebRequest https://$($env:COMPUTERNAME)/qps/user -UseBasicParsing).statusCode }
|
||||
catch
|
||||
{
|
||||
$i++
|
||||
write-log -Message "QSR on $env:COMPUTERNAME not responding attempt $i of 10..." -Severity "Warn"
|
||||
start-sleep -s 20
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Function restartServices
|
||||
{
|
||||
write-log -Message "Restarting Qlik Sense Services on $env:COMPUTERNAME" -Severity "Warn"
|
||||
Restart-Service QlikSenseRepositoryDatabase -Force
|
||||
Restart-Service QlikLoggingService -Force
|
||||
Restart-Service QlikSenseServiceDispatcher -Force
|
||||
Restart-Service QlikSenseRepositoryService -Force
|
||||
Restart-Service QlikSenseProxyService -Force
|
||||
Restart-Service QlikSenseEngineService -Force
|
||||
Restart-Service QlikSensePrintingService -Force
|
||||
Restart-Service QlikSenseSchedulerService -Force
|
||||
}
|
||||
|
||||
Function qlikSenseUserAccess
|
||||
{
|
||||
$userAccessGroup = (@{name = "License Everyone";} | ConvertTo-Json -Compress -Depth 10)
|
||||
$licenseId = Invoke-QlikPost "/qrs/License/UserAccessGroup" $userAccessGroup
|
||||
$systemRuleJson = (@{
|
||||
name = "Grant Everyone a token";
|
||||
category = "License";
|
||||
rule = '((user.name like "*"))';
|
||||
type = "Custom";
|
||||
resourceFilter = "License.UserAccessGroup_" + $licenseId.id;
|
||||
actions = 1;
|
||||
ruleContext = "QlikSenseOnly";
|
||||
disabled = $false;
|
||||
comment = "Rule to set up automatic user access";} | ConvertTo-Json -Compress -Depth 10)
|
||||
Write-Log -Message "Adding user license rule to grant Everyone Tokens."
|
||||
try {
|
||||
Invoke-QlikPost "/qrs/SystemRule" $systemRuleJson | Out-Null
|
||||
} catch {
|
||||
Write-Log -Message $_.Exception.Message -Severity "Error"
|
||||
}
|
||||
}
|
||||
|
||||
Function qlikSenseProfessionalAccess
|
||||
{
|
||||
$professionalAccessGroup = (@{name = "License Everyone";} | ConvertTo-Json -Compress -Depth 10)
|
||||
$licenseId = Invoke-QlikPost "/qrs/License/ProfessionalAccessGroup" $professionalAccessGroup
|
||||
$systemRuleJson = (@{
|
||||
name = "Grant Everyone Professional Access";
|
||||
category = "License";
|
||||
rule = '((user.name like "*"))';
|
||||
type = "Custom";
|
||||
resourceFilter = "License.ProfessionalAccessGroup_" + $licenseId.id;
|
||||
actions = 1;
|
||||
ruleContext = "QlikSenseOnly";
|
||||
disabled = $false;
|
||||
comment = "Rule to set up automatic user access";} | ConvertTo-Json -Compress -Depth 10)
|
||||
Write-Log -Message "Adding user license rule to grant Everyone access as Professional."
|
||||
try {
|
||||
Invoke-QlikPost "/qrs/SystemRule" $systemRuleJson | Out-Null
|
||||
} catch {
|
||||
Write-Log -Message $_.Exception.Message -Severity "Error"
|
||||
}
|
||||
}
|
||||
|
||||
#-----------
|
||||
write-log -Message "Waiting 1 minute for Qlik Sense installation to complete"
|
||||
start-sleep -s 60
|
||||
|
||||
|
||||
### wait for Qlik Sense Proxy service to respond with an HTTP 200 status before proceeding
|
||||
connQSR
|
||||
$statusCode = (Invoke-WebRequest https://$($env:COMPUTERNAME)/qps/user -UseBasicParsing).statusCode
|
||||
if ($statusCode -ne 200)
|
||||
{
|
||||
Write-Log -Message "Waiting 25 seconds before next pass" -Severity "Warn"
|
||||
restartServices
|
||||
Write-Log -Message "Waiting 45 seconds for Services to ensure they are ready" -Severity "Warn"
|
||||
start-sleep -s 45
|
||||
connQSR
|
||||
}
|
||||
|
||||
$statusCode = (Invoke-WebRequest https://$($env:COMPUTERNAME)/qps/user -UseBasicParsing).statusCode
|
||||
if ($statusCode -ne 200) {
|
||||
Write-Log -Message "Provisioning failed" -Severity "Error"
|
||||
Exit
|
||||
}
|
||||
Write-Log -Message "Qlik Sense Proxy responding on $env:COMPUTERNAME, status code: $statusCode"
|
||||
Write-Log -Message "Connecting to Qlik Sense Repository Service on $env:COMPUTERNAME"
|
||||
|
||||
restartQse
|
||||
|
||||
### Connect to the Qlik Sense Repository Service with Qlik-Cli
|
||||
do {write-log -Message "Connecting to Qlik Sense Repository"; start-sleep 15}
|
||||
While( (Connect-Qlik $($env:COMPUTERNAME) -TrustAllCerts -UseDefaultCredentials -ErrorAction SilentlyContinue).length -eq 0 )
|
||||
|
||||
|
||||
### Enabling HTTP
|
||||
#Write-Log -Message "Enabling HTTP access on Central Node proxy"
|
||||
#try {
|
||||
# Get-QlikProxy -filter "serverNodeConfiguration.Name eq 'Central'" | Update-QlikProxy -AllowHttp 1 | Out-Null
|
||||
#} catch {
|
||||
# Write-Log -Message $_.Exception.Message -Severity "Error"
|
||||
#}
|
||||
#Start-Sleep -s 10
|
||||
|
||||
### Install qlik-poc_com certificate
|
||||
Write-Log -Message "Install 'qmi.qlik-poc.com' certificate, set thumbsprint and whitelist domain in QS central virtual proxy"
|
||||
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
|
||||
Update-QlikProxy -SslBrowserCertificateThumbprint $sslCert.Thumbprint -id (Get-QlikProxy).id | Out-Null
|
||||
Start-Sleep -s 10
|
||||
Connect-Qlik $($env:COMPUTERNAME) -TrustAllCerts -UseDefaultCredentials | Out-Null
|
||||
Update-QlikVirtualProxy -id (Get-QlikVirtualProxy -filter "description eq 'Central Proxy (Default)'").id -websocketCrossOriginWhiteList $Hostname | Out-Null
|
||||
Start-Sleep -s 10
|
||||
} catch {
|
||||
Write-Log -Message $_.Exception.Message -Severity "Error"
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
@echo off
|
||||
set host_name=localhost
|
||||
set owner_name=postgres
|
||||
set PGPASSWORD=Qlik1234
|
||||
|
||||
C: && cd "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\9.6\bin" && psql -p 4432 -U %owner_name% -d QSR --command "UPDATE public.\"Users\" SET \"UserDirectory\" = '%COMPUTERNAME%', \"RolesString\" = 'RootAdmin' WHERE \"UserDirectory\" != 'INTERNAL';"
|
||||
psql -p 4432 -U %owner_name% -d QSR --command "SELECT * FROM public.\"Users\" WHERE \"RolesString\" = 'RootAdmin';"
|
||||
|
||||
cd "C:\provision"
|
||||
@echo off
|
||||
@@ -1,30 +0,0 @@
|
||||
Write-Host "Delete any existing WinRM listeners"
|
||||
winrm delete winrm/config/listener?Address=*+Transport=HTTP 2>$Null
|
||||
#winrm delete winrm/config/listener?Address=*+Transport=HTTPS 2>$Null
|
||||
|
||||
Write-Host "Create a new WinRM listener and configure"
|
||||
winrm create winrm/config/listener?Address=*+Transport=HTTP
|
||||
#winrm set winrm/config/winrs "@{MaxMemoryPerShellMB=`"0`"}"
|
||||
winrm set winrm/config "@{MaxTimeoutms=`"1800000`"}"
|
||||
winrm set winrm/config/service "@{AllowUnencrypted=`"true`"}"
|
||||
#winrm set winrm/config/service "@{MaxConcurrentOperationsPerUser=`"12000`"}"
|
||||
winrm set winrm/config/service/auth "@{Basic=`"true`"}"
|
||||
winrm set winrm/config/client/auth "@{Basic=`"true`"}"
|
||||
|
||||
Write-Host "Configure UAC to allow privilege elevation in remote shells"
|
||||
$Key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System'
|
||||
$Setting = 'LocalAccountTokenFilterPolicy'
|
||||
Set-ItemProperty -Path $Key -Name $Setting -Value 1 -Force
|
||||
|
||||
#Write-Host "turn off PowerShell execution policy restrictions"
|
||||
#Set-ExecutionPolicy -ExecutionPolicy Unrestricted
|
||||
|
||||
|
||||
Write-Host "Configure and restart the WinRM Service; Enable the required firewall exception"
|
||||
net stop winrm
|
||||
net start winrm
|
||||
#Stop-Service -Name WinRM
|
||||
#Set-Service -Name WinRM -StartupType Automatic
|
||||
netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new action=allow localip=any remoteip=any
|
||||
#Start-Service -Name WinRM
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
|
||||
variable "prefix" {
|
||||
default = "QMI"
|
||||
}
|
||||
|
||||
variable "subnet_id" {
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
}
|
||||
|
||||
variable "snapshot_id" {
|
||||
}
|
||||
|
||||
variable "resource_group_name" {
|
||||
}
|
||||
|
||||
variable "vm_type" {
|
||||
default = "Standard_D4s_v3"
|
||||
}
|
||||
|
||||
variable "managed_disk_type" {
|
||||
default = "Premium_LRS"
|
||||
}
|
||||
|
||||
variable "disk_size_gb" {
|
||||
default = "128"
|
||||
}
|
||||
|
||||
variable "admin_username" {
|
||||
default = "scdemoadmin"
|
||||
}
|
||||
|
||||
variable "initial_password" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "virtual_machine_name" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "provId" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "is_24x7"{
|
||||
type = bool
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "shutdownTime"{
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "startupTime"{
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "notrename" {
|
||||
default = null
|
||||
}
|
||||
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
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.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
|
||||
notrename = (var.notrename != null)? "-NotApply" : ""
|
||||
}
|
||||
|
||||
resource "azurerm_managed_disk" "copy" {
|
||||
|
||||
name = "Disk-${var.prefix}-${random_id.randomMachineId.hex}"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
storage_account_type = "Premium_LRS"
|
||||
create_option = "Copy"
|
||||
source_resource_id = var.snapshot_id
|
||||
disk_size_gb = var.disk_size_gb
|
||||
|
||||
tags = {
|
||||
"Deployment" = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
"QMI_user" = var.user_id != null? var.user_id : null
|
||||
}
|
||||
}
|
||||
|
||||
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_virtual_machine" "vm" {
|
||||
name = local.virtual_machine_name
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
network_interface_ids = [ module.qmi-nic.id ]
|
||||
vm_size = var.vm_type
|
||||
|
||||
|
||||
storage_os_disk {
|
||||
name = azurerm_managed_disk.copy.name
|
||||
os_type = "Windows"
|
||||
managed_disk_id = azurerm_managed_disk.copy.id
|
||||
managed_disk_type = "Premium_LRS"
|
||||
create_option = "Attach"
|
||||
}
|
||||
|
||||
os_profile_windows_config {
|
||||
|
||||
provision_vm_agent = true
|
||||
enable_automatic_upgrades = false
|
||||
|
||||
winrm {
|
||||
protocol = "http"
|
||||
}
|
||||
}
|
||||
|
||||
/*os_profile {
|
||||
computer_name = local.virtual_machine_name
|
||||
admin_username = local.admin_username
|
||||
}*/
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
connection {
|
||||
type = "winrm"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = local.admin_username
|
||||
password = var.initial_password
|
||||
port = 5985
|
||||
https = false
|
||||
timeout = "10m"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
destination = "C:/tmp/provision"
|
||||
}
|
||||
|
||||
|
||||
provisioner "remote-exec" {
|
||||
connection {
|
||||
type = "winrm"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = local.admin_username
|
||||
password = var.initial_password
|
||||
port = 5985
|
||||
https = false
|
||||
timeout = "10m"
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/tmp/provision/bootstrap.ps1",
|
||||
"powershell.exe -File C:/tmp/provision/password.ps1 -Username ${local.admin_username} -Pass ${local.admin_password}"
|
||||
]
|
||||
}
|
||||
|
||||
# Rename Computer
|
||||
provisioner "remote-exec" {
|
||||
connection {
|
||||
type = "winrm"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = local.admin_username
|
||||
password = local.admin_password
|
||||
port = 5985
|
||||
https = false
|
||||
timeout = "10m"
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/tmp/provision/RenameComputer.ps1 -NewName ${local.virtual_machine_name} ${local.notrename}"
|
||||
]
|
||||
|
||||
on_failure = continue
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
Param(
|
||||
[string] $NewName,
|
||||
[switch] $NotApply = $False
|
||||
)
|
||||
|
||||
|
||||
|
||||
if ($NotApply){
|
||||
Write-Host "Not renaming machine"
|
||||
} else {
|
||||
Write-Host "Machine is going to be renamed as $NewName"
|
||||
Rename-Computer -NewName $NewName -Force -Restart
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
|
||||
New-Item -ItemType directory -Path C:\Windows\System32\WindowsPowerShell\v1.0\Modules\qmiCLI -force | Out-Null
|
||||
Copy-Item $PSScriptRoot\qmiCLI.psm1 C:\Windows\System32\WindowsPowerShell\v1.0\Modules\qmiCLI\qmiCLI.psm1 | Out-Null
|
||||
Import-Module qmiCLI.psm1 | Out-Null
|
||||
|
||||
#Importing Utils module
|
||||
New-Item -ItemType directory -Path C:\Windows\System32\WindowsPowerShell\v1.0\Modules\qmiUtils -force | Out-Null
|
||||
Copy-Item $PSScriptRoot\qmiUtils.psm1 C:\Windows\System32\WindowsPowerShell\v1.0\Modules\qmiUtils\qmiUtils.psm1 | Out-Null
|
||||
Import-Module qmiUtils.psm1 | Out-Null
|
||||
|
||||
Write-Log "Scripts locations is: $PSScriptRoot"
|
||||
|
||||
#Install Chocolatey
|
||||
#Write-Log "Install Chocolatey"
|
||||
#Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
|
||||
### Disable Password policy
|
||||
secedit /export /cfg c:\secpol.cfg | Out-Null
|
||||
(Get-Content C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg | Out-Null
|
||||
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY | Out-Null
|
||||
rm -force c:\secpol.cfg -confirm:$false | Out-Null
|
||||
|
||||
#Write-Log "Resize Partition C to max size"
|
||||
#$size = Get-PartitionSupportedSize -DriveLetter C
|
||||
#Resize-Partition -DriveLetter C -Size $size.SizeMax | Out-Null
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
Param(
|
||||
[string] $Username,
|
||||
[string] $Pass
|
||||
)
|
||||
|
||||
Import-Module "Carbon"
|
||||
|
||||
$secpasswd = ConvertTo-SecureString $Pass -AsPlainText -Force
|
||||
$cred = New-Object System.Management.Automation.PSCredential ($Username, $secpasswd)
|
||||
|
||||
Install-User -Credential $cred
|
||||
Write-Log "Done! Setting new password to user $Username"
|
||||
@@ -1,189 +0,0 @@
|
||||
<#
|
||||
Module: QlikCLI
|
||||
Author: Clint Carr
|
||||
Byron Ainsworth
|
||||
|
||||
Modified by: -
|
||||
last updated: 10/10/2017
|
||||
|
||||
Modification History:
|
||||
-
|
||||
|
||||
Intent: Provide prepackaged commands to facilitate common QMI activities
|
||||
|
||||
Dependencies:
|
||||
-
|
||||
|
||||
#>
|
||||
|
||||
function Write-Log
|
||||
{
|
||||
param (
|
||||
[Parameter(Mandatory)]
|
||||
[string]$Message,
|
||||
[Parameter()]
|
||||
[ValidateSet('Info','Warn','Error')]
|
||||
[string]$Severity = 'Info'
|
||||
)
|
||||
|
||||
$line = [pscustomobject]@{
|
||||
'DateTime' = (Get-Date)
|
||||
'Severity' = $Severity
|
||||
'Message' = $Message
|
||||
|
||||
}
|
||||
Write-Host "$($line.DateTime) [$($line.Severity)]: $($line.Message)"
|
||||
$line | Export-Csv -Path c:\provision\QMIProvision.log -Append -NoTypeInformation
|
||||
}
|
||||
|
||||
Function Backup-QMIAppsSerial
|
||||
{
|
||||
param (
|
||||
[Parameter()]
|
||||
[string]$Source = 'c:\QlikShare\apps\',
|
||||
[Parameter()]
|
||||
[string]$Destination = '\\VBOXSVR\shared-content\apps'
|
||||
)
|
||||
|
||||
Write-Log -Message "Commencing export process for local Qlik Sense Apps repository" -Severity 'Info'
|
||||
|
||||
### Get Apps
|
||||
Write-Log -Message "Identifying eligible local Qlik Sense Apps" -Severity 'Info'
|
||||
$arrApps = Get-QlikApp | ? {$_.stream.name -ne 'monitoring apps'}
|
||||
Write-Log -Message "Qlik Sense Apps identified: $($arrApps.Count)" -Severity 'Info'
|
||||
|
||||
Foreach($objApp in $arrApps){
|
||||
If($objApp.Published -eq $True){
|
||||
If(Test-Path -Path $($Destination + '\' + $objApp.stream.name)){
|
||||
}
|
||||
else{
|
||||
Write-Log -Message "Identified new stream $($objApp.stream.name). Creating central stream repository" -Severity 'Info'
|
||||
New-Item -ItemType Directory -Path $($Destination + '\' + $objApp.stream.name) -Force
|
||||
}
|
||||
$objApp | Export-QlikApp -filename $($Destination + '\' + $($objApp.stream.name) + '\' +$objApp.name + '.qvf')
|
||||
Write-Log -Message "Qlik Sense Apps exported: $($objApp.Name)" -Severity 'Info'
|
||||
}else{
|
||||
$objApp | Export-QlikApp -filename $($Destination + '\' + $objApp.name + '.qvf')
|
||||
Write-Log -Message "Qlik Sense Apps exported: $($objApp.Name)" -Severity 'Info'
|
||||
}
|
||||
}
|
||||
|
||||
Write-Log -Message "Concluding export process for local Qlik Sense Apps repository" -Severity 'Info'
|
||||
|
||||
}
|
||||
|
||||
Function Backup-QMIApps
|
||||
{
|
||||
param (
|
||||
[Parameter()]
|
||||
[string]$Source = 'c:\QlikShare\apps\',
|
||||
[Parameter()]
|
||||
[string]$Destination = '\\VBOXSVR\shared-content\apps'
|
||||
)
|
||||
|
||||
Write-Log -Message "Commencing export process for local Qlik Sense Apps repository" -Severity 'Info'
|
||||
|
||||
}
|
||||
|
||||
Function Backup-QMIExtensions
|
||||
{
|
||||
param (
|
||||
[Parameter()]
|
||||
[string]$Source = 'C:\QlikShare\StaticContent\Extensions\',
|
||||
[Parameter()]
|
||||
[string]$Destination = '\\VBOXSVR\shared-content\extensions'
|
||||
)
|
||||
|
||||
Write-Log -Message "Commencing export process for Extensions to from local $env:computername to central shared-content repository" -Severity 'Info'
|
||||
|
||||
## Verify source directory exists
|
||||
If (Test-Path $Source){
|
||||
Write-Log -Message "Confirmed local Extensions repository exists" -Severity 'Info'
|
||||
|
||||
Try
|
||||
{
|
||||
$arrExtensions = Get-ChildItem -Path $Source | ? {$_.Name -notlike "idevio*"}
|
||||
foreach($objExtension in $arrExtensions){
|
||||
Compress-Archive -Path $objExtension.FullName -DestinationPath $($Destination + '\' + $objExtension.name + '.zip' ) -CompressionLevel 'Optimal' -Force
|
||||
}
|
||||
|
||||
#$arrObjects | Copy-Item -Destination $Destination -Recurse -Force -Verbose
|
||||
Write-Log -Message "Concluding export process for Extensions repository" -Severity 'Info'
|
||||
}
|
||||
Catch
|
||||
{
|
||||
$_.Exception.Message
|
||||
$_.Exception.ItemName
|
||||
Write-Log -Message "Something went wrong with the file transfer. Confirm shared-content is available at $Destination" -Severity 'Error'
|
||||
}
|
||||
|
||||
}else{
|
||||
Write-Log -Message "Local Extensions repository does not exist. If you have placed your local repository in a location other than $Source you can leverage the Source argument to override" -Severity 'Error'
|
||||
Exit
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Function Backup-QMIReferenceData
|
||||
{
|
||||
param (
|
||||
[Parameter()]
|
||||
[string]$Source = 'c:\QlikShare\ReferenceData\',
|
||||
[Parameter()]
|
||||
[string]$Destination = '\\VBOXSVR\shared-content\ReferenceData'
|
||||
)
|
||||
|
||||
Write-Log -Message "Commencing export process for ReferenceData to from local $env:computername to central shared-content repository" -Severity 'Info'
|
||||
|
||||
## Verify source directory exists
|
||||
If (Test-Path $Source){
|
||||
Write-Log -Message "Confirmed local ReferenceData repository exists" -Severity 'Info'
|
||||
|
||||
Try
|
||||
{
|
||||
$arrObjects = Get-ChildItem -Path $Source
|
||||
$arrObjects | Copy-Item -Destination $Destination -Recurse -Force -Verbose
|
||||
Write-Log -Message "Concluding export process for ReferenceData repository" -Severity 'Info'
|
||||
}
|
||||
Catch
|
||||
{
|
||||
Write-Log -Message "Something went wrong with the file transfer. Confirm shared-content is available at $Destination" -Severity 'Error'
|
||||
}
|
||||
|
||||
}else{
|
||||
Write-Log -Message "Local ReferenceData repository does not exist. If you have placed your local repository in a location other than $Source you can leverage the Source argument to override" -Severity 'Error'
|
||||
Exit
|
||||
}
|
||||
}
|
||||
|
||||
Function Backup-QMIContentLibraries
|
||||
{
|
||||
param (
|
||||
[Parameter()]
|
||||
[string]$Source = 'C:\QlikShare\StaticContent\Content\',
|
||||
[Parameter()]
|
||||
[string]$Destination = '\\VBOXSVR\shared-content\ContentLibrary'
|
||||
)
|
||||
|
||||
Write-Log -Message "Commencing export process for ContentLibraries to from local $env:computername to central shared-content repository" -Severity 'Info'
|
||||
|
||||
## Verify source directory exists
|
||||
If (Test-Path $Source){
|
||||
Write-Log -Message "Confirmed local ContentLibraries repository exists" -Severity 'Info'
|
||||
|
||||
Try
|
||||
{
|
||||
$arrObjects = Get-ChildItem -Path $Source
|
||||
$arrObjects | Copy-Item -Destination $Destination -Recurse -Force -Verbose
|
||||
Write-Log -Message "Concluding export process for ContentLibraries repository" -Severity 'Info'
|
||||
}
|
||||
Catch
|
||||
{
|
||||
Write-Log -Message "Something went wrong with the file transfer. Confirm shared-content is available at $Destination" -Severity 'Error'
|
||||
}
|
||||
|
||||
}else{
|
||||
Write-Log -Message "Local ContentLibraries repository does not exist. If you have placed your local repository in a location other than $Source you can leverage the Source argument to override" -Severity 'Error'
|
||||
Exit
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
<#
|
||||
Module: UtilsQMI
|
||||
Author: Manuel Romero
|
||||
Clint Car
|
||||
|
||||
Modified by: -
|
||||
last updated: 11/10/2017
|
||||
|
||||
Modification History:
|
||||
-
|
||||
|
||||
Intent: One place for common functions across modules we don't want in qmiCLI
|
||||
|
||||
Dependencies:
|
||||
-
|
||||
#>
|
||||
|
||||
Function New-MyCredential
|
||||
{
|
||||
param (
|
||||
[string] $user,
|
||||
[string] $pass
|
||||
)
|
||||
|
||||
PROCESS {
|
||||
$secpasswd = ConvertTo-SecureString $pass -AsPlainText -Force
|
||||
return New-Object System.Management.Automation.PSCredential ($user, $secpasswd)
|
||||
}
|
||||
}
|
||||
|
||||
Function CreateOdagLink
|
||||
{
|
||||
param (
|
||||
[string]$odagLinkName,
|
||||
[string]$selectionAppName,
|
||||
[string]$detailsAppName,
|
||||
[string]$sheet2OpenName,
|
||||
[string]$odagLinkExpression,
|
||||
[int]$rowsLimit,
|
||||
[int]$appsLimit,
|
||||
[string]$retentionTime,
|
||||
[string]$sheetEmbedName
|
||||
)
|
||||
|
||||
|
||||
PROCESS {
|
||||
|
||||
Trap {
|
||||
Write-Log -Message "Error in function CreateOdagLink" -Severity "Error"
|
||||
Write-Log -Message $_.Exception.Message -Severity "Error"
|
||||
Break
|
||||
}
|
||||
|
||||
Write-Log -Message "Installing NodeJs"
|
||||
cinst nodejs.install --version 6.4.0 | Out-Null
|
||||
|
||||
if ( -Not (Test-Path C:\OdagEnigma) ) {
|
||||
Write-Log -Message "Unzipping Node EnigmaJS"
|
||||
Expand-Archive -LiteralPath C:\installation\EnigmaModule.zip -DestinationPath C:\OdagEnigma -Force | Out-Null
|
||||
}
|
||||
|
||||
# Create ODAG Link
|
||||
Write-Log -Message "Adding ODAG Link"
|
||||
#$rawOutput = $true
|
||||
$detailApp = $(Get-QlikApp -filter "name eq '$detailsAppName'").id
|
||||
$selectionApp = $(Get-QlikApp -filter "name eq '$selectionAppName'").id
|
||||
$sheetID = $(Invoke-QlikGet "/qrs/app/object" -filter "name eq '$sheet2OpenName' and objectType eq 'sheet'").engineObjectId
|
||||
$data = (@{"name"=$odagLinkName;
|
||||
"templateApp"=$detailApp;
|
||||
"rowEstExpr"=$odagLinkExpression;
|
||||
"properties"=@{
|
||||
"rowEstRange"=@(@{"context"="*";"highBound"=$rowsLimit});
|
||||
"genAppLimit"=@(@{"context"="User_*";"limit"=$appsLimit});
|
||||
"appRetentionTime"=@(@{"context"="User_*";"retentionTime"=$retentionTime});
|
||||
"targetSheet"=@(@{"context"="User_*";"sheetId"=$sheetID})};
|
||||
"selectionApp"=$selectionApp}) | ConvertTo-Json -Compress -Depth 10
|
||||
|
||||
$result = $(Invoke-QlikPost "/api/odag/v1/links" $data)
|
||||
$odagLinkRef = $result.objectDef.id
|
||||
|
||||
|
||||
Write-Log -Message "ODAG link added $odagLinkRef"
|
||||
|
||||
$sheetSelectionID = $(invoke-qlikget "/qrs/app/object" -filter "name eq '$sheetEmbedName' and objectType eq 'sheet'").engineObjectId
|
||||
|
||||
|
||||
# EnigmaJS to attach this link to apps and sheet using APIs
|
||||
C:\OdagEnigma\run.bat $odagLinkRef $odagLinkName $sheetSelectionID $selectionAppName $detailsAppName
|
||||
|
||||
return $odagLinkRef
|
||||
}
|
||||
}
|
||||
@@ -1,154 +0,0 @@
|
||||
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
|
||||
}
|
||||
|
||||
resource "random_password" "qlikpassword" {
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
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" "sensorsettings" {
|
||||
name = "carbonblack-sensorsettings"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
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_virtual_machine" "vm" {
|
||||
name = local.virtual_machine_name
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
network_interface_ids = [module.qmi-nic.id]
|
||||
vm_size = var.vm_type
|
||||
|
||||
delete_os_disk_on_termination = true
|
||||
delete_data_disks_on_termination = true
|
||||
|
||||
storage_image_reference {
|
||||
id = var.image_reference
|
||||
}
|
||||
|
||||
storage_os_disk {
|
||||
name = "${local.virtual_machine_name}-osdisk"
|
||||
caching = "ReadWrite"
|
||||
create_option = "FromImage"
|
||||
managed_disk_type = var.managed_disk_type
|
||||
disk_size_gb = var.disk_size_gb
|
||||
}
|
||||
|
||||
os_profile {
|
||||
computer_name = local.virtual_machine_name
|
||||
admin_username = local.admin_username
|
||||
admin_password = local.admin_password
|
||||
}
|
||||
|
||||
os_profile_windows_config {
|
||||
|
||||
provision_vm_agent = true
|
||||
enable_automatic_upgrades = false
|
||||
|
||||
winrm {
|
||||
protocol = "http"
|
||||
}
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
connection {
|
||||
type = "winrm"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = local.admin_username
|
||||
password = local.admin_password
|
||||
port = 5985
|
||||
https = false
|
||||
timeout = "3m"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
destination = "C:/provision"
|
||||
}
|
||||
|
||||
provisioner "remote-exec" {
|
||||
connection {
|
||||
type = "winrm"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = "qservice"
|
||||
password = "Qlik1234"
|
||||
port = 5985
|
||||
https = false
|
||||
timeout = "3m"
|
||||
}
|
||||
|
||||
inline = [
|
||||
"powershell.exe -File C:/provision/resethostname.ps1"
|
||||
]
|
||||
}
|
||||
|
||||
provisioner "remote-exec" {
|
||||
connection {
|
||||
type = "winrm"
|
||||
host = module.qmi-nic.private_ip_address
|
||||
user = "qservice"
|
||||
password = "Qlik1234"
|
||||
port = 5985
|
||||
https = false
|
||||
timeout = "3m"
|
||||
}
|
||||
|
||||
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/np-post.ps1"
|
||||
]
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
Param(
|
||||
[string] $SensorSettings
|
||||
)
|
||||
|
||||
Write-Log -Message "Installing and configuring Carbon Black"
|
||||
|
||||
New-Item C:\provision\sensorsettings.ini | Out-Null
|
||||
Set-Content C:\provision\sensorsettings.ini $SensorSettings | Out-Null
|
||||
(Get-Content C:\provision\sensorsettings.ini) -replace ' ',"`r`n" | Set-Content C:\provision\sensorsettings.ini -Force
|
||||
|
||||
C:\provision\CarbonBlackClientSetup.exe /S
|
||||
|
||||
Write-Log -Message "Carbon Black is configure!"
|
||||
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
Function restartNPServices
|
||||
{
|
||||
write-log -Message "Starting NPrinting Services on $env:COMPUTERNAME"
|
||||
|
||||
Set-Service -Name QlikNPrintingEngine -StartupType Automatic
|
||||
Set-Service -Name QlikNPrintingWebEngine -StartupType Automatic
|
||||
Set-Service -Name QlikNPrintingScheduler -StartupType Automatic
|
||||
Set-Service -Name QlikNPrintingMessagingService -StartupType Automatic
|
||||
Set-Service -Name QlikNPrintingRepoService -StartupType Automatic
|
||||
Set-Service -Name QlikNPrintingLicenseService -StartupType Automatic
|
||||
|
||||
Start-Service -InputObject QlikNPrintingRepoService -ErrorAction SilentlyContinue
|
||||
Start-Service -InputObject QlikNPrintingMessagingService -ErrorAction SilentlyContinue
|
||||
Start-Service -InputObject QlikNPrintingWebEngine -ErrorAction SilentlyContinue
|
||||
Start-Service -InputObject QlikNPrintingEngine -ErrorAction SilentlyContinue
|
||||
Start-Service -InputObject QlikNPrintingScheduler -ErrorAction SilentlyContinue
|
||||
Start-Service -InputObject QlikNPrintingLicenseService -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
Write-Log -Message "Exporting new certificates"
|
||||
Export-QlikCertificate -machineNames "localhost" -includeSecretsKey -exportFormat "Windows"
|
||||
Export-QlikCertificate -machineNames "localhost" -includeSecretsKey -exportFormat "Pem"
|
||||
|
||||
|
||||
Copy-Item "C:\ProgramData\Qlik\Sense\Repository\Exported Certificates\localhost\client.pfx" -Destination "C:\Program Files\NPrintingServer\Settings\SenseCertificates" -Force
|
||||
|
||||
restartNPServices
|
||||
@@ -1,172 +0,0 @@
|
||||
<#
|
||||
Module: qs-post-cfg
|
||||
Author: Clint Carr
|
||||
Modified by: -
|
||||
Modification History:
|
||||
- Fixed connect as user logic (qlik-cli change)
|
||||
- Added logic to accomodate for Professional/Analyzer or User licenses
|
||||
- Added a loop into the Connect-Qlik statement to remove an abort error
|
||||
- Added Logging
|
||||
- Added comments
|
||||
- Error checking
|
||||
- Modified service connection for Qlik Sense from endless loop to a set number of attempts.
|
||||
- Added a service restart at the end of the Central Node (seems to resolve an issue with April 2018)
|
||||
last updated: 10/18/2019
|
||||
Intent: Configure the Qlik Sense environment with applications and Security Rules.
|
||||
#>
|
||||
|
||||
Param(
|
||||
[string] $Hostname,
|
||||
[string] $CertPwd,
|
||||
[string] $QlikUserPwd
|
||||
|
||||
)
|
||||
|
||||
Import-Module Qlik-Cli
|
||||
Import-Module "Carbon"
|
||||
|
||||
# Helper Functions
|
||||
# ----------------
|
||||
function New-Credential($u,$p) {
|
||||
$secpasswd = ConvertTo-SecureString $p -AsPlainText -Force
|
||||
return New-Object System.Management.Automation.PSCredential ($u, $secpasswd)
|
||||
}
|
||||
|
||||
Write-Log -Message "Creating Qlik account"
|
||||
$cred = New-Credential "Qlik" $QlikUserPwd
|
||||
Install-User -Credential $cred
|
||||
|
||||
Write-Log -Message "Starting qs-post-cfg.ps1"
|
||||
|
||||
### Waiting for Qlik Sense installation to complete
|
||||
#-----------
|
||||
Function restartQse
|
||||
{
|
||||
Write-Log "Checking Engine Service has started..."
|
||||
$qse = get-service QlikSenseEngineService
|
||||
write-log -Message "The engine is currently $($qse.Status)"
|
||||
if ($qse.Status -eq "Stopped") {
|
||||
Write-Log -Message "Starting Qlik Sense Engine and waiting 120 seconds" -Severity "Warn";
|
||||
Start-Service QlikSenseEngineService ;
|
||||
Restart-Service QlikSenseServiceDispatcher;
|
||||
start-sleep -s 120
|
||||
}
|
||||
write-log -Message "The engine is currently $($qse.Status)"
|
||||
}
|
||||
|
||||
Function connQSR
|
||||
{
|
||||
$i = 1
|
||||
$statusCode = 0
|
||||
while ($statusCode -ne 200 -and $i -le 10)
|
||||
{
|
||||
try {$statusCode = (Invoke-WebRequest https://$($env:COMPUTERNAME)/qps/user -UseBasicParsing).statusCode }
|
||||
catch
|
||||
{
|
||||
$i++
|
||||
write-log -Message "QSR on $env:COMPUTERNAME not responding attempt $i of 10..." -Severity "Warn"
|
||||
start-sleep -s 20
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Function restartServices
|
||||
{
|
||||
write-log -Message "Restarting Qlik Sense Services on $env:COMPUTERNAME" -Severity "Warn"
|
||||
Restart-Service QlikSenseRepositoryDatabase -Force
|
||||
Restart-Service QlikLoggingService -Force
|
||||
Restart-Service QlikSenseServiceDispatcher -Force
|
||||
Restart-Service QlikSenseRepositoryService -Force
|
||||
Restart-Service QlikSenseProxyService -Force
|
||||
Restart-Service QlikSenseEngineService -Force
|
||||
Restart-Service QlikSensePrintingService -Force
|
||||
Restart-Service QlikSenseSchedulerService -Force
|
||||
}
|
||||
|
||||
Function qlikSenseUserAccess
|
||||
{
|
||||
$userAccessGroup = (@{name = "License Everyone";} | ConvertTo-Json -Compress -Depth 10)
|
||||
$licenseId = Invoke-QlikPost "/qrs/License/UserAccessGroup" $userAccessGroup
|
||||
$systemRuleJson = (@{
|
||||
name = "Grant Everyone a token";
|
||||
category = "License";
|
||||
rule = '((user.name like "*"))';
|
||||
type = "Custom";
|
||||
resourceFilter = "License.UserAccessGroup_" + $licenseId.id;
|
||||
actions = 1;
|
||||
ruleContext = "QlikSenseOnly";
|
||||
disabled = $false;
|
||||
comment = "Rule to set up automatic user access";} | ConvertTo-Json -Compress -Depth 10)
|
||||
Write-Log -Message "Adding user license rule to grant Everyone Tokens."
|
||||
try {
|
||||
Invoke-QlikPost "/qrs/SystemRule" $systemRuleJson | Out-Null
|
||||
} catch {
|
||||
Write-Log -Message $_.Exception.Message -Severity "Error"
|
||||
}
|
||||
}
|
||||
|
||||
Function qlikSenseProfessionalAccess
|
||||
{
|
||||
$professionalAccessGroup = (@{name = "License Everyone";} | ConvertTo-Json -Compress -Depth 10)
|
||||
$licenseId = Invoke-QlikPost "/qrs/License/ProfessionalAccessGroup" $professionalAccessGroup
|
||||
$systemRuleJson = (@{
|
||||
name = "Grant Everyone Professional Access";
|
||||
category = "License";
|
||||
rule = '((user.name like "*"))';
|
||||
type = "Custom";
|
||||
resourceFilter = "License.ProfessionalAccessGroup_" + $licenseId.id;
|
||||
actions = 1;
|
||||
ruleContext = "QlikSenseOnly";
|
||||
disabled = $false;
|
||||
comment = "Rule to set up automatic user access";} | ConvertTo-Json -Compress -Depth 10)
|
||||
Write-Log -Message "Adding user license rule to grant Everyone access as Professional."
|
||||
try {
|
||||
Invoke-QlikPost "/qrs/SystemRule" $systemRuleJson | Out-Null
|
||||
} catch {
|
||||
Write-Log -Message $_.Exception.Message -Severity "Error"
|
||||
}
|
||||
}
|
||||
|
||||
#-----------
|
||||
write-log -Message "Waiting 1 minute for Qlik Sense installation to complete"
|
||||
start-sleep -s 60
|
||||
|
||||
|
||||
### wait for Qlik Sense Proxy service to respond with an HTTP 200 status before proceeding
|
||||
connQSR
|
||||
$statusCode = (Invoke-WebRequest https://$($env:COMPUTERNAME)/qps/user -UseBasicParsing).statusCode
|
||||
if ($statusCode -ne 200)
|
||||
{
|
||||
Write-Log -Message "Waiting 25 seconds before next pass" -Severity "Warn"
|
||||
restartServices
|
||||
Write-Log -Message "Waiting 45 seconds for Services to ensure they are ready" -Severity "Warn"
|
||||
start-sleep -s 45
|
||||
connQSR
|
||||
}
|
||||
|
||||
$statusCode = (Invoke-WebRequest https://$($env:COMPUTERNAME)/qps/user -UseBasicParsing).statusCode
|
||||
if ($statusCode -ne 200) {
|
||||
Write-Log -Message "Provisioning failed" -Severity "Error"
|
||||
Exit
|
||||
}
|
||||
Write-Log -Message "Qlik Sense Proxy responding on $env:COMPUTERNAME, status code: $statusCode"
|
||||
Write-Log -Message "Connecting to Qlik Sense Repository Service on $env:COMPUTERNAME"
|
||||
|
||||
restartQse
|
||||
|
||||
### Connect to the Qlik Sense Repository Service with Qlik-Cli
|
||||
do {write-log -Message "Connecting to Qlik Sense Repository"; start-sleep 15}
|
||||
While( (Connect-Qlik $($env:COMPUTERNAME) -TrustAllCerts -UseDefaultCredentials -ErrorAction SilentlyContinue).length -eq 0 )
|
||||
|
||||
|
||||
### Install qlik-poc_com certificate
|
||||
Write-Log -Message "Install qlik-poc_com certificate"
|
||||
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
|
||||
Update-QlikProxy -SslBrowserCertificateThumbprint $sslCert.Thumbprint -id (Get-QlikProxy).id | Out-Null
|
||||
Start-Sleep -s 10
|
||||
Update-QlikVirtualProxy -id (Get-QlikVirtualProxy -filter "description eq 'Central Proxy (Default)'").id -websocketCrossOriginWhiteList $Hostname | Out-Null
|
||||
} catch {
|
||||
Write-Log -Message $_.Exception.Message -Severity "Error"
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
Write-Log "Resize Partition C to max size"
|
||||
$size = Get-PartitionSupportedSize -DriveLetter C
|
||||
Resize-Partition -DriveLetter C -Size $size.SizeMax
|
||||
|
||||
# Helper Functions
|
||||
# ----------------
|
||||
function New-Credential($u,$p) {
|
||||
$secpasswd = ConvertTo-SecureString $p -AsPlainText -Force
|
||||
return New-Object System.Management.Automation.PSCredential ($u, $secpasswd)
|
||||
}
|
||||
$cred = New-Credential "qservice" "Qlik1234"
|
||||
#import-module "Carbon"
|
||||
|
||||
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f
|
||||
|
||||
|
||||
Set-Service -Name "QlikLoggingService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseServiceDispatcher" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseProxyService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseEngineService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSensePrintingService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseSchedulerService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseRepositoryService" -StartupType Automatic
|
||||
Set-Service -Name "QlikSenseRepositoryDatabase" -StartupType Automatic
|
||||
|
||||
|
||||
Write-Log "Starting QlikSenseRepositoryDatabase and QlikSenseServiceDispatcher"
|
||||
Start-Service QlikSenseRepositoryDatabase
|
||||
Start-Service QlikSenseServiceDispatcher
|
||||
|
||||
#Delete certificates
|
||||
Write-Log "Deleting old certificates"
|
||||
#Get-ChildItem "$($env:ProgramData)\Qlik\Sense\Repository\Exported Certificates\" | Remove-Item -Recurse
|
||||
$Certs = Get-ChildItem cert:"CurrentUser\My" | Where-Object { $_.Subject -match 'QlikClient' }
|
||||
$Certs | ForEach-Object{Remove-Item -path $_.PSPath -recurse -Force}
|
||||
$Certs = Get-ChildItem cert:"LocalMachine\My" | Where-Object { $_.Subject -match 'GEN-QS' -or $_.Subject -match 'QMI-QS' }
|
||||
$Certs | ForEach-Object{Remove-Item -path $_.PSPath -recurse -Force}
|
||||
$Certs = Get-ChildItem cert:"LocalMachine\Root" | Where-Object { $_.Subject -match 'GEN-QS' -or $_.Subject -match 'QMI-QS' }
|
||||
$Certs | ForEach-Object{Remove-Item -path $_.PSPath -recurse -Force}
|
||||
|
||||
Write-Log "Setting new hostname to Host.cfg file"
|
||||
Write-Log $($env:computername)
|
||||
$enchostname = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$($env:computername)"))
|
||||
Set-Content -Path C:\ProgramData\Qlik\Sense\Host.cfg -Value $enchostname
|
||||
|
||||
Write-Log "Recreating Qlik Sense certificates"
|
||||
# AS if qservice user
|
||||
Start-Process powershell.exe -ArgumentList "Start-Process cmd.exe -Verb runAs -ArgumentList '/k C:\PROGRA~1\Qlik\Sense\Repository\Repository.exe -bootstrap -standalone -restorehostname'"
|
||||
|
||||
#From PS
|
||||
#Start-Process -FilePath "C:\PROGRA~1\Qlik\Sense\Repository\Repository.exe" -ArgumentList "/bootstrap /standalone /restorehostname" -Verb runAs
|
||||
|
||||
#qs
|
||||
#Start-Process powershell.exe -Credential $cred -ArgumentList "Start-Process cmd.exe -Verb runAs -ArgumentList '/k C:\PROGRA~1\Qlik\Sense\Repository\Repository.exe -bootstrap -standalone -restorehostname'"
|
||||
|
||||
$waiting=50
|
||||
Write-Log "Waiting $waiting secs ..."
|
||||
Start-Sleep -s $waiting
|
||||
|
||||
#- Wait 10 seconds
|
||||
Write-Log "Restarting Service Dispatcher"
|
||||
#- Restart Service Dispacher
|
||||
Restart-Service QlikSenseServiceDispatcher -Force
|
||||
#- Restart rest of the services
|
||||
|
||||
|
||||
Start-Sleep -s 20
|
||||
|
||||
Write-Log "New Certs: CurrentUser\My"
|
||||
Get-ChildItem cert:"CurrentUser\My"
|
||||
Write-Log "New Certs: LocalMachine\My"
|
||||
Get-ChildItem cert:"LocalMachine\My"
|
||||
Write-Log "New Certs: LocalMachine\Root"
|
||||
Get-ChildItem cert:"LocalMachine\Root" | Where-Object { $_.Subject -match 'QMI' }
|
||||
$NewCerts = Get-ChildItem cert:"LocalMachine\Root" | Where-Object { $_.Subject -match 'QMI' }
|
||||
|
||||
if ($NewCerts) {
|
||||
Write-Log "Restarting all Qlik Sense services"
|
||||
Restart-Service QlikSenseServiceDispatcher -Force
|
||||
Restart-Service QlikLoggingService -Force
|
||||
Restart-Service QlikSenseRepositoryService -Force
|
||||
Restart-Service QlikSenseProxyService -Force
|
||||
Restart-Service QlikSenseEngineService -Force
|
||||
Restart-Service QlikSenseSchedulerService -Force
|
||||
Restart-Service QlikSensePrintingService -Force
|
||||
|
||||
Start-Sleep -s 20
|
||||
Write-Log "Recovering Qlik Sense users"
|
||||
Start-Process powershell.exe -ArgumentList "Start-Process cmd.exe -Verb runAs -ArgumentList '/c C:\provision\updatedir.bat'"
|
||||
Restart-Service QlikSenseRepositoryService -Force
|
||||
|
||||
} else {
|
||||
Write-Error "Error: Qlik Sense Certs not recreated!"
|
||||
throw "Error: Qlik Sense Certs not recreated!"
|
||||
}
|
||||
|
||||
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 5 /f
|
||||
@@ -1,10 +0,0 @@
|
||||
@echo off
|
||||
set host_name=localhost
|
||||
set owner_name=postgres
|
||||
set PGPASSWORD=Qlik1234
|
||||
|
||||
C: && cd "C:\Program Files\Qlik\Sense\Repository\PostgreSQL\9.6\bin" && psql -p 4432 -U %owner_name% -d QSR --command "UPDATE public.\"Users\" SET \"UserDirectory\" = '%COMPUTERNAME%', \"RolesString\" = 'RootAdmin' WHERE \"UserDirectory\" != 'INTERNAL';"
|
||||
psql -p 4432 -U %owner_name% -d QSR --command "SELECT * FROM public.\"Users\" WHERE \"RolesString\" = 'RootAdmin';"
|
||||
|
||||
cd "C:\provision"
|
||||
@echo off
|
||||
9
aws-olh-prereqs/kinesis.tf
Normal file
9
aws-olh-prereqs/kinesis.tf
Normal file
@@ -0,0 +1,9 @@
|
||||
resource "aws_kinesis_stream" "qlik_stream" {
|
||||
name = "qlik-data-stream-${var.provision_id}" # Change the name as needed
|
||||
shard_count = 1
|
||||
stream_mode_details {
|
||||
stream_mode = "PROVISIONED"
|
||||
}
|
||||
|
||||
retention_period = 24 # Optional: Retain records for 24 hours (default)
|
||||
}
|
||||
14
aws-olh-prereqs/kms.tf
Normal file
14
aws-olh-prereqs/kms.tf
Normal file
@@ -0,0 +1,14 @@
|
||||
resource "aws_kms_key" "qlik_key" {
|
||||
description = "QMIOpenLakehouse - Customer managed key for Qlik resources"
|
||||
deletion_window_in_days = 10
|
||||
enable_key_rotation = true
|
||||
|
||||
tags = {
|
||||
Alias = "kms-for-qmi-olh-${var.provision_id}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_kms_alias" "qlik_key_alias" {
|
||||
name = "alias/kms-for-qmi-olh-${var.provision_id}"
|
||||
target_key_id = aws_kms_key.qlik_key.key_id
|
||||
}
|
||||
8
aws-olh-prereqs/main.tf
Normal file
8
aws-olh-prereqs/main.tf
Normal file
@@ -0,0 +1,8 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 6.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
71
aws-olh-prereqs/output.tf
Normal file
71
aws-olh-prereqs/output.tf
Normal file
@@ -0,0 +1,71 @@
|
||||
output "AWS_ACCOUNT_ID" {
|
||||
value = var.aws_account_id
|
||||
}
|
||||
|
||||
output "VPC_ID" {
|
||||
value = aws_vpc.main.id
|
||||
|
||||
}
|
||||
|
||||
output "VPC_CIDR" {
|
||||
value = var.vpc_cidr
|
||||
}
|
||||
|
||||
output "PUBLIC_SUBNET_CIDRS" {
|
||||
value = var.public_subnet_cidrs
|
||||
}
|
||||
|
||||
output "SUBNETS_IDS" {
|
||||
value = aws_subnet.public[*].id
|
||||
|
||||
}
|
||||
|
||||
output "PUBLIC_SUBNET_AZS" {
|
||||
value = [
|
||||
for subnet in aws_subnet.public : subnet.availability_zone
|
||||
]
|
||||
}
|
||||
|
||||
output "KMS_KEY_ARN" {
|
||||
value = aws_kms_key.qlik_key.arn
|
||||
}
|
||||
|
||||
output "KINESIS_STREAM_NAME" {
|
||||
value = aws_kinesis_stream.qlik_stream.name
|
||||
}
|
||||
|
||||
output "SECURITY_GROUP_ID" {
|
||||
value = aws_security_group.allow_tls.id
|
||||
}
|
||||
|
||||
output "MANAGEMENT_ROLE_ARN" {
|
||||
value = aws_iam_role.olh_mgmt_role.arn
|
||||
}
|
||||
|
||||
output "EC2_INTANCE_ROLE_ARN" {
|
||||
value = aws_iam_role.olh_ec2_role.arn
|
||||
}
|
||||
|
||||
output "EC2_INTANCE_PROFILE_ARN" {
|
||||
value = aws_iam_instance_profile.ec2_instance_profile.arn
|
||||
}
|
||||
|
||||
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_BUCKET_ACCESS_KEY" {
|
||||
value = module.qmi-s3-bucket.iam_access_key
|
||||
}
|
||||
|
||||
output "S3_BUCKET_ACCESS_SECRET" {
|
||||
value = module.qmi-s3-bucket.iam_access_secret
|
||||
}
|
||||
|
||||
output "TAGS" {
|
||||
value = "Environment = QMI-${var.provision_id}"
|
||||
}
|
||||
156
aws-olh-prereqs/role-ec2.tf
Normal file
156
aws-olh-prereqs/role-ec2.tf
Normal file
@@ -0,0 +1,156 @@
|
||||
resource "aws_iam_role" "olh_ec2_role" {
|
||||
name = "qmi_olh_ec2_${var.provision_id}"
|
||||
|
||||
assume_role_policy = jsonencode({
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": "sts:AssumeRole",
|
||||
"Principal": {
|
||||
"Service" : "ec2.amazonaws.com"
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
resource "aws_iam_role_policy" "server_policy" {
|
||||
|
||||
name = "qmi-olh-${var.provision_id}_s3_policy"
|
||||
role = aws_iam_role.olh_ec2_role.id
|
||||
|
||||
policy = jsonencode({
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"ec2:AttachVolume",
|
||||
"ec2:DetachVolume",
|
||||
"autoscaling:SetInstanceHealth"
|
||||
],
|
||||
"Condition": {
|
||||
"Null": {
|
||||
"aws:ResourceTag/qlik_cluster": "false"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"cloudwatch:PutMetricData"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:kinesis:*:*:stream/${aws_kinesis_stream.qlik_stream.name}"
|
||||
],
|
||||
"Action": [
|
||||
"kinesis:PutRecord",
|
||||
"kinesis:DescribeStreamSummary",
|
||||
"kinesis:ListShards",
|
||||
"kinesis:PutRecords",
|
||||
"kinesis:GetShardIterator",
|
||||
"kinesis:GetRecords",
|
||||
"kinesis:DescribeStream",
|
||||
"kinesis:ListStreamConsumers"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"s3:ListBucket",
|
||||
"s3:GetBucketLocation"
|
||||
],
|
||||
"Resource": "arn:aws:s3:::${module.qmi-s3-bucket.bucket.s3_bucket_id}"
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:s3:::${module.qmi-s3-bucket.bucket.s3_bucket_id}",
|
||||
"arn:aws:s3:::${module.qmi-s3-bucket.bucket.s3_bucket_id}/*"
|
||||
],
|
||||
"Action": [
|
||||
"s3:PutObject",
|
||||
"s3:GetObject",
|
||||
"s3:AbortMultipartUpload",
|
||||
"s3:DeleteObjectVersion",
|
||||
"s3:ListBucket",
|
||||
"s3:DeleteObject",
|
||||
"s3:GetObjectVersion"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:ssm:*:*:parameter/qlik/*"
|
||||
],
|
||||
"Action": [
|
||||
"ssm:GetParameter",
|
||||
"ssm:PutParameter"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"${aws_kms_key.qlik_key.arn}"
|
||||
],
|
||||
"Action": [
|
||||
"kms:*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"sts:AssumeRole"
|
||||
],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"sts:ExternalId": "6b69f9c3c8f502f2ddfc8434d443f172ebe4c032f4ef1a3c51215d27a58ca799"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"glue:CreateTable",
|
||||
"glue:UpdateTable",
|
||||
"glue:DeleteTable",
|
||||
"glue:BatchDeleteTable",
|
||||
"glue:GetTable",
|
||||
"glue:GetTables",
|
||||
"glue:CreateDatabase",
|
||||
"glue:UpdateDatabase",
|
||||
"glue:GetDatabase",
|
||||
"glue:GetDatabases",
|
||||
"glue:GetUserDefinedFunction"
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:glue:us-east-1:*:catalog",
|
||||
"arn:aws:glue:us-east-1:*:database/*",
|
||||
"arn:aws:glue:us-east-1:*:table/*/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
resource "aws_iam_instance_profile" "ec2_instance_profile" {
|
||||
name = "qmi-olh-instance-profile-${var.provision_id}"
|
||||
role = aws_iam_role.olh_ec2_role.name
|
||||
}
|
||||
233
aws-olh-prereqs/role-mgmt.tf
Normal file
233
aws-olh-prereqs/role-mgmt.tf
Normal file
@@ -0,0 +1,233 @@
|
||||
resource "aws_iam_role" "olh_mgmt_role" {
|
||||
name = "qmi_olh_mgmt_${var.provision_id}"
|
||||
|
||||
assume_role_policy = jsonencode({
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Principal": {
|
||||
"AWS": "arn:aws:iam::072398622971:role/upsolver-proxy-assume-role"
|
||||
},
|
||||
"Action": [
|
||||
"sts:AssumeRole"
|
||||
],
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"sts:ExternalId": "6b69f9c3c8f502f2ddfc8434d443f172ebe4c032f4ef1a3c51215d27a58ca799"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": "sts:AssumeRole",
|
||||
"Principal": {
|
||||
"Service" : "ec2.amazonaws.com"
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
resource "aws_iam_role_policy" "inline_policy" {
|
||||
|
||||
name = "qmi-olh-role-policy-${var.provision_id}"
|
||||
role = aws_iam_role.olh_mgmt_role.id
|
||||
|
||||
policy = jsonencode({
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"ec2:CancelSpotInstanceRequests",
|
||||
"ec2:CreateLaunchTemplate",
|
||||
"ec2:CreateTags",
|
||||
"ec2:CreateVolume",
|
||||
"ec2:DescribeAddresses",
|
||||
"ec2:DescribeImageAttribute",
|
||||
"ec2:DescribeImages",
|
||||
"ec2:DescribeInstanceStatus",
|
||||
"ec2:DescribeInstanceTypeOfferings",
|
||||
"ec2:DescribeInstanceTypes",
|
||||
"ec2:DescribeInstances",
|
||||
"ec2:DescribeLaunchTemplateVersions",
|
||||
"ec2:DescribeLaunchTemplates",
|
||||
"ec2:DescribeSecurityGroups",
|
||||
"ec2:DescribeSpotInstanceRequests",
|
||||
"ec2:DescribeSpotPriceHistory",
|
||||
"ec2:DescribeTags",
|
||||
"ec2:DescribeRegions",
|
||||
"ec2:DescribeSubnets",
|
||||
"ec2:DescribeRouteTables",
|
||||
"ec2:DescribeSecurityGroups",
|
||||
"ec2:RequestSpotInstances",
|
||||
"ec2:DescribeVolumes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:ec2:*::image/*",
|
||||
"arn:aws:ec2:*:*:instance/*",
|
||||
"arn:aws:ec2:*:*:key-pair/*",
|
||||
"arn:aws:ec2:*:*:launch-template/*",
|
||||
"arn:aws:ec2:*:*:network-interface/*",
|
||||
"arn:aws:ec2:*:*:security-group/*",
|
||||
"arn:aws:ec2:*:*:subnet/*",
|
||||
"arn:aws:ec2:*:*:volume/*"
|
||||
],
|
||||
"Action": [
|
||||
"ec2:RunInstances"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"ec2:AttachVolume",
|
||||
"ec2:DeleteVolume",
|
||||
"ec2:DetachVolume",
|
||||
"ec2:DeleteLaunchTemplate",
|
||||
"ec2:TerminateInstances",
|
||||
"ec2:StartInstances",
|
||||
"ec2:ModifyLaunchTemplate",
|
||||
"ec2:DeleteLaunchTemplateVersions",
|
||||
"ec2:CreateLaunchTemplateVersion"
|
||||
],
|
||||
"Condition": {
|
||||
"Null": {
|
||||
"aws:ResourceTag/qlik_cluster": "false"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"autoscaling:DeleteAutoScalingGroup",
|
||||
"autoscaling:DeletePolicy",
|
||||
"autoscaling:PutScalingPolicy",
|
||||
"autoscaling:StartInstanceRefresh",
|
||||
"autoscaling:TerminateInstanceInAutoScalingGroup",
|
||||
"autoscaling:UpdateAutoScalingGroup"
|
||||
],
|
||||
"Condition": {
|
||||
"Null": {
|
||||
"aws:ResourceTag/qlik_cluster": "false"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"autoscaling:CreateAutoScalingGroup",
|
||||
"autoscaling:CreateOrUpdateTags",
|
||||
"autoscaling:DescribeAutoScalingGroups",
|
||||
"autoscaling:DescribeInstanceRefreshes",
|
||||
"autoscaling:DescribePolicies",
|
||||
"autoscaling:DescribeScalingActivities"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"ec2:DescribeRegions",
|
||||
"ec2:DescribeSubnets",
|
||||
"ec2:DescribeRouteTables",
|
||||
"ec2:DescribeSecurityGroups"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"cloudwatch:DescribeAlarmHistory",
|
||||
"cloudwatch:DescribeAlarms",
|
||||
"cloudwatch:DescribeAlarmsForMetric",
|
||||
"cloudwatch:GetMetricStatistics",
|
||||
"cloudwatch:ListMetrics",
|
||||
"cloudwatch:PutMetricData"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"cloudwatch:PutMetricAlarm",
|
||||
"cloudwatch:DeleteAlarms"
|
||||
],
|
||||
"Condition": {
|
||||
"Null": {
|
||||
"aws:ResourceTag/qlik_cluster": "false"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"iam:AddRoleToInstanceProfile",
|
||||
"iam:CreateServiceLinkedRole",
|
||||
"iam:GetPolicy",
|
||||
"iam:GetPolicyVersion",
|
||||
"iam:ListAccountAliases",
|
||||
"iam:ListAttachedRolePolicies",
|
||||
"iam:ListInstanceProfiles",
|
||||
"iam:ListInstanceProfilesForRole",
|
||||
"iam:ListPolicies",
|
||||
"iam:ListRoles",
|
||||
"iam:PassRole"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"*"
|
||||
],
|
||||
"Action": [
|
||||
"sts:DecodeAuthorizationMessage"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"arn:aws:ssm:*:${var.aws_account_id}:parameter/qlik/*"
|
||||
],
|
||||
"Action": [
|
||||
"ssm:PutParameter"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Resource": [
|
||||
"${aws_kms_key.qlik_key.arn}"
|
||||
],
|
||||
"Action": [
|
||||
"kms:GenerateDataKeyPairWithoutPlaintext",
|
||||
"kms:Encrypt"
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
10
aws-olh-prereqs/s3.tf
Normal file
10
aws-olh-prereqs/s3.tf
Normal file
@@ -0,0 +1,10 @@
|
||||
module "qmi-s3-bucket" {
|
||||
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//s3-bucket"
|
||||
|
||||
bucket_name = "qmi-olh-bucket-${var.provision_id}"
|
||||
provision_id = var.provision_id
|
||||
user_id = var.user_id
|
||||
forced_destroy = var.forced_destroy
|
||||
|
||||
}
|
||||
30
aws-olh-prereqs/variables.tf
Normal file
30
aws-olh-prereqs/variables.tf
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
variable "aws_account_id" {
|
||||
description = "AWS account ID"
|
||||
}
|
||||
|
||||
variable "region" {
|
||||
description = "AWS region"
|
||||
default = "us-east-1"
|
||||
}
|
||||
|
||||
variable "provision_id" {
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
}
|
||||
|
||||
variable "vpc_cidr" {
|
||||
default = "10.0.0.0/16"
|
||||
}
|
||||
|
||||
variable "public_subnet_cidrs" {
|
||||
default = ["10.0.1.0/24", "10.0.2.0/24"]
|
||||
}
|
||||
|
||||
variable "forced_destroy" {
|
||||
default = null
|
||||
}
|
||||
|
||||
|
||||
|
||||
74
aws-olh-prereqs/vpc.tf
Normal file
74
aws-olh-prereqs/vpc.tf
Normal file
@@ -0,0 +1,74 @@
|
||||
resource "aws_vpc" "main" {
|
||||
cidr_block = var.vpc_cidr
|
||||
enable_dns_support = true
|
||||
enable_dns_hostnames = true
|
||||
|
||||
tags = {
|
||||
Name = "qmi-olh-vpc-${var.provision_id}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_internet_gateway" "igw" {
|
||||
vpc_id = aws_vpc.main.id
|
||||
|
||||
tags = {
|
||||
Name = "qmi-olh-igw-${var.provision_id}"
|
||||
}
|
||||
}
|
||||
|
||||
data "aws_availability_zones" "available" {
|
||||
state = "available"
|
||||
}
|
||||
|
||||
resource "aws_subnet" "public" {
|
||||
count = length(var.public_subnet_cidrs)
|
||||
vpc_id = aws_vpc.main.id
|
||||
cidr_block = var.public_subnet_cidrs[count.index]
|
||||
availability_zone = data.aws_availability_zones.available.names[count.index]
|
||||
map_public_ip_on_launch = true
|
||||
|
||||
tags = {
|
||||
Name = "qmi-olh-subnet-${var.provision_id}-${count.index + 1}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_route_table" "public" {
|
||||
vpc_id = aws_vpc.main.id
|
||||
|
||||
route {
|
||||
cidr_block = "0.0.0.0/0"
|
||||
gateway_id = aws_internet_gateway.igw.id
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_route_table_association" "public_assoc" {
|
||||
count = length(var.public_subnet_cidrs)
|
||||
subnet_id = aws_subnet.public[count.index].id
|
||||
route_table_id = aws_route_table.public.id
|
||||
}
|
||||
|
||||
|
||||
resource "aws_security_group" "allow_tls" {
|
||||
name = "olh-${var.provision_id}-SG"
|
||||
description = "olh-${var.provision_id}-SG"
|
||||
vpc_id = aws_vpc.main.id
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_ingress_rule" "allow_tls_ipv4" {
|
||||
security_group_id = aws_security_group.allow_tls.id
|
||||
|
||||
cidr_ipv4 = var.vpc_cidr
|
||||
ip_protocol = "tcp"
|
||||
from_port = 0
|
||||
to_port = 65535
|
||||
|
||||
description = "olh-${var.provision_id}-ingress-rule"
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_egress_rule" "allow_tls_ipv4" {
|
||||
|
||||
security_group_id = aws_security_group.allow_tls.id
|
||||
cidr_ipv4 = "0.0.0.0/0"
|
||||
ip_protocol = "-1"
|
||||
description = "olh-${var.provision_id}-egress-rule"
|
||||
}
|
||||
@@ -1,20 +1,10 @@
|
||||
data "azurerm_key_vault_secret" "compose-license" {
|
||||
name = "compose-license"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
data "azurerm_key_vault_secret" "c4dw" {
|
||||
name = "compose-datawarehouse-license"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
data "azurerm_key_vault_secret" "cert-password" {
|
||||
name = "star-qmi-qlikpoc-com-password"
|
||||
key_vault_id = var.key_vault_id
|
||||
}
|
||||
|
||||
locals {
|
||||
composeLicense = (var.c_version == "c4dw")? data.azurerm_key_vault_secret.c4dw.value : data.azurerm_key_vault_secret.compose-license.value
|
||||
cert_password = nonsensitive(data.azurerm_key_vault_secret.cert-password.value)
|
||||
}
|
||||
|
||||
# Install and configure Compose
|
||||
@@ -30,7 +20,7 @@ resource "null_resource" "install" {
|
||||
https = false
|
||||
timeout = "30m"
|
||||
}
|
||||
source = "${path.module}/scripts"
|
||||
source = "${path.module}/main"
|
||||
destination = "C:/provision/compose-install"
|
||||
}
|
||||
|
||||
@@ -46,10 +36,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-install.ps1 -url ${var.download_url}",
|
||||
"powershell.exe -File C:/provision/compose-install/di-compose-setlicense.ps1 -version ${var.c_version}",
|
||||
"powershell.exe -File C:/provision/compose-install/di-compose-installQMICertificate.ps1 -CertPwd \"${local.cert_password}\" -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
|
||||
]
|
||||
}
|
||||
@@ -1,25 +1,20 @@
|
||||
[{CC3EB4FA-1694-4961-93E6-D7F0DA630806}-DlgOrder]
|
||||
Dlg0={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdWelcome-0
|
||||
Count=5
|
||||
Dlg1={CC3EB4FA-1694-4961-93E6-D7F0DA630806}-SdLicense2Rtf-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}-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]
|
||||
[{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
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
21
compose-install/scripts/compose-license.txt
Normal file
21
compose-install/scripts/compose-license.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$type": "ComposeLicense",
|
||||
"product": "QlikCompose",
|
||||
"issued_to": "Qlik Internal",
|
||||
"issued_by": "Attunity US",
|
||||
"license_type": "EVALUATION",
|
||||
"serial_no": "85011700",
|
||||
"expiration_date": "2025-12-31",
|
||||
"hosts": "",
|
||||
"product_version": "2024.12",
|
||||
"notes": "",
|
||||
"host_role": "",
|
||||
"source_db_types": "",
|
||||
"dwh_type": "*",
|
||||
"dl_type": "*",
|
||||
"number_of_dms": "0",
|
||||
"number_of_developers": "0",
|
||||
"managed_dwh_size": "0",
|
||||
"issue_time": "12/18/2024 8:31:25 PM",
|
||||
"signature": "bMVg+X1Saxvcux5I96eU+oHndPWHv4E1QzxYwgo/cGpfVltneqGgBrVPmjotMGxp705aj29jGQLHNSx/0bBlwJd9DcfLAKaS/mH9mfph50KWRV1+ZLgPVQmmDHv/vFYLoIQLoyV2RqhMGN2rbVEXrQLzXRa+FWQEbulVa05Uvog="
|
||||
}
|
||||
@@ -9,25 +9,36 @@ Intent: Install the selected version of Attunity Replicate
|
||||
#>
|
||||
|
||||
Param(
|
||||
[string] $url,
|
||||
[string] $version = "gen2"
|
||||
[string] $url
|
||||
)
|
||||
|
||||
Import-Module $PSScriptRoot\q-helper.psm1 | Out-Null
|
||||
|
||||
$fileName = $url.Substring($url.LastIndexOf("/") + 1)
|
||||
|
||||
Write-Host "--- Starting di-compose-install.ps1"
|
||||
|
||||
$bin = "$PSScriptRoot\binaries\Attunity"
|
||||
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 ( $url -Match "2021.2" ) {
|
||||
$issFile="Compose_install_2021.2.0.iss"
|
||||
}
|
||||
if ( $url -Match "Attunity_Compose_for_Data_Warehouses" ) {
|
||||
$issFile="Compose_install_c4dw.iss"
|
||||
}
|
||||
|
||||
Write-Host "Using ISS file: $issFile"
|
||||
|
||||
Write-Host $bin\$fileName
|
||||
|
||||
if (Test-Path "$($bin)\Compose_silent_x64_install.log") {
|
||||
Remove-Item -Path "$($bin)\Compose_silent_x64_install.log" -Force
|
||||
}
|
||||
|
||||
If ((Test-Path $bin\$fileName))
|
||||
{
|
||||
Write-Host "Installing Attunity Compose from $($bin)\$($fileName)"
|
||||
@@ -35,20 +46,22 @@ If ((Test-Path $bin\$fileName))
|
||||
$fileNoExtension = [IO.Path]::GetFileNameWithoutExtension("$bin\$fileName")
|
||||
Expand-Archive $bin\$fileName -DestinationPath $bin\$fileNoExtension -Force
|
||||
|
||||
#Write-Host "Binary decompressed in folder $($bin)\$($fileNoExtension)"
|
||||
Write-Host "Binary decompressed in folder $($bin)\$($fileNoExtension)"
|
||||
$exec = Get-ChildItem $bin\$fileNoExtension\*.exe | Select-Object -ExpandProperty Name
|
||||
#Write-Host "Exec: $($exec)"
|
||||
|
||||
$C4DWInstall = "$($bin)\$($fileNoExtension)\$($exec) /s /f1$($PSScriptRoot)\$($issFile) /f2$($bin)\Compose_silent_x64_install.log"
|
||||
$silentInstall = "$($bin)\$($fileNoExtension)\$($exec) /s /f1$($PSScriptRoot)\$($issFile) /f2$($bin)\Compose_silent_x64_install.log"
|
||||
|
||||
Write-Host "Run Compose silent installation : $($C4DWInstall)"
|
||||
Invoke-Expression $C4DWInstall
|
||||
Start-Sleep 5
|
||||
|
||||
Write-Host "Run Compose silent installation : $($silentInstall)"
|
||||
Invoke-Expression $silentInstall
|
||||
while (!(Test-Path "$($bin)\Compose_silent_x64_install.log")) {
|
||||
Write-Host "[Waiting Compose to be installed] ..."
|
||||
Start-Sleep 2
|
||||
Start-Sleep 4
|
||||
}
|
||||
$C4DWResults = Get-IniFile "$($bin)\Compose_silent_x64_install.log"
|
||||
$testResult = $C4DWResults.ResponseResult.ResultCode
|
||||
$resultLogs = Get-IniFile "$($bin)\Compose_silent_x64_install.log"
|
||||
$testResult = $resultLogs.ResponseResult.ResultCode
|
||||
Write-Host "Installation return code : $($testResult)"
|
||||
|
||||
}
|
||||
|
||||
@@ -6,23 +6,28 @@ Param(
|
||||
|
||||
try {
|
||||
Write-Host "Install qmi_qlik-poc_com certificate on Windows"
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
(New-Object System.Net.WebClient).DownloadFile("https://gitlab.com/qmi/qmi-cloud-tf-modules/-/raw/master/qmicerts/wildcard_qmi_qlik-poc_com.pfx", "$PSScriptRoot\wildcard_qmi_qlik-poc_com.pfx")
|
||||
|
||||
$secpasswd = ConvertTo-SecureString $CertPwd -AsPlainText -Force
|
||||
$sslCert = Import-PfxCertificate -FilePath $PSScriptRoot/wildcard_qmi_qlik-poc_com.pfx -CertStoreLocation Cert:\LocalMachine\My -Password $secpasswd
|
||||
$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
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -9,14 +9,10 @@ Intent: Setting the DBs
|
||||
#>
|
||||
|
||||
Param(
|
||||
[string] $composeLicense,
|
||||
[string] $version = 'gen2'
|
||||
)
|
||||
|
||||
Write-Host "ComposeLicenseJSON"
|
||||
Write-Host $composeLicense
|
||||
|
||||
Set-Content $PSScriptRoot\compose-license.txt $composeLicense
|
||||
Write-Host "--- Setting Compose License"
|
||||
|
||||
# TODO set license
|
||||
$bin = "C:\Program Files\Qlik\Compose\bin\"
|
||||
@@ -25,11 +21,22 @@ 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 "2022.2.0" -or $version -eq "c4dw") {
|
||||
# Old way
|
||||
$cmd = "$($bin)ComposeCli.exe register_license --req @$PSScriptRoot\compose-license.txt"
|
||||
} else {
|
||||
# New way
|
||||
$cmd = "$($bin)ComposeCli.exe register_license --infile $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
|
||||
}
|
||||
BIN
databases/.DS_Store
vendored
Normal file
BIN
databases/.DS_Store
vendored
Normal file
Binary file not shown.
148
databases/aws-emr/main.tf
Normal file
148
databases/aws-emr/main.tf
Normal file
@@ -0,0 +1,148 @@
|
||||
terraform {
|
||||
|
||||
required_version = ">= 1.1"
|
||||
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module "s3_bucket" {
|
||||
source = "terraform-aws-modules/s3-bucket/aws"
|
||||
version = "~> 3.0"
|
||||
|
||||
bucket_prefix = "qmi-bucket-${var.provision_id}"
|
||||
|
||||
# Allow deletion of non-empty bucket
|
||||
# Example usage only - not recommended for production
|
||||
force_destroy = true
|
||||
|
||||
attach_deny_insecure_transport_policy = true
|
||||
attach_require_latest_tls_policy = true
|
||||
|
||||
block_public_acls = true
|
||||
block_public_policy = true
|
||||
ignore_public_acls = true
|
||||
restrict_public_buckets = true
|
||||
|
||||
server_side_encryption_configuration = {
|
||||
rule = {
|
||||
apply_server_side_encryption_by_default = {
|
||||
sse_algorithm = "AES256"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tags = {
|
||||
QMI_user = var.user_id
|
||||
ProvID = var.provision_id
|
||||
Name = "qmi-emr-${var.provision_id}"
|
||||
Owner = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
module "emr" {
|
||||
source = "terraform-aws-modules/emr/aws"
|
||||
|
||||
name = var.provision_id
|
||||
|
||||
release_label = "emr-6.11.0"
|
||||
applications = ["spark", "hadoop", "hive", "hue"]
|
||||
auto_termination_policy = {
|
||||
idle_timeout = 3600
|
||||
}
|
||||
|
||||
bootstrap_action = {
|
||||
example = {
|
||||
name = "Just an example",
|
||||
path = "file:/bin/echo",
|
||||
args = ["Hello World!"]
|
||||
}
|
||||
}
|
||||
|
||||
configurations_json = jsonencode([
|
||||
{
|
||||
"classification" : "spark-env",
|
||||
"configurations" : [
|
||||
{
|
||||
"classification" : "export",
|
||||
"properties" : {
|
||||
"JAVA_HOME" : "/usr/lib/jvm/java-1.8.0"
|
||||
}
|
||||
}
|
||||
],
|
||||
"properties" : {}
|
||||
},
|
||||
{
|
||||
"classification": "hive-site",
|
||||
"properties": {
|
||||
"hive.support.concurrency": "true",
|
||||
"hive.exec.dynamic.partition.mode": "nonstrict",
|
||||
"hive.txn.manager": "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager"
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
master_instance_group = {
|
||||
name = "master-group"
|
||||
instance_count = 1
|
||||
instance_type = "m5.xlarge"
|
||||
}
|
||||
|
||||
core_instance_group = {
|
||||
name = "core-group"
|
||||
instance_count = 1
|
||||
instance_type = "c4.large"
|
||||
}
|
||||
|
||||
task_instance_group = {
|
||||
name = "task-group"
|
||||
instance_count = 1
|
||||
instance_type = "c5.xlarge"
|
||||
bid_price = "0.1"
|
||||
|
||||
ebs_config = {
|
||||
size = 64
|
||||
type = "gp3"
|
||||
volumes_per_instance = 1
|
||||
}
|
||||
ebs_optimized = true
|
||||
}
|
||||
|
||||
ebs_root_volume_size = 64
|
||||
ec2_attributes = {
|
||||
# Instance groups only support one Subnet/AZ
|
||||
# Subnets should be private subnets and tagged with
|
||||
# { "for-use-with-amazon-emr-managed-policies" = true }
|
||||
subnet_id = var.subnet_ids_us[0]
|
||||
}
|
||||
vpc_id = var.vpc_id_us
|
||||
|
||||
list_steps_states = ["PENDING", "RUNNING", "CANCEL_PENDING", "CANCELLED", "FAILED", "INTERRUPTED", "COMPLETED"]
|
||||
log_uri = "s3://${module.s3_bucket.s3_bucket_id}/"
|
||||
|
||||
scale_down_behavior = "TERMINATE_AT_TASK_COMPLETION"
|
||||
step_concurrency_level = 3
|
||||
termination_protection = false
|
||||
visible_to_all_users = true
|
||||
|
||||
is_private_cluster = false
|
||||
#create_service_iam_role = false
|
||||
#service_iam_role_arn = "arn:aws:iam::192018133564:role/service-role/AmazonEMR-ServiceRole-20230622T122656"
|
||||
#create_iam_instance_profile = false
|
||||
#iam_instance_profile_name = "AmazonEMR-InstanceProfile-20230622T122640"
|
||||
|
||||
tags = {
|
||||
Environment = "QMI-${var.provision_id}"
|
||||
Deployment = "QMI-${var.provision_id}"
|
||||
Terraform = "true"
|
||||
Environment = "dev"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
ProvID = var.provision_id
|
||||
Name = "qmi-emr-${var.provision_id}"
|
||||
}
|
||||
}
|
||||
15
databases/aws-emr/outputs.tf
Normal file
15
databases/aws-emr/outputs.tf
Normal file
@@ -0,0 +1,15 @@
|
||||
output "s3_bucket" {
|
||||
value = module.qmi-s3-bucket.bucket.s3_bucket_id
|
||||
}
|
||||
|
||||
output "s3_iam_name" {
|
||||
value = module.qmi-s3-bucket.iam_name
|
||||
}
|
||||
|
||||
output "s3_iam_access_key" {
|
||||
value = module.qmi-s3-bucket.iam_access_key
|
||||
}
|
||||
|
||||
output "s3_iam_access_secret" {
|
||||
value = module.qmi-s3-bucket.iam_access_secret
|
||||
}
|
||||
34
databases/aws-emr/variables.tf
Normal file
34
databases/aws-emr/variables.tf
Normal file
@@ -0,0 +1,34 @@
|
||||
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"]
|
||||
}
|
||||
120
databases/aws-kinesis/main.tf
Normal file
120
databases/aws-kinesis/main.tf
Normal file
@@ -0,0 +1,120 @@
|
||||
|
||||
terraform {
|
||||
|
||||
required_version = ">= 0.13"
|
||||
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 3.69.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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}"
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI-${var.provision_id}"
|
||||
Environment = "QMI-${var.provision_id}"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
ProvID = var.provision_id
|
||||
Name = "qmi-${var.provision_id}"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resource "aws_kinesis_stream" "attrep_apply_exceptions" {
|
||||
|
||||
name = "${local.scnamelower}.attrep_apply_exceptions"
|
||||
shard_count = 1
|
||||
|
||||
/*stream_mode_details {
|
||||
stream_mode = "PROVISIONED"
|
||||
}*/
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
resource "aws_kinesis_stream" "semployees" {
|
||||
|
||||
name = "${local.scnamelower}.EMPLOYEES"
|
||||
shard_count = 3
|
||||
|
||||
/*stream_mode_details {
|
||||
stream_mode = "PROVISIONED"
|
||||
}*/
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
resource "aws_kinesis_stream" "sjobs" {
|
||||
|
||||
name = "${local.scnamelower}.JOBS"
|
||||
shard_count = 3
|
||||
|
||||
/*stream_mode_details {
|
||||
stream_mode = "PROVISIONED"
|
||||
}*/
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
resource "aws_kinesis_stream" "metadata" {
|
||||
|
||||
name = "${local.scnamelower}.metadata"
|
||||
shard_count = 1
|
||||
|
||||
/*stream_mode_details {
|
||||
stream_mode = "PROVISIONED"
|
||||
}*/
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
module "iam_user" {
|
||||
source = "terraform-aws-modules/iam/aws//modules/iam-user"
|
||||
|
||||
|
||||
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 = local.tags
|
||||
|
||||
}
|
||||
|
||||
resource "aws_iam_user_policy" "kinesis_pol" {
|
||||
|
||||
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 = nonsensitive(module.iam_user.this_iam_access_key_secret)
|
||||
}
|
||||
10
databases/aws-kinesis/variables.tf
Normal file
10
databases/aws-kinesis/variables.tf
Normal file
@@ -0,0 +1,10 @@
|
||||
variable "region" {
|
||||
default = "us-east-1"
|
||||
}
|
||||
|
||||
variable "provision_id" {
|
||||
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
}
|
||||
@@ -1,98 +1,60 @@
|
||||
terraform {
|
||||
|
||||
required_version = ">= 0.13"
|
||||
required_version = ">= 0.14"
|
||||
|
||||
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 = "_!"
|
||||
upper = true
|
||||
lower = true
|
||||
min_numeric = 2
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
|
||||
locals {
|
||||
provid5 = substr(var.provision_id, 0, 5)
|
||||
aurora = (var.engine == "aurora-mysql") ? true : (var.engine == "aurora-postgresql") ? true : false
|
||||
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 = (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" : (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
|
||||
|
||||
port = var.port[var.engine]
|
||||
engine_version = var.engine_version[var.engine]
|
||||
major_engine_version = var.major_engine_version[var.engine]
|
||||
family = var.family[var.engine]
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI-${var.provision_id}"
|
||||
Environment = "QMI-${var.provision_id}"
|
||||
"Cost Center" = "3100"
|
||||
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 = "qmi-${var.provision_id}"
|
||||
Owner = var.user_id
|
||||
}
|
||||
|
||||
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"]
|
||||
|
||||
ingress_with_cidr_blocks = [
|
||||
{
|
||||
from_port = local.port
|
||||
to_port = local.port
|
||||
protocol = "tcp"
|
||||
description = "RDS"
|
||||
|
||||
},
|
||||
]
|
||||
|
||||
# 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"]
|
||||
|
||||
egress_with_cidr_blocks = [
|
||||
{
|
||||
from_port = local.port
|
||||
to_port = local.port
|
||||
protocol = "tcp"
|
||||
description = "RDS"
|
||||
|
||||
},
|
||||
]
|
||||
|
||||
tags = local.tags
|
||||
is_postgres = length(regexall("postgres", local.family)) > 0 ? true : false
|
||||
is_mysql = length(regexall("mysql", local.family)) > 0 ? true : false
|
||||
}
|
||||
|
||||
|
||||
module "common_rds_instance" {
|
||||
source = "terraform-aws-modules/rds/aws"
|
||||
version = "~> 3.3"
|
||||
version = "= 6.1.1"
|
||||
|
||||
count = local.aurora ? 0 : 1
|
||||
|
||||
providers = {
|
||||
aws = aws.myaws
|
||||
}
|
||||
count = local.aurora? 0 : 1
|
||||
|
||||
identifier = "${var.engine}${var.provision_id}"
|
||||
|
||||
@@ -102,62 +64,172 @@ module "common_rds_instance" {
|
||||
major_engine_version = local.major_engine_version # DB option group
|
||||
instance_class = var.instance_size
|
||||
allocated_storage = var.storage
|
||||
storage_encrypted = (var.engine == "sqlserver-ex")? false : true
|
||||
|
||||
license_model = local.license
|
||||
|
||||
name = local.name
|
||||
db_name = local.name
|
||||
username = "qmirdsuser"
|
||||
create_random_password = true
|
||||
random_password_length = 12
|
||||
password = random_password.password.result
|
||||
manage_master_user_password = false
|
||||
port = local.port
|
||||
|
||||
multi_az = false
|
||||
subnet_ids = local.subnet_ids
|
||||
vpc_security_group_ids = [module.security_group.security_group_id]
|
||||
vpc_security_group_ids = [
|
||||
aws_security_group.allow_tls.id,
|
||||
aws_security_group.allow_tls_2.id
|
||||
]
|
||||
publicly_accessible = true
|
||||
|
||||
maintenance_window = "Mon:00:00-Mon:03:00"
|
||||
backup_window = "03:00-06:00"
|
||||
|
||||
backup_retention_period = 0
|
||||
backup_retention_period = 1
|
||||
skip_final_snapshot = true
|
||||
deletion_protection = false
|
||||
|
||||
parameters = local.is_postgres? [
|
||||
{
|
||||
apply_method = "pending-reboot"
|
||||
name = "rds.logical_replication"
|
||||
value = 1
|
||||
},
|
||||
{
|
||||
apply_method = "pending-reboot"
|
||||
name = "max_wal_senders"
|
||||
value = 10
|
||||
},
|
||||
{
|
||||
apply_method = "pending-reboot"
|
||||
name = "max_replication_slots"
|
||||
value = 10
|
||||
}
|
||||
] : local.is_mysql? [{
|
||||
name = "binlog_format"
|
||||
value = "row"
|
||||
}]: []
|
||||
|
||||
tags = local.tags
|
||||
|
||||
}
|
||||
|
||||
|
||||
resource "aws_rds_cluster_parameter_group" "pg-postgres" {
|
||||
|
||||
count = var.engine == "aurora-postgresql"? 1 : 0
|
||||
|
||||
name = "rds-cluster-pg-${var.provision_id}"
|
||||
family = "aurora-postgresql14"
|
||||
description = "RDS aurora-postgresql14 cluster parameter group"
|
||||
|
||||
parameter {
|
||||
apply_method = "pending-reboot"
|
||||
name = "rds.logical_replication"
|
||||
value = 1
|
||||
}
|
||||
|
||||
parameter {
|
||||
apply_method = "pending-reboot"
|
||||
name = "max_wal_senders"
|
||||
value = 10
|
||||
}
|
||||
|
||||
parameter {
|
||||
apply_method = "pending-reboot"
|
||||
name = "max_replication_slots"
|
||||
value = 10
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resource "aws_rds_cluster_parameter_group" "pg-mysql" {
|
||||
|
||||
count = var.engine == "aurora-mysql"? 1 : 0
|
||||
|
||||
name = "rds-cluster-pg-${var.provision_id}"
|
||||
family = "aurora-mysql8.0"
|
||||
description = "RDS aurora-mysql8.0 cluster parameter group"
|
||||
|
||||
parameter {
|
||||
apply_method = "pending-reboot"
|
||||
name = "binlog_format"
|
||||
value = "row"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module "aurora_rds_instance" {
|
||||
|
||||
depends_on = [
|
||||
aws_rds_cluster_parameter_group.pg-postgres,
|
||||
aws_rds_cluster_parameter_group.pg-mysql
|
||||
]
|
||||
|
||||
source = "terraform-aws-modules/rds-aurora/aws"
|
||||
version = "~> 5.2"
|
||||
version = "~> 8.3.1"
|
||||
|
||||
count = local.aurora ? 1 : 0
|
||||
|
||||
providers = {
|
||||
aws = aws.myaws
|
||||
}
|
||||
count = local.aurora? 1 : 0
|
||||
|
||||
name = local.name
|
||||
engine = var.engine
|
||||
engine_version = local.engine_version
|
||||
instance_type = var.instance_size
|
||||
instance_class = var.instance_size
|
||||
|
||||
database_name = local.name
|
||||
|
||||
instances = { 1 = {} }
|
||||
|
||||
autoscaling_enabled = true
|
||||
autoscaling_min_capacity = 1
|
||||
autoscaling_max_capacity = 3
|
||||
|
||||
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 = [
|
||||
aws_security_group.allow_tls.id,
|
||||
aws_security_group.allow_tls_2.id
|
||||
]
|
||||
port = local.port
|
||||
publicly_accessible = true
|
||||
|
||||
username = "qmirdsuser"
|
||||
create_random_password = true
|
||||
master_username = "qmirdsuser"
|
||||
manage_master_user_password = false
|
||||
master_password = random_password.password.result
|
||||
create_db_subnet_group = true
|
||||
|
||||
|
||||
|
||||
backup_retention_period = 0
|
||||
backup_retention_period = 1
|
||||
skip_final_snapshot = true
|
||||
deletion_protection = false
|
||||
|
||||
tags = local.tags
|
||||
|
||||
db_cluster_parameter_group_name = "rds-cluster-pg-${var.provision_id}"
|
||||
|
||||
}
|
||||
|
||||
locals {
|
||||
|
||||
type = (var.engine == "mysql" || var.engine == "mariadb")? "mysql" : (var.engine == "postgres" || var.engine == "aurora-postgres")? "postgres" : (var.engine == "sqlserver-ex")? "mssql" : null
|
||||
port4dummy = (local.aurora)? module.aurora_rds_instance[0].cluster_port : module.common_rds_instance[0].db_instance_port
|
||||
host = (local.aurora)? "${module.aurora_rds_instance[0].cluster_endpoint}:${local.port4dummy}" : module.common_rds_instance[0].db_instance_endpoint
|
||||
username = (local.aurora)? nonsensitive(module.aurora_rds_instance[0].cluster_master_username) : nonsensitive(module.common_rds_instance[0].db_instance_username)
|
||||
password = nonsensitive(random_password.password.result)
|
||||
database = (var.engine == "postgres" || var.engine == "aurora-postgres")? "postgres" : local.name
|
||||
}
|
||||
|
||||
|
||||
module "dummy-data" {
|
||||
|
||||
count = var.dummydata != null && local.type != null? 1 : 0
|
||||
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//databases/dummy"
|
||||
|
||||
type = local.type
|
||||
host = local.host
|
||||
username = local.username
|
||||
password = local.password
|
||||
database = local.database
|
||||
}
|
||||
|
||||
@@ -1,21 +1,31 @@
|
||||
output "db_username" {
|
||||
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
|
||||
sensitive = true
|
||||
value = (local.aurora)? nonsensitive(module.aurora_rds_instance[0].cluster_master_username) : nonsensitive(module.common_rds_instance[0].db_instance_username)
|
||||
}
|
||||
|
||||
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
|
||||
sensitive = true
|
||||
value = nonsensitive(random_password.password.result)
|
||||
}
|
||||
|
||||
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)? module.aurora_rds_instance[0].cluster_port : module.common_rds_instance[0].db_instance_port
|
||||
}
|
||||
|
||||
output "db_instance_endpoint" {
|
||||
description = "The connection endpoint"
|
||||
value = local.aurora ? module.aurora_rds_instance[0].rds_cluster_endpoint : module.common_rds_instance[0].db_instance_endpoint
|
||||
value = (local.aurora)? module.aurora_rds_instance[0].cluster_endpoint : module.common_rds_instance[0].db_instance_endpoint
|
||||
}
|
||||
|
||||
output "db_instance_id" {
|
||||
value = (local.aurora)? null : "${var.engine}${var.provision_id}"
|
||||
}
|
||||
|
||||
output "db_instance_name" {
|
||||
value = local.name
|
||||
}
|
||||
|
||||
output "dummy_data_databases_available" {
|
||||
value = var.dummydata != null && local.type != null? module.dummy-data[0].dbs : null
|
||||
}
|
||||
|
||||
69
databases/aws-rds/sec_groups.tf
Normal file
69
databases/aws-rds/sec_groups.tf
Normal file
@@ -0,0 +1,69 @@
|
||||
module "fw-ips" {
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//databases/firewall_ips"
|
||||
}
|
||||
|
||||
resource "aws_security_group" "allow_tls" {
|
||||
name = "${var.provision_id}-SG"
|
||||
description = "${var.provision_id}-SG"
|
||||
vpc_id = local.vpc_id
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_ingress_rule" "allow_tls_ipv4" {
|
||||
for_each = toset(module.fw-ips.cidr_blocks)
|
||||
|
||||
security_group_id = aws_security_group.allow_tls.id
|
||||
|
||||
cidr_ipv4 = each.key
|
||||
from_port = local.port
|
||||
ip_protocol = "tcp"
|
||||
to_port = local.port
|
||||
description = "dbport"
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_egress_rule" "allow_tls_ipv4" {
|
||||
|
||||
for_each = toset(module.fw-ips.cidr_blocks)
|
||||
|
||||
security_group_id = aws_security_group.allow_tls.id
|
||||
|
||||
cidr_ipv4 = each.key
|
||||
from_port = local.port
|
||||
ip_protocol = "tcp"
|
||||
to_port = local.port
|
||||
description = "dbport"
|
||||
}
|
||||
|
||||
resource "aws_security_group" "allow_tls_2" {
|
||||
name = "${var.provision_id}-SG2"
|
||||
description = "${var.provision_id}-SG2"
|
||||
vpc_id = local.vpc_id
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_ingress_rule" "allow_tls_ipv4_2" {
|
||||
for_each = toset(module.fw-ips.cidr_blocks_others)
|
||||
|
||||
security_group_id = aws_security_group.allow_tls_2.id
|
||||
|
||||
cidr_ipv4 = each.key
|
||||
from_port = local.port
|
||||
ip_protocol = "tcp"
|
||||
to_port = local.port
|
||||
description = "Others - dbport"
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_egress_rule" "allow_tls_ipv_2" {
|
||||
|
||||
for_each = toset(module.fw-ips.cidr_blocks_others)
|
||||
|
||||
security_group_id = aws_security_group.allow_tls_2.id
|
||||
|
||||
cidr_ipv4 = each.key
|
||||
from_port = local.port
|
||||
ip_protocol = "tcp"
|
||||
to_port = local.port
|
||||
description = "Others - dbport"
|
||||
}
|
||||
@@ -1,9 +1,3 @@
|
||||
variable "aws_provider_access_key" {
|
||||
}
|
||||
|
||||
variable "aws_provider_access_secret" {
|
||||
}
|
||||
|
||||
variable "region" {
|
||||
default = "us-east-1"
|
||||
}
|
||||
@@ -44,25 +38,79 @@ variable "engine" {
|
||||
description = "Accepted values are mysql, sqlserver-ex, postgres, oracle-se2, aurora-mysql, aurora-postgresql, mariadb"
|
||||
}
|
||||
|
||||
variable "engine_version" {
|
||||
default = "8.0.25"
|
||||
description = "Not currently used"
|
||||
}
|
||||
|
||||
variable "major_eng" {
|
||||
default = "8.0"
|
||||
description = "Not currently used"
|
||||
}
|
||||
|
||||
variable "family" {
|
||||
default = "mysql8.0"
|
||||
description = "Not currently used"
|
||||
}
|
||||
|
||||
variable "instance_size" {
|
||||
default = "db.t3.large"
|
||||
}
|
||||
|
||||
variable "storage" {
|
||||
default = "20"
|
||||
default = "100"
|
||||
}
|
||||
|
||||
variable "engine_version" {
|
||||
type = map
|
||||
|
||||
default = {
|
||||
<<<<<<< HEAD
|
||||
"mysql" = "8.0.32"
|
||||
=======
|
||||
"mysql" = "8.0.36"
|
||||
>>>>>>> master
|
||||
"postgres" = "14.12"
|
||||
"oracle-se2" = "19.0.0.0.ru-2023-04.rur-2023-04.r1"
|
||||
"sqlserver-ex" = "15.00.4236.7.v1"
|
||||
"mariadb" = "10.5"
|
||||
"aurora-mysql" = "8.0.mysql_aurora.3.02.3" #"5.7.mysql_aurora.2.11.2"
|
||||
"aurora-postgresql" = "14.5"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
variable "major_engine_version" {
|
||||
type = map
|
||||
|
||||
default = {
|
||||
"mysql" = "8.0"
|
||||
"postgres" = "14"
|
||||
"oracle-se2" = "19"
|
||||
"sqlserver-ex" = "15.00"
|
||||
"mariadb" = "10.5"
|
||||
# for script compatibility only
|
||||
"aurora-mysql" = "not_used"
|
||||
"aurora-postgresql" = "not_used"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
variable "family" {
|
||||
type = map
|
||||
|
||||
default = {
|
||||
"mysql" = "mysql8.0"
|
||||
"postgres" = "postgres14"
|
||||
"oracle-se2" = "oracle-se2-19"
|
||||
"sqlserver-ex" = "sqlserver-ex-15.0"
|
||||
"mariadb" = "mariadb10.5"
|
||||
# for script compatibility only
|
||||
"aurora-mysql" = "not_used"
|
||||
"aurora-postgresql" = "not_used"
|
||||
}
|
||||
}
|
||||
|
||||
variable "port" {
|
||||
type = map
|
||||
|
||||
default = {
|
||||
"mysql" = "3306"
|
||||
"postgres" = "5432"
|
||||
"oracle-se2" = "1521"
|
||||
"sqlserver-ex" = "1433"
|
||||
"mariadb" = "3306"
|
||||
"aurora-mysql" = "3306"
|
||||
"aurora-postgresql" = "5432"
|
||||
}
|
||||
}
|
||||
|
||||
variable "dummydata" {
|
||||
default = null
|
||||
}
|
||||
|
||||
69
databases/aws-redshift/main.tf
Normal file
69
databases/aws-redshift/main.tf
Normal file
@@ -0,0 +1,69 @@
|
||||
terraform {
|
||||
|
||||
required_version = ">= 0.14"
|
||||
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 6.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "random_password" "password" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!"
|
||||
min_numeric = 1
|
||||
upper = true
|
||||
lower = true
|
||||
numeric = true
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
locals {
|
||||
s3_prefix = "redshift/qmi-${var.provision_id}"
|
||||
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 = {
|
||||
Deployment = "QMI-${var.provision_id}"
|
||||
Environment = "QMI-${var.provision_id}"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
ProvID = var.provision_id
|
||||
Name = "qmi-${var.provision_id}"
|
||||
Owner = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
module "qmi-s3-bucket" {
|
||||
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//s3-bucket"
|
||||
|
||||
provision_id = var.provision_id
|
||||
user_id = var.user_id
|
||||
}
|
||||
|
||||
|
||||
resource "aws_redshift_cluster" "qmi" {
|
||||
cluster_identifier = "qmi-${var.provision_id}"
|
||||
database_name = var.cluster_database_name
|
||||
master_username = var.cluster_master_username
|
||||
master_password = random_password.password.result
|
||||
node_type = "ra3.large"
|
||||
cluster_type = "single-node"
|
||||
|
||||
skip_final_snapshot = true
|
||||
|
||||
vpc_security_group_ids = [aws_security_group.allow_tls.id, aws_security_group.allow_tls_2.id]
|
||||
|
||||
publicly_accessible = true
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
|
||||
42
databases/aws-redshift/outputs.tf
Normal file
42
databases/aws-redshift/outputs.tf
Normal file
@@ -0,0 +1,42 @@
|
||||
output "redshift_cluster_id" {
|
||||
description = "The availability zone of the RDS instance"
|
||||
value = aws_redshift_cluster.qmi.id
|
||||
}
|
||||
|
||||
output "redshift_cluster_endpoint" {
|
||||
description = "Redshift endpoint"
|
||||
value = aws_redshift_cluster.qmi.endpoint
|
||||
}
|
||||
|
||||
output "redshift_cluster_port" {
|
||||
description = "Redshift port"
|
||||
value = aws_redshift_cluster.qmi.port
|
||||
}
|
||||
|
||||
output "redshift_cluster_database_name" {
|
||||
value = aws_redshift_cluster.qmi.database_name
|
||||
}
|
||||
|
||||
output "redshift_cluster_master_username" {
|
||||
value = var.cluster_master_username
|
||||
}
|
||||
|
||||
output "redshift_cluster_master_password" {
|
||||
value = nonsensitive(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
|
||||
}
|
||||
69
databases/aws-redshift/sec_groups.tf
Normal file
69
databases/aws-redshift/sec_groups.tf
Normal file
@@ -0,0 +1,69 @@
|
||||
module "fw-ips" {
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//databases/firewall_ips"
|
||||
}
|
||||
|
||||
resource "aws_security_group" "allow_tls" {
|
||||
name = "${var.provision_id}-SG"
|
||||
description = "${var.provision_id}-SG"
|
||||
vpc_id = local.vpc_id
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_ingress_rule" "allow_tls_ipv4" {
|
||||
for_each = toset(module.fw-ips.cidr_blocks)
|
||||
|
||||
security_group_id = aws_security_group.allow_tls.id
|
||||
|
||||
cidr_ipv4 = each.key
|
||||
from_port = local.port
|
||||
ip_protocol = "tcp"
|
||||
to_port = local.port
|
||||
description = "dbport"
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_egress_rule" "allow_tls_ipv4" {
|
||||
|
||||
for_each = toset(module.fw-ips.cidr_blocks)
|
||||
|
||||
security_group_id = aws_security_group.allow_tls.id
|
||||
|
||||
cidr_ipv4 = each.key
|
||||
from_port = local.port
|
||||
ip_protocol = "tcp"
|
||||
to_port = local.port
|
||||
description = "dbport"
|
||||
}
|
||||
|
||||
resource "aws_security_group" "allow_tls_2" {
|
||||
name = "${var.provision_id}-SG2"
|
||||
description = "${var.provision_id}-SG2"
|
||||
vpc_id = local.vpc_id
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_ingress_rule" "allow_tls_ipv4_2" {
|
||||
for_each = toset(module.fw-ips.cidr_blocks_others)
|
||||
|
||||
security_group_id = aws_security_group.allow_tls_2.id
|
||||
|
||||
cidr_ipv4 = each.key
|
||||
from_port = local.port
|
||||
ip_protocol = "tcp"
|
||||
to_port = local.port
|
||||
description = "Others - dbport"
|
||||
}
|
||||
|
||||
resource "aws_vpc_security_group_egress_rule" "allow_tls_ipv_2" {
|
||||
|
||||
for_each = toset(module.fw-ips.cidr_blocks_others)
|
||||
|
||||
security_group_id = aws_security_group.allow_tls_2.id
|
||||
|
||||
cidr_ipv4 = each.key
|
||||
from_port = local.port
|
||||
ip_protocol = "tcp"
|
||||
to_port = local.port
|
||||
description = "Others - dbport"
|
||||
}
|
||||
42
databases/aws-redshift/variables.tf
Normal file
42
databases/aws-redshift/variables.tf
Normal file
@@ -0,0 +1,42 @@
|
||||
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 = "qmiuser"
|
||||
}
|
||||
73
databases/azure-eventhub/main.tf
Normal file
73
databases/azure-eventhub/main.tf
Normal file
@@ -0,0 +1,73 @@
|
||||
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-${var.provision_id}"
|
||||
Environment = "QMI-${var.provision_id}"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
Owner = 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 = nonsensitive(azurerm_eventhub_namespace.ehbnamespace.default_primary_connection_string)
|
||||
}
|
||||
|
||||
output "default_primary_key" {
|
||||
value = nonsensitive(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
|
||||
}
|
||||
107
databases/azure-hdinsight-hadoop/main.tf
Normal file
107
databases/azure-hdinsight-hadoop/main.tf
Normal file
@@ -0,0 +1,107 @@
|
||||
|
||||
resource "random_password" "password1" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!@"
|
||||
upper = true
|
||||
lower = true
|
||||
min_numeric = 2
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
resource "random_password" "password2" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!@"
|
||||
upper = true
|
||||
lower = true
|
||||
min_numeric = 2
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
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 = 5
|
||||
}
|
||||
|
||||
resource "azurerm_storage_account" "example" {
|
||||
name = "hdinsightstor${random_id.randomMachineId.hex}"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
account_tier = "Standard"
|
||||
account_replication_type = "LRS"
|
||||
|
||||
tags = var.tags
|
||||
}
|
||||
|
||||
resource "azurerm_storage_container" "example" {
|
||||
name = "hdinsight"
|
||||
storage_account_name = azurerm_storage_account.example.name
|
||||
container_access_type = "private"
|
||||
}
|
||||
|
||||
resource "azurerm_role_assignment" "data-contributor-dbricksapp1" {
|
||||
scope = azurerm_storage_account.example.id
|
||||
role_definition_name = "Contributor"
|
||||
principal_id = var.dbricks_app_registration_principal_id
|
||||
}
|
||||
|
||||
resource "azurerm_role_assignment" "data-contributor-dbricksapp2" {
|
||||
scope = azurerm_storage_account.example.id
|
||||
role_definition_name = "Storage Blob Data Contributor"
|
||||
principal_id = var.dbricks_app_registration_principal_id
|
||||
}
|
||||
|
||||
resource "azurerm_hdinsight_hadoop_cluster" "example" {
|
||||
name = "hdicluster-${var.provision_id}"
|
||||
resource_group_name = var.resource_group_name
|
||||
location = var.location
|
||||
cluster_version = "4.0"
|
||||
tier = "Standard"
|
||||
|
||||
tags = var.tags
|
||||
|
||||
component_version {
|
||||
hadoop = "3.1"
|
||||
}
|
||||
|
||||
gateway {
|
||||
username = "acctestusrgw"
|
||||
password = random_password.password1.result
|
||||
}
|
||||
|
||||
storage_account {
|
||||
storage_container_id = azurerm_storage_container.example.id
|
||||
storage_account_key = azurerm_storage_account.example.primary_access_key
|
||||
is_default = true
|
||||
}
|
||||
|
||||
roles {
|
||||
head_node {
|
||||
vm_size = "Standard_D3_V2"
|
||||
username = "acctestusrvm"
|
||||
password = random_password.password2.result
|
||||
}
|
||||
|
||||
worker_node {
|
||||
vm_size = "Standard_D3_V2"
|
||||
username = "acctestusrvm"
|
||||
password = random_password.password2.result
|
||||
target_instance_count = 2
|
||||
}
|
||||
|
||||
zookeeper_node {
|
||||
vm_size = "Standard_D3_V2"
|
||||
username = "acctestusrvm"
|
||||
password = random_password.password2.result
|
||||
}
|
||||
}
|
||||
}
|
||||
67
databases/azure-hdinsight-hadoop/outputs.tf
Normal file
67
databases/azure-hdinsight-hadoop/outputs.tf
Normal file
@@ -0,0 +1,67 @@
|
||||
output "gateway-creds" {
|
||||
value = {
|
||||
username = "acctestusrgw"
|
||||
password = nonsensitive(random_password.password1.result)
|
||||
}
|
||||
}
|
||||
|
||||
output "cluster-creds" {
|
||||
value = {
|
||||
username = "acctestusrvm"
|
||||
password = nonsensitive(random_password.password2.result)
|
||||
}
|
||||
}
|
||||
|
||||
output "https_endpoint" {
|
||||
value = azurerm_hdinsight_hadoop_cluster.example.https_endpoint
|
||||
}
|
||||
|
||||
output "ssh_endpoint" {
|
||||
value = azurerm_hdinsight_hadoop_cluster.example.ssh_endpoint
|
||||
}
|
||||
|
||||
|
||||
output "Azure_Active_Directory_Tenant_ID" {
|
||||
value = "c21eeb5f-f5a6-44e8-a997-124f2f7a497c"
|
||||
}
|
||||
|
||||
output "Azure_Application_Registration_Client_ID" {
|
||||
value = var.dbricks_app_registration_application_id
|
||||
}
|
||||
|
||||
output "Azure_Application_Registration_Secret" {
|
||||
<<<<<<< HEAD
|
||||
value = "~qp8Q~utl~YJ3skNM9kAuq25VY~rKxxOWpaVYcnQ"
|
||||
=======
|
||||
value = "i3F8Q~FxhoyOP1-4r9sstaohnjxXaf~ulhVJFav_"
|
||||
>>>>>>> master
|
||||
}
|
||||
|
||||
|
||||
output "adls_StorageAccount-Name" {
|
||||
value = azurerm_storage_account.example.name
|
||||
}
|
||||
|
||||
output "adls_StorageAccount-ContainerName" {
|
||||
value = azurerm_storage_container.example.name
|
||||
}
|
||||
|
||||
output "adls_StorageAccount-AccessKey" {
|
||||
value = nonsensitive(azurerm_storage_account.example.primary_access_key)
|
||||
}
|
||||
|
||||
output "adls_Azure_Active_Directory_Tenant_ID" {
|
||||
value = "c21eeb5f-f5a6-44e8-a997-124f2f7a497c"
|
||||
}
|
||||
|
||||
output "adls_Azure_Application_Registration_Client_ID" {
|
||||
value = var.dbricks_app_registration_application_id
|
||||
}
|
||||
|
||||
output "adls_Azure_Application_Registration_Secret" {
|
||||
<<<<<<< HEAD
|
||||
value = "~qp8Q~utl~YJ3skNM9kAuq25VY~rKxxOWpaVYcnQ"
|
||||
=======
|
||||
value = "i3F8Q~FxhoyOP1-4r9sstaohnjxXaf~ulhVJFav_"
|
||||
>>>>>>> master
|
||||
}
|
||||
26
databases/azure-hdinsight-hadoop/variables.tf
Normal file
26
databases/azure-hdinsight-hadoop/variables.tf
Normal file
@@ -0,0 +1,26 @@
|
||||
variable "resource_group_name" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "provision_id" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
type = string
|
||||
default = "EAST US"
|
||||
}
|
||||
|
||||
variable "tags" {
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "dbricks_app_registration_principal_id" {
|
||||
description = "databricks-qmi"
|
||||
default = "efeee17c-d2b3-4e7c-a163-9995b7d281e2"
|
||||
}
|
||||
|
||||
variable "dbricks_app_registration_application_id" {
|
||||
description = "databricks-qmi"
|
||||
default = "9ccb0d99-3bba-4695-aa47-df77bf512084"
|
||||
}
|
||||
29
databases/azure-rds-flexmysql/firewall.tf
Normal file
29
databases/azure-rds-flexmysql/firewall.tf
Normal file
@@ -0,0 +1,29 @@
|
||||
module "fw-ips" {
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//databases/firewall_ips"
|
||||
}
|
||||
|
||||
resource "azurerm_mysql_flexible_server_firewall_rule" "fw_rule" {
|
||||
for_each = module.fw-ips.ips_az_qcs
|
||||
|
||||
name = each.key
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_flexible_server.mysql-server.name
|
||||
start_ip_address = each.value.0
|
||||
end_ip_address = each.value.1
|
||||
|
||||
}
|
||||
|
||||
module "dummy-data" {
|
||||
|
||||
count = var.dummydata != null? 1 : 0
|
||||
|
||||
depends_on = [ azurerm_mysql_flexible_server_firewall_rule.fw_rule ]
|
||||
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//databases/dummy"
|
||||
|
||||
type = "mysql"
|
||||
host = "${azurerm_mysql_flexible_server.mysql-server.fqdn}:3306"
|
||||
username = var.admin_login
|
||||
password = nonsensitive(random_password.password.result)
|
||||
database = ""
|
||||
}
|
||||
53
databases/azure-rds-flexmysql/main.tf
Normal file
53
databases/azure-rds-flexmysql/main.tf
Normal file
@@ -0,0 +1,53 @@
|
||||
resource "random_password" "password" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!"
|
||||
upper = true
|
||||
lower = true
|
||||
min_numeric = 2
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
resource "azurerm_mysql_flexible_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_password = random_password.password.result
|
||||
|
||||
storage {
|
||||
size_gb = var.mysql-storage
|
||||
}
|
||||
|
||||
backup_retention_days = 7
|
||||
sku_name = var.mysql-sku-name
|
||||
version = var.mysql-version
|
||||
|
||||
geo_redundant_backup_enabled = false
|
||||
//public_network_access_enabled = true
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_mysql_flexible_database" "example" {
|
||||
name = "QlikDB"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_flexible_server.mysql-server.name
|
||||
charset = "utf8"
|
||||
collation = "utf8_unicode_ci"
|
||||
}
|
||||
|
||||
resource "azurerm_mysql_flexible_server_configuration" "example" {
|
||||
name = "binlog_row_image"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mysql_flexible_server.mysql-server.name
|
||||
value = "full"
|
||||
}
|
||||
15
databases/azure-rds-flexmysql/output.tf
Normal file
15
databases/azure-rds-flexmysql/output.tf
Normal file
@@ -0,0 +1,15 @@
|
||||
output "db_server_fqdn" {
|
||||
value = azurerm_mysql_flexible_server.mysql-server.fqdn
|
||||
}
|
||||
|
||||
output "root_username" {
|
||||
value = var.admin_login
|
||||
}
|
||||
|
||||
output "root_username_password" {
|
||||
value = nonsensitive(random_password.password.result)
|
||||
}
|
||||
|
||||
output "dummy_data_databases_available" {
|
||||
value = var.dummydata != null? module.dummy-data[0].dbs : null
|
||||
}
|
||||
47
databases/azure-rds-flexmysql/variables.tf
Normal file
47
databases/azure-rds-flexmysql/variables.tf
Normal file
@@ -0,0 +1,47 @@
|
||||
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 = "8.0.21"
|
||||
}
|
||||
variable "mysql-sku-name" {
|
||||
type = string
|
||||
description = "MySQL SKU Name"
|
||||
<<<<<<< HEAD
|
||||
default = "GP_Standard_D4ds_v4"
|
||||
=======
|
||||
default = "B_Standard_B2s"
|
||||
>>>>>>> master
|
||||
}
|
||||
variable "mysql-storage" {
|
||||
type = string
|
||||
description = "MySQL Storage in MB"
|
||||
default = "20"
|
||||
}
|
||||
|
||||
variable "dummydata" {
|
||||
default = null
|
||||
}
|
||||
13
databases/azure-rds-flexpostgres/firewall.tf
Normal file
13
databases/azure-rds-flexpostgres/firewall.tf
Normal file
@@ -0,0 +1,13 @@
|
||||
module "fw-ips" {
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//databases/firewall_ips"
|
||||
}
|
||||
|
||||
resource "azurerm_postgresql_flexible_server_firewall_rule" "fw_rule" {
|
||||
for_each = module.fw-ips.ips_az_qcs
|
||||
|
||||
name = each.key
|
||||
server_id = azurerm_postgresql_flexible_server.postgresql-server.id
|
||||
start_ip_address = each.value.0
|
||||
end_ip_address = each.value.1
|
||||
|
||||
}
|
||||
54
databases/azure-rds-flexpostgres/main.tf
Normal file
54
databases/azure-rds-flexpostgres/main.tf
Normal file
@@ -0,0 +1,54 @@
|
||||
resource "random_password" "password" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!)"
|
||||
upper = true
|
||||
lower = true
|
||||
min_numeric = 2
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
resource "azurerm_postgresql_flexible_server" "postgresql-server" {
|
||||
name = "qmi-postgresql-${var.provision_id}"
|
||||
location = var.location
|
||||
resource_group_name = var.resource_group_name
|
||||
|
||||
version = var.postgresql-version
|
||||
|
||||
administrator_login = var.admin_login
|
||||
administrator_password = random_password.password.result
|
||||
|
||||
storage_mb = var.postgresql-storage
|
||||
sku_name = var.postgresql-sku-name
|
||||
|
||||
geo_redundant_backup_enabled = false
|
||||
|
||||
tags = {
|
||||
Deployment = "QMI PoC"
|
||||
"Cost Center" = "3100"
|
||||
QMI_user = var.user_id
|
||||
Owner = var.user_id
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
resource "azurerm_postgresql_flexible_server_configuration" "conf1" {
|
||||
name = "wal_level"
|
||||
server_id = azurerm_postgresql_flexible_server.postgresql-server.id
|
||||
value = "logical"
|
||||
}
|
||||
|
||||
resource "azurerm_postgresql_flexible_server_configuration" "conf2" {
|
||||
name = "log_statement"
|
||||
server_id = azurerm_postgresql_flexible_server.postgresql-server.id
|
||||
value = "all"
|
||||
}
|
||||
|
||||
resource "azurerm_postgresql_flexible_server_database" "postgresql-db" {
|
||||
name = "QlikPostgresqlDB"
|
||||
server_id = azurerm_postgresql_flexible_server.postgresql-server.id
|
||||
collation = "en_US.utf8"
|
||||
charset = "utf8"
|
||||
}
|
||||
11
databases/azure-rds-flexpostgres/output.tf
Normal file
11
databases/azure-rds-flexpostgres/output.tf
Normal file
@@ -0,0 +1,11 @@
|
||||
output "db_server_fqdn" {
|
||||
value = azurerm_postgresql_flexible_server.postgresql-server.fqdn
|
||||
}
|
||||
|
||||
output "root_username" {
|
||||
value = var.admin_login
|
||||
}
|
||||
|
||||
output "root_username_password" {
|
||||
value = nonsensitive(random_password.password.result)
|
||||
}
|
||||
41
databases/azure-rds-flexpostgres/variables.tf
Normal file
41
databases/azure-rds-flexpostgres/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 = "14"
|
||||
}
|
||||
variable "postgresql-sku-name" {
|
||||
type = string
|
||||
description = "PostgreSQL SKU Name"
|
||||
default = "B_Standard_B2s"
|
||||
}
|
||||
variable "postgresql-storage" {
|
||||
type = string
|
||||
description = "PostgreSQL Storage in MB"
|
||||
default = "32768"
|
||||
}
|
||||
|
||||
variable "user_id" {
|
||||
|
||||
}
|
||||
26
databases/azure-rds-mariadb/firewall.tf
Normal file
26
databases/azure-rds-mariadb/firewall.tf
Normal file
@@ -0,0 +1,26 @@
|
||||
resource "azurerm_mariadb_virtual_network_rule" "vnetrule" {
|
||||
|
||||
count = var.subnet_id != null? 1 : 0
|
||||
|
||||
name = "vnet-rule-${var.provision_id}"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mariadb_server.mariadb-server.name
|
||||
subnet_id = var.subnet_id
|
||||
|
||||
}
|
||||
|
||||
module "fw-ips" {
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//databases/firewall_ips"
|
||||
}
|
||||
|
||||
|
||||
resource "azurerm_mariadb_firewall_rule" "fw_rule" {
|
||||
for_each = module.fw-ips.ips
|
||||
|
||||
name = each.key
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mariadb_server.mariadb-server.name
|
||||
start_ip_address = each.value.0
|
||||
end_ip_address = each.value.1
|
||||
|
||||
}
|
||||
61
databases/azure-rds-mariadb/main.tf
Normal file
61
databases/azure-rds-mariadb/main.tf
Normal file
@@ -0,0 +1,61 @@
|
||||
resource "random_password" "password" {
|
||||
length = 16
|
||||
special = true
|
||||
override_special = "_!"
|
||||
upper = true
|
||||
lower = true
|
||||
min_numeric = 2
|
||||
min_lower = 2
|
||||
min_upper = 2
|
||||
min_special = 2
|
||||
}
|
||||
|
||||
|
||||
resource "azurerm_mariadb_server" "mariadb-server" {
|
||||
name = "qmi-mariadb-${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.sku-name
|
||||
version = var.db-version
|
||||
|
||||
storage_mb = var.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
|
||||
Owner = var.user_id
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_mariadb_database" "mariadb-db" {
|
||||
name = "QlikDB"
|
||||
resource_group_name = var.resource_group_name
|
||||
server_name = azurerm_mariadb_server.mariadb-server.name
|
||||
charset = "utf8"
|
||||
collation = "utf8_unicode_ci"
|
||||
}
|
||||
|
||||
/*
|
||||
module "dummy-data" {
|
||||
|
||||
source = "git::https://gitlab.com/qmi/qmi-cloud-tf-modules.git//databases/dummy"
|
||||
|
||||
type = "mysql"
|
||||
host = "${azurerm_mariadb_server.mariadb-server.fqdn}:3306"
|
||||
username = var.admin_login
|
||||
password = nonsensitive(random_password.password.result)
|
||||
database = ""
|
||||
}
|
||||
*/
|
||||
11
databases/azure-rds-mariadb/output.tf
Normal file
11
databases/azure-rds-mariadb/output.tf
Normal file
@@ -0,0 +1,11 @@
|
||||
output "db_server_fqdn" {
|
||||
value = azurerm_mariadb_server.mariadb-server.fqdn
|
||||
}
|
||||
|
||||
output "root_username" {
|
||||
value = "${var.admin_login}@qmi-mariadb-${var.provision_id}"
|
||||
}
|
||||
|
||||
output "root_username_password" {
|
||||
value = nonsensitive(random_password.password.result)
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user