@gradientedge/cdk-utils 10.7.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.
Files changed (198) hide show
  1. package/dist/app/api-destined-function/src/lib/lambda.d.ts +1 -0
  2. package/dist/app/api-destined-function/src/lib/lambda.d.ts.map +1 -0
  3. package/dist/app/api-destined-function/src/lib/lambda.js +1 -0
  4. package/dist/app/api-destined-function/src/lib/lambda.js.map +1 -0
  5. package/dist/app/api-destined-function/tsconfig.tsbuildinfo +1 -0
  6. package/dist/src/lib/aws/services/cloudwatch/main.d.ts +11 -11
  7. package/dist/src/lib/azure/common/constants.d.ts +74 -0
  8. package/dist/src/lib/azure/common/constants.js +77 -0
  9. package/dist/src/lib/azure/common/construct.d.ts +15 -3
  10. package/dist/src/lib/azure/common/construct.js +39 -3
  11. package/dist/src/lib/azure/common/stack.d.ts +3 -2
  12. package/dist/src/lib/azure/common/stack.js +25 -42
  13. package/dist/src/lib/azure/common/types.d.ts +13 -2
  14. package/dist/src/lib/azure/construct/event-handler/index.d.ts +2 -0
  15. package/dist/src/lib/azure/construct/event-handler/index.js +2 -0
  16. package/dist/src/lib/azure/construct/event-handler/main.d.ts +20 -0
  17. package/dist/src/lib/azure/construct/event-handler/main.js +139 -0
  18. package/dist/src/lib/azure/construct/event-handler/types.d.ts +35 -0
  19. package/dist/src/lib/azure/construct/event-handler/types.js +1 -0
  20. package/dist/src/lib/azure/construct/function-app/index.d.ts +2 -0
  21. package/dist/src/lib/azure/construct/function-app/index.js +2 -0
  22. package/dist/src/lib/azure/construct/function-app/main.d.ts +51 -0
  23. package/dist/src/lib/azure/construct/function-app/main.js +297 -0
  24. package/dist/src/lib/azure/construct/function-app/types.d.ts +33 -0
  25. package/dist/src/lib/azure/construct/function-app/types.js +1 -0
  26. package/dist/src/lib/azure/construct/index.d.ts +6 -0
  27. package/dist/src/lib/azure/construct/index.js +6 -0
  28. package/dist/src/lib/azure/construct/rest-api/index.d.ts +2 -0
  29. package/dist/src/lib/azure/construct/rest-api/index.js +2 -0
  30. package/dist/src/lib/azure/construct/rest-api/main.d.ts +20 -0
  31. package/dist/src/lib/azure/construct/rest-api/main.js +172 -0
  32. package/dist/src/lib/azure/construct/rest-api/types.d.ts +25 -0
  33. package/dist/src/lib/azure/construct/rest-api/types.js +1 -0
  34. package/dist/src/lib/azure/construct/rest-api-function/index.d.ts +2 -0
  35. package/dist/src/lib/azure/construct/rest-api-function/index.js +2 -0
  36. package/dist/src/lib/azure/construct/rest-api-function/main.d.ts +19 -0
  37. package/dist/src/lib/azure/construct/rest-api-function/main.js +255 -0
  38. package/dist/src/lib/azure/construct/rest-api-function/types.d.ts +29 -0
  39. package/dist/src/lib/azure/construct/rest-api-function/types.js +1 -0
  40. package/dist/src/lib/azure/construct/rest-api-with-cache/index.d.ts +2 -0
  41. package/dist/src/lib/azure/construct/rest-api-with-cache/index.js +2 -0
  42. package/dist/src/lib/azure/construct/rest-api-with-cache/main.d.ts +12 -0
  43. package/dist/src/lib/azure/construct/rest-api-with-cache/main.js +56 -0
  44. package/dist/src/lib/azure/construct/rest-api-with-cache/types.d.ts +13 -0
  45. package/dist/src/lib/azure/construct/rest-api-with-cache/types.js +1 -0
  46. package/dist/src/lib/azure/construct/site-with-webapp/index.d.ts +2 -0
  47. package/dist/src/lib/azure/construct/site-with-webapp/index.js +2 -0
  48. package/dist/src/lib/azure/construct/site-with-webapp/main.d.ts +19 -0
  49. package/dist/src/lib/azure/construct/site-with-webapp/main.js +135 -0
  50. package/dist/src/lib/azure/construct/site-with-webapp/types.d.ts +30 -0
  51. package/dist/src/lib/azure/construct/site-with-webapp/types.js +1 -0
  52. package/dist/src/lib/azure/index.d.ts +1 -0
  53. package/dist/src/lib/azure/index.js +1 -0
  54. package/dist/src/lib/azure/services/api-management/main.d.ts +83 -5
  55. package/dist/src/lib/azure/services/api-management/main.js +114 -148
  56. package/dist/src/lib/azure/services/api-management/types.d.ts +22 -1
  57. package/dist/src/lib/azure/services/app-configuration/main.d.ts +13 -1
  58. package/dist/src/lib/azure/services/app-configuration/main.js +21 -2
  59. package/dist/src/lib/azure/services/app-service/main.d.ts +5 -2
  60. package/dist/src/lib/azure/services/app-service/main.js +12 -4
  61. package/dist/src/lib/azure/services/application-insights/main.d.ts +15 -4
  62. package/dist/src/lib/azure/services/application-insights/main.js +27 -6
  63. package/dist/src/lib/azure/services/application-insights/types.d.ts +4 -1
  64. package/dist/src/lib/azure/services/authorisation/constants.d.ts +13 -0
  65. package/dist/src/lib/azure/services/authorisation/constants.js +14 -0
  66. package/dist/src/lib/azure/services/authorisation/index.d.ts +3 -0
  67. package/dist/src/lib/azure/services/authorisation/index.js +3 -0
  68. package/dist/src/lib/azure/services/authorisation/main.d.ts +84 -0
  69. package/dist/src/lib/azure/services/authorisation/main.js +120 -0
  70. package/dist/src/lib/azure/services/authorisation/types.d.ts +3 -0
  71. package/dist/src/lib/azure/services/authorisation/types.js +1 -0
  72. package/dist/src/lib/azure/services/cosmosdb/constants.d.ts +8 -0
  73. package/dist/src/lib/azure/services/cosmosdb/constants.js +10 -0
  74. package/dist/src/lib/azure/services/cosmosdb/index.d.ts +1 -0
  75. package/dist/src/lib/azure/services/cosmosdb/index.js +1 -0
  76. package/dist/src/lib/azure/services/cosmosdb/main.d.ts +47 -5
  77. package/dist/src/lib/azure/services/cosmosdb/main.js +77 -8
  78. package/dist/src/lib/azure/services/cosmosdb/types.d.ts +3 -1
  79. package/dist/src/lib/azure/services/dns/main.d.ts +9 -4
  80. package/dist/src/lib/azure/services/dns/main.js +12 -8
  81. package/dist/src/lib/azure/services/eventgrid/main.d.ts +12 -7
  82. package/dist/src/lib/azure/services/eventgrid/main.js +18 -19
  83. package/dist/src/lib/azure/services/function/main.d.ts +16 -3
  84. package/dist/src/lib/azure/services/function/main.js +122 -8
  85. package/dist/src/lib/azure/services/function/types.d.ts +3 -4
  86. package/dist/src/lib/azure/services/index.d.ts +3 -0
  87. package/dist/src/lib/azure/services/index.js +3 -0
  88. package/dist/src/lib/azure/services/key-vault/main.d.ts +22 -2
  89. package/dist/src/lib/azure/services/key-vault/main.js +28 -3
  90. package/dist/src/lib/azure/services/key-vault/types.d.ts +3 -2
  91. package/dist/src/lib/azure/services/monitor/main.d.ts +3 -1
  92. package/dist/src/lib/azure/services/monitor/main.js +3 -2
  93. package/dist/src/lib/azure/services/operational-insights/main.d.ts +13 -2
  94. package/dist/src/lib/azure/services/operational-insights/main.js +17 -3
  95. package/dist/src/lib/azure/services/operational-insights/types.d.ts +3 -1
  96. package/dist/src/lib/azure/services/portal/error.d.ts +5 -0
  97. package/dist/src/lib/azure/services/portal/error.js +10 -0
  98. package/dist/src/lib/azure/services/portal/index.d.ts +4 -0
  99. package/dist/src/lib/azure/services/portal/index.js +4 -0
  100. package/dist/src/lib/azure/services/portal/main.d.ts +33 -0
  101. package/dist/src/lib/azure/services/portal/main.js +51 -0
  102. package/dist/src/lib/azure/services/portal/renderer.d.ts +11 -0
  103. package/dist/src/lib/azure/services/portal/renderer.js +156 -0
  104. package/dist/src/lib/azure/services/portal/types.d.ts +40 -0
  105. package/dist/src/lib/azure/services/portal/types.js +1 -0
  106. package/dist/src/lib/azure/services/redis/main.d.ts +4 -2
  107. package/dist/src/lib/azure/services/redis/main.js +3 -2
  108. package/dist/src/lib/azure/services/redis/types.d.ts +1 -1
  109. package/dist/src/lib/azure/services/resource-group/main.d.ts +10 -1
  110. package/dist/src/lib/azure/services/resource-group/main.js +17 -3
  111. package/dist/src/lib/azure/services/security-center/index.d.ts +2 -0
  112. package/dist/src/lib/azure/services/security-center/index.js +2 -0
  113. package/dist/src/lib/azure/services/security-center/main.d.ts +31 -0
  114. package/dist/src/lib/azure/services/security-center/main.js +33 -0
  115. package/dist/src/lib/azure/services/security-center/types.d.ts +3 -0
  116. package/dist/src/lib/azure/services/security-center/types.js +1 -0
  117. package/dist/src/lib/azure/services/servicebus/main.d.ts +28 -22
  118. package/dist/src/lib/azure/services/servicebus/main.js +31 -26
  119. package/dist/src/lib/azure/services/servicebus/types.d.ts +4 -4
  120. package/dist/src/lib/azure/services/storage/main.d.ts +26 -5
  121. package/dist/src/lib/azure/services/storage/main.js +51 -9
  122. package/dist/src/lib/azure/services/storage/types.d.ts +7 -2
  123. package/dist/src/lib/cloudflare/common/stack.d.ts +2 -2
  124. package/dist/src/lib/cloudflare/common/stack.js +25 -25
  125. package/dist/src/lib/cloudflare/services/worker/main.js +8 -1
  126. package/dist/src/lib/cloudflare/services/worker/types.d.ts +1 -0
  127. package/package.json +26 -23
  128. package/src/lib/azure/common/constants.ts +83 -0
  129. package/src/lib/azure/common/construct.ts +49 -6
  130. package/src/lib/azure/common/stack.ts +26 -43
  131. package/src/lib/azure/common/types.ts +14 -2
  132. package/src/lib/azure/construct/event-handler/index.ts +2 -0
  133. package/src/lib/azure/construct/event-handler/main.ts +183 -0
  134. package/src/lib/azure/construct/event-handler/types.ts +49 -0
  135. package/src/lib/azure/construct/function-app/index.ts +2 -0
  136. package/src/lib/azure/construct/function-app/main.ts +410 -0
  137. package/src/lib/azure/construct/function-app/types.ts +45 -0
  138. package/src/lib/azure/construct/index.ts +6 -0
  139. package/src/lib/azure/construct/rest-api/index.ts +2 -0
  140. package/src/lib/azure/construct/rest-api/main.ts +205 -0
  141. package/src/lib/azure/construct/rest-api/types.ts +33 -0
  142. package/src/lib/azure/construct/rest-api-function/index.ts +2 -0
  143. package/src/lib/azure/construct/rest-api-function/main.ts +297 -0
  144. package/src/lib/azure/construct/rest-api-function/types.ts +39 -0
  145. package/src/lib/azure/construct/rest-api-with-cache/index.ts +2 -0
  146. package/src/lib/azure/construct/rest-api-with-cache/main.ts +75 -0
  147. package/src/lib/azure/construct/rest-api-with-cache/types.ts +15 -0
  148. package/src/lib/azure/construct/site-with-webapp/index.ts +2 -0
  149. package/src/lib/azure/construct/site-with-webapp/main.ts +160 -0
  150. package/src/lib/azure/construct/site-with-webapp/types.ts +33 -0
  151. package/src/lib/azure/index.ts +1 -0
  152. package/src/lib/azure/services/api-management/main.ts +168 -152
  153. package/src/lib/azure/services/api-management/types.ts +30 -1
  154. package/src/lib/azure/services/app-configuration/main.ts +29 -2
  155. package/src/lib/azure/services/app-service/main.ts +23 -4
  156. package/src/lib/azure/services/application-insights/main.ts +46 -7
  157. package/src/lib/azure/services/application-insights/types.ts +6 -2
  158. package/src/lib/azure/services/authorisation/constants.ts +13 -0
  159. package/src/lib/azure/services/authorisation/index.ts +3 -0
  160. package/src/lib/azure/services/authorisation/main.ts +202 -0
  161. package/src/lib/azure/services/authorisation/types.ts +3 -0
  162. package/src/lib/azure/services/cosmosdb/constants.ts +9 -0
  163. package/src/lib/azure/services/cosmosdb/index.ts +1 -0
  164. package/src/lib/azure/services/cosmosdb/main.ts +158 -8
  165. package/src/lib/azure/services/cosmosdb/types.ts +3 -0
  166. package/src/lib/azure/services/dns/main.ts +33 -8
  167. package/src/lib/azure/services/eventgrid/main.ts +41 -23
  168. package/src/lib/azure/services/function/main.ts +155 -9
  169. package/src/lib/azure/services/function/types.ts +3 -4
  170. package/src/lib/azure/services/index.ts +3 -0
  171. package/src/lib/azure/services/key-vault/main.ts +47 -4
  172. package/src/lib/azure/services/key-vault/types.ts +4 -4
  173. package/src/lib/azure/services/monitor/main.ts +5 -2
  174. package/src/lib/azure/services/operational-insights/main.ts +30 -4
  175. package/src/lib/azure/services/operational-insights/types.ts +3 -1
  176. package/src/lib/azure/services/portal/error.ts +12 -0
  177. package/src/lib/azure/services/portal/index.ts +4 -0
  178. package/src/lib/azure/services/portal/main.ts +81 -0
  179. package/src/lib/azure/services/portal/renderer.ts +182 -0
  180. package/src/lib/azure/services/portal/types.ts +45 -0
  181. package/src/lib/azure/services/redis/main.ts +10 -3
  182. package/src/lib/azure/services/redis/types.ts +1 -1
  183. package/src/lib/azure/services/resource-group/main.ts +34 -3
  184. package/src/lib/azure/services/security-center/index.ts +2 -0
  185. package/src/lib/azure/services/security-center/main.ts +42 -0
  186. package/src/lib/azure/services/security-center/types.ts +3 -0
  187. package/src/lib/azure/services/servicebus/main.ts +61 -30
  188. package/src/lib/azure/services/servicebus/types.ts +4 -4
  189. package/src/lib/azure/services/storage/main.ts +91 -9
  190. package/src/lib/azure/services/storage/types.ts +11 -2
  191. package/src/lib/cloudflare/common/stack.ts +25 -25
  192. package/src/lib/cloudflare/services/worker/main.ts +10 -1
  193. package/src/lib/cloudflare/services/worker/types.ts +8 -1
  194. package/dist/lib/lambda.d.ts +0 -17
  195. package/dist/lib/lambda.d.ts.map +0 -1
  196. package/dist/lib/lambda.js +0 -28
  197. package/dist/lib/lambda.js.map +0 -1
  198. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -14,3 +14,4 @@ export declare const processEvent: (event: any) => {
14
14
  statusCode: number;
15
15
  success: boolean;
16
16
  };
