@gradientedge/cdk-utils 10.6.0 → 10.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/api-destined-function/src/lib/lambda.d.ts +1 -0
- package/dist/app/api-destined-function/src/lib/lambda.d.ts.map +1 -0
- package/dist/app/api-destined-function/src/lib/lambda.js +1 -0
- package/dist/app/api-destined-function/src/lib/lambda.js.map +1 -0
- package/dist/app/api-destined-function/tsconfig.tsbuildinfo +1 -0
- package/dist/src/lib/aws/services/cloudwatch/main.d.ts +11 -11
- package/dist/src/lib/azure/common/constants.d.ts +74 -0
- package/dist/src/lib/azure/common/constants.js +77 -0
- package/dist/src/lib/azure/common/construct.d.ts +15 -3
- package/dist/src/lib/azure/common/construct.js +40 -4
- package/dist/src/lib/azure/common/stack.d.ts +3 -2
- package/dist/src/lib/azure/common/stack.js +25 -42
- package/dist/src/lib/azure/common/types.d.ts +13 -2
- package/dist/src/lib/azure/construct/event-handler/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/event-handler/index.js +2 -0
- package/dist/src/lib/azure/construct/event-handler/main.d.ts +20 -0
- package/dist/src/lib/azure/construct/event-handler/main.js +139 -0
- package/dist/src/lib/azure/construct/event-handler/types.d.ts +35 -0
- package/dist/src/lib/azure/construct/event-handler/types.js +1 -0
- package/dist/src/lib/azure/construct/function-app/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/function-app/index.js +2 -0
- package/dist/src/lib/azure/construct/function-app/main.d.ts +51 -0
- package/dist/src/lib/azure/construct/function-app/main.js +297 -0
- package/dist/src/lib/azure/construct/function-app/types.d.ts +33 -0
- package/dist/src/lib/azure/construct/function-app/types.js +1 -0
- package/dist/src/lib/azure/construct/index.d.ts +6 -0
- package/dist/src/lib/azure/construct/index.js +6 -0
- package/dist/src/lib/azure/construct/rest-api/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/rest-api/index.js +2 -0
- package/dist/src/lib/azure/construct/rest-api/main.d.ts +20 -0
- package/dist/src/lib/azure/construct/rest-api/main.js +172 -0
- package/dist/src/lib/azure/construct/rest-api/types.d.ts +25 -0
- package/dist/src/lib/azure/construct/rest-api/types.js +1 -0
- package/dist/src/lib/azure/construct/rest-api-function/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/rest-api-function/index.js +2 -0
- package/dist/src/lib/azure/construct/rest-api-function/main.d.ts +19 -0
- package/dist/src/lib/azure/construct/rest-api-function/main.js +255 -0
- package/dist/src/lib/azure/construct/rest-api-function/types.d.ts +29 -0
- package/dist/src/lib/azure/construct/rest-api-function/types.js +1 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/index.js +2 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/main.d.ts +12 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/main.js +56 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/types.d.ts +13 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/types.js +1 -0
- package/dist/src/lib/azure/construct/site-with-webapp/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/site-with-webapp/index.js +2 -0
- package/dist/src/lib/azure/construct/site-with-webapp/main.d.ts +19 -0
- package/dist/src/lib/azure/construct/site-with-webapp/main.js +135 -0
- package/dist/src/lib/azure/construct/site-with-webapp/types.d.ts +30 -0
- package/dist/src/lib/azure/construct/site-with-webapp/types.js +1 -0
- package/dist/src/lib/azure/index.d.ts +1 -0
- package/dist/src/lib/azure/index.js +1 -0
- package/dist/src/lib/azure/services/api-management/main.d.ts +83 -5
- package/dist/src/lib/azure/services/api-management/main.js +114 -148
- package/dist/src/lib/azure/services/api-management/types.d.ts +22 -1
- package/dist/src/lib/azure/services/app-configuration/main.d.ts +13 -1
- package/dist/src/lib/azure/services/app-configuration/main.js +21 -2
- package/dist/src/lib/azure/services/app-service/main.d.ts +5 -2
- package/dist/src/lib/azure/services/app-service/main.js +12 -4
- package/dist/src/lib/azure/services/application-insights/main.d.ts +15 -4
- package/dist/src/lib/azure/services/application-insights/main.js +27 -6
- package/dist/src/lib/azure/services/application-insights/types.d.ts +4 -1
- package/dist/src/lib/azure/services/authorisation/constants.d.ts +13 -0
- package/dist/src/lib/azure/services/authorisation/constants.js +14 -0
- package/dist/src/lib/azure/services/authorisation/index.d.ts +3 -0
- package/dist/src/lib/azure/services/authorisation/index.js +3 -0
- package/dist/src/lib/azure/services/authorisation/main.d.ts +84 -0
- package/dist/src/lib/azure/services/authorisation/main.js +120 -0
- package/dist/src/lib/azure/services/authorisation/types.d.ts +3 -0
- package/dist/src/lib/azure/services/authorisation/types.js +1 -0
- package/dist/src/lib/azure/services/cosmosdb/constants.d.ts +8 -0
- package/dist/src/lib/azure/services/cosmosdb/constants.js +10 -0
- package/dist/src/lib/azure/services/cosmosdb/index.d.ts +1 -0
- package/dist/src/lib/azure/services/cosmosdb/index.js +1 -0
- package/dist/src/lib/azure/services/cosmosdb/main.d.ts +47 -5
- package/dist/src/lib/azure/services/cosmosdb/main.js +77 -8
- package/dist/src/lib/azure/services/cosmosdb/types.d.ts +3 -1
- package/dist/src/lib/azure/services/dns/main.d.ts +9 -4
- package/dist/src/lib/azure/services/dns/main.js +12 -8
- package/dist/src/lib/azure/services/eventgrid/main.d.ts +12 -7
- package/dist/src/lib/azure/services/eventgrid/main.js +18 -19
- package/dist/src/lib/azure/services/function/main.d.ts +16 -3
- package/dist/src/lib/azure/services/function/main.js +122 -8
- package/dist/src/lib/azure/services/function/types.d.ts +3 -4
- package/dist/src/lib/azure/services/index.d.ts +3 -0
- package/dist/src/lib/azure/services/index.js +3 -0
- package/dist/src/lib/azure/services/key-vault/main.d.ts +22 -2
- package/dist/src/lib/azure/services/key-vault/main.js +28 -3
- package/dist/src/lib/azure/services/key-vault/types.d.ts +3 -2
- package/dist/src/lib/azure/services/monitor/main.d.ts +3 -1
- package/dist/src/lib/azure/services/monitor/main.js +3 -2
- package/dist/src/lib/azure/services/operational-insights/main.d.ts +13 -2
- package/dist/src/lib/azure/services/operational-insights/main.js +17 -3
- package/dist/src/lib/azure/services/operational-insights/types.d.ts +3 -1
- package/dist/src/lib/azure/services/portal/error.d.ts +5 -0
- package/dist/src/lib/azure/services/portal/error.js +10 -0
- package/dist/src/lib/azure/services/portal/index.d.ts +4 -0
- package/dist/src/lib/azure/services/portal/index.js +4 -0
- package/dist/src/lib/azure/services/portal/main.d.ts +33 -0
- package/dist/src/lib/azure/services/portal/main.js +51 -0
- package/dist/src/lib/azure/services/portal/renderer.d.ts +11 -0
- package/dist/src/lib/azure/services/portal/renderer.js +156 -0
- package/dist/src/lib/azure/services/portal/types.d.ts +40 -0
- package/dist/src/lib/azure/services/portal/types.js +1 -0
- package/dist/src/lib/azure/services/redis/main.d.ts +4 -2
- package/dist/src/lib/azure/services/redis/main.js +3 -2
- package/dist/src/lib/azure/services/redis/types.d.ts +1 -1
- package/dist/src/lib/azure/services/resource-group/main.d.ts +10 -1
- package/dist/src/lib/azure/services/resource-group/main.js +17 -3
- package/dist/src/lib/azure/services/security-center/index.d.ts +2 -0
- package/dist/src/lib/azure/services/security-center/index.js +2 -0
- package/dist/src/lib/azure/services/security-center/main.d.ts +31 -0
- package/dist/src/lib/azure/services/security-center/main.js +33 -0
- package/dist/src/lib/azure/services/security-center/types.d.ts +3 -0
- package/dist/src/lib/azure/services/security-center/types.js +1 -0
- package/dist/src/lib/azure/services/servicebus/main.d.ts +28 -22
- package/dist/src/lib/azure/services/servicebus/main.js +31 -26
- package/dist/src/lib/azure/services/servicebus/types.d.ts +4 -4
- package/dist/src/lib/azure/services/storage/main.d.ts +26 -5
- package/dist/src/lib/azure/services/storage/main.js +51 -9
- package/dist/src/lib/azure/services/storage/types.d.ts +7 -2
- package/dist/src/lib/cloudflare/common/construct.js +1 -1
- package/dist/src/lib/cloudflare/common/stack.d.ts +2 -2
- package/dist/src/lib/cloudflare/common/stack.js +25 -25
- package/dist/src/lib/cloudflare/services/worker/main.js +8 -1
- package/dist/src/lib/cloudflare/services/worker/types.d.ts +1 -0
- package/package.json +26 -23
- package/src/lib/azure/common/constants.ts +83 -0
- package/src/lib/azure/common/construct.ts +50 -7
- package/src/lib/azure/common/stack.ts +26 -43
- package/src/lib/azure/common/types.ts +14 -2
- package/src/lib/azure/construct/event-handler/index.ts +2 -0
- package/src/lib/azure/construct/event-handler/main.ts +183 -0
- package/src/lib/azure/construct/event-handler/types.ts +49 -0
- package/src/lib/azure/construct/function-app/index.ts +2 -0
- package/src/lib/azure/construct/function-app/main.ts +410 -0
- package/src/lib/azure/construct/function-app/types.ts +45 -0
- package/src/lib/azure/construct/index.ts +6 -0
- package/src/lib/azure/construct/rest-api/index.ts +2 -0
- package/src/lib/azure/construct/rest-api/main.ts +205 -0
- package/src/lib/azure/construct/rest-api/types.ts +33 -0
- package/src/lib/azure/construct/rest-api-function/index.ts +2 -0
- package/src/lib/azure/construct/rest-api-function/main.ts +297 -0
- package/src/lib/azure/construct/rest-api-function/types.ts +39 -0
- package/src/lib/azure/construct/rest-api-with-cache/index.ts +2 -0
- package/src/lib/azure/construct/rest-api-with-cache/main.ts +75 -0
- package/src/lib/azure/construct/rest-api-with-cache/types.ts +15 -0
- package/src/lib/azure/construct/site-with-webapp/index.ts +2 -0
- package/src/lib/azure/construct/site-with-webapp/main.ts +160 -0
- package/src/lib/azure/construct/site-with-webapp/types.ts +33 -0
- package/src/lib/azure/index.ts +1 -0
- package/src/lib/azure/services/api-management/main.ts +168 -152
- package/src/lib/azure/services/api-management/types.ts +30 -1
- package/src/lib/azure/services/app-configuration/main.ts +29 -2
- package/src/lib/azure/services/app-service/main.ts +23 -4
- package/src/lib/azure/services/application-insights/main.ts +46 -7
- package/src/lib/azure/services/application-insights/types.ts +6 -2
- package/src/lib/azure/services/authorisation/constants.ts +13 -0
- package/src/lib/azure/services/authorisation/index.ts +3 -0
- package/src/lib/azure/services/authorisation/main.ts +202 -0
- package/src/lib/azure/services/authorisation/types.ts +3 -0
- package/src/lib/azure/services/cosmosdb/constants.ts +9 -0
- package/src/lib/azure/services/cosmosdb/index.ts +1 -0
- package/src/lib/azure/services/cosmosdb/main.ts +158 -8
- package/src/lib/azure/services/cosmosdb/types.ts +3 -0
- package/src/lib/azure/services/dns/main.ts +33 -8
- package/src/lib/azure/services/eventgrid/main.ts +41 -23
- package/src/lib/azure/services/function/main.ts +155 -9
- package/src/lib/azure/services/function/types.ts +3 -4
- package/src/lib/azure/services/index.ts +3 -0
- package/src/lib/azure/services/key-vault/main.ts +47 -4
- package/src/lib/azure/services/key-vault/types.ts +4 -4
- package/src/lib/azure/services/monitor/main.ts +5 -2
- package/src/lib/azure/services/operational-insights/main.ts +30 -4
- package/src/lib/azure/services/operational-insights/types.ts +3 -1
- package/src/lib/azure/services/portal/error.ts +12 -0
- package/src/lib/azure/services/portal/index.ts +4 -0
- package/src/lib/azure/services/portal/main.ts +81 -0
- package/src/lib/azure/services/portal/renderer.ts +182 -0
- package/src/lib/azure/services/portal/types.ts +45 -0
- package/src/lib/azure/services/redis/main.ts +10 -3
- package/src/lib/azure/services/redis/types.ts +1 -1
- package/src/lib/azure/services/resource-group/main.ts +34 -3
- package/src/lib/azure/services/security-center/index.ts +2 -0
- package/src/lib/azure/services/security-center/main.ts +42 -0
- package/src/lib/azure/services/security-center/types.ts +3 -0
- package/src/lib/azure/services/servicebus/main.ts +61 -30
- package/src/lib/azure/services/servicebus/types.ts +4 -4
- package/src/lib/azure/services/storage/main.ts +91 -9
- package/src/lib/azure/services/storage/types.ts +11 -2
- package/src/lib/cloudflare/common/construct.ts +1 -1
- package/src/lib/cloudflare/common/stack.ts +25 -25
- package/src/lib/cloudflare/services/worker/main.ts +10 -1
- package/src/lib/cloudflare/services/worker/types.ts +8 -1
- package/dist/lib/lambda.d.ts +0 -17
- package/dist/lib/lambda.d.ts.map +0 -1
- package/dist/lib/lambda.js +0 -28
- package/dist/lib/lambda.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/cdk-utils",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.8.0",
|
|
4
4
|
"description": "Utilities for AWS CDK provisioning",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node": ">=22 <=24",
|
|
15
15
|
"pnpm": "=10"
|
|
16
16
|
},
|
|
17
|
-
"packageManager": "pnpm@10.
|
|
17
|
+
"packageManager": "pnpm@10.33.0",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "git+https://github.com/gradientedge/cdk-utils.git"
|
|
@@ -55,20 +55,22 @@
|
|
|
55
55
|
"prepare": "husky"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@aws-sdk/client-secrets-manager": "^3.
|
|
59
|
-
"@aws-sdk/credential-providers": "^3.
|
|
58
|
+
"@aws-sdk/client-secrets-manager": "^3.1021.0",
|
|
59
|
+
"@aws-sdk/credential-providers": "^3.1021.0",
|
|
60
60
|
"@aws-sdk/types": "^3.973.6",
|
|
61
|
-
"@pulumi/
|
|
62
|
-
"@pulumi/
|
|
63
|
-
"@pulumi/
|
|
61
|
+
"@pulumi/archive": "^0.3.7",
|
|
62
|
+
"@pulumi/aws": "^7.24.0",
|
|
63
|
+
"@pulumi/azure-native": "^3.16.0",
|
|
64
|
+
"@pulumi/cloudflare": "^6.13.1",
|
|
64
65
|
"@pulumi/command": "^1.2.1",
|
|
65
|
-
"@pulumi/pulumi": "^3.
|
|
66
|
+
"@pulumi/pulumi": "^3.228.0",
|
|
66
67
|
"@pulumi/std": "^2.3.2",
|
|
67
68
|
"@types/lodash": "^4.17.24",
|
|
68
69
|
"@types/node": "^25.5.0",
|
|
69
70
|
"app-root-path": "^3.1.0",
|
|
70
|
-
"aws-cdk-lib": "^2.
|
|
71
|
-
"constructs": "^10.
|
|
71
|
+
"aws-cdk-lib": "^2.246.0",
|
|
72
|
+
"constructs": "^10.6.0",
|
|
73
|
+
"json5": "^2.2.3",
|
|
72
74
|
"lodash": "^4.17.23",
|
|
73
75
|
"moment": "^2.30.1",
|
|
74
76
|
"nconf": "^0.13.0",
|
|
@@ -81,20 +83,23 @@
|
|
|
81
83
|
"@babel/eslint-parser": "^7.28.6",
|
|
82
84
|
"@eslint/config-array": "^0.23.3",
|
|
83
85
|
"@eslint/object-schema": "^3.0.3",
|
|
86
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
87
|
+
"@semantic-release/github": "^12.0.6",
|
|
88
|
+
"@semantic-release/npm": "^13.1.5",
|
|
84
89
|
"@types/node": "^25.5.0",
|
|
85
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
86
|
-
"@typescript-eslint/parser": "^8.
|
|
87
|
-
"@vitest/coverage-v8": "^4.1.
|
|
88
|
-
"aws-cdk": "^2.
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "^8.58.0",
|
|
91
|
+
"@typescript-eslint/parser": "^8.58.0",
|
|
92
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
93
|
+
"aws-cdk": "^2.1115.1",
|
|
89
94
|
"better-docs": "^2.7.3",
|
|
90
95
|
"commitizen": "^4.3.1",
|
|
91
96
|
"docdash": "^2.0.2",
|
|
92
97
|
"dotenv": "^17.3.1",
|
|
93
98
|
"esbuild": "^0.27.4",
|
|
94
|
-
"eslint": "^10.0
|
|
99
|
+
"eslint": "^10.1.0",
|
|
95
100
|
"eslint-config-prettier": "^10.1.8",
|
|
96
101
|
"eslint-plugin-import": "^2.32.0",
|
|
97
|
-
"eslint-plugin-jsdoc": "^62.8.
|
|
102
|
+
"eslint-plugin-jsdoc": "^62.8.1",
|
|
98
103
|
"husky": "^9.1.7",
|
|
99
104
|
"jsdoc": "^4.0.5",
|
|
100
105
|
"jsdoc-babel": "^0.5.0",
|
|
@@ -104,16 +109,14 @@
|
|
|
104
109
|
"prettier": "^3.8.1",
|
|
105
110
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
106
111
|
"rimraf": "^6.1.3",
|
|
107
|
-
"rollup": "^4.
|
|
112
|
+
"rollup": "^4.60.1",
|
|
108
113
|
"semantic-release": "^25.0.3",
|
|
109
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
110
|
-
"@semantic-release/github": "^12.0.6",
|
|
111
|
-
"@semantic-release/npm": "^13.1.5",
|
|
112
114
|
"taffydb": "^2.7.3",
|
|
115
|
+
"ts-md5": "^2.0.1",
|
|
113
116
|
"ts-node": "^10.9.2",
|
|
114
|
-
"typescript": "
|
|
115
|
-
"vitest": "^4.1.
|
|
116
|
-
"yaml": "^2.8.
|
|
117
|
+
"typescript": "6.0.2",
|
|
118
|
+
"vitest": "^4.1.2",
|
|
119
|
+
"yaml": "^2.8.3"
|
|
117
120
|
},
|
|
118
121
|
"optionalDependencies": {
|
|
119
122
|
"prop-types": "^15.8.1",
|
|
@@ -8,3 +8,86 @@ export enum AzureRemoteBackend {
|
|
|
8
8
|
* List of Azure resources that excludes tags
|
|
9
9
|
*/
|
|
10
10
|
export const RESOURCES_TO_EXCLUDE_TAGS = new Set(['ApiManagementNamedValue', 'Application', 'ServicePrincipal'])
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @see https://learn.microsoft.com/en-us/azure/reliability/regions-list?tabs=all
|
|
14
|
+
*/
|
|
15
|
+
export const AzureLocation = {
|
|
16
|
+
// Americas
|
|
17
|
+
BrazilSouth: 'brazilsouth',
|
|
18
|
+
BrazilSoutheast: 'brazilsoutheast',
|
|
19
|
+
CanadaCentral: 'canadacentral',
|
|
20
|
+
CanadaEast: 'canadaeast',
|
|
21
|
+
CentralUS: 'centralus',
|
|
22
|
+
EastUS: 'eastus',
|
|
23
|
+
EastUS2: 'eastus2',
|
|
24
|
+
MexicoCentral: 'mexicocentral',
|
|
25
|
+
NorthCentralUS: 'northcentralus',
|
|
26
|
+
SouthCentralUS: 'southcentralus',
|
|
27
|
+
USGovArizona: 'usgovarizona',
|
|
28
|
+
USGovTexas: 'usgovtexas',
|
|
29
|
+
USGovVirginia: 'usgovvirginia',
|
|
30
|
+
WestCentralUS: 'westcentralus',
|
|
31
|
+
WestUS: 'westus',
|
|
32
|
+
WestUS2: 'westus2',
|
|
33
|
+
WestUS3: 'westus3',
|
|
34
|
+
|
|
35
|
+
// Europe
|
|
36
|
+
AustriaCentral: 'austriacentral',
|
|
37
|
+
BelgiumCentral: 'belgiumcentral',
|
|
38
|
+
DenmarkEast: 'denmarkeast',
|
|
39
|
+
FinlandCentral: 'finlandcentral',
|
|
40
|
+
FranceCentral: 'francecentral',
|
|
41
|
+
FranceSouth: 'francesouth',
|
|
42
|
+
GermanyNorth: 'germanynorth',
|
|
43
|
+
GermanyWestCentral: 'germanywestcentral',
|
|
44
|
+
GreeceHydra: 'greecehydra',
|
|
45
|
+
ItalyNorth: 'italynorth',
|
|
46
|
+
NorthEurope: 'northeurope',
|
|
47
|
+
NorwayEast: 'norwayeast',
|
|
48
|
+
NorwayWest: 'norwaywest',
|
|
49
|
+
PolandCentral: 'polandcentral',
|
|
50
|
+
SpainCentral: 'spaincentral',
|
|
51
|
+
SwedenCentral: 'swedencentral',
|
|
52
|
+
SwedenSouth: 'swedensouth',
|
|
53
|
+
SwitzerlandNorth: 'switzerlandnorth',
|
|
54
|
+
SwitzerlandWest: 'switzerlandwest',
|
|
55
|
+
UKSouth: 'uksouth',
|
|
56
|
+
UKWest: 'ukwest',
|
|
57
|
+
WestEurope: 'westeurope',
|
|
58
|
+
|
|
59
|
+
// Middle East & Africa
|
|
60
|
+
IsraelCentral: 'israelcentral',
|
|
61
|
+
QatarCentral: 'qatarcentral',
|
|
62
|
+
SouthAfricaNorth: 'southafricanorth',
|
|
63
|
+
SouthAfricaWest: 'southafricawest',
|
|
64
|
+
UAECentral: 'uaecentral',
|
|
65
|
+
UAENorth: 'uaenorth',
|
|
66
|
+
|
|
67
|
+
// Asia Pacific
|
|
68
|
+
AustraliaCentral: 'australiacentral',
|
|
69
|
+
AustraliaCentral2: 'australiacentral2',
|
|
70
|
+
AustraliaEast: 'australiaeast',
|
|
71
|
+
AustraliaSoutheast: 'australiasoutheast',
|
|
72
|
+
CentralIndia: 'centralindia',
|
|
73
|
+
ChinaEast: 'chinaeast',
|
|
74
|
+
ChinaEast2: 'chinaeast2',
|
|
75
|
+
ChinaNorth: 'chinanorth',
|
|
76
|
+
ChinaNorth2: 'chinanorth2',
|
|
77
|
+
ChinaNorth3: 'chinanorth3',
|
|
78
|
+
EastAsia: 'eastasia',
|
|
79
|
+
JapanEast: 'japaneast',
|
|
80
|
+
JapanWest: 'japanwest',
|
|
81
|
+
KoreaCentral: 'koreacentral',
|
|
82
|
+
KoreaSouth: 'koreasouth',
|
|
83
|
+
MalaysiaSouth: 'malaysiasouth',
|
|
84
|
+
MalaysiaWest: 'malaysiawest',
|
|
85
|
+
NewZealandNorth: 'newzealandnorth',
|
|
86
|
+
SoutheastAsia: 'southeastasia',
|
|
87
|
+
SouthIndia: 'southindia',
|
|
88
|
+
TaiwanNorth: 'taiwannorth',
|
|
89
|
+
TaiwanNorthwest: 'taiwannorthwest',
|
|
90
|
+
WestIndia: 'westindia',
|
|
91
|
+
} as const
|
|
92
|
+
|
|
93
|
+
export type AzureLocation = (typeof AzureLocation)[keyof typeof AzureLocation]
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getWorkspaceOutput, GetWorkspaceResult, Workspace } from '@pulumi/azure-native/operationalinsights/index.js'
|
|
2
|
+
import { ResourceGroup } from '@pulumi/azure-native/resources/index.js'
|
|
3
|
+
import * as pulumi from '@pulumi/pulumi'
|
|
4
|
+
import { ComponentResource, ComponentResourceOptions, Output } from '@pulumi/pulumi'
|
|
2
5
|
import { isDevStage, isPrdStage, isTestStage, isUatStage } from '../../common/index.js'
|
|
6
|
+
import { AzureAuthorisationManager } from '../services/authorisation/main.js'
|
|
3
7
|
import {
|
|
4
8
|
AzureApiManagementManager,
|
|
5
9
|
AzureAppConfigurationManager,
|
|
6
|
-
AzureAppServiceManager,
|
|
7
10
|
AzureApplicationInsightsManager,
|
|
11
|
+
AzureAppServiceManager,
|
|
8
12
|
AzureCosmosDbManager,
|
|
9
13
|
AzureDnsManager,
|
|
10
14
|
AzureEventgridManager,
|
|
11
15
|
AzureFunctionManager,
|
|
12
16
|
AzureKeyVaultManager,
|
|
13
|
-
AzureOperationalInsightsManager,
|
|
14
17
|
AzureMonitorManager,
|
|
18
|
+
AzureOperationalInsightsManager,
|
|
19
|
+
AzurePortalManager,
|
|
15
20
|
AzureRedisManager,
|
|
16
21
|
AzureResourceGroupManager,
|
|
17
|
-
|
|
22
|
+
AzureSecurityCentermanager,
|
|
23
|
+
AzureServiceBusManager,
|
|
18
24
|
AzureStorageManager,
|
|
19
25
|
} from '../services/index.js'
|
|
20
26
|
import { AzureResourceNameFormatter } from './resource-name-formatter.js'
|
|
@@ -41,7 +47,9 @@ export class CommonAzureConstruct extends ComponentResource {
|
|
|
41
47
|
declare props: CommonAzureStackProps
|
|
42
48
|
declare options?: ComponentResourceOptions
|
|
43
49
|
id: string
|
|
50
|
+
resourceGroup: ResourceGroup
|
|
44
51
|
fullyQualifiedDomainName: string
|
|
52
|
+
authorisationManager: AzureAuthorisationManager
|
|
45
53
|
apiManagementManager: AzureApiManagementManager
|
|
46
54
|
appConfigurationManager: AzureAppConfigurationManager
|
|
47
55
|
appServiceManager: AzureAppServiceManager
|
|
@@ -52,19 +60,23 @@ export class CommonAzureConstruct extends ComponentResource {
|
|
|
52
60
|
functionManager: AzureFunctionManager
|
|
53
61
|
keyVaultManager: AzureKeyVaultManager
|
|
54
62
|
operationalInsightsManager: AzureOperationalInsightsManager
|
|
63
|
+
portalManager: AzurePortalManager
|
|
55
64
|
monitorManager: AzureMonitorManager
|
|
56
65
|
redisManager: AzureRedisManager
|
|
57
66
|
resourceGroupManager: AzureResourceGroupManager
|
|
58
67
|
resourceNameFormatter: AzureResourceNameFormatter
|
|
59
|
-
|
|
68
|
+
securityCentermanager: AzureSecurityCentermanager
|
|
69
|
+
serviceBusManager: AzureServiceBusManager
|
|
60
70
|
storageManager: AzureStorageManager
|
|
71
|
+
commonLogAnalyticsWorkspace: Workspace | Output<GetWorkspaceResult>
|
|
61
72
|
|
|
62
73
|
constructor(name: string, props: CommonAzureStackProps, options?: ComponentResourceOptions) {
|
|
63
|
-
super(`
|
|
74
|
+
super(`azure:${name}`, name, props, options)
|
|
64
75
|
this.props = props
|
|
65
76
|
this.options = options
|
|
66
77
|
this.id = name
|
|
67
78
|
|
|
79
|
+
this.authorisationManager = new AzureAuthorisationManager()
|
|
68
80
|
this.apiManagementManager = new AzureApiManagementManager()
|
|
69
81
|
this.appConfigurationManager = new AzureAppConfigurationManager()
|
|
70
82
|
this.appServiceManager = new AzureAppServiceManager()
|
|
@@ -75,16 +87,47 @@ export class CommonAzureConstruct extends ComponentResource {
|
|
|
75
87
|
this.functionManager = new AzureFunctionManager()
|
|
76
88
|
this.keyVaultManager = new AzureKeyVaultManager()
|
|
77
89
|
this.operationalInsightsManager = new AzureOperationalInsightsManager()
|
|
90
|
+
this.portalManager = new AzurePortalManager()
|
|
78
91
|
this.monitorManager = new AzureMonitorManager()
|
|
79
92
|
this.redisManager = new AzureRedisManager()
|
|
80
93
|
this.resourceGroupManager = new AzureResourceGroupManager()
|
|
81
94
|
this.resourceNameFormatter = new AzureResourceNameFormatter(props)
|
|
82
|
-
this.
|
|
95
|
+
this.securityCentermanager = new AzureSecurityCentermanager()
|
|
96
|
+
this.serviceBusManager = new AzureServiceBusManager()
|
|
83
97
|
this.storageManager = new AzureStorageManager()
|
|
84
98
|
|
|
85
99
|
this.determineFullyQualifiedDomain()
|
|
86
100
|
}
|
|
87
101
|
|
|
102
|
+
protected resolveStack(stackName: string) {
|
|
103
|
+
if (!stackName) throw 'Stack name undefined'
|
|
104
|
+
return new pulumi.StackReference(stackName)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
protected createResourceGroup() {
|
|
108
|
+
if (this.resourceGroup) return
|
|
109
|
+
|
|
110
|
+
this.resourceGroup = this.resourceGroupManager.createResourceGroup(`${this.id}`, this, {
|
|
111
|
+
resourceGroupName: this.props.stackName,
|
|
112
|
+
location: this.props.location,
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
this.registerOutputs({
|
|
116
|
+
resourceGroupId: this.resourceGroup.id,
|
|
117
|
+
resourceGroupName: this.resourceGroup.name,
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
protected resolveCommonLogAnalyticsWorkspace() {
|
|
122
|
+
if (!this.props.commonLogAnalyticsWorkspace || !this.props.commonLogAnalyticsWorkspace.workspaceName)
|
|
123
|
+
throw 'Props undefined for commonLogAnalyticsWorkspace'
|
|
124
|
+
|
|
125
|
+
this.commonLogAnalyticsWorkspace = getWorkspaceOutput({
|
|
126
|
+
workspaceName: this.props.commonLogAnalyticsWorkspace.workspaceName,
|
|
127
|
+
resourceGroupName: this.props.commonLogAnalyticsWorkspace.resourceGroupName,
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
|
|
88
131
|
/**
|
|
89
132
|
* @summary Determine the fully qualified domain name based on domainName & subDomain
|
|
90
133
|
*/
|
|
@@ -23,6 +23,8 @@ import { CommonAzureStackProps } from './types.js'
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export class CommonAzureStack extends ComponentResource {
|
|
26
|
+
public static NODEJS_RUNTIME = '22'
|
|
27
|
+
|
|
26
28
|
construct: CommonAzureConstruct
|
|
27
29
|
props: CommonAzureStackProps
|
|
28
30
|
config: Config
|
|
@@ -46,37 +48,13 @@ export class CommonAzureStack extends ComponentResource {
|
|
|
46
48
|
* @returns The stack properties
|
|
47
49
|
*/
|
|
48
50
|
protected determineConstructProps(props: CommonAzureStackProps) {
|
|
49
|
-
let projectProps: CommonAzureStackProps = props
|
|
50
|
-
if (!projectProps) {
|
|
51
|
-
const projectPropsPath = path.join(appRoot.path, 'pulumi.json')
|
|
52
|
-
if (!fs.existsSync(projectPropsPath)) throw `Context properties unavailable in path:${projectPropsPath}`
|
|
53
|
-
|
|
54
|
-
const projectPropsBuffer = fs.readFileSync(projectPropsPath)
|
|
55
|
-
projectProps = JSON.parse(projectPropsBuffer.toString('utf-8'))
|
|
56
|
-
}
|
|
57
|
-
|
|
58
51
|
return {
|
|
59
|
-
|
|
60
|
-
extraContexts:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
globalSuffix: projectProps.globalSuffix,
|
|
66
|
-
resourceNameOptions: projectProps.resourceNameOptions,
|
|
67
|
-
resourcePrefix: projectProps.resourcePrefix,
|
|
68
|
-
resourceSuffix: projectProps.resourceSuffix,
|
|
69
|
-
skipStageForARecords: projectProps.skipStageForARecords,
|
|
70
|
-
stage: projectProps.stage,
|
|
71
|
-
stageContextPath: projectProps.stageContextPath,
|
|
72
|
-
subDomain: projectProps.subDomain,
|
|
73
|
-
subscriptionId: projectProps.subscriptionId,
|
|
74
|
-
tenantId: projectProps.tenantId,
|
|
75
|
-
clientId: projectProps.clientId,
|
|
76
|
-
clientSecret: projectProps.clientSecret,
|
|
77
|
-
defaultTags: projectProps.defaultTags,
|
|
78
|
-
...this.determineExtraContexts(props),
|
|
79
|
-
...this.determineStageContexts(props),
|
|
52
|
+
...props,
|
|
53
|
+
extraContexts: this.config.getObject('extraContexts'),
|
|
54
|
+
stage: this.config.require('stage'),
|
|
55
|
+
stageContextPath: this.config.require('stageContextPath'),
|
|
56
|
+
...this.determineExtraContexts(),
|
|
57
|
+
...this.determineStageContexts(),
|
|
80
58
|
}
|
|
81
59
|
}
|
|
82
60
|
|
|
@@ -85,14 +63,16 @@ export class CommonAzureStack extends ComponentResource {
|
|
|
85
63
|
* - Sets the properties from the extra contexts
|
|
86
64
|
* - Primary use is to have layered config in separate files to enable easier maintenance and readability
|
|
87
65
|
*/
|
|
88
|
-
protected determineExtraContexts(
|
|
89
|
-
|
|
90
|
-
|
|
66
|
+
protected determineExtraContexts() {
|
|
67
|
+
const extraContexts = this.config.getObject('extraContexts')
|
|
68
|
+
const debug = this.config.getBoolean('debug')
|
|
69
|
+
if (!extraContexts) {
|
|
70
|
+
if (debug) console.debug(`No additional contexts provided. Using default context properties`)
|
|
91
71
|
return {}
|
|
92
72
|
}
|
|
93
73
|
|
|
94
74
|
let extraContextProps: Record<string, any> = {}
|
|
95
|
-
_.forEach(
|
|
75
|
+
_.forEach(extraContexts, (context: string) => {
|
|
96
76
|
const extraContextPath = path.join(appRoot.path, context)
|
|
97
77
|
|
|
98
78
|
/* scenario where extra context is configured but absent in file system */
|
|
@@ -100,7 +80,7 @@ export class CommonAzureStack extends ComponentResource {
|
|
|
100
80
|
|
|
101
81
|
/* read the extra properties */
|
|
102
82
|
const extraContextPropsBuffer = fs.readFileSync(extraContextPath)
|
|
103
|
-
if (
|
|
83
|
+
if (debug) console.debug(`Adding additional contexts provided in ${extraContextPath}`)
|
|
104
84
|
|
|
105
85
|
/* parse as JSON properties */
|
|
106
86
|
extraContextProps = {
|
|
@@ -116,23 +96,26 @@ export class CommonAzureStack extends ComponentResource {
|
|
|
116
96
|
* - Sets the properties from the extra stage contexts
|
|
117
97
|
* - Primary use is to have layered config for each environment which is injected into the context
|
|
118
98
|
*/
|
|
119
|
-
protected determineStageContexts(
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
99
|
+
protected determineStageContexts() {
|
|
100
|
+
const debug = this.config.getBoolean('debug')
|
|
101
|
+
const stage = this.config.require('stage')
|
|
102
|
+
const stageContextPath = this.config.get('stageContextPath')
|
|
103
|
+
const stageContextFilePath = path.join(appRoot.path, stageContextPath ?? 'env', `${stage}.json`)
|
|
104
|
+
|
|
105
|
+
if (isDevStage(stage)) {
|
|
106
|
+
if (debug) console.debug(`Development stage. Using default stage context properties`)
|
|
124
107
|
}
|
|
125
108
|
|
|
126
109
|
/* alert default context usage when extra stage config is missing */
|
|
127
110
|
if (!fs.existsSync(stageContextFilePath)) {
|
|
128
|
-
if (
|
|
129
|
-
if (
|
|
111
|
+
if (debug) console.debug(`Stage specific context properties unavailable in path:${stageContextFilePath}`)
|
|
112
|
+
if (debug) console.debug(`Using default stage context properties for ${stage} stage`)
|
|
130
113
|
return {}
|
|
131
114
|
}
|
|
132
115
|
|
|
133
116
|
/* read the extra properties */
|
|
134
117
|
const stageContextPropsBuffer = fs.readFileSync(stageContextFilePath)
|
|
135
|
-
if (
|
|
118
|
+
if (debug) console.debug(`Adding additional stage contexts provided in ${stageContextFilePath}`)
|
|
136
119
|
|
|
137
120
|
/* parse as JSON properties */
|
|
138
121
|
return JSON.parse(stageContextPropsBuffer.toString('utf-8'))
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import { GetComponentOutputArgs } from '@pulumi/azure-native/applicationinsights/index.js'
|
|
2
|
+
import { GetWorkspaceOutputArgs } from '@pulumi/azure-native/operationalinsights/index.js'
|
|
1
3
|
import { BaseProps } from '../../common/index.js'
|
|
2
|
-
import { AzureRemoteBackend } from './constants.js'
|
|
4
|
+
import { AzureLocation, AzureRemoteBackend } from './constants.js'
|
|
5
|
+
|
|
6
|
+
export interface AzureLocationConfig {
|
|
7
|
+
id: string
|
|
8
|
+
name: string
|
|
9
|
+
}
|
|
3
10
|
|
|
4
11
|
/**
|
|
5
12
|
* @interface CommonAzureStackProps
|
|
6
13
|
* @description Common properties for Azure stack configuration using Pulumi
|
|
7
14
|
*/
|
|
8
15
|
export interface CommonAzureStackProps extends BaseProps {
|
|
16
|
+
stackName?: string
|
|
9
17
|
resourceGroupName?: string
|
|
10
18
|
remoteBackend?: AzureRemoteBackendProps
|
|
11
19
|
globalPrefix?: string
|
|
@@ -13,8 +21,12 @@ export interface CommonAzureStackProps extends BaseProps {
|
|
|
13
21
|
resourcePrefix?: string
|
|
14
22
|
resourceSuffix?: string
|
|
15
23
|
resourceNameOptions?: { [key: string]: AzureResourceNameFormatterProps }
|
|
16
|
-
location
|
|
24
|
+
location: AzureLocation
|
|
25
|
+
locationConfig?: Record<AzureLocation, AzureLocationConfig>
|
|
26
|
+
locales?: string[]
|
|
17
27
|
defaultTags?: { [key: string]: string }
|
|
28
|
+
commonLogAnalyticsWorkspace?: GetWorkspaceOutputArgs
|
|
29
|
+
commonApplicationInsights?: GetComponentOutputArgs
|
|
18
30
|
|
|
19
31
|
// Azure Provider properties for Pulumi
|
|
20
32
|
subscriptionId?: string
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { Provider } from '@pulumi/azure-native'
|
|
2
|
+
import { getTopicOutput, GetTopicResult, Topic } from '@pulumi/azure-native/eventgrid/index.js'
|
|
3
|
+
import { Resource } from '@pulumi/azure-native/resources/index.js'
|
|
4
|
+
import { Output } from '@pulumi/pulumi'
|
|
5
|
+
import { AzureFunctionApp } from '../function-app/index.js'
|
|
6
|
+
import { AzureEventHandlerProps, EventHandlerEventGridSubscription, EventHandlerServiceBus } from './types.js'
|
|
7
|
+
|
|
8
|
+
export class AzureEventHandler extends AzureFunctionApp {
|
|
9
|
+
props: AzureEventHandlerProps
|
|
10
|
+
eventGridEventSubscription: EventHandlerEventGridSubscription
|
|
11
|
+
eventGridTopic: Topic | Output<GetTopicResult>
|
|
12
|
+
serviceBus: EventHandlerServiceBus
|
|
13
|
+
|
|
14
|
+
constructor(id: string, props: AzureEventHandlerProps) {
|
|
15
|
+
super(id, props)
|
|
16
|
+
this.props = props
|
|
17
|
+
this.id = id
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public initResources() {
|
|
21
|
+
this.createResourceGroup()
|
|
22
|
+
this.resolveCommonLogAnalyticsWorkspace()
|
|
23
|
+
this.resolveApplicationInsights()
|
|
24
|
+
this.createEventGridSubscriptionDlqStorageAccount()
|
|
25
|
+
this.createEventGridSubscriptionDlqStorageContainer()
|
|
26
|
+
this.createServiceBusNamespace()
|
|
27
|
+
this.createServiceBusQueue()
|
|
28
|
+
this.createEventGrid()
|
|
29
|
+
this.createEventGridEventSubscription()
|
|
30
|
+
this.createServiceBusDiagnosticLog()
|
|
31
|
+
this.enableMalwareScanningOnDataStorageAccount()
|
|
32
|
+
super.initResources()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
protected createEventGridSubscriptionDlqStorageAccount() {
|
|
36
|
+
this.eventGridEventSubscription.dlqStorageAccount = this.storageManager.createStorageAccount(
|
|
37
|
+
`${this.id}-eventgrid-subscription-dlq-storage-account`,
|
|
38
|
+
this,
|
|
39
|
+
{
|
|
40
|
+
...this.props.eventGridSubscription.dlqStorageAccount,
|
|
41
|
+
resourceGroupName: this.resourceGroup.name,
|
|
42
|
+
location: this.resourceGroup.location,
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected createEventGridSubscriptionDlqStorageContainer() {
|
|
48
|
+
this.eventGridEventSubscription.dlqStorageContainer = this.storageManager.createStorageContainer(
|
|
49
|
+
`${this.id}-eventgrid-subscription-dlq-container`,
|
|
50
|
+
this,
|
|
51
|
+
{
|
|
52
|
+
...this.props.eventGridSubscription.dlqStorageContainer,
|
|
53
|
+
accountName: this.eventGridEventSubscription.dlqStorageAccount.name,
|
|
54
|
+
containerName: 'eventgrid-subscription-dlq-container',
|
|
55
|
+
resourceGroupName: this.resourceGroup.name,
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
protected createServiceBusNamespace() {
|
|
61
|
+
this.serviceBus.namespace = this.serviceBusManager.createServiceBusNamespace(
|
|
62
|
+
this.id,
|
|
63
|
+
this,
|
|
64
|
+
{
|
|
65
|
+
...this.props.serviceBus.namespace,
|
|
66
|
+
namespaceName: this.props.serviceBus.namespace.namespaceName ?? this.id,
|
|
67
|
+
resourceGroupName: this.resourceGroup.name,
|
|
68
|
+
},
|
|
69
|
+
{ ignoreChanges: ['location'] }
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
this.registerOutputs({
|
|
73
|
+
serviceBusNamespaceId: this.serviceBus.namespace.id,
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
protected createServiceBusQueue() {
|
|
78
|
+
this.serviceBus.queue = this.serviceBusManager.createServiceBusQueue(this.id, this, {
|
|
79
|
+
...this.props.serviceBus.queue,
|
|
80
|
+
queueName: this.props.serviceBus.queue.queueName ?? this.id,
|
|
81
|
+
namespaceName: this.serviceBus.namespace.name,
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
this.registerOutputs({
|
|
85
|
+
serviceBusQueueId: this.serviceBus.queue.id,
|
|
86
|
+
serviceBusQueueName: this.serviceBus.queue.name,
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
protected createEventGrid() {
|
|
91
|
+
if (!this.props.eventGridTopic.useExistingTopic) {
|
|
92
|
+
this.eventGridTopic = this.eventgridManager.createEventgridTopic(
|
|
93
|
+
this.id,
|
|
94
|
+
this,
|
|
95
|
+
{
|
|
96
|
+
...this.props.eventGridTopic,
|
|
97
|
+
topicName: this.props.eventGridTopic.topicName ?? this.id,
|
|
98
|
+
location: this.resourceGroup.location,
|
|
99
|
+
resourceGroupName: this.resourceGroup.name,
|
|
100
|
+
},
|
|
101
|
+
{ protect: true, ignoreChanges: ['location'] }
|
|
102
|
+
)
|
|
103
|
+
return
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const existingSubscriptionId = this.props.eventGridTopic.existingSubscriptionId
|
|
107
|
+
const existingTopicName = this.props.eventGridTopic.existingTopicName
|
|
108
|
+
const existingResourceGroupName = this.props.eventGridTopic.existingResourceGroupName
|
|
109
|
+
|
|
110
|
+
let provider: Provider | undefined
|
|
111
|
+
if (existingSubscriptionId) {
|
|
112
|
+
provider = new Provider(`${this.id}-${existingSubscriptionId}`, {
|
|
113
|
+
subscriptionId: existingSubscriptionId,
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
if (existingResourceGroupName && existingTopicName) {
|
|
117
|
+
this.eventGridTopic = getTopicOutput(
|
|
118
|
+
{
|
|
119
|
+
topicName: existingTopicName,
|
|
120
|
+
resourceGroupName: existingResourceGroupName,
|
|
121
|
+
},
|
|
122
|
+
{ provider }
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
protected createEventGridEventSubscription() {
|
|
128
|
+
this.eventGridEventSubscription.eventSubscription = this.eventgridManager.createEventgridSubscription(
|
|
129
|
+
this.id,
|
|
130
|
+
this,
|
|
131
|
+
{
|
|
132
|
+
...this.props.eventGridEventSubscription,
|
|
133
|
+
eventSubscriptionName: this.props.eventGridEventSubscription.eventSubscriptionName ?? this.id,
|
|
134
|
+
scope: this.eventGridTopic.id,
|
|
135
|
+
destination: {
|
|
136
|
+
endpointType: 'ServiceBusQueue',
|
|
137
|
+
resourceId: this.serviceBus.queue.id,
|
|
138
|
+
},
|
|
139
|
+
deadLetterDestination: {
|
|
140
|
+
blobContainerName: this.eventGridEventSubscription.dlqStorageContainer.name,
|
|
141
|
+
endpointType: 'StorageBlob',
|
|
142
|
+
resourceId: this.eventGridEventSubscription.dlqStorageAccount.id,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
{ dependsOn: [this.eventGridTopic as unknown as Resource] }
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
protected createServiceBusDiagnosticLog() {
|
|
150
|
+
this.monitorManager.createMonitorDiagnosticSettings(this.id, this, {
|
|
151
|
+
name: `${this.props.stackName}-servicebus`,
|
|
152
|
+
resourceUri: this.serviceBus.namespace.id,
|
|
153
|
+
workspaceId: this.commonLogAnalyticsWorkspace.id,
|
|
154
|
+
logAnalyticsDestinationType: 'Dedicated',
|
|
155
|
+
logs: [
|
|
156
|
+
{
|
|
157
|
+
categoryGroup: 'allLogs',
|
|
158
|
+
enabled: true,
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
metrics: [
|
|
162
|
+
{
|
|
163
|
+
category: 'AllMetrics',
|
|
164
|
+
enabled: true,
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
protected enableMalwareScanningOnDataStorageAccount() {
|
|
171
|
+
if (!this.props.defender) return
|
|
172
|
+
|
|
173
|
+
this.securityCentermanager.createDefenderForStorage(`${this.id}-data-storage-defender`, this, {
|
|
174
|
+
...this.props.defender,
|
|
175
|
+
resourceId: this.dataStorageAccount.id,
|
|
176
|
+
properties: {
|
|
177
|
+
malwareScanning: {
|
|
178
|
+
scanResultsEventGridTopicResourceId: this.eventGridTopic.id,
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
}
|