@gradientedge/cdk-utils-azure 1.0.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 (176) hide show
  1. package/LICENSE +21 -0
  2. package/dist/src/common/constants.d.ts +83 -0
  3. package/dist/src/common/constants.js +87 -0
  4. package/dist/src/common/construct.d.ts +80 -0
  5. package/dist/src/common/construct.js +128 -0
  6. package/dist/src/common/index.d.ts +6 -0
  7. package/dist/src/common/index.js +6 -0
  8. package/dist/src/common/resource-name-formatter.d.ts +18 -0
  9. package/dist/src/common/resource-name-formatter.js +34 -0
  10. package/dist/src/common/stack.d.ts +46 -0
  11. package/dist/src/common/stack.js +120 -0
  12. package/dist/src/common/tagging.d.ts +29 -0
  13. package/dist/src/common/tagging.js +78 -0
  14. package/dist/src/common/types.d.ts +57 -0
  15. package/dist/src/common/types.js +1 -0
  16. package/dist/src/construct/event-handler/index.d.ts +2 -0
  17. package/dist/src/construct/event-handler/index.js +2 -0
  18. package/dist/src/construct/event-handler/main.d.ts +61 -0
  19. package/dist/src/construct/event-handler/main.js +180 -0
  20. package/dist/src/construct/event-handler/types.d.ts +35 -0
  21. package/dist/src/construct/event-handler/types.js +1 -0
  22. package/dist/src/construct/function-app/index.d.ts +2 -0
  23. package/dist/src/construct/function-app/index.js +2 -0
  24. package/dist/src/construct/function-app/main.d.ts +128 -0
  25. package/dist/src/construct/function-app/main.js +374 -0
  26. package/dist/src/construct/function-app/types.d.ts +33 -0
  27. package/dist/src/construct/function-app/types.js +1 -0
  28. package/dist/src/construct/index.d.ts +6 -0
  29. package/dist/src/construct/index.js +6 -0
  30. package/dist/src/construct/rest-api/index.d.ts +2 -0
  31. package/dist/src/construct/rest-api/index.js +2 -0
  32. package/dist/src/construct/rest-api/main.d.ts +64 -0
  33. package/dist/src/construct/rest-api/main.js +216 -0
  34. package/dist/src/construct/rest-api/types.d.ts +25 -0
  35. package/dist/src/construct/rest-api/types.js +1 -0
  36. package/dist/src/construct/rest-api-function/index.d.ts +2 -0
  37. package/dist/src/construct/rest-api-function/index.js +2 -0
  38. package/dist/src/construct/rest-api-function/main.d.ts +66 -0
  39. package/dist/src/construct/rest-api-function/main.js +302 -0
  40. package/dist/src/construct/rest-api-function/types.d.ts +29 -0
  41. package/dist/src/construct/rest-api-function/types.js +1 -0
  42. package/dist/src/construct/rest-api-with-cache/index.d.ts +2 -0
  43. package/dist/src/construct/rest-api-with-cache/index.js +2 -0
  44. package/dist/src/construct/rest-api-with-cache/main.d.ts +41 -0
  45. package/dist/src/construct/rest-api-with-cache/main.js +85 -0
  46. package/dist/src/construct/rest-api-with-cache/types.d.ts +13 -0
  47. package/dist/src/construct/rest-api-with-cache/types.js +1 -0
  48. package/dist/src/construct/site-with-webapp/index.d.ts +2 -0
  49. package/dist/src/construct/site-with-webapp/index.js +2 -0
  50. package/dist/src/construct/site-with-webapp/main.d.ts +60 -0
  51. package/dist/src/construct/site-with-webapp/main.js +176 -0
  52. package/dist/src/construct/site-with-webapp/types.d.ts +30 -0
  53. package/dist/src/construct/site-with-webapp/types.js +1 -0
  54. package/dist/src/index.d.ts +4 -0
  55. package/dist/src/index.js +4 -0
  56. package/dist/src/services/api-management/index.d.ts +2 -0
  57. package/dist/src/services/api-management/index.js +2 -0
  58. package/dist/src/services/api-management/main.d.ts +143 -0
  59. package/dist/src/services/api-management/main.js +244 -0
  60. package/dist/src/services/api-management/types.d.ts +72 -0
  61. package/dist/src/services/api-management/types.js +1 -0
  62. package/dist/src/services/app-configuration/index.d.ts +2 -0
  63. package/dist/src/services/app-configuration/index.js +2 -0
  64. package/dist/src/services/app-configuration/main.d.ts +41 -0
  65. package/dist/src/services/app-configuration/main.js +71 -0
  66. package/dist/src/services/app-configuration/types.d.ts +3 -0
  67. package/dist/src/services/app-configuration/types.js +1 -0
  68. package/dist/src/services/app-service/index.d.ts +2 -0
  69. package/dist/src/services/app-service/index.js +2 -0
  70. package/dist/src/services/app-service/main.d.ts +40 -0
  71. package/dist/src/services/app-service/main.js +90 -0
  72. package/dist/src/services/app-service/types.d.ts +6 -0
  73. package/dist/src/services/app-service/types.js +1 -0
  74. package/dist/src/services/application-insights/index.d.ts +2 -0
  75. package/dist/src/services/application-insights/index.js +2 -0
  76. package/dist/src/services/application-insights/main.d.ts +40 -0
  77. package/dist/src/services/application-insights/main.js +68 -0
  78. package/dist/src/services/application-insights/types.d.ts +6 -0
  79. package/dist/src/services/application-insights/types.js +1 -0
  80. package/dist/src/services/authorisation/constants.d.ts +13 -0
  81. package/dist/src/services/authorisation/constants.js +14 -0
  82. package/dist/src/services/authorisation/index.d.ts +3 -0
  83. package/dist/src/services/authorisation/index.js +3 -0
  84. package/dist/src/services/authorisation/main.d.ts +84 -0
  85. package/dist/src/services/authorisation/main.js +120 -0
  86. package/dist/src/services/authorisation/types.d.ts +3 -0
  87. package/dist/src/services/authorisation/types.js +1 -0
  88. package/dist/src/services/cosmosdb/constants.d.ts +8 -0
  89. package/dist/src/services/cosmosdb/constants.js +10 -0
  90. package/dist/src/services/cosmosdb/index.d.ts +3 -0
  91. package/dist/src/services/cosmosdb/index.js +3 -0
  92. package/dist/src/services/cosmosdb/main.d.ts +87 -0
  93. package/dist/src/services/cosmosdb/main.js +162 -0
  94. package/dist/src/services/cosmosdb/types.d.ts +9 -0
  95. package/dist/src/services/cosmosdb/types.js +1 -0
  96. package/dist/src/services/dns/index.d.ts +2 -0
  97. package/dist/src/services/dns/index.js +2 -0
  98. package/dist/src/services/dns/main.d.ts +58 -0
  99. package/dist/src/services/dns/main.js +107 -0
  100. package/dist/src/services/dns/types.d.ts +9 -0
  101. package/dist/src/services/dns/types.js +1 -0
  102. package/dist/src/services/eventgrid/index.d.ts +2 -0
  103. package/dist/src/services/eventgrid/index.js +2 -0
  104. package/dist/src/services/eventgrid/main.d.ts +69 -0
  105. package/dist/src/services/eventgrid/main.js +136 -0
  106. package/dist/src/services/eventgrid/types.d.ts +11 -0
  107. package/dist/src/services/eventgrid/types.js +1 -0
  108. package/dist/src/services/function/index.d.ts +2 -0
  109. package/dist/src/services/function/index.js +2 -0
  110. package/dist/src/services/function/main.d.ts +60 -0
  111. package/dist/src/services/function/main.js +223 -0
  112. package/dist/src/services/function/types.d.ts +20 -0
  113. package/dist/src/services/function/types.js +1 -0
  114. package/dist/src/services/index.d.ts +18 -0
  115. package/dist/src/services/index.js +18 -0
  116. package/dist/src/services/key-vault/index.d.ts +2 -0
  117. package/dist/src/services/key-vault/index.js +2 -0
  118. package/dist/src/services/key-vault/main.d.ts +49 -0
  119. package/dist/src/services/key-vault/main.js +83 -0
  120. package/dist/src/services/key-vault/types.d.ts +5 -0
  121. package/dist/src/services/key-vault/types.js +1 -0
  122. package/dist/src/services/monitor/index.d.ts +2 -0
  123. package/dist/src/services/monitor/index.js +2 -0
  124. package/dist/src/services/monitor/main.d.ts +31 -0
  125. package/dist/src/services/monitor/main.js +36 -0
  126. package/dist/src/services/monitor/types.d.ts +3 -0
  127. package/dist/src/services/monitor/types.js +1 -0
  128. package/dist/src/services/operational-insights/index.d.ts +2 -0
  129. package/dist/src/services/operational-insights/index.js +2 -0
  130. package/dist/src/services/operational-insights/main.d.ts +40 -0
  131. package/dist/src/services/operational-insights/main.js +64 -0
  132. package/dist/src/services/operational-insights/types.d.ts +5 -0
  133. package/dist/src/services/operational-insights/types.js +1 -0
  134. package/dist/src/services/portal/error.d.ts +5 -0
  135. package/dist/src/services/portal/error.js +10 -0
  136. package/dist/src/services/portal/index.d.ts +4 -0
  137. package/dist/src/services/portal/index.js +4 -0
  138. package/dist/src/services/portal/main.d.ts +33 -0
  139. package/dist/src/services/portal/main.js +51 -0
  140. package/dist/src/services/portal/renderer.d.ts +11 -0
  141. package/dist/src/services/portal/renderer.js +156 -0
  142. package/dist/src/services/portal/types.d.ts +40 -0
  143. package/dist/src/services/portal/types.js +1 -0
  144. package/dist/src/services/redis/index.d.ts +2 -0
  145. package/dist/src/services/redis/index.js +2 -0
  146. package/dist/src/services/redis/main.d.ts +31 -0
  147. package/dist/src/services/redis/main.js +52 -0
  148. package/dist/src/services/redis/types.d.ts +3 -0
  149. package/dist/src/services/redis/types.js +1 -0
  150. package/dist/src/services/resource-group/index.d.ts +2 -0
  151. package/dist/src/services/resource-group/index.js +2 -0
  152. package/dist/src/services/resource-group/main.d.ts +38 -0
  153. package/dist/src/services/resource-group/main.js +53 -0
  154. package/dist/src/services/resource-group/types.d.ts +3 -0
  155. package/dist/src/services/resource-group/types.js +1 -0
  156. package/dist/src/services/security-center/index.d.ts +2 -0
  157. package/dist/src/services/security-center/index.js +2 -0
  158. package/dist/src/services/security-center/main.d.ts +31 -0
  159. package/dist/src/services/security-center/main.js +33 -0
  160. package/dist/src/services/security-center/types.d.ts +3 -0
  161. package/dist/src/services/security-center/types.js +1 -0
  162. package/dist/src/services/servicebus/index.d.ts +2 -0
  163. package/dist/src/services/servicebus/index.js +2 -0
  164. package/dist/src/services/servicebus/main.d.ts +67 -0
  165. package/dist/src/services/servicebus/main.js +127 -0
  166. package/dist/src/services/servicebus/types.d.ts +11 -0
  167. package/dist/src/services/servicebus/types.js +1 -0
  168. package/dist/src/services/storage/index.d.ts +2 -0
  169. package/dist/src/services/storage/index.js +2 -0
  170. package/dist/src/services/storage/main.d.ts +88 -0
  171. package/dist/src/services/storage/main.js +173 -0
  172. package/dist/src/services/storage/types.d.ts +20 -0
  173. package/dist/src/services/storage/types.js +1 -0
  174. package/dist/src/types/index.d.ts +4 -0
  175. package/dist/src/types/index.js +1 -0
  176. package/package.json +41 -0
