@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,244 @@
1
+ import { Api, ApiDiagnostic, ApiManagementService, ApiOperation, ApiOperationPolicy, ApiPolicy, Backend, BackendProtocol, Cache, getApiManagementServiceOutput, Logger, LoggerType, NamedValue, Protocol, Subscription, } from '@pulumi/azure-native/apimanagement/index.js';
2
+ /**
3
+ * @classdesc Provides operations on Azure API Management 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.apiManagementManager.createApiManagement('MyApiManagement', this, props)
15
+ * }
16
+ * }
17
+ * ```
18
+ */
19
+ export class AzureApiManagementManager {
20
+ /**
21
+ * @summary Method to create a new API Management service
22
+ * @param id scoped id of the resource
23
+ * @param scope scope in which this resource is defined
24
+ * @param props API Management properties
25
+ * @param applicationInsightsKey Optional Application Insights instrumentation key for logging
26
+ * @param externalRedisCache Optional external Redis cache for API Management caching
27
+ * @param resourceOptions Optional settings to control resource behaviour
28
+ * @see [Pulumi Azure Native API Management]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/apimanagementservice/}
29
+ */
30
+ createApiManagementService(id, scope, props, applicationInsightsKey, externalRedisCache, 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
+ const apiManagementService = new ApiManagementService(`${id}-am`, {
40
+ ...props,
41
+ serviceName: scope.resourceNameFormatter.format(props.serviceName?.toString(), scope.props.resourceNameOptions?.apiManagement),
42
+ resourceGroupName: resourceGroupName,
43
+ location: props.location ?? scope.props.location,
44
+ publisherEmail: props.publisherEmail ?? 'noreply@example.com',
45
+ publisherName: props.publisherName ?? 'Default Publisher',
46
+ tags: props.tags ?? {
47
+ environment: scope.props.stage,
48
+ },
49
+ }, { parent: scope, ...resourceOptions });
50
+ // Create logger if Application Insights key is provided
51
+ if (applicationInsightsKey) {
52
+ new Logger(`${id}-am-logger`, {
53
+ loggerId: scope.resourceNameFormatter.format(props.serviceName?.toString(), scope.props.resourceNameOptions?.apiManagementLogger),
54
+ resourceGroupName: resourceGroupName,
55
+ serviceName: apiManagementService.name,
56
+ loggerType: LoggerType.ApplicationInsights,
57
+ credentials: {
58
+ instrumentationKey: applicationInsightsKey,
59
+ },
60
+ }, { parent: scope, dependsOn: [apiManagementService] });
61
+ }
62
+ // Create Redis cache connection if external Redis is provided
63
+ if (externalRedisCache) {
64
+ new Cache(`${id}-am-redis-cache`, {
65
+ cacheId: scope.resourceNameFormatter.format(props.serviceName?.toString(), scope.props.resourceNameOptions?.apiManagementRedisCache),
66
+ serviceName: apiManagementService.name,
67
+ resourceGroupName: resourceGroupName,
68
+ connectionString: externalRedisCache.hostName.apply(hostName => `${hostName}:10000,password=${externalRedisCache.accessKeys.apply(k => k?.primaryKey)},ssl=True,abortConnect=False`),
69
+ useFromLocation: externalRedisCache.location,
70
+ resourceId: externalRedisCache.id,
71
+ }, { parent: scope, dependsOn: apiManagementService });
72
+ }
73
+ return apiManagementService;
74
+ }
75
+ /**
76
+ * @summary Method to resolve an existing API Management service
77
+ * @param id scoped id of the resource
78
+ * @param scope scope in which this resource is defined
79
+ * @param props API Management lookup properties
80
+ * @param resourceOptions Optional settings to control resource behaviour
81
+ * @see [Pulumi Azure Native API Management Lookup]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/apimanagementservice/}
82
+ */
83
+ resolveApiManagementService(id, scope, props, resourceOptions) {
84
+ if (!props)
85
+ throw `Props undefined for ${id}`;
86
+ return getApiManagementServiceOutput({
87
+ serviceName: scope.resourceNameFormatter.format(props.serviceName?.toString(), scope.props.resourceNameOptions?.dataAzurermApiManagement),
88
+ resourceGroupName: scope.props.resourceGroupName
89
+ ? `${scope.props.resourceGroupName}-${scope.props.stage}`
90
+ : props.resourceGroupName,
91
+ }, { parent: scope, ...resourceOptions });
92
+ }
93
+ /**
94
+ * @summary Method to create a new API Management backend
95
+ * @param id scoped id of the resource
96
+ * @param scope scope in which this resource is defined
97
+ * @param props API Management backend properties
98
+ * @param resourceOptions Optional settings to control resource behaviour
99
+ * @see [Pulumi Azure Native API Management Backend]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/backend/}
100
+ */
101
+ createBackend(id, scope, props, resourceOptions) {
102
+ if (!props)
103
+ throw `Props undefined for ${id}`;
104
+ return new Backend(`${id}-am-be`, {
105
+ ...props,
106
+ backendId: scope.resourceNameFormatter.format(props.backendId?.toString(), scope.props.resourceNameOptions?.apiManagementBackend),
107
+ description: props.description ?? `Backend for ${props.name || id}-${scope.props.stage}`,
108
+ protocol: props.protocol ?? BackendProtocol.Http,
109
+ }, { parent: scope, ...resourceOptions });
110
+ }
111
+ /**
112
+ * @summary Method to create a new API Management API with operations and policies
113
+ * @param id scoped id of the resource
114
+ * @param scope scope in which this resource is defined
115
+ * @param props API Management API properties
116
+ * @param resourceOptions Optional settings to control resource behaviour
117
+ * @see [Pulumi Azure Native API Management API]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/api/}
118
+ */
119
+ createApi(id, scope, props, resourceOptions) {
120
+ if (!props)
121
+ throw `Props undefined for ${id}`;
122
+ const api = new Api(`${id}-am-api`, {
123
+ ...props,
124
+ apiId: scope.resourceNameFormatter.format(props.apiId?.toString(), scope.props.resourceNameOptions?.apiManagementApi),
125
+ displayName: props.displayName ?? props.apiId,
126
+ apiRevision: props.apiRevision ?? '1',
127
+ protocols: props.protocols ?? [Protocol.Https],
128
+ }, { parent: scope, ...resourceOptions });
129
+ return api;
130
+ }
131
+ /**
132
+ * @summary Method to create a new API Diagnostic
133
+ * @param id scoped id of the resource
134
+ * @param scope scope in which this resource is defined
135
+ * @param props API Disagnostic properties
136
+ * @param resourceOptions Optional settings to control resource behaviour
137
+ * @see [Pulumi Azure Native API Management Diagnostic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/apidiagnostic/}
138
+ */
139
+ createApiDiagnostic(id, scope, props, resourceOptions) {
140
+ if (!props)
141
+ throw `Props undefined for ${id}`;
142
+ return new ApiDiagnostic(`${id}`, props, { parent: scope, ...resourceOptions });
143
+ }
144
+ /**
145
+ * @summary Method to create a new API Logger
146
+ * @param id scoped id of the resource
147
+ * @param scope scope in which this resource is defined
148
+ * @param props API Logger properties
149
+ * @param resourceOptions Optional settings to control resource behaviour
150
+ * @see [Pulumi Azure Native API Management Logger]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/logger/}
151
+ */
152
+ createLogger(id, scope, props, resourceOptions) {
153
+ if (!props)
154
+ throw `Props undefined for ${id}`;
155
+ return new Logger(`${id}`, props, { parent: scope, ...resourceOptions });
156
+ }
157
+ /**
158
+ * @summary Method to create a new API Named Value
159
+ * @param id scoped id of the resource
160
+ * @param scope scope in which this resource is defined
161
+ * @param props API Named Value properties
162
+ * @param resourceOptions Optional settings to control resource behaviour
163
+ * @see [Pulumi Azure Native API Management Named Value]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/namedvalue/}
164
+ */
165
+ createNamedValue(id, scope, props, resourceOptions) {
166
+ if (!props)
167
+ throw `Props undefined for ${id}`;
168
+ return new NamedValue(`${id}`, props, { parent: scope, ...resourceOptions });
169
+ }
170
+ /**
171
+ * @summary Method to create a new API Subscription
172
+ * @param id scoped id of the resource
173
+ * @param scope scope in which this resource is defined
174
+ * @param props API Subscription properties
175
+ * @param resourceOptions Optional settings to control resource behaviour
176
+ * @see [Pulumi Azure Native API Management Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/subscription/}
177
+ */
178
+ createSubscription(id, scope, props, resourceOptions) {
179
+ if (!props)
180
+ throw `Props undefined for ${id}`;
181
+ return new Subscription(`${id}`, props, { parent: scope, ...resourceOptions });
182
+ }
183
+ /**
184
+ * @summary Method to create a new API cache
185
+ * @param id scoped id of the resource
186
+ * @param scope scope in which this resource is defined
187
+ * @param props API cache properties
188
+ * @param resourceOptions Optional settings to control resource behaviour
189
+ * @see [Pulumi Azure Native API Management Cache]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/cache/}
190
+ */
191
+ createCache(id, scope, props, resourceOptions) {
192
+ if (!props)
193
+ throw `Props undefined for ${id}`;
194
+ return new Cache(`${id}`, props, { parent: scope, ...resourceOptions });
195
+ }
196
+ /**
197
+ * @summary Method to create a new API operation
198
+ * @param id scoped id of the resource
199
+ * @param scope scope in which this resource is defined
200
+ * @param props API operation properties
201
+ * @param resourceOptions Optional settings to control resource behaviour
202
+ * @see [Pulumi Azure Native API Management Operation]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/apioperation/}
203
+ */
204
+ createOperation(id, scope, props, resourceOptions) {
205
+ return new ApiOperation(`${id}`, props, { parent: scope, ...resourceOptions });
206
+ }
207
+ /**
208
+ * @summary Method to create a new API operation policy
209
+ * @param id scoped id of the resource
210
+ * @param scope scope in which this resource is defined
211
+ * @param props API operation policy properties
212
+ * @param resourceOptions Optional settings to control resource behaviour
213
+ * @see [Pulumi Azure Native API Management Operation Policy]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/apioperationpolicy/}
214
+ */
215
+ createOperationPolicy(id, scope, props, resourceOptions) {
216
+ return new ApiOperationPolicy(`${id}`, props, { parent: scope, ...resourceOptions });
217
+ }
218
+ /**
219
+ * @summary Method to create a new API policy
220
+ * @param id scoped id of the resource
221
+ * @param scope scope in which this resource is defined
222
+ * @param props API policy properties
223
+ * @param resourceOptions Optional settings to control resource behaviour
224
+ * @see [Pulumi Azure Native API Management Policy]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/apipolicy/}
225
+ */
226
+ createPolicy(id, scope, props, resourceOptions) {
227
+ return new ApiPolicy(`${id}`, props, { parent: scope, ...resourceOptions });
228
+ }
229
+ /**
230
+ * @summary Method to create a new API Management custom domain
231
+ * @param id scoped id of the resource
232
+ * @param scope scope in which this resource is defined
233
+ * @param props API Management custom domain properties
234
+ * @param resourceOptions Optional settings to control resource behaviour
235
+ * @note In Pulumi Azure Native, custom domains are configured as part of the API Management service resource,
236
+ * not as a separate resource. Use the hostnameConfigurations property when creating the service.
237
+ */
238
+ createApiManagementCustomDomain(id, scope, props) {
239
+ // Note: In Pulumi Azure Native, custom domains are part of the ApiManagementService
240
+ // This method is provided for API compatibility but should be configured
241
+ // via the hostnameConfigurations property of ApiManagementService instead
242
+ throw new Error('Custom domains should be configured via the hostnameConfigurations property of ApiManagementService in Pulumi Azure Native');
243
+ }
244
+ }
@@ -0,0 +1,72 @@
1
+ import { ApiArgs, ApiDiagnosticArgs, ApiManagementServiceArgs, ApiOperationArgs, ApiOperationPolicyArgs, ApiPolicyArgs, BackendArgs, CacheArgs, GetApiManagementServiceOutputArgs, LoggerArgs, NamedValueArgs, SubscriptionArgs } from '@pulumi/azure-native/apimanagement/index.js';
2
+ export interface ApiManagementProps extends ApiManagementServiceArgs {
3
+ certificateKeyVaultId?: string;
4
+ apiStackName?: string;
5
+ useExistingApiManagement?: boolean;
6
+ }
7
+ export interface ApiManagementBackendProps extends BackendArgs {
8
+ backendUrlPath?: string;
9
+ apiManagementId?: string;
10
+ circuitBreaker?: any;
11
+ }
12
+ export interface ApiDiagnosticProps extends ApiDiagnosticArgs {
13
+ }
14
+ export interface LoggerProps extends LoggerArgs {
15
+ }
16
+ export interface NamedValueProps extends NamedValueArgs {
17
+ }
18
+ export interface ApiSubscriptionProps extends SubscriptionArgs {
19
+ }
20
+ export interface CacheProps extends CacheArgs {
21
+ }
22
+ export interface ApiManagementCustomDomainProps {
23
+ apiManagementId: string;
24
+ gateway?: Array<{
25
+ hostName: string;
26
+ certificateId?: string;
27
+ negotiateClientCertificate?: boolean;
28
+ }>;
29
+ developerPortal?: Array<{
30
+ hostName: string;
31
+ certificateId?: string;
32
+ }>;
33
+ management?: Array<{
34
+ hostName: string;
35
+ certificateId?: string;
36
+ }>;
37
+ }
38
+ export interface ApiManagementApiProps extends ApiArgs {
39
+ operations: ApiManagementApiOperationProps[];
40
+ commonInboundPolicyXml?: string;
41
+ commonOutboundPolicyXml?: string;
42
+ cacheSetInboundPolicy?: string;
43
+ cacheSetOutboundPolicy?: string;
44
+ rateLimit?: ApiManagementApiRateLimit;
45
+ }
46
+ export interface ApiManagementApiOperationProps extends ApiOperationArgs {
47
+ caching?: ApiManagementApiCaching;
48
+ }
49
+ export interface ApiManagementApiCaching {
50
+ enableCacheSet?: boolean;
51
+ enableCacheInvalidation?: boolean;
52
+ ttlInSecs?: number;
53
+ cachingType?: string;
54
+ }
55
+ export interface ApiManagementApiRateLimit {
56
+ calls: number;
57
+ renewalPeriodInSecs: number;
58
+ }
59
+ export interface ApiManagementRedisCacheProps {
60
+ apiManagementId: string;
61
+ connectionString: string;
62
+ cacheLocation: string;
63
+ redisCacheId: string;
64
+ }
65
+ export interface ResolveApiManagementProps extends GetApiManagementServiceOutputArgs {
66
+ }
67
+ export interface ApiOperationProps extends ApiOperationArgs {
68
+ }
69
+ export interface ApiOperationPolicyProps extends ApiOperationPolicyArgs {
70
+ }
71
+ export interface ApiPolicyProps extends ApiPolicyArgs {
72
+ }
@@ -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,41 @@
1
+ import { ResourceOptions } from '@pulumi/pulumi';
2
+ import { CommonAzureConstruct } from '../../common/index.js';
3
+ import { AppConfigurationProps } from './types.js';
4
+ /**
5
+ * @classdesc Provides operations on Azure App Configuration 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.appConfigurationManager.createAppConfiguration('MyAppConfiguration', this, props)
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ export declare class AzureAppConfigurationManager {
22
+ /**
23
+ * @summary Method to create a new app configuration
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props app configuration properties
27
+ * @param resourceOptions Optional settings to control resource behaviour
28
+ * @see [Pulumi Azure Native App Configuration]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/appconfiguration/configurationstore/}
29
+ */
30
+ createConfigurationStore(id: string, scope: CommonAzureConstruct, props: AppConfigurationProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/appconfiguration/configurationStore.js").ConfigurationStore;
31
+ /**
32
+ * @summary Determine if the config object has cosmosdb dependencies
33
+ * @param obj the config object value
34
+ */
35
+ static hasCosmosDependencies: (obj: any) => boolean;
36
+ /**
37
+ * @summary Determine if the config object has eventgrid target dependencies
38
+ * @param obj the config object value
39
+ */
40
+ static hasEventGridTargets(obj: any): boolean;
41
+ }
@@ -0,0 +1,71 @@
1
+ import { ConfigurationStore, IdentityType } from '@pulumi/azure-native/appconfiguration/index.js';
2
+ /**
3
+ * @classdesc Provides operations on Azure App Configuration 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.appConfigurationManager.createAppConfiguration('MyAppConfiguration', this, props)
15
+ * }
16
+ * }
17
+ * ```
18
+ */
19
+ export class AzureAppConfigurationManager {
20
+ /**
21
+ * @summary Method to create a new app configuration
22
+ * @param id scoped id of the resource
23
+ * @param scope scope in which this resource is defined
24
+ * @param props app configuration properties
25
+ * @param resourceOptions Optional settings to control resource behaviour
26
+ * @see [Pulumi Azure Native App Configuration]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/appconfiguration/configurationstore/}
27
+ */
28
+ createConfigurationStore(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 ConfigurationStore(`${id}-ac`, {
38
+ ...props,
39
+ configStoreName: scope.resourceNameFormatter.format(props.configStoreName?.toString(), scope.props.resourceNameOptions?.appConfiguration),
40
+ resourceGroupName: resourceGroupName,
41
+ location: props.location ?? scope.props.location,
42
+ identity: props.identity ?? {
43
+ type: IdentityType.SystemAssigned,
44
+ },
45
+ sku: props.sku ?? {
46
+ name: 'standard',
47
+ },
48
+ tags: props.tags ?? {
49
+ environment: scope.props.stage,
50
+ },
51
+ }, { parent: scope, ...resourceOptions });
52
+ }
53
+ /**
54
+ * @summary Determine if the config object has cosmosdb dependencies
55
+ * @param obj the config object value
56
+ */
57
+ static hasCosmosDependencies = (obj) => {
58
+ if (!obj || typeof obj !== 'object')
59
+ return false;
60
+ if ('databaseName' in obj || 'tableName' in obj)
61
+ return true;
62
+ return Object.values(obj).some(val => this.hasCosmosDependencies(val));
63
+ };
64
+ /**
65
+ * @summary Determine if the config object has eventgrid target dependencies
66
+ * @param obj the config object value
67
+ */
68
+ static hasEventGridTargets(obj) {
69
+ return (obj && typeof obj === 'object' && ('eventGridTargets' in obj || Object.values(obj).some(this.hasEventGridTargets)));
70
+ }
71
+ }
@@ -0,0 +1,3 @@
1
+ import { ConfigurationStoreArgs } from '@pulumi/azure-native/appconfiguration/index.js';
2
+ export interface AppConfigurationProps extends ConfigurationStoreArgs {
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 { LinuxWebAppProps, ServicePlanProps } from './types.js';
4
+ /**
5
+ * @classdesc Provides operations on Azure App Service 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.appServiceManager.createAppServicePlan('MyAppService', this, props)
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ export declare class AzureAppServiceManager {
22
+ /**
23
+ * @summary Method to create a new app service plan
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props app service plan properties
27
+ * @param resourceOptions Optional settings to control resource behaviour
28
+ * @see [Pulumi Azure Native App Service Plan]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/appserviceplan/}
29
+ */
30
+ createAppServicePlan(id: string, scope: CommonAzureConstruct, props: ServicePlanProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/web/appServicePlan.js").AppServicePlan;
31
+ /**
32
+ * @summary Method to create a new Linux web app
33
+ * @param id scoped id of the resource
34
+ * @param scope scope in which this resource is defined
35
+ * @param props web app properties
36
+ * @param resourceOptions Optional settings to control resource behaviour
37
+ * @see [Pulumi Azure Native Web App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
38
+ */
39
+ createLinuxWebApp(id: string, scope: CommonAzureConstruct, props: LinuxWebAppProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/web/webApp.js").WebApp;
40
+ }
@@ -0,0 +1,90 @@
1
+ import { AppServicePlan, ManagedServiceIdentityType, SupportedTlsVersions, WebApp, } from '@pulumi/azure-native/web/index.js';
2
+ /**
3
+ * @classdesc Provides operations on Azure App Service 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.appServiceManager.createAppServicePlan('MyAppService', this, props)
15
+ * }
16
+ * }
17
+ * ```
18
+ */
19
+ export class AzureAppServiceManager {
20
+ /**
21
+ * @summary Method to create a new app service plan
22
+ * @param id scoped id of the resource
23
+ * @param scope scope in which this resource is defined
24
+ * @param props app service plan properties
25
+ * @param resourceOptions Optional settings to control resource behaviour
26
+ * @see [Pulumi Azure Native App Service Plan]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/appserviceplan/}
27
+ */
28
+ createAppServicePlan(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 AppServicePlan(`${id}-as`, {
38
+ ...props,
39
+ name: scope.resourceNameFormatter.format(props.name?.toString(), scope.props.resourceNameOptions?.appServicePlan),
40
+ resourceGroupName: resourceGroupName,
41
+ location: props.location ?? scope.props.location,
42
+ sku: props.sku ?? {
43
+ name: 'FC1',
44
+ tier: 'FlexConsumption',
45
+ },
46
+ reserved: props.reserved ?? true,
47
+ zoneRedundant: props.zoneRedundant ?? true,
48
+ tags: props.tags ?? {
49
+ environment: scope.props.stage,
50
+ },
51
+ }, { parent: scope, ...resourceOptions });
52
+ }
53
+ /**
54
+ * @summary Method to create a new Linux web app
55
+ * @param id scoped id of the resource
56
+ * @param scope scope in which this resource is defined
57
+ * @param props web app properties
58
+ * @param resourceOptions Optional settings to control resource behaviour
59
+ * @see [Pulumi Azure Native Web App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
60
+ */
61
+ createLinuxWebApp(id, scope, props, resourceOptions) {
62
+ if (!props)
63
+ throw `Props undefined for ${id}`;
64
+ // Get resource group name
65
+ const resourceGroupName = scope.props.resourceGroupName
66
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
67
+ : props.resourceGroupName;
68
+ if (!resourceGroupName)
69
+ throw `Resource group name undefined for ${id}`;
70
+ return new WebApp(`${id}-lwa`, {
71
+ ...props,
72
+ name: scope.resourceNameFormatter.format(props.name?.toString(), scope.props.resourceNameOptions?.linuxWebApp),
73
+ resourceGroupName: resourceGroupName,
74
+ location: props.location ?? scope.props.location,
75
+ httpsOnly: props.httpsOnly ?? true,
76
+ kind: props.kind ?? 'app,linux',
77
+ identity: props.identity ?? {
78
+ type: ManagedServiceIdentityType.SystemAssigned,
79
+ },
80
+ siteConfig: props.siteConfig ?? {
81
+ alwaysOn: true,
82
+ linuxFxVersion: 'NODE|22-lts',
83
+ minTlsVersion: SupportedTlsVersions.SupportedTlsVersions_1_3,
84
+ },
85
+ tags: props.tags ?? {
86
+ environment: scope.props.stage,
87
+ },
88
+ }, { parent: scope, ...resourceOptions });
89
+ }
90
+ }
@@ -0,0 +1,6 @@
1
+ import { AppServicePlanArgs } from '@pulumi/azure-native/web/index.js';
2
+ import { WebAppArgs } from '@pulumi/azure-native/web/index.js';
3
+ export interface ServicePlanProps extends AppServicePlanArgs {
4
+ }
5
+ export interface LinuxWebAppProps extends WebAppArgs {
6
+ }
@@ -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 { ApplicationInsightsProps, ComponentCurrentBillingFeatureProps } from './types.js';
4
+ /**
5
+ * @classdesc Provides operations on Azure Application Insights 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.applicationInsightsManager.createApplicationInsights('MyApplicationInsights', this, props)
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ export declare class AzureApplicationInsightsManager {
22
+ /**
23
+ * @summary Method to create a new application insights component
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props application insights component properties
27
+ * @param resourceOptions Optional settings to control resource behaviour
28
+ * @see [Pulumi Azure Native Application Insights Component]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/component/}
29
+ */
30
+ createComponent(id: string, scope: CommonAzureConstruct, props: ApplicationInsightsProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/applicationinsights/component.js").Component;
31
+ /**
32
+ * @summary Method to create a new application insights component billing feature
33
+ * @param id scoped id of the resource
34
+ * @param scope scope in which this resource is defined
35
+ * @param props application insights properties component billing featureø
36
+ * @param resourceOptions Optional settings to control resource behaviour
37
+ * @see [Pulumi Azure Native Application Insights Billing Feature]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/componentcurrentbillingfeature/}
38
+ */
39
+ createComponentCurrentBillingFeature(id: string, scope: CommonAzureConstruct, props: ComponentCurrentBillingFeatureProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/applicationinsights/componentCurrentBillingFeature.js").ComponentCurrentBillingFeature;
40
+ }