17
+ //# sourceMappingURL=lambda.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lambda.d.ts","sourceRoot":"","sources":["../../../../../app/api-destined-function/src/lib/lambda.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,GAAI,OAAO,GAAG;;;;;;;;;;;;;;;CAmBtC,CAAA"}
@@ -25,3 +25,4 @@ exports.handler = async (event, context, callback) => {
25
25
  console.log('Event Records:', JSON.stringify(event.Records));
26
26
  return callback(null, processEvent(event));
27
27
  };
28
+ //# sourceMappingURL=lambda.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lambda.js","sourceRoot":"","sources":["../../../../../app/api-destined-function/src/lib/lambda.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAA;AAEnC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE;IACzC,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;IAE5C,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK;SACb;QACD,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,EAAE,EAAE,MAAM,EAAE;QACZ,OAAO,EAAE,yBAAyB;QAClC,MAAM,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM;QAC7B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO;QAC/B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM,EAAE,4BAA4B;QACpC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS;QAC/B,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,IAAI;KACd,CAAA;AACH,CAAC,CAAA;AAED,OAAO,CAAC,OAAO,GAAG,KAAK,EAAE,KAAU,EAAE,OAAY,EAAE,QAAa,EAAE,EAAE;IAClE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;IAC5C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAChD,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;IAC5D,OAAO,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;AAC5C,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ {"root":["../../../app/api-destined-function/src/lib/lambda.ts","../../../app/api-destined-function/src/test/lambda.test.ts"],"version":"6.0.2"}
@@ -55,7 +55,7 @@ export declare class CloudWatchManager {
55
55
  * @param scope scope in which this resource is defined
56
56
  * @param props
57
57
  */
58
- createWidget(id: string, scope: CommonConstruct, props: any): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
58
+ createWidget(id: string, scope: CommonConstruct, props: any): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
59
59
  /**
60
60
  * @summary Method to create a cloudfront distribution widget
61
61
  * @param id scoped id of the resource
@@ -63,7 +63,7 @@ export declare class CloudWatchManager {
63
63
  * @param props
64
64
  * @param distributionId the cloudfront distribution id
65
65
  */
66
- createCloudfrontDistributionWidget(id: string, scope: CommonConstruct, props: any, distributionId: string): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
66
+ createCloudfrontDistributionWidget(id: string, scope: CommonConstruct, props: any, distributionId: string): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
67
67
  /**
68
68
  * @summary Method to create a step function widget
69
69
  * @param id scoped id of the resource
@@ -71,7 +71,7 @@ export declare class CloudWatchManager {
71
71
  * @param props
72
72
  * @param stateMachineArn the step function arn
73
73
  */
74
- createStateWidget(id: string, scope: CommonConstruct, props: any, stateMachineArn: string): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
74
+ createStateWidget(id: string, scope: CommonConstruct, props: any, stateMachineArn: string): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
75
75
  /**
76
76
  * @summary Method to create an event widget
77
77
  * @param id scoped id of the resource
@@ -80,7 +80,7 @@ export declare class CloudWatchManager {
80
80
  * @param eventBusName the event bus name
81
81
  * @param ruleName the event rule name
82
82
  */
83
- createEventWidget(id: string, scope: CommonConstruct, props: any, eventBusName: string, ruleName: string): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
83
+ createEventWidget(id: string, scope: CommonConstruct, props: any, eventBusName: string, ruleName: string): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
84
84
  /**
85
85
  * @summary Method to create an api gateway widget
86
86
  * @param id scoped id of the resource
@@ -88,7 +88,7 @@ export declare class CloudWatchManager {
88
88
  * @param props
89
89
  * @param apiName the api name
90
90
  */
91
- createApiGatewayWidget(id: string, scope: CommonConstruct, props: any, apiName: string): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
91
+ createApiGatewayWidget(id: string, scope: CommonConstruct, props: any, apiName: string): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
92
92
  /**
93
93
  * @summary Method to create a lambda function widget
94
94
  * @param id scoped id of the resource
@@ -96,7 +96,7 @@ export declare class CloudWatchManager {
96
96
  * @param props
97
97
  * @param functionName the lambda function name
98
98
  */
99
- createLambdaWidget(id: string, scope: CommonConstruct, props: any, functionName: string): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
99
+ createLambdaWidget(id: string, scope: CommonConstruct, props: any, functionName: string): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
100
100
  /**
101
101
  * @summary Method to create a custom widget
102
102
  * @param id scoped id of the resource
@@ -104,7 +104,7 @@ export declare class CloudWatchManager {
104
104
  * @param props
105
105
  * @param service the service identifier
106
106
  */
107
- createCustomWidget(id: string, scope: CommonConstruct, props: any, service: string): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
107
+ createCustomWidget(id: string, scope: CommonConstruct, props: any, service: string): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
108
108
  /**
109
109
  * @summary Method to create an ecs cluster widget
110
110
  * @param id scoped id of the resource
@@ -112,7 +112,7 @@ export declare class CloudWatchManager {
112
112
  * @param props
113
113
  * @param clusterName the ecs cluster name
114
114
  */
115
- createEcsClusterWidget(id: string, scope: CommonConstruct, props: any, clusterName: string): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
115
+ createEcsClusterWidget(id: string, scope: CommonConstruct, props: any, clusterName: string): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
116
116
  /**
117
117
  * @summary Method to create an ecs service widget
118
118
  * @param id scoped id of the resource
@@ -121,7 +121,7 @@ export declare class CloudWatchManager {
121
121
  * @param clusterName the ecs cluster name
122
122
  * @param serviceName the ecs service name
123
123
  */
124
- createEcsServiceWidget(id: string, scope: CommonConstruct, props: any, clusterName: string, serviceName: string): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
124
+ createEcsServiceWidget(id: string, scope: CommonConstruct, props: any, clusterName: string, serviceName: string): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
125
125
  /**
126
126
  * @summary Method to create an elb widget
127
127
  * @param id scoped id of the resource
@@ -129,7 +129,7 @@ export declare class CloudWatchManager {
129
129
  * @param props
130
130
  * @param loadBalancer the loadbalancer reference
131
131
  */
132
- createElbWidget(id: string, scope: CommonConstruct, props: any, loadBalancer: string): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
132
+ createElbWidget(id: string, scope: CommonConstruct, props: any, loadBalancer: string): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
133
133
  /**
134
134
  * @summary Method to create an elasticache widget
135
135
  * @param id scoped id of the resource
@@ -137,7 +137,7 @@ export declare class CloudWatchManager {
137
137
  * @param props
138
138
  * @param cacheClusterId the elasticache cluster id
139
139
  */
140
- createCacheWidget(id: string, scope: CommonConstruct, props: any, cacheClusterId: string): cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.LogQueryWidget | cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.AlarmStatusWidget;
140
+ createCacheWidget(id: string, scope: CommonConstruct, props: any, cacheClusterId: string): cdk.aws_cloudwatch.TextWidget | cdk.aws_cloudwatch.SingleValueWidget | cdk.aws_cloudwatch.GaugeWidget | cdk.aws_cloudwatch.GraphWidget | cdk.aws_cloudwatch.AlarmStatusWidget | cdk.aws_cloudwatch.LogQueryWidget;
141
141
  /**
142
142
  * @summary Method to create a cloudwatch text widget
143
143
  * @param id scoped id of the resource
@@ -7,3 +7,77 @@ export declare enum AzureRemoteBackend {
7
7
  * List of Azure resources that excludes tags
8
8
  */
9
9
  export declare const RESOURCES_TO_EXCLUDE_TAGS: Set<string>;
10
+ /**
11
+ * @see https://learn.microsoft.com/en-us/azure/reliability/regions-list?tabs=all
12
+ */
13
+ export declare const AzureLocation: {
14
+ readonly BrazilSouth: "brazilsouth";
15
+ readonly BrazilSoutheast: "brazilsoutheast";
16
+ readonly CanadaCentral: "canadacentral";
17
+ readonly CanadaEast: "canadaeast";
18
+ readonly CentralUS: "centralus";
19
+ readonly EastUS: "eastus";
20
+ readonly EastUS2: "eastus2";
21
+ readonly MexicoCentral: "mexicocentral";
22
+ readonly NorthCentralUS: "northcentralus";
23
+ readonly SouthCentralUS: "southcentralus";
24
+ readonly USGovArizona: "usgovarizona";
25
+ readonly USGovTexas: "usgovtexas";
26
+ readonly USGovVirginia: "usgovvirginia";
27
+ readonly WestCentralUS: "westcentralus";
28
+ readonly WestUS: "westus";
29
+ readonly WestUS2: "westus2";
30
+ readonly WestUS3: "westus3";
31
+ readonly AustriaCentral: "austriacentral";
32
+ readonly BelgiumCentral: "belgiumcentral";
33
+ readonly DenmarkEast: "denmarkeast";
34
+ readonly FinlandCentral: "finlandcentral";
35
+ readonly FranceCentral: "francecentral";
36
+ readonly FranceSouth: "francesouth";
37
+ readonly GermanyNorth: "germanynorth";
38
+ readonly GermanyWestCentral: "germanywestcentral";
39
+ readonly GreeceHydra: "greecehydra";
40
+ readonly ItalyNorth: "italynorth";
41
+ readonly NorthEurope: "northeurope";
42
+ readonly NorwayEast: "norwayeast";
43
+ readonly NorwayWest: "norwaywest";
44
+ readonly PolandCentral: "polandcentral";
45
+ readonly SpainCentral: "spaincentral";
46
+ readonly SwedenCentral: "swedencentral";
47
+ readonly SwedenSouth: "swedensouth";
48
+ readonly SwitzerlandNorth: "switzerlandnorth";
49
+ readonly SwitzerlandWest: "switzerlandwest";
50
+ readonly UKSouth: "uksouth";
51
+ readonly UKWest: "ukwest";
52
+ readonly WestEurope: "westeurope";
53
+ readonly IsraelCentral: "israelcentral";
54
+ readonly QatarCentral: "qatarcentral";
55
+ readonly SouthAfricaNorth: "southafricanorth";
56
+ readonly SouthAfricaWest: "southafricawest";
57
+ readonly UAECentral: "uaecentral";
58
+ readonly UAENorth: "uaenorth";
59
+ readonly AustraliaCentral: "australiacentral";
60
+ readonly AustraliaCentral2: "australiacentral2";
61
+ readonly AustraliaEast: "australiaeast";
62
+ readonly AustraliaSoutheast: "australiasoutheast";
63
+ readonly CentralIndia: "centralindia";
64
+ readonly ChinaEast: "chinaeast";
65
+ readonly ChinaEast2: "chinaeast2";
66
+ readonly ChinaNorth: "chinanorth";
67
+ readonly ChinaNorth2: "chinanorth2";
68
+ readonly ChinaNorth3: "chinanorth3";
69
+ readonly EastAsia: "eastasia";
70
+ readonly JapanEast: "japaneast";
71
+ readonly JapanWest: "japanwest";
72
+ readonly KoreaCentral: "koreacentral";
73
+ readonly KoreaSouth: "koreasouth";
74
+ readonly MalaysiaSouth: "malaysiasouth";
75
+ readonly MalaysiaWest: "malaysiawest";
76
+ readonly NewZealandNorth: "newzealandnorth";
77
+ readonly SoutheastAsia: "southeastasia";
78
+ readonly SouthIndia: "southindia";
79
+ readonly TaiwanNorth: "taiwannorth";
80
+ readonly TaiwanNorthwest: "taiwannorthwest";
81
+ readonly WestIndia: "westindia";
82
+ };
83
+ export type AzureLocation = (typeof AzureLocation)[keyof typeof AzureLocation];
@@ -8,3 +8,80 @@ export var 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
+ * @see https://learn.microsoft.com/en-us/azure/reliability/regions-list?tabs=all
13
+ */
14
+ export const AzureLocation = {
15
+ // Americas
16
+ BrazilSouth: 'brazilsouth',
17
+ BrazilSoutheast: 'brazilsoutheast',
18
+ CanadaCentral: 'canadacentral',
19
+ CanadaEast: 'canadaeast',
20
+ CentralUS: 'centralus',
21
+ EastUS: 'eastus',
22
+ EastUS2: 'eastus2',
23
+ MexicoCentral: 'mexicocentral',
24
+ NorthCentralUS: 'northcentralus',
25
+ SouthCentralUS: 'southcentralus',
26
+ USGovArizona: 'usgovarizona',
27
+ USGovTexas: 'usgovtexas',
28
+ USGovVirginia: 'usgovvirginia',
29
+ WestCentralUS: 'westcentralus',
30
+ WestUS: 'westus',
31
+ WestUS2: 'westus2',
32
+ WestUS3: 'westus3',
33
+ // Europe
34
+ AustriaCentral: 'austriacentral',
35
+ BelgiumCentral: 'belgiumcentral',
36
+ DenmarkEast: 'denmarkeast',
37
+ FinlandCentral: 'finlandcentral',
38
+ FranceCentral: 'francecentral',
39
+ FranceSouth: 'francesouth',
40
+ GermanyNorth: 'germanynorth',
41
+ GermanyWestCentral: 'germanywestcentral',
42
+ GreeceHydra: 'greecehydra',
43
+ ItalyNorth: 'italynorth',
44
+ NorthEurope: 'northeurope',
45
+ NorwayEast: 'norwayeast',
46
+ NorwayWest: 'norwaywest',
47
+ PolandCentral: 'polandcentral',
48
+ SpainCentral: 'spaincentral',
49
+ SwedenCentral: 'swedencentral',
50
+ SwedenSouth: 'swedensouth',
51
+ SwitzerlandNorth: 'switzerlandnorth',
52
+ SwitzerlandWest: 'switzerlandwest',
53
+ UKSouth: 'uksouth',
54
+ UKWest: 'ukwest',
55
+ WestEurope: 'westeurope',
56
+ // Middle East & Africa
57
+ IsraelCentral: 'israelcentral',
58
+ QatarCentral: 'qatarcentral',
59
+ SouthAfricaNorth: 'southafricanorth',
60
+ SouthAfricaWest: 'southafricawest',
61
+ UAECentral: 'uaecentral',
62
+ UAENorth: 'uaenorth',
63
+ // Asia Pacific
64
+ AustraliaCentral: 'australiacentral',
65
+ AustraliaCentral2: 'australiacentral2',
66
+ AustraliaEast: 'australiaeast',
67
+ AustraliaSoutheast: 'australiasoutheast',
68
+ CentralIndia: 'centralindia',
69
+ ChinaEast: 'chinaeast',
70
+ ChinaEast2: 'chinaeast2',
71
+ ChinaNorth: 'chinanorth',
72
+ ChinaNorth2: 'chinanorth2',
73
+ ChinaNorth3: 'chinanorth3',
74
+ EastAsia: 'eastasia',
75
+ JapanEast: 'japaneast',
76
+ JapanWest: 'japanwest',
77
+ KoreaCentral: 'koreacentral',
78
+ KoreaSouth: 'koreasouth',
79
+ MalaysiaSouth: 'malaysiasouth',
80
+ MalaysiaWest: 'malaysiawest',
81
+ NewZealandNorth: 'newzealandnorth',
82
+ SoutheastAsia: 'southeastasia',
83
+ SouthIndia: 'southindia',
84
+ TaiwanNorth: 'taiwannorth',
85
+ TaiwanNorthwest: 'taiwannorthwest',
86
+ WestIndia: 'westindia',
87
+ };
@@ -1,5 +1,9 @@
1
- import { ComponentResource, ComponentResourceOptions } from '@pulumi/pulumi';
2
- import { AzureApiManagementManager, AzureAppConfigurationManager, AzureAppServiceManager, AzureApplicationInsightsManager, AzureCosmosDbManager, AzureDnsManager, AzureEventgridManager, AzureFunctionManager, AzureKeyVaultManager, AzureOperationalInsightsManager, AzureMonitorManager, AzureRedisManager, AzureResourceGroupManager, AzureServicebusManager, AzureStorageManager } from '../services/index.js';
1
+ import { 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';
5
+ import { AzureAuthorisationManager } from '../services/authorisation/main.js';
6
+ import { AzureApiManagementManager, AzureAppConfigurationManager, AzureApplicationInsightsManager, AzureAppServiceManager, AzureCosmosDbManager, AzureDnsManager, AzureEventgridManager, AzureFunctionManager, AzureKeyVaultManager, AzureMonitorManager, AzureOperationalInsightsManager, AzurePortalManager, AzureRedisManager, AzureResourceGroupManager, AzureSecurityCentermanager, AzureServiceBusManager, AzureStorageManager } from '../services/index.js';
3
7
  import { AzureResourceNameFormatter } from './resource-name-formatter.js';
4
8
  import { CommonAzureStackProps } from './types.js';
5
9
  /**
@@ -23,7 +27,9 @@ export declare class CommonAzureConstruct extends ComponentResource {
23
27
  props: CommonAzureStackProps;
24
28
  options?: ComponentResourceOptions;
25
29
  id: string;
30
+ resourceGroup: ResourceGroup;
26
31
  fullyQualifiedDomainName: string;
32
+ authorisationManager: AzureAuthorisationManager;
27
33
  apiManagementManager: AzureApiManagementManager;
28
34
  appConfigurationManager: AzureAppConfigurationManager;
29
35
  appServiceManager: AzureAppServiceManager;
@@ -34,13 +40,19 @@ export declare class CommonAzureConstruct extends ComponentResource {
34
40
  functionManager: AzureFunctionManager;
35
41
  keyVaultManager: AzureKeyVaultManager;
36
42
  operationalInsightsManager: AzureOperationalInsightsManager;
43
+ portalManager: AzurePortalManager;
37
44
  monitorManager: AzureMonitorManager;
38
45
  redisManager: AzureRedisManager;
39
46
  resourceGroupManager: AzureResourceGroupManager;
40
47
  resourceNameFormatter: AzureResourceNameFormatter;
41
- servicebusManager: AzureServicebusManager;
48
+ securityCentermanager: AzureSecurityCentermanager;
49
+ serviceBusManager: AzureServiceBusManager;
42
50
  storageManager: AzureStorageManager;
51
+ commonLogAnalyticsWorkspace: Workspace | Output<GetWorkspaceResult>;
43
52
  constructor(name: string, props: CommonAzureStackProps, options?: ComponentResourceOptions);
53
+ protected resolveStack(stackName: string): pulumi.StackReference;
54
+ protected createResourceGroup(): void;
55
+ protected resolveCommonLogAnalyticsWorkspace(): void;
44
56
  /**
45
57
  * @summary Determine the fully qualified domain name based on domainName & subDomain
46
58
  */
@@ -1,6 +1,9 @@
1
+ import { getWorkspaceOutput } from '@pulumi/azure-native/operationalinsights/index.js';
2
+ import * as pulumi from '@pulumi/pulumi';
1
3
  import { ComponentResource } from '@pulumi/pulumi';
2
4
  import { isDevStage, isPrdStage, isTestStage, isUatStage } from '../../common/index.js';
3
- import { AzureApiManagementManager, AzureAppConfigurationManager, AzureAppServiceManager, AzureApplicationInsightsManager, AzureCosmosDbManager, AzureDnsManager, AzureEventgridManager, AzureFunctionManager, AzureKeyVaultManager, AzureOperationalInsightsManager, AzureMonitorManager, AzureRedisManager, AzureResourceGroupManager, AzureServicebusManager, AzureStorageManager, } from '../services/index.js';
5
+ import { AzureAuthorisationManager } from '../services/authorisation/main.js';
6
+ import { AzureApiManagementManager, AzureAppConfigurationManager, AzureApplicationInsightsManager, AzureAppServiceManager, AzureCosmosDbManager, AzureDnsManager, AzureEventgridManager, AzureFunctionManager, AzureKeyVaultManager, AzureMonitorManager, AzureOperationalInsightsManager, AzurePortalManager, AzureRedisManager, AzureResourceGroupManager, AzureSecurityCentermanager, AzureServiceBusManager, AzureStorageManager, } from '../services/index.js';
4
7
  import { AzureResourceNameFormatter } from './resource-name-formatter.js';
5
8
  /**
6
9
  * @classdesc Common Azure construct to use as a base for all higher level constructs using Pulumi
@@ -21,7 +24,9 @@ import { AzureResourceNameFormatter } from './resource-name-formatter.js';
21
24
  */
22
25
  export class CommonAzureConstruct extends ComponentResource {
23
26
  id;
27
+ resourceGroup;
24
28
  fullyQualifiedDomainName;
29
+ authorisationManager;
25
30
  apiManagementManager;
26
31
  appConfigurationManager;
27
32
  appServiceManager;
@@ -32,17 +37,21 @@ export class CommonAzureConstruct extends ComponentResource {
32
37
  functionManager;
33
38
  keyVaultManager;
34
39
  operationalInsightsManager;
40
+ portalManager;
35
41
  monitorManager;
36
42
  redisManager;
37
43
  resourceGroupManager;
38
44
  resourceNameFormatter;
39
- servicebusManager;
45
+ securityCentermanager;
46
+ serviceBusManager;
40
47
  storageManager;
48
+ commonLogAnalyticsWorkspace;
41
49
  constructor(name, props, options) {
42
50
  super(`azure:${name}`, name, props, options);
43
51
  this.props = props;
44
52
  this.options = options;
45
53
  this.id = name;
54
+ this.authorisationManager = new AzureAuthorisationManager();
46
55
  this.apiManagementManager = new AzureApiManagementManager();
47
56
  this.appConfigurationManager = new AzureAppConfigurationManager();
48
57
  this.appServiceManager = new AzureAppServiceManager();
@@ -53,14 +62,41 @@ export class CommonAzureConstruct extends ComponentResource {
53
62
  this.functionManager = new AzureFunctionManager();
54
63
  this.keyVaultManager = new AzureKeyVaultManager();
55
64
  this.operationalInsightsManager = new AzureOperationalInsightsManager();
65
+ this.portalManager = new AzurePortalManager();
56
66
  this.monitorManager = new AzureMonitorManager();
57
67
  this.redisManager = new AzureRedisManager();
58
68
  this.resourceGroupManager = new AzureResourceGroupManager();
59
69
  this.resourceNameFormatter = new AzureResourceNameFormatter(props);
60
- this.servicebusManager = new AzureServicebusManager();
70
+ this.securityCentermanager = new AzureSecurityCentermanager();
71
+ this.serviceBusManager = new AzureServiceBusManager();
61
72
  this.storageManager = new AzureStorageManager();
62
73
  this.determineFullyQualifiedDomain();
63
74
  }
75
+ resolveStack(stackName) {
76
+ if (!stackName)
77
+ throw 'Stack name undefined';
78
+ return new pulumi.StackReference(stackName);
79
+ }
80
+ createResourceGroup() {
81
+ if (this.resourceGroup)
82
+ return;
83
+ this.resourceGroup = this.resourceGroupManager.createResourceGroup(`${this.id}`, this, {
84
+ resourceGroupName: this.props.stackName,
85
+ location: this.props.location,
86
+ });
87
+ this.registerOutputs({
88
+ resourceGroupId: this.resourceGroup.id,
89
+ resourceGroupName: this.resourceGroup.name,
90
+ });
91
+ }
92
+ resolveCommonLogAnalyticsWorkspace() {
93
+ if (!this.props.commonLogAnalyticsWorkspace || !this.props.commonLogAnalyticsWorkspace.workspaceName)
94
+ throw 'Props undefined for commonLogAnalyticsWorkspace';
95
+ this.commonLogAnalyticsWorkspace = getWorkspaceOutput({
96
+ workspaceName: this.props.commonLogAnalyticsWorkspace.workspaceName,
97
+ resourceGroupName: this.props.commonLogAnalyticsWorkspace.resourceGroupName,
98
+ });
99
+ }
64
100
  /**
65
101
  * @summary Determine the fully qualified domain name based on domainName & subDomain
66
102
  */
@@ -16,6 +16,7 @@ import { CommonAzureStackProps } from './types.js';
16
16
  * ```
17
17
  */
18
18
  export declare class CommonAzureStack extends ComponentResource {
19
+ static NODEJS_RUNTIME: string;
19
20
  construct: CommonAzureConstruct;
20
21
  props: CommonAzureStackProps;
21
22
  config: Config;
@@ -31,13 +32,13 @@ export declare class CommonAzureStack extends ComponentResource {
31
32
  * - Sets the properties from the extra contexts
32
33
  * - Primary use is to have layered config in separate files to enable easier maintenance and readability
33
34
  */
34
- protected determineExtraContexts(props: CommonAzureStackProps): Record<string, any>;
35
+ protected determineExtraContexts(): Record<string, any>;
35
36
  /**
36
37
  * @summary Method to determine extra stage contexts apart from the main context
37
38
  * - Sets the properties from the extra stage contexts
38
39
  * - Primary use is to have layered config for each environment which is injected into the context
39
40
  */
40
- protected determineStageContexts(props: CommonAzureStackProps): any;
41
+ protected determineStageContexts(): any;
41
42
  /**
42
43
  * @summary Determine the fully qualified domain name based on domainName & subDomain
43
44
  */
@@ -20,6 +20,7 @@ import { registerTagTransformation } from './tagging.js';
20
20
  * ```
21
21
  */
22
22
  export class CommonAzureStack extends ComponentResource {
23
+ static NODEJS_RUNTIME = '22';
23
24
  construct;
24
25
  props;
25
26
  config;
@@ -39,36 +40,13 @@ export class CommonAzureStack extends ComponentResource {
39
40
  * @returns The stack properties
40
41
  */
41
42
  determineConstructProps(props) {
42
- let projectProps = props;
43
- if (!projectProps) {
44
- const projectPropsPath = path.join(appRoot.path, 'pulumi.json');
45
- if (!fs.existsSync(projectPropsPath))
46
- throw `Context properties unavailable in path:${projectPropsPath}`;
47
- const projectPropsBuffer = fs.readFileSync(projectPropsPath);
48
- projectProps = JSON.parse(projectPropsBuffer.toString('utf-8'));
49
- }
50
43
  return {
51
- domainName: projectProps.domainName,
52
- extraContexts: projectProps.extraContexts,
53
- location: projectProps.location,
54
- name: projectProps.resourceGroupName ?? projectProps.name,
55
- resourceGroupName: projectProps.resourceGroupName,
56
- globalPrefix: projectProps.globalPrefix,
57
- globalSuffix: projectProps.globalSuffix,
58
- resourceNameOptions: projectProps.resourceNameOptions,
59
- resourcePrefix: projectProps.resourcePrefix,
60
- resourceSuffix: projectProps.resourceSuffix,
61
- skipStageForARecords: projectProps.skipStageForARecords,
62
- stage: projectProps.stage,
63
- stageContextPath: projectProps.stageContextPath,
64
- subDomain: projectProps.subDomain,
65
- subscriptionId: projectProps.subscriptionId,
66
- tenantId: projectProps.tenantId,
67
- clientId: projectProps.clientId,
68
- clientSecret: projectProps.clientSecret,
69
- defaultTags: projectProps.defaultTags,
70
- ...this.determineExtraContexts(props),
71
- ...this.determineStageContexts(props),
44
+ ...props,
45
+ extraContexts: this.config.getObject('extraContexts'),
46
+ stage: this.config.require('stage'),
47
+ stageContextPath: this.config.require('stageContextPath'),
48
+ ...this.determineExtraContexts(),
49
+ ...this.determineStageContexts(),
72
50
  };
73
51
  }
74
52
  /**
@@ -76,21 +54,23 @@ export class CommonAzureStack extends ComponentResource {
76
54
  * - Sets the properties from the extra contexts
77
55
  * - Primary use is to have layered config in separate files to enable easier maintenance and readability
78
56
  */
79
- determineExtraContexts(props) {
80
- if (!props.extraContexts) {
81
- if (props.debug)
57
+ determineExtraContexts() {
58
+ const extraContexts = this.config.getObject('extraContexts');
59
+ const debug = this.config.getBoolean('debug');
60
+ if (!extraContexts) {
61
+ if (debug)
82
62
  console.debug(`No additional contexts provided. Using default context properties`);
83
63
  return {};
84
64
  }
85
65
  let extraContextProps = {};
86
- _.forEach(props.extraContexts, (context) => {
66
+ _.forEach(extraContexts, (context) => {
87
67
  const extraContextPath = path.join(appRoot.path, context);
88
68
  /* scenario where extra context is configured but absent in file system */
89
69
  if (!fs.existsSync(extraContextPath))
90
70
  throw `Extra context properties unavailable in path:${extraContextPath}`;
91
71
  /* read the extra properties */
92
72
  const extraContextPropsBuffer = fs.readFileSync(extraContextPath);
93
- if (props.debug)
73
+ if (debug)
94
74
  console.debug(`Adding additional contexts provided in ${extraContextPath}`);
95
75
  /* parse as JSON properties */
96
76
  extraContextProps = {
@@ -105,23 +85,26 @@ export class CommonAzureStack extends ComponentResource {
105
85
  * - Sets the properties from the extra stage contexts
106
86
  * - Primary use is to have layered config for each environment which is injected into the context
107
87
  */
108
- determineStageContexts(props) {
109
- const stageContextFilePath = path.join(appRoot.path, props.stageContextPath ?? 'env', `${props.stage}.json`);
110
- if (isDevStage(props.stage)) {
111
- if (props.debug)
88
+ determineStageContexts() {
89
+ const debug = this.config.getBoolean('debug');
90
+ const stage = this.config.require('stage');
91
+ const stageContextPath = this.config.get('stageContextPath');
92
+ const stageContextFilePath = path.join(appRoot.path, stageContextPath ?? 'env', `${stage}.json`);
93
+ if (isDevStage(stage)) {
94
+ if (debug)
112
95
  console.debug(`Development stage. Using default stage context properties`);
113
96
  }
114
97
  /* alert default context usage when extra stage config is missing */
115
98
  if (!fs.existsSync(stageContextFilePath)) {
116
- if (props.debug)
99
+ if (debug)
117
100
  console.debug(`Stage specific context properties unavailable in path:${stageContextFilePath}`);
118
- if (props.debug)
119
- console.debug(`Using default stage context properties for ${props.stage} stage`);
101
+ if (debug)
102
+ console.debug(`Using default stage context properties for ${stage} stage`);
120
103
  return {};
121
104
  }
122
105
  /* read the extra properties */
123
106
  const stageContextPropsBuffer = fs.readFileSync(stageContextFilePath);
124
- if (props.debug)
107
+ if (debug)
125
108
  console.debug(`Adding additional stage contexts provided in ${stageContextFilePath}`);
126
109
  /* parse as JSON properties */
127
110
  return JSON.parse(stageContextPropsBuffer.toString('utf-8'));
@@ -1,10 +1,17 @@
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
+ export interface AzureLocationConfig {
6
+ id: string;
7
+ name: string;
8
+ }
3
9
  /**
4
10
  * @interface CommonAzureStackProps
5
11
  * @description Common properties for Azure stack configuration using Pulumi
6
12
  */
7
13
  export interface CommonAzureStackProps extends BaseProps {
14
+ stackName?: string;
8
15
  resourceGroupName?: string;
9
16
  remoteBackend?: AzureRemoteBackendProps;
10
17
  globalPrefix?: string;
@@ -14,10 +21,14 @@ export interface CommonAzureStackProps extends BaseProps {
14
21
  resourceNameOptions?: {
15
22
  [key: string]: AzureResourceNameFormatterProps;
16
23
  };
17
- location?: string;
24
+ location: AzureLocation;
25
+ locationConfig?: Record<AzureLocation, AzureLocationConfig>;
26
+ locales?: string[];
18
27
  defaultTags?: {
19
28
  [key: string]: string;
20
29
  };
30
+ commonLogAnalyticsWorkspace?: GetWorkspaceOutputArgs;
31
+ commonApplicationInsights?: GetComponentOutputArgs;
21
32
  subscriptionId?: string;
22
33
  tenantId?: string;
23
34
  clientId?: string;
@@ -0,0 +1,2 @@
1
+ export * from './main.js';
2
+ export * from './types.js';
@@ -0,0 +1,2 @@
1
+ export * from './main.js';
2
+ export * from './types.js';
@@ -0,0 +1,20 @@
1
+ import { GetTopicResult, Topic } from '@pulumi/azure-native/eventgrid/index.js';
2
+ import { Output } from '@pulumi/pulumi';
3
+ import { AzureFunctionApp } from '../function-app/index.js';
4
+ import { AzureEventHandlerProps, EventHandlerEventGridSubscription, EventHandlerServiceBus } from './types.js';
5
+ export declare class AzureEventHandler extends AzureFunctionApp {
6
+ props: AzureEventHandlerProps;
7
+ eventGridEventSubscription: EventHandlerEventGridSubscription;
8
+ eventGridTopic: Topic | Output<GetTopicResult>;
9
+ serviceBus: EventHandlerServiceBus;
10
+ constructor(id: string, props: AzureEventHandlerProps);
11
+ initResources(): void;
12
+ protected createEventGridSubscriptionDlqStorageAccount(): void;
13
+ protected createEventGridSubscriptionDlqStorageContainer(): void;
14
+ protected createServiceBusNamespace(): void;
15
+ protected createServiceBusQueue(): void;
16
+ protected createEventGrid(): void;
17
+ protected createEventGridEventSubscription(): void;
18
+ protected createServiceBusDiagnosticLog(): void;
19
+ protected enableMalwareScanningOnDataStorageAccount(): void;
20
+ }