@@ -0,0 +1,223 @@
1
+ import { Deployment, DeploymentMode, Resource } from '@pulumi/azure-native/resources/index.js';
2
+ import { ManagedServiceIdentityType, WebApp, WebAppFunction } from '@pulumi/azure-native/web/index.js';
3
+ import { CommonAzureStack } from '../../common/index.js';
4
+ /**
5
+ * @classdesc Provides operations on Azure Functions using Pulumi
6
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
7
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
8
+ * @example
9
+ * ```typescript
10
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
11
+ *
12
+ * class CustomConstruct extends CommonAzureConstruct {
13
+ * constructor(name: string, props: CommonAzureStackProps) {
14
+ * super(name, props)
15
+ * this.props = props
16
+ * this.functionManager.createFunctionApp('MyFunctionApp', this, props)
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ export class AzureFunctionManager {
22
+ /**
23
+ * @summary Method to create a new Linux function app
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props function app properties
27
+ * @param resourceOptions Optional settings to control resource behaviour
28
+ * @see [Pulumi Azure Native Function App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
29
+ */
30
+ createFunctionApp(id, scope, props, resourceOptions) {
31
+ if (!props)
32
+ throw `Props undefined for ${id}`;
33
+ // Get resource group name
34
+ const resourceGroupName = scope.props.resourceGroupName
35
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
36
+ : props.resourceGroupName;
37
+ if (!resourceGroupName)
38
+ throw `Resource group name undefined for ${id}`;
39
+ return new WebApp(`${id}-fa`, {
40
+ ...props,
41
+ name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.linuxFunctionApp),
42
+ resourceGroupName: resourceGroupName,
43
+ location: props.location ?? scope.props.location,
44
+ kind: props.kind ?? 'functionapp,linux',
45
+ identity: props.identity ?? {
46
+ type: ManagedServiceIdentityType.SystemAssigned,
47
+ },
48
+ tags: props.tags ?? {
49
+ environment: scope.props.stage,
50
+ },
51
+ }, { parent: scope, ...resourceOptions });
52
+ }
53
+ /**
54
+ * @summary Method to create a new function within a function app
55
+ * @param id scoped id of the resource
56
+ * @param scope scope in which this resource is defined
57
+ * @param props function properties
58
+ * @param resourceOptions Optional settings to control resource behaviour
59
+ * @see [Pulumi Azure Native Function Envelope]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webappfunction/}
60
+ * @note In Pulumi, individual functions are typically deployed via code deployment rather than as separate infrastructure resources.
61
+ * This method is provided for API compatibility but may require additional setup.
62
+ */
63
+ createFunction(id, scope, props, resourceOptions) {
64
+ if (!props)
65
+ throw `Props undefined for ${id}`;
66
+ // Get resource group name
67
+ const resourceGroupName = scope.props.resourceGroupName
68
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
69
+ : '';
70
+ return new WebAppFunction(`${id}-fc`, {
71
+ name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.functionAppFunction),
72
+ resourceGroupName: resourceGroupName,
73
+ functionAppId: props.functionAppId,
74
+ config: props.configJson,
75
+ isDisabled: props.enabled !== undefined ? !props.enabled : false,
76
+ testData: props.testData,
77
+ }, { parent: scope, ...resourceOptions });
78
+ }
79
+ /**
80
+ * @summary Method to create a new flex consumption function app
81
+ * @param id scoped id of the resource
82
+ * @param scope scope in which this resource is defined
83
+ * @param props flex consumption function app properties
84
+ * @param resourceOptions Optional settings to control resource behaviour
85
+ * @see [Pulumi Azure Native Function App (Flex Consumption)]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
86
+ */
87
+ createFunctionAppFlexConsumption(id, scope, props, resourceOptions) {
88
+ if (!props)
89
+ throw `Props undefined for ${id}`;
90
+ // Get resource group name
91
+ const resourceGroupName = scope.props.resourceGroupName
92
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
93
+ : props.resourceGroupName;
94
+ if (!resourceGroupName)
95
+ throw `Resource group name undefined for ${id}`;
96
+ const functionApp = new WebApp(`${id}-fc`, {
97
+ ...props,
98
+ name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.functionApp),
99
+ location: props.location ?? scope.props.location,
100
+ resourceGroupName: resourceGroupName,
101
+ kind: props.kind ?? 'functionapp,linux',
102
+ httpsOnly: props.httpsOnly ?? true,
103
+ identity: props.identity ?? {
104
+ type: ManagedServiceIdentityType.SystemAssigned,
105
+ },
106
+ functionAppConfig: props.functionAppConfig ?? {
107
+ runtime: {
108
+ ...props.runtime,
109
+ name: props.runtime?.name ?? 'node',
110
+ version: props.runtime?.version ?? CommonAzureStack.NODEJS_RUNTIME,
111
+ },
112
+ scaleAndConcurrency: {
113
+ ...props.scaleAndConcurrency,
114
+ instanceMemoryMB: props.scaleAndConcurrency?.instanceMemoryMB ?? 4096,
115
+ maximumInstanceCount: props.scaleAndConcurrency?.maximumInstanceCount ?? 40,
116
+ },
117
+ },
118
+ siteConfig: props.siteConfig ?? {
119
+ http20Enabled: true,
120
+ linuxFxVersion: `${props.runtime?.name ?? 'node'}|${props.runtime?.version ?? CommonAzureStack.NODEJS_RUNTIME}`,
121
+ },
122
+ tags: props.tags ?? {
123
+ environment: scope.props.stage,
124
+ },
125
+ }, { parent: scope, ...resourceOptions });
126
+ const functionAppConfig = props.functionAppConfig;
127
+ new Deployment(`${id}-deployment`, {
128
+ resourceGroupName: resourceGroupName,
129
+ properties: {
130
+ mode: DeploymentMode.Incremental,
131
+ template: {
132
+ $schema: 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#',
133
+ contentVersion: '1.0.0.0',
134
+ resources: [
135
+ {
136
+ type: 'Microsoft.Web/sites',
137
+ apiVersion: '2024-04-01',
138
+ name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.functionApp),
139
+ location: props.location ?? scope.props.location,
140
+ properties: {
141
+ functionAppConfig: {
142
+ ...props.functionAppConfig,
143
+ runtime: {
144
+ ...props.runtime,
145
+ name: props.runtime?.name ?? functionAppConfig?.runtime?.name ?? 'node',
146
+ version: props.runtime?.version ??
147
+ functionAppConfig?.runtime?.version ??
148
+ CommonAzureStack.NODEJS_RUNTIME,
149
+ },
150
+ scaleAndConcurrency: {
151
+ ...props.scaleAndConcurrency,
152
+ instanceMemoryMB: props.scaleAndConcurrency?.instanceMemoryMB ??
153
+ functionAppConfig?.scaleAndConcurrency?.instanceMemoryMB ??
154
+ 4096,
155
+ maximumInstanceCount: props.scaleAndConcurrency?.maximumInstanceCount ??
156
+ functionAppConfig?.scaleAndConcurrency?.maximumInstanceCount ??
157
+ 40,
158
+ },
159
+ siteUpdateStrategy: {
160
+ type: 'RollingUpdate',
161
+ },
162
+ },
163
+ },
164
+ },
165
+ ],
166
+ },
167
+ },
168
+ }, { parent: scope, ...resourceOptions });
169
+ return functionApp;
170
+ }
171
+ /**
172
+ * @summary Method to create a new flex consumption function app
173
+ * @param id scoped id of the resource
174
+ * @param scope scope in which this resource is defined
175
+ * @param props flex consumption function app properties
176
+ * @param resourceOptions Optional settings to control resource behaviour
177
+ * @see [Pulumi Azure Native Function App (Flex Consumption)]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
178
+ */
179
+ createFunctionAppFlexConsumptionResource(id, scope, props, resourceOptions) {
180
+ if (!props)
181
+ throw `Props undefined for ${id}`;
182
+ // Get resource group name
183
+ const resourceGroupName = scope.props.resourceGroupName
184
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
185
+ : props.resourceGroupName;
186
+ if (!resourceGroupName)
187
+ throw `Resource group name undefined for ${id}`;
188
+ return new Resource(`${id}-fc`, {
189
+ apiVersion: '2024-04-01',
190
+ identity: {
191
+ type: ManagedServiceIdentityType.SystemAssigned,
192
+ },
193
+ kind: props.kind ?? 'functionapp,linux',
194
+ location: props.location ?? scope.props.location,
195
+ parentResourcePath: '',
196
+ properties: {
197
+ httpsOnly: props.httpsOnly ?? true,
198
+ serverFarmId: props.serverFarmId,
199
+ siteConfig: props.siteConfig,
200
+ functionAppConfig: {
201
+ ...props.functionAppConfig,
202
+ runtime: {
203
+ ...props.runtime,
204
+ name: props.runtime?.name ?? 'node',
205
+ version: props.runtime?.version ?? CommonAzureStack.NODEJS_RUNTIME,
206
+ },
207
+ scaleAndConcurrency: {
208
+ ...props.scaleAndConcurrency,
209
+ instanceMemoryMB: props.scaleAndConcurrency?.instanceMemoryMB ?? 4096,
210
+ maximumInstanceCount: props.scaleAndConcurrency?.maximumInstanceCount ?? 40,
211
+ },
212
+ siteUpdateStrategy: {
213
+ type: 'RollingUpdate',
214
+ },
215
+ },
216
+ },
217
+ resourceGroupName: resourceGroupName,
218
+ resourceName: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.functionApp),
219
+ resourceProviderNamespace: 'Microsoft.Web',
220
+ resourceType: 'sites',
221
+ }, { parent: scope, ...resourceOptions });
222
+ }
223
+ }
@@ -0,0 +1,20 @@
1
+ import { input } from '@pulumi/azure-native/types/index.js';
2
+ import { WebAppArgs } from '@pulumi/azure-native/web/index.js';
3
+ export interface FunctionAppProps extends WebAppArgs {
4
+ name?: string;
5
+ }
6
+ export interface FunctionProps {
7
+ name: string;
8
+ functionAppId: string;
9
+ language?: string;
10
+ configJson?: any;
11
+ testData?: string;
12
+ enabled?: boolean;
13
+ }
14
+ export interface FunctionAppFlexConsumptionProps extends WebAppArgs {
15
+ name?: string;
16
+ runtime?: input.web.FunctionsRuntimeArgs;
17
+ scaleAndConcurrency?: input.web.FunctionsScaleAndConcurrencyArgs;
18
+ storageAuthenticationType?: string;
19
+ storageContainerType?: string;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ export * from './api-management/index.js';
2
+ export * from './app-configuration/index.js';
3
+ export * from './app-service/index.js';
4
+ export * from './application-insights/index.js';
5
+ export * from './authorisation/index.js';
6
+ export * from './cosmosdb/index.js';
7
+ export * from './dns/index.js';
8
+ export * from './eventgrid/index.js';
9
+ export * from './function/index.js';
10
+ export * from './key-vault/index.js';
11
+ export * from './operational-insights/index.js';
12
+ export * from './portal/index.js';
13
+ export * from './monitor/index.js';
14
+ export * from './redis/index.js';
15
+ export * from './resource-group/index.js';
16
+ export * from './security-center/index.js';
17
+ export * from './servicebus/index.js';
18
+ export * from './storage/index.js';
@@ -0,0 +1,18 @@
1
+ export * from './api-management/index.js';
2
+ export * from './app-configuration/index.js';
3
+ export * from './app-service/index.js';
4
+ export * from './application-insights/index.js';
5
+ export * from './authorisation/index.js';
6
+ export * from './cosmosdb/index.js';
7
+ export * from './dns/index.js';
8
+ export * from './eventgrid/index.js';
9
+ export * from './function/index.js';
10
+ export * from './key-vault/index.js';
11
+ export * from './operational-insights/index.js';
12
+ export * from './portal/index.js';
13
+ export * from './monitor/index.js';
14
+ export * from './redis/index.js';
15
+ export * from './resource-group/index.js';
16
+ export * from './security-center/index.js';
17
+ export * from './servicebus/index.js';
18
+ export * from './storage/index.js';
@@ -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,49 @@
1
+ import { ResourceOptions } from '@pulumi/pulumi';
2
+ import { CommonAzureConstruct } from '../../common/index.js';
3
+ import { KeyVaultProps, SecretProps } from './types.js';
4
+ /**
5
+ * @classdesc Provides operations on Azure Key Vault using Pulumi
6
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
7
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
8
+ * @example
9
+ * ```typescript
10
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
11
+ *
12
+ * class CustomConstruct extends CommonAzureConstruct {
13
+ * constructor(name: string, props: CommonAzureStackProps) {
14
+ * super(name, props)
15
+ * this.props = props
16
+ * this.keyVaultManager.createKeyVault('MyKeyVault', this, props)
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ export declare class AzureKeyVaultManager {
22
+ /**
23
+ * @summary Method to create a new key vault
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props key vault properties
27
+ * @param resourceOptions Optional settings to control resource behaviour
28
+ * @see [Pulumi Azure Native Key Vault]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/keyvault/vault/}
29
+ */
30
+ createKeyVault(id: string, scope: CommonAzureConstruct, props: KeyVaultProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/keyvault/vault.js").Vault;
31
+ /**
32
+ *
33
+ * @summary Method to create a new key vault secret
34
+ * @param id scoped id of the resource
35
+ * @param scope scope in which this resource is defined
36
+ * @param props key vault secret properties
37
+ * @param resourceOptions Optional settings to control resource behaviour
38
+ * @see [Pulumi Azure Native Key Vault Secret]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/keyvault/secret/}
39
+ */
40
+ createKeyVaultSecret(id: string, scope: CommonAzureConstruct, props: SecretProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/keyvault/secret.js").Secret;
41
+ /**
42
+ * @summary Method to resolve an existing key vault
43
+ * @param scope scope in which this resource is defined
44
+ * @param vaultName the key vault name
45
+ * @param resourceGroupName the resource group name
46
+ * @param resourceOptions Optional settings to control resource behaviour
47
+ */
48
+ resolveKeyVault(scope: CommonAzureConstruct, vaultName: string, resourceGroupName: string, resourceOptions?: ResourceOptions): import("@pulumi/pulumi").Output<import("@pulumi/azure-native/keyvault/getVault.js").GetVaultResult>;
49
+ }
@@ -0,0 +1,83 @@
1
+ import { getVaultOutput, Secret, SkuFamily, SkuName, Vault } from '@pulumi/azure-native/keyvault/index.js';
2
+ /**
3
+ * @classdesc Provides operations on Azure Key Vault using Pulumi
4
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
5
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
6
+ * @example
7
+ * ```typescript
8
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
9
+ *
10
+ * class CustomConstruct extends CommonAzureConstruct {
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
13
+ * this.props = props
14
+ * this.keyVaultManager.createKeyVault('MyKeyVault', this, props)
15
+ * }
16
+ * }
17
+ * ```
18
+ */
19
+ export class AzureKeyVaultManager {
20
+ /**
21
+ * @summary Method to create a new key vault
22
+ * @param id scoped id of the resource
23
+ * @param scope scope in which this resource is defined
24
+ * @param props key vault properties
25
+ * @param resourceOptions Optional settings to control resource behaviour
26
+ * @see [Pulumi Azure Native Key Vault]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/keyvault/vault/}
27
+ */
28
+ createKeyVault(id, scope, props, resourceOptions) {
29
+ if (!props)
30
+ throw `Props undefined for ${id}`;
31
+ // Get resource group name
32
+ const resourceGroupName = scope.props.resourceGroupName
33
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
34
+ : props.resourceGroupName;
35
+ if (!resourceGroupName)
36
+ throw `Resource group name undefined for ${id}`;
37
+ return new Vault(`${id}-kv`, {
38
+ ...props,
39
+ vaultName: scope.resourceNameFormatter.format(props.vaultName?.toString(), scope.props.resourceNameOptions?.keyVault),
40
+ location: props.location ?? scope.props.location,
41
+ resourceGroupName: resourceGroupName,
42
+ properties: {
43
+ ...props.properties,
44
+ sku: props.properties?.sku ?? {
45
+ family: SkuFamily.A,
46
+ name: SkuName.Standard,
47
+ },
48
+ tenantId: props.properties?.tenantId ?? scope.props.tenantId ?? '',
49
+ enableRbacAuthorization: props.properties?.enableRbacAuthorization ?? true,
50
+ enableSoftDelete: props.properties?.enableSoftDelete ?? true,
51
+ softDeleteRetentionInDays: props.properties?.softDeleteRetentionInDays ?? 90,
52
+ enablePurgeProtection: props.properties?.enablePurgeProtection ?? true,
53
+ },
54
+ tags: props.tags ?? {
55
+ environment: scope.props.stage,
56
+ },
57
+ }, { parent: scope, ...resourceOptions });
58
+ }
59
+ /**
60
+ *
61
+ * @summary Method to create a new key vault secret
62
+ * @param id scoped id of the resource
63
+ * @param scope scope in which this resource is defined
64
+ * @param props key vault secret properties
65
+ * @param resourceOptions Optional settings to control resource behaviour
66
+ * @see [Pulumi Azure Native Key Vault Secret]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/keyvault/secret/}
67
+ */
68
+ createKeyVaultSecret(id, scope, props, resourceOptions) {
69
+ if (!props)
70
+ throw `Props undefined for ${id}`;
71
+ return new Secret(`${id}`, props, { parent: scope, ...resourceOptions });
72
+ }
73
+ /**
74
+ * @summary Method to resolve an existing key vault
75
+ * @param scope scope in which this resource is defined
76
+ * @param vaultName the key vault name
77
+ * @param resourceGroupName the resource group name
78
+ * @param resourceOptions Optional settings to control resource behaviour
79
+ */
80
+ resolveKeyVault(scope, vaultName, resourceGroupName, resourceOptions) {
81
+ return getVaultOutput({ vaultName, resourceGroupName }, { parent: scope, ...resourceOptions });
82
+ }
83
+ }
@@ -0,0 +1,5 @@
1
+ import { SecretArgs, VaultArgs } from '@pulumi/azure-native/keyvault/index.js';
2
+ export interface KeyVaultProps extends VaultArgs {
3
+ }
4
+ export interface SecretProps extends SecretArgs {
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -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,31 @@
1
+ import { ResourceOptions } from '@pulumi/pulumi';
2
+ import { CommonAzureConstruct } from '../../common/index.js';
3
+ import { MonitorDiagnosticSettingProps } from './types.js';
4
+ /**
5
+ * @classdesc Provides operations on Azure Monitor using Pulumi
6
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
7
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
8
+ * @example
9
+ * ```typescript
10
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
11
+ *
12
+ * class CustomConstruct extends CommonAzureConstruct {
13
+ * constructor(name: string, props: CommonAzureStackProps) {
14
+ * super(name, props)
15
+ * this.props = props
16
+ * this.monitorManager.createMonitorDiagnosticSettings('MyMonitor', this, props)
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ export declare class AzureMonitorManager {
22
+ /**
23
+ * @summary Method to create a new monitor diagnostic setting
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props monitor diagnostics settings properties
27
+ * @param resourceOptions Optional settings to control resource behaviour
28
+ * @see [Pulumi Azure Native Monitor Diagnostic Settings]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/diagnosticsetting/}
29
+ */
30
+ createMonitorDiagnosticSettings(id: string, scope: CommonAzureConstruct, props: MonitorDiagnosticSettingProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/monitor/diagnosticSetting.js").DiagnosticSetting;
31
+ }
@@ -0,0 +1,36 @@
1
+ import { DiagnosticSetting } from '@pulumi/azure-native/monitor/index.js';
2
+ /**
3
+ * @classdesc Provides operations on Azure Monitor using Pulumi
4
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
5
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
6
+ * @example
7
+ * ```typescript
8
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
9
+ *
10
+ * class CustomConstruct extends CommonAzureConstruct {
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
13
+ * this.props = props
14
+ * this.monitorManager.createMonitorDiagnosticSettings('MyMonitor', this, props)
15
+ * }
16
+ * }
17
+ * ```
18
+ */
19
+ export class AzureMonitorManager {
20
+ /**
21
+ * @summary Method to create a new monitor diagnostic setting
22
+ * @param id scoped id of the resource
23
+ * @param scope scope in which this resource is defined
24
+ * @param props monitor diagnostics settings properties
25
+ * @param resourceOptions Optional settings to control resource behaviour
26
+ * @see [Pulumi Azure Native Monitor Diagnostic Settings]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/diagnosticsetting/}
27
+ */
28
+ createMonitorDiagnosticSettings(id, scope, props, resourceOptions) {
29
+ if (!props)
30
+ throw `Props undefined for ${id}`;
31
+ return new DiagnosticSetting(`${id}-ds`, {
32
+ ...props,
33
+ name: scope.resourceNameFormatter.format(props.name?.toString(), scope.props.resourceNameOptions?.monitorDiagnosticSetting),
34
+ }, { parent: scope, ...resourceOptions });
35
+ }
36
+ }
@@ -0,0 +1,3 @@
1
+ import { DiagnosticSettingArgs } from '@pulumi/azure-native/monitor/index.js';
2
+ export interface MonitorDiagnosticSettingProps extends DiagnosticSettingArgs {
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -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,40 @@
1
+ import { ResourceOptions } from '@pulumi/pulumi';
2
+ import { CommonAzureConstruct } from '../../common/index.js';
3
+ import { WorkspaceProps, WorkspaceTableProps } from './types.js';
4
+ /**
5
+ * @classdesc Provides operations on Azure Log Analytics Workspace using Pulumi
6
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
7
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
8
+ * @example
9
+ * ```typescript
10
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
11
+ *
12
+ * class CustomConstruct extends CommonAzureConstruct {
13
+ * constructor(name: string, props: CommonAzureStackProps) {
14
+ * super(name, props)
15
+ * this.props = props
16
+ * this.logAnalyticsWorkspaceManager.createLogAnalyticsWorkspace('MyLogAnalyticsWorkspace', this, props)
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ export declare class AzureOperationalInsightsManager {
22
+ /**
23
+ * @summary Method to create a new log analytics workspace
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props log analytics workspace properties
27
+ * @param resourceOptions Optional settings to control resource behaviour
28
+ * @see [Pulumi Azure Native Operational Insights Workspace]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/operationalinsights/workspace/}
29
+ */
30
+ createWorkspace(id: string, scope: CommonAzureConstruct, props: WorkspaceProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/operationalinsights/workspace.js").Workspace;
31
+ /**
32
+ * @summary Method to create a new log analytics workspace table
33
+ * @param id scoped id of the resource
34
+ * @param scope scope in which this resource is defined
35
+ * @param props log analytics workspace table properties
36
+ * @param resourceOptions Optional settings to control resource behaviour
37
+ * @see [Pulumi Azure Native Operational Insights Table]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/operationalinsights/table/}
38
+ */
39
+ createTable(id: string, scope: CommonAzureConstruct, props: WorkspaceTableProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/operationalinsights/table.js").Table;
40
+ }
@@ -0,0 +1,64 @@
1
+ import { Table, Workspace, WorkspaceSkuNameEnum } from '@pulumi/azure-native/operationalinsights/index.js';
2
+ /**
3
+ * @classdesc Provides operations on Azure Log Analytics Workspace using Pulumi
4
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
5
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
6
+ * @example
7
+ * ```typescript
8
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
9
+ *
10
+ * class CustomConstruct extends CommonAzureConstruct {
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
13
+ * this.props = props
14
+ * this.logAnalyticsWorkspaceManager.createLogAnalyticsWorkspace('MyLogAnalyticsWorkspace', this, props)
15
+ * }
16
+ * }
17
+ * ```
18
+ */
19
+ export class AzureOperationalInsightsManager {
20
+ /**
21
+ * @summary Method to create a new log analytics workspace
22
+ * @param id scoped id of the resource
23
+ * @param scope scope in which this resource is defined
24
+ * @param props log analytics workspace properties
25
+ * @param resourceOptions Optional settings to control resource behaviour
26
+ * @see [Pulumi Azure Native Operational Insights Workspace]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/operationalinsights/workspace/}
27
+ */
28
+ createWorkspace(id, scope, props, resourceOptions) {
29
+ if (!props)
30
+ throw `Props undefined for ${id}`;
31
+ // Get resource group name
32
+ const resourceGroupName = scope.props.resourceGroupName
33
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
34
+ : props.resourceGroupName;
35
+ if (!resourceGroupName)
36
+ throw `Resource group name undefined for ${id}`;
37
+ return new Workspace(`${id}-lw`, {
38
+ ...props,
39
+ workspaceName: scope.resourceNameFormatter.format(props.workspaceName?.toString(), scope.props.resourceNameOptions?.logAnalyticsWorkspace),
40
+ location: props.location ?? scope.props.location,
41
+ resourceGroupName: resourceGroupName,
42
+ sku: props.sku ?? {
43
+ name: WorkspaceSkuNameEnum.PerGB2018,
44
+ },
45
+ retentionInDays: props.retentionInDays ?? 30,
46
+ tags: props.tags ?? {
47
+ environment: scope.props.stage,
48
+ },
49
+ }, { parent: scope, ...resourceOptions });
50
+ }
51
+ /**
52
+ * @summary Method to create a new log analytics workspace table
53
+ * @param id scoped id of the resource
54
+ * @param scope scope in which this resource is defined
55
+ * @param props log analytics workspace table properties
56
+ * @param resourceOptions Optional settings to control resource behaviour
57
+ * @see [Pulumi Azure Native Operational Insights Table]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/operationalinsights/table/}
58
+ */
59
+ createTable(id, scope, props, resourceOptions) {
60
+ if (!props)
61
+ throw `Props undefined for ${id}`;
62
+ return new Table(`${id}`, props, { parent: scope, ...resourceOptions });
63
+ }
64
+ }
@@ -0,0 +1,5 @@
1
+ import { TableArgs, WorkspaceArgs } from '@pulumi/azure-native/operationalinsights/index.js';
2
+ export interface WorkspaceProps extends WorkspaceArgs {
3
+ }
4
+ export interface WorkspaceTableProps extends TableArgs {
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare class TemplateError extends Error {
2
+ readonly isTemplateError = true;
3
+ constructor(message: string);
4
+ static isInstance(error: unknown): error is TemplateError;
5
+ }