@gradientedge/cdk-utils 10.6.0 → 10.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/api-destined-function/src/lib/lambda.d.ts +1 -0
- package/dist/app/api-destined-function/src/lib/lambda.d.ts.map +1 -0
- package/dist/app/api-destined-function/src/lib/lambda.js +1 -0
- package/dist/app/api-destined-function/src/lib/lambda.js.map +1 -0
- package/dist/app/api-destined-function/tsconfig.tsbuildinfo +1 -0
- package/dist/src/lib/aws/services/cloudwatch/main.d.ts +11 -11
- package/dist/src/lib/azure/common/constants.d.ts +74 -0
- package/dist/src/lib/azure/common/constants.js +77 -0
- package/dist/src/lib/azure/common/construct.d.ts +15 -3
- package/dist/src/lib/azure/common/construct.js +40 -4
- package/dist/src/lib/azure/common/stack.d.ts +3 -2
- package/dist/src/lib/azure/common/stack.js +25 -42
- package/dist/src/lib/azure/common/types.d.ts +13 -2
- package/dist/src/lib/azure/construct/event-handler/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/event-handler/index.js +2 -0
- package/dist/src/lib/azure/construct/event-handler/main.d.ts +20 -0
- package/dist/src/lib/azure/construct/event-handler/main.js +139 -0
- package/dist/src/lib/azure/construct/event-handler/types.d.ts +35 -0
- package/dist/src/lib/azure/construct/event-handler/types.js +1 -0
- package/dist/src/lib/azure/construct/function-app/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/function-app/index.js +2 -0
- package/dist/src/lib/azure/construct/function-app/main.d.ts +51 -0
- package/dist/src/lib/azure/construct/function-app/main.js +297 -0
- package/dist/src/lib/azure/construct/function-app/types.d.ts +33 -0
- package/dist/src/lib/azure/construct/function-app/types.js +1 -0
- package/dist/src/lib/azure/construct/index.d.ts +6 -0
- package/dist/src/lib/azure/construct/index.js +6 -0
- package/dist/src/lib/azure/construct/rest-api/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/rest-api/index.js +2 -0
- package/dist/src/lib/azure/construct/rest-api/main.d.ts +20 -0
- package/dist/src/lib/azure/construct/rest-api/main.js +172 -0
- package/dist/src/lib/azure/construct/rest-api/types.d.ts +25 -0
- package/dist/src/lib/azure/construct/rest-api/types.js +1 -0
- package/dist/src/lib/azure/construct/rest-api-function/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/rest-api-function/index.js +2 -0
- package/dist/src/lib/azure/construct/rest-api-function/main.d.ts +19 -0
- package/dist/src/lib/azure/construct/rest-api-function/main.js +255 -0
- package/dist/src/lib/azure/construct/rest-api-function/types.d.ts +29 -0
- package/dist/src/lib/azure/construct/rest-api-function/types.js +1 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/index.js +2 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/main.d.ts +12 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/main.js +56 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/types.d.ts +13 -0
- package/dist/src/lib/azure/construct/rest-api-with-cache/types.js +1 -0
- package/dist/src/lib/azure/construct/site-with-webapp/index.d.ts +2 -0
- package/dist/src/lib/azure/construct/site-with-webapp/index.js +2 -0
- package/dist/src/lib/azure/construct/site-with-webapp/main.d.ts +19 -0
- package/dist/src/lib/azure/construct/site-with-webapp/main.js +135 -0
- package/dist/src/lib/azure/construct/site-with-webapp/types.d.ts +30 -0
- package/dist/src/lib/azure/construct/site-with-webapp/types.js +1 -0
- package/dist/src/lib/azure/index.d.ts +1 -0
- package/dist/src/lib/azure/index.js +1 -0
- package/dist/src/lib/azure/services/api-management/main.d.ts +83 -5
- package/dist/src/lib/azure/services/api-management/main.js +114 -148
- package/dist/src/lib/azure/services/api-management/types.d.ts +22 -1
- package/dist/src/lib/azure/services/app-configuration/main.d.ts +13 -1
- package/dist/src/lib/azure/services/app-configuration/main.js +21 -2
- package/dist/src/lib/azure/services/app-service/main.d.ts +5 -2
- package/dist/src/lib/azure/services/app-service/main.js +12 -4
- package/dist/src/lib/azure/services/application-insights/main.d.ts +15 -4
- package/dist/src/lib/azure/services/application-insights/main.js +27 -6
- package/dist/src/lib/azure/services/application-insights/types.d.ts +4 -1
- package/dist/src/lib/azure/services/authorisation/constants.d.ts +13 -0
- package/dist/src/lib/azure/services/authorisation/constants.js +14 -0
- package/dist/src/lib/azure/services/authorisation/index.d.ts +3 -0
- package/dist/src/lib/azure/services/authorisation/index.js +3 -0
- package/dist/src/lib/azure/services/authorisation/main.d.ts +84 -0
- package/dist/src/lib/azure/services/authorisation/main.js +120 -0
- package/dist/src/lib/azure/services/authorisation/types.d.ts +3 -0
- package/dist/src/lib/azure/services/authorisation/types.js +1 -0
- package/dist/src/lib/azure/services/cosmosdb/constants.d.ts +8 -0
- package/dist/src/lib/azure/services/cosmosdb/constants.js +10 -0
- package/dist/src/lib/azure/services/cosmosdb/index.d.ts +1 -0
- package/dist/src/lib/azure/services/cosmosdb/index.js +1 -0
- package/dist/src/lib/azure/services/cosmosdb/main.d.ts +47 -5
- package/dist/src/lib/azure/services/cosmosdb/main.js +77 -8
- package/dist/src/lib/azure/services/cosmosdb/types.d.ts +3 -1
- package/dist/src/lib/azure/services/dns/main.d.ts +9 -4
- package/dist/src/lib/azure/services/dns/main.js +12 -8
- package/dist/src/lib/azure/services/eventgrid/main.d.ts +12 -7
- package/dist/src/lib/azure/services/eventgrid/main.js +18 -19
- package/dist/src/lib/azure/services/function/main.d.ts +16 -3
- package/dist/src/lib/azure/services/function/main.js +122 -8
- package/dist/src/lib/azure/services/function/types.d.ts +3 -4
- package/dist/src/lib/azure/services/index.d.ts +3 -0
- package/dist/src/lib/azure/services/index.js +3 -0
- package/dist/src/lib/azure/services/key-vault/main.d.ts +22 -2
- package/dist/src/lib/azure/services/key-vault/main.js +28 -3
- package/dist/src/lib/azure/services/key-vault/types.d.ts +3 -2
- package/dist/src/lib/azure/services/monitor/main.d.ts +3 -1
- package/dist/src/lib/azure/services/monitor/main.js +3 -2
- package/dist/src/lib/azure/services/operational-insights/main.d.ts +13 -2
- package/dist/src/lib/azure/services/operational-insights/main.js +17 -3
- package/dist/src/lib/azure/services/operational-insights/types.d.ts +3 -1
- package/dist/src/lib/azure/services/portal/error.d.ts +5 -0
- package/dist/src/lib/azure/services/portal/error.js +10 -0
- package/dist/src/lib/azure/services/portal/index.d.ts +4 -0
- package/dist/src/lib/azure/services/portal/index.js +4 -0
- package/dist/src/lib/azure/services/portal/main.d.ts +33 -0
- package/dist/src/lib/azure/services/portal/main.js +51 -0
- package/dist/src/lib/azure/services/portal/renderer.d.ts +11 -0
- package/dist/src/lib/azure/services/portal/renderer.js +156 -0
- package/dist/src/lib/azure/services/portal/types.d.ts +40 -0
- package/dist/src/lib/azure/services/portal/types.js +1 -0
- package/dist/src/lib/azure/services/redis/main.d.ts +4 -2
- package/dist/src/lib/azure/services/redis/main.js +3 -2
- package/dist/src/lib/azure/services/redis/types.d.ts +1 -1
- package/dist/src/lib/azure/services/resource-group/main.d.ts +10 -1
- package/dist/src/lib/azure/services/resource-group/main.js +17 -3
- package/dist/src/lib/azure/services/security-center/index.d.ts +2 -0
- package/dist/src/lib/azure/services/security-center/index.js +2 -0
- package/dist/src/lib/azure/services/security-center/main.d.ts +31 -0
- package/dist/src/lib/azure/services/security-center/main.js +33 -0
- package/dist/src/lib/azure/services/security-center/types.d.ts +3 -0
- package/dist/src/lib/azure/services/security-center/types.js +1 -0
- package/dist/src/lib/azure/services/servicebus/main.d.ts +28 -22
- package/dist/src/lib/azure/services/servicebus/main.js +31 -26
- package/dist/src/lib/azure/services/servicebus/types.d.ts +4 -4
- package/dist/src/lib/azure/services/storage/main.d.ts +26 -5
- package/dist/src/lib/azure/services/storage/main.js +51 -9
- package/dist/src/lib/azure/services/storage/types.d.ts +7 -2
- package/dist/src/lib/cloudflare/common/construct.js +1 -1
- package/dist/src/lib/cloudflare/common/stack.d.ts +2 -2
- package/dist/src/lib/cloudflare/common/stack.js +25 -25
- package/dist/src/lib/cloudflare/services/worker/main.js +8 -1
- package/dist/src/lib/cloudflare/services/worker/types.d.ts +1 -0
- package/package.json +26 -23
- package/src/lib/azure/common/constants.ts +83 -0
- package/src/lib/azure/common/construct.ts +50 -7
- package/src/lib/azure/common/stack.ts +26 -43
- package/src/lib/azure/common/types.ts +14 -2
- package/src/lib/azure/construct/event-handler/index.ts +2 -0
- package/src/lib/azure/construct/event-handler/main.ts +183 -0
- package/src/lib/azure/construct/event-handler/types.ts +49 -0
- package/src/lib/azure/construct/function-app/index.ts +2 -0
- package/src/lib/azure/construct/function-app/main.ts +410 -0
- package/src/lib/azure/construct/function-app/types.ts +45 -0
- package/src/lib/azure/construct/index.ts +6 -0
- package/src/lib/azure/construct/rest-api/index.ts +2 -0
- package/src/lib/azure/construct/rest-api/main.ts +205 -0
- package/src/lib/azure/construct/rest-api/types.ts +33 -0
- package/src/lib/azure/construct/rest-api-function/index.ts +2 -0
- package/src/lib/azure/construct/rest-api-function/main.ts +297 -0
- package/src/lib/azure/construct/rest-api-function/types.ts +39 -0
- package/src/lib/azure/construct/rest-api-with-cache/index.ts +2 -0
- package/src/lib/azure/construct/rest-api-with-cache/main.ts +75 -0
- package/src/lib/azure/construct/rest-api-with-cache/types.ts +15 -0
- package/src/lib/azure/construct/site-with-webapp/index.ts +2 -0
- package/src/lib/azure/construct/site-with-webapp/main.ts +160 -0
- package/src/lib/azure/construct/site-with-webapp/types.ts +33 -0
- package/src/lib/azure/index.ts +1 -0
- package/src/lib/azure/services/api-management/main.ts +168 -152
- package/src/lib/azure/services/api-management/types.ts +30 -1
- package/src/lib/azure/services/app-configuration/main.ts +29 -2
- package/src/lib/azure/services/app-service/main.ts +23 -4
- package/src/lib/azure/services/application-insights/main.ts +46 -7
- package/src/lib/azure/services/application-insights/types.ts +6 -2
- package/src/lib/azure/services/authorisation/constants.ts +13 -0
- package/src/lib/azure/services/authorisation/index.ts +3 -0
- package/src/lib/azure/services/authorisation/main.ts +202 -0
- package/src/lib/azure/services/authorisation/types.ts +3 -0
- package/src/lib/azure/services/cosmosdb/constants.ts +9 -0
- package/src/lib/azure/services/cosmosdb/index.ts +1 -0
- package/src/lib/azure/services/cosmosdb/main.ts +158 -8
- package/src/lib/azure/services/cosmosdb/types.ts +3 -0
- package/src/lib/azure/services/dns/main.ts +33 -8
- package/src/lib/azure/services/eventgrid/main.ts +41 -23
- package/src/lib/azure/services/function/main.ts +155 -9
- package/src/lib/azure/services/function/types.ts +3 -4
- package/src/lib/azure/services/index.ts +3 -0
- package/src/lib/azure/services/key-vault/main.ts +47 -4
- package/src/lib/azure/services/key-vault/types.ts +4 -4
- package/src/lib/azure/services/monitor/main.ts +5 -2
- package/src/lib/azure/services/operational-insights/main.ts +30 -4
- package/src/lib/azure/services/operational-insights/types.ts +3 -1
- package/src/lib/azure/services/portal/error.ts +12 -0
- package/src/lib/azure/services/portal/index.ts +4 -0
- package/src/lib/azure/services/portal/main.ts +81 -0
- package/src/lib/azure/services/portal/renderer.ts +182 -0
- package/src/lib/azure/services/portal/types.ts +45 -0
- package/src/lib/azure/services/redis/main.ts +10 -3
- package/src/lib/azure/services/redis/types.ts +1 -1
- package/src/lib/azure/services/resource-group/main.ts +34 -3
- package/src/lib/azure/services/security-center/index.ts +2 -0
- package/src/lib/azure/services/security-center/main.ts +42 -0
- package/src/lib/azure/services/security-center/types.ts +3 -0
- package/src/lib/azure/services/servicebus/main.ts +61 -30
- package/src/lib/azure/services/servicebus/types.ts +4 -4
- package/src/lib/azure/services/storage/main.ts +91 -9
- package/src/lib/azure/services/storage/types.ts +11 -2
- package/src/lib/cloudflare/common/construct.ts +1 -1
- package/src/lib/cloudflare/common/stack.ts +25 -25
- package/src/lib/cloudflare/services/worker/main.ts +10 -1
- package/src/lib/cloudflare/services/worker/types.ts +8 -1
- package/dist/lib/lambda.d.ts +0 -17
- package/dist/lib/lambda.d.ts.map +0 -1
- package/dist/lib/lambda.js +0 -28
- package/dist/lib/lambda.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Api, ApiManagementService, ApiOperation, ApiOperationPolicy, Backend, BackendProtocol, Cache, getApiManagementServiceOutput, Logger, LoggerType,
|
|
2
|
-
import _ from 'lodash';
|
|
1
|
+
import { Api, ApiDiagnostic, ApiManagementService, ApiOperation, ApiOperationPolicy, ApiPolicy, Backend, BackendProtocol, Cache, getApiManagementServiceOutput, Logger, LoggerType, NamedValue, Protocol, Subscription, } from '@pulumi/azure-native/apimanagement/index.js';
|
|
3
2
|
/**
|
|
4
3
|
* @classdesc Provides operations on Azure API Management using Pulumi
|
|
5
4
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
@@ -25,9 +24,10 @@ export class AzureApiManagementManager {
|
|
|
25
24
|
* @param props API Management properties
|
|
26
25
|
* @param applicationInsightsKey Optional Application Insights instrumentation key for logging
|
|
27
26
|
* @param externalRedisCache Optional external Redis cache for API Management caching
|
|
27
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
28
28
|
* @see [Pulumi Azure Native API Management]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/apimanagementservice/}
|
|
29
29
|
*/
|
|
30
|
-
createApiManagementService(id, scope, props, applicationInsightsKey, externalRedisCache) {
|
|
30
|
+
createApiManagementService(id, scope, props, applicationInsightsKey, externalRedisCache, resourceOptions) {
|
|
31
31
|
if (!props)
|
|
32
32
|
throw `Props undefined for ${id}`;
|
|
33
33
|
// Get resource group name
|
|
@@ -46,7 +46,7 @@ export class AzureApiManagementManager {
|
|
|
46
46
|
tags: props.tags ?? {
|
|
47
47
|
environment: scope.props.stage,
|
|
48
48
|
},
|
|
49
|
-
}, { parent: scope });
|
|
49
|
+
}, { parent: scope, ...resourceOptions });
|
|
50
50
|
// Create logger if Application Insights key is provided
|
|
51
51
|
if (applicationInsightsKey) {
|
|
52
52
|
new Logger(`${id}-am-logger`, {
|
|
@@ -57,7 +57,7 @@ export class AzureApiManagementManager {
|
|
|
57
57
|
credentials: {
|
|
58
58
|
instrumentationKey: applicationInsightsKey,
|
|
59
59
|
},
|
|
60
|
-
}, { parent: scope });
|
|
60
|
+
}, { parent: scope, dependsOn: [apiManagementService] });
|
|
61
61
|
}
|
|
62
62
|
// Create Redis cache connection if external Redis is provided
|
|
63
63
|
if (externalRedisCache) {
|
|
@@ -68,7 +68,7 @@ export class AzureApiManagementManager {
|
|
|
68
68
|
connectionString: externalRedisCache.hostName.apply(hostName => `${hostName}:10000,password=${externalRedisCache.accessKeys.apply(k => k?.primaryKey)},ssl=True,abortConnect=False`),
|
|
69
69
|
useFromLocation: externalRedisCache.location,
|
|
70
70
|
resourceId: externalRedisCache.id,
|
|
71
|
-
}, { parent: scope });
|
|
71
|
+
}, { parent: scope, dependsOn: apiManagementService });
|
|
72
72
|
}
|
|
73
73
|
return apiManagementService;
|
|
74
74
|
}
|
|
@@ -77,9 +77,10 @@ export class AzureApiManagementManager {
|
|
|
77
77
|
* @param id scoped id of the resource
|
|
78
78
|
* @param scope scope in which this resource is defined
|
|
79
79
|
* @param props API Management lookup properties
|
|
80
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
80
81
|
* @see [Pulumi Azure Native API Management Lookup]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/apimanagementservice/}
|
|
81
82
|
*/
|
|
82
|
-
resolveApiManagementService(id, scope, props) {
|
|
83
|
+
resolveApiManagementService(id, scope, props, resourceOptions) {
|
|
83
84
|
if (!props)
|
|
84
85
|
throw `Props undefined for ${id}`;
|
|
85
86
|
return getApiManagementServiceOutput({
|
|
@@ -87,16 +88,17 @@ export class AzureApiManagementManager {
|
|
|
87
88
|
resourceGroupName: scope.props.resourceGroupName
|
|
88
89
|
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
89
90
|
: props.resourceGroupName,
|
|
90
|
-
}, { parent: scope });
|
|
91
|
+
}, { parent: scope, ...resourceOptions });
|
|
91
92
|
}
|
|
92
93
|
/**
|
|
93
94
|
* @summary Method to create a new API Management backend
|
|
94
95
|
* @param id scoped id of the resource
|
|
95
96
|
* @param scope scope in which this resource is defined
|
|
96
97
|
* @param props API Management backend properties
|
|
98
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
97
99
|
* @see [Pulumi Azure Native API Management Backend]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/backend/}
|
|
98
100
|
*/
|
|
99
|
-
createBackend(id, scope, props) {
|
|
101
|
+
createBackend(id, scope, props, resourceOptions) {
|
|
100
102
|
if (!props)
|
|
101
103
|
throw `Props undefined for ${id}`;
|
|
102
104
|
return new Backend(`${id}-am-be`, {
|
|
@@ -104,16 +106,17 @@ export class AzureApiManagementManager {
|
|
|
104
106
|
backendId: scope.resourceNameFormatter.format(props.backendId?.toString(), scope.props.resourceNameOptions?.apiManagementBackend),
|
|
105
107
|
description: props.description ?? `Backend for ${props.name || id}-${scope.props.stage}`,
|
|
106
108
|
protocol: props.protocol ?? BackendProtocol.Http,
|
|
107
|
-
}, { parent: scope });
|
|
109
|
+
}, { parent: scope, ...resourceOptions });
|
|
108
110
|
}
|
|
109
111
|
/**
|
|
110
112
|
* @summary Method to create a new API Management API with operations and policies
|
|
111
113
|
* @param id scoped id of the resource
|
|
112
114
|
* @param scope scope in which this resource is defined
|
|
113
115
|
* @param props API Management API properties
|
|
116
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
114
117
|
* @see [Pulumi Azure Native API Management API]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/apimanagement/api/}
|
|
115
118
|
*/
|
|
116
|
-
createApi(id, scope, props) {
|
|
119
|
+
createApi(id, scope, props, resourceOptions) {
|
|
117
120
|
if (!props)
|
|
118
121
|
throw `Props undefined for ${id}`;
|
|
119
122
|
const api = new Api(`${id}-am-api`, {
|
|
@@ -122,154 +125,117 @@ export class AzureApiManagementManager {
|
|
|
122
125
|
displayName: props.displayName ?? props.apiId,
|
|
123
126
|
apiRevision: props.apiRevision ?? '1',
|
|
124
127
|
protocols: props.protocols ?? [Protocol.Https],
|
|
125
|
-
}, { parent: scope });
|
|
126
|
-
// Create operations and policies
|
|
127
|
-
_.forEach(props.operations, operation => {
|
|
128
|
-
const operationId = `${operation.displayName}-${operation.method}`;
|
|
129
|
-
const apimOperation = new ApiOperation(`${id}-apim-api-operation-${operation.displayName}-${operation.method}`, {
|
|
130
|
-
operationId: operationId,
|
|
131
|
-
method: operation.method?.toUpperCase() || 'GET',
|
|
132
|
-
serviceName: props.serviceName,
|
|
133
|
-
resourceGroupName: props.resourceGroupName,
|
|
134
|
-
apiId: api.name,
|
|
135
|
-
displayName: operation.displayName,
|
|
136
|
-
urlTemplate: operation.urlTemplate,
|
|
137
|
-
templateParameters: operation.templateParameters,
|
|
138
|
-
}, { parent: scope });
|
|
139
|
-
// Define Caching Policy if enabled
|
|
140
|
-
let cacheSetVariablePolicy = '';
|
|
141
|
-
let cacheInvalidateInboundPolicy = '';
|
|
142
|
-
let cacheSetInboundPolicy = '';
|
|
143
|
-
let cacheSetOutboundPolicy = '';
|
|
144
|
-
if (operation.caching) {
|
|
145
|
-
cacheSetVariablePolicy = `<!-- Generate a comprehensive custom cache key (without query params or Accept header) -->
|
|
146
|
-
<set-variable name="customCacheKey" value="@{
|
|
147
|
-
// Instance identification
|
|
148
|
-
|
|
149
|
-
// API identification
|
|
150
|
-
string apiName = context.Api.Name.Replace(" ", "").ToLower();
|
|
151
|
-
string apiVersion = context.Api.Version ?? "v1";
|
|
152
|
-
|
|
153
|
-
// Full path construction (without query parameters)
|
|
154
|
-
string fullPath = context.Request.Url.Path.ToLower();
|
|
155
|
-
|
|
156
|
-
// Query parameters
|
|
157
|
-
string query = context.Request.Url.QueryString.ToLower();
|
|
158
|
-
|
|
159
|
-
// Construct final cache key (no Accept header needed for JSON-only APIs)
|
|
160
|
-
return $"{apiName}:{apiVersion}:{fullPath}:{query}";
|
|
161
|
-
}" />
|
|
162
|
-
<set-variable name="bypassCache" value="@(context.Request.Headers.GetValueOrDefault("X-Cache-Bypass", "false").ToLower())" />`;
|
|
163
|
-
if (operation.caching.enableCacheSet) {
|
|
164
|
-
cacheSetInboundPolicy = `<choose>
|
|
165
|
-
<when condition="@((string)context.Variables["bypassCache"] != "true")">
|
|
166
|
-
<!-- Attempt to retrieve cached response -->
|
|
167
|
-
<cache-lookup-value key="@((string)context.Variables["customCacheKey"])" variable-name="cachedResponse" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
168
|
-
|
|
169
|
-
<!-- If cache hit, return cached response -->
|
|
170
|
-
<choose>
|
|
171
|
-
<when condition="@(context.Variables.ContainsKey("cachedResponse"))">
|
|
172
|
-
<return-response>
|
|
173
|
-
<set-status code="200" reason="OK" />
|
|
174
|
-
<set-header name="Content-Type" exists-action="override">
|
|
175
|
-
<value>application/json</value>
|
|
176
|
-
</set-header>
|
|
177
|
-
<set-header name="X-Apim-Cache-Status" exists-action="override">
|
|
178
|
-
<value>HIT</value>
|
|
179
|
-
</set-header>
|
|
180
|
-
<set-header name="X-Apim-Cache-Key" exists-action="override">
|
|
181
|
-
<value>@((string)context.Variables["customCacheKey"])</value>
|
|
182
|
-
</set-header>
|
|
183
|
-
<set-body>@((string)context.Variables["cachedResponse"])</set-body>
|
|
184
|
-
</return-response>
|
|
185
|
-
</when>
|
|
186
|
-
</choose>
|
|
187
|
-
</when>
|
|
188
|
-
<when condition="@((string)context.Variables["bypassCache"] == "true")">
|
|
189
|
-
<cache-remove-value key="@((string)context.Variables["customCacheKey"])" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
190
|
-
</when>
|
|
191
|
-
</choose>`;
|
|
192
|
-
cacheSetOutboundPolicy = `<!-- Store the response body in cache -->
|
|
193
|
-
<choose>
|
|
194
|
-
<when condition="@(context.Response.StatusCode == 200)">
|
|
195
|
-
<cache-store-value key="@((string)context.Variables["customCacheKey"])" value="@(context.Response.Body.As<string>(preserveContent: true))" duration="${operation.caching.ttlInSecs ?? 900}" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
196
|
-
<!-- Add cache status header -->
|
|
197
|
-
<set-header name="X-Apim-Cache-Status" exists-action="override">
|
|
198
|
-
<value>MISS</value>
|
|
199
|
-
</set-header>
|
|
200
|
-
</when>
|
|
201
|
-
</choose>
|
|
202
|
-
<!-- Add debug headers -->
|
|
203
|
-
<set-header name="X-Apim-Cache-Key" exists-action="override">
|
|
204
|
-
<value>@((string)context.Variables["customCacheKey"])</value>
|
|
205
|
-
</set-header>
|
|
206
|
-
<set-header name="X-Apim-API-Name" exists-action="override">
|
|
207
|
-
<value>@(context.Api.Name)</value>
|
|
208
|
-
</set-header>`;
|
|
209
|
-
}
|
|
210
|
-
if (operation.caching.enableCacheInvalidation) {
|
|
211
|
-
cacheInvalidateInboundPolicy = `<set-variable name="clearCache" value="@(context.Request.Headers.GetValueOrDefault("X-Apim-Clear-Cache", "false").ToLower())" />
|
|
212
|
-
<!-- Allow admin to clear specific cache entries -->
|
|
213
|
-
<choose>
|
|
214
|
-
<when condition="@((string)context.Variables["clearCache"] == "true")">
|
|
215
|
-
<cache-remove-value key="@((string)context.Variables["customCacheKey"])" caching-type="${operation.caching.cachingType || 'prefer-external'}" />
|
|
216
|
-
<return-response>
|
|
217
|
-
<set-status code="200" reason="OK" />
|
|
218
|
-
<set-body>Cache entry removed successfully</set-body>
|
|
219
|
-
</return-response>
|
|
220
|
-
</when>
|
|
221
|
-
</choose>`;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
// Inject rate limiting policy (if configured)
|
|
225
|
-
let rateLimitPolicy = '';
|
|
226
|
-
if (props.rateLimit && scope.props.subscriptionId) {
|
|
227
|
-
rateLimitPolicy = `<rate-limit-by-key calls="${props.rateLimit.calls}" renewal-period="${props.rateLimit.renewalPeriodInSecs}" counter-key="${scope.props.subscriptionId}-${operationId}"/>`;
|
|
228
|
-
}
|
|
229
|
-
const policyXmlContent = `<policies>
|
|
230
|
-
<inbound>
|
|
231
|
-
<base />
|
|
232
|
-
${rateLimitPolicy}
|
|
233
|
-
${cacheSetVariablePolicy}
|
|
234
|
-
${cacheInvalidateInboundPolicy}
|
|
235
|
-
${cacheSetInboundPolicy}
|
|
236
|
-
${props.commonInboundPolicyXml ?? ''}
|
|
237
|
-
</inbound>
|
|
238
|
-
<backend>
|
|
239
|
-
<base />
|
|
240
|
-
</backend>
|
|
241
|
-
<outbound>
|
|
242
|
-
<base />
|
|
243
|
-
${cacheSetOutboundPolicy}
|
|
244
|
-
${props.commonOutboundPolicyXml ?? ''}
|
|
245
|
-
</outbound>
|
|
246
|
-
<on-error>
|
|
247
|
-
<base />
|
|
248
|
-
</on-error>
|
|
249
|
-
</policies>`;
|
|
250
|
-
new ApiOperationPolicy(`${id}-apim-api-operation-policy-${operation.displayName}-${operation.method}`, {
|
|
251
|
-
serviceName: props.serviceName,
|
|
252
|
-
resourceGroupName: props.resourceGroupName,
|
|
253
|
-
apiId: api.name,
|
|
254
|
-
operationId: operationId,
|
|
255
|
-
policyId: 'policy',
|
|
256
|
-
value: policyXmlContent,
|
|
257
|
-
format: PolicyContentFormat.Xml,
|
|
258
|
-
}, { parent: scope });
|
|
259
|
-
});
|
|
128
|
+
}, { parent: scope, ...resourceOptions });
|
|
260
129
|
return api;
|
|
261
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
|
+
}
|
|
262
229
|
/**
|
|
263
230
|
* @summary Method to create a new API Management custom domain
|
|
264
231
|
* @param id scoped id of the resource
|
|
265
232
|
* @param scope scope in which this resource is defined
|
|
266
233
|
* @param props API Management custom domain properties
|
|
234
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
267
235
|
* @note In Pulumi Azure Native, custom domains are configured as part of the API Management service resource,
|
|
268
236
|
* not as a separate resource. Use the hostnameConfigurations property when creating the service.
|
|
269
237
|
*/
|
|
270
238
|
createApiManagementCustomDomain(id, scope, props) {
|
|
271
|
-
if (!props)
|
|
272
|
-
throw `Props undefined for ${id}`;
|
|
273
239
|
// Note: In Pulumi Azure Native, custom domains are part of the ApiManagementService
|
|
274
240
|
// This method is provided for API compatibility but should be configured
|
|
275
241
|
// via the hostnameConfigurations property of ApiManagementService instead
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
-
import { ApiArgs, ApiManagementServiceArgs, ApiOperationArgs, BackendArgs, GetApiManagementServiceOutputArgs } from '@pulumi/azure-native/apimanagement/index.js';
|
|
1
|
+
import { ApiArgs, ApiDiagnosticArgs, ApiManagementServiceArgs, ApiOperationArgs, ApiOperationPolicyArgs, ApiPolicyArgs, BackendArgs, CacheArgs, GetApiManagementServiceOutputArgs, LoggerArgs, NamedValueArgs, SubscriptionArgs } from '@pulumi/azure-native/apimanagement/index.js';
|
|
2
2
|
export interface ApiManagementProps extends ApiManagementServiceArgs {
|
|
3
|
+
certificateKeyVaultId?: string;
|
|
4
|
+
apiStackName?: string;
|
|
5
|
+
useExistingApiManagement?: boolean;
|
|
3
6
|
}
|
|
4
7
|
export interface ApiManagementBackendProps extends BackendArgs {
|
|
5
8
|
backendUrlPath?: string;
|
|
6
9
|
apiManagementId?: string;
|
|
7
10
|
circuitBreaker?: any;
|
|
8
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
|
+
}
|
|
9
22
|
export interface ApiManagementCustomDomainProps {
|
|
10
23
|
apiManagementId: string;
|
|
11
24
|
gateway?: Array<{
|
|
@@ -26,6 +39,8 @@ export interface ApiManagementApiProps extends ApiArgs {
|
|
|
26
39
|
operations: ApiManagementApiOperationProps[];
|
|
27
40
|
commonInboundPolicyXml?: string;
|
|
28
41
|
commonOutboundPolicyXml?: string;
|
|
42
|
+
cacheSetInboundPolicy?: string;
|
|
43
|
+
cacheSetOutboundPolicy?: string;
|
|
29
44
|
rateLimit?: ApiManagementApiRateLimit;
|
|
30
45
|
}
|
|
31
46
|
export interface ApiManagementApiOperationProps extends ApiOperationArgs {
|
|
@@ -49,3 +64,9 @@ export interface ApiManagementRedisCacheProps {
|
|
|
49
64
|
}
|
|
50
65
|
export interface ResolveApiManagementProps extends GetApiManagementServiceOutputArgs {
|
|
51
66
|
}
|
|
67
|
+
export interface ApiOperationProps extends ApiOperationArgs {
|
|
68
|
+
}
|
|
69
|
+
export interface ApiOperationPolicyProps extends ApiOperationPolicyArgs {
|
|
70
|
+
}
|
|
71
|
+
export interface ApiPolicyProps extends ApiPolicyArgs {
|
|
72
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ResourceOptions } from '@pulumi/pulumi';
|
|
1
2
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
2
3
|
import { AppConfigurationProps } from './types.js';
|
|
3
4
|
/**
|
|
@@ -23,7 +24,18 @@ export declare class AzureAppConfigurationManager {
|
|
|
23
24
|
* @param id scoped id of the resource
|
|
24
25
|
* @param scope scope in which this resource is defined
|
|
25
26
|
* @param props app configuration properties
|
|
27
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
26
28
|
* @see [Pulumi Azure Native App Configuration]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/appconfiguration/configurationstore/}
|
|
27
29
|
*/
|
|
28
|
-
createConfigurationStore(id: string, scope: CommonAzureConstruct, props: AppConfigurationProps): import("@pulumi/azure-native/appconfiguration/configurationStore.js").ConfigurationStore;
|
|
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;
|
|
29
41
|
}
|
|
@@ -22,9 +22,10 @@ export class AzureAppConfigurationManager {
|
|
|
22
22
|
* @param id scoped id of the resource
|
|
23
23
|
* @param scope scope in which this resource is defined
|
|
24
24
|
* @param props app configuration properties
|
|
25
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
25
26
|
* @see [Pulumi Azure Native App Configuration]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/appconfiguration/configurationstore/}
|
|
26
27
|
*/
|
|
27
|
-
createConfigurationStore(id, scope, props) {
|
|
28
|
+
createConfigurationStore(id, scope, props, resourceOptions) {
|
|
28
29
|
if (!props)
|
|
29
30
|
throw `Props undefined for ${id}`;
|
|
30
31
|
// Get resource group name
|
|
@@ -47,6 +48,24 @@ export class AzureAppConfigurationManager {
|
|
|
47
48
|
tags: props.tags ?? {
|
|
48
49
|
environment: scope.props.stage,
|
|
49
50
|
},
|
|
50
|
-
}, { parent: scope });
|
|
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)));
|
|
51
70
|
}
|
|
52
71
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ResourceOptions } from '@pulumi/pulumi';
|
|
1
2
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
2
3
|
import { LinuxWebAppProps, ServicePlanProps } from './types.js';
|
|
3
4
|
/**
|
|
@@ -23,15 +24,17 @@ export declare class AzureAppServiceManager {
|
|
|
23
24
|
* @param id scoped id of the resource
|
|
24
25
|
* @param scope scope in which this resource is defined
|
|
25
26
|
* @param props app service plan properties
|
|
27
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
26
28
|
* @see [Pulumi Azure Native App Service Plan]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/appserviceplan/}
|
|
27
29
|
*/
|
|
28
|
-
createAppServicePlan(id: string, scope: CommonAzureConstruct, props: ServicePlanProps): import("@pulumi/azure-native/web/appServicePlan.js").AppServicePlan;
|
|
30
|
+
createAppServicePlan(id: string, scope: CommonAzureConstruct, props: ServicePlanProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/web/appServicePlan.js").AppServicePlan;
|
|
29
31
|
/**
|
|
30
32
|
* @summary Method to create a new Linux web app
|
|
31
33
|
* @param id scoped id of the resource
|
|
32
34
|
* @param scope scope in which this resource is defined
|
|
33
35
|
* @param props web app properties
|
|
36
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
34
37
|
* @see [Pulumi Azure Native Web App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
|
|
35
38
|
*/
|
|
36
|
-
createLinuxWebApp(id: string, scope: CommonAzureConstruct, props: LinuxWebAppProps): import("@pulumi/azure-native/web/webApp.js").WebApp;
|
|
39
|
+
createLinuxWebApp(id: string, scope: CommonAzureConstruct, props: LinuxWebAppProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/web/webApp.js").WebApp;
|
|
37
40
|
}
|
|
@@ -22,9 +22,10 @@ export class AzureAppServiceManager {
|
|
|
22
22
|
* @param id scoped id of the resource
|
|
23
23
|
* @param scope scope in which this resource is defined
|
|
24
24
|
* @param props app service plan properties
|
|
25
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
25
26
|
* @see [Pulumi Azure Native App Service Plan]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/appserviceplan/}
|
|
26
27
|
*/
|
|
27
|
-
createAppServicePlan(id, scope, props) {
|
|
28
|
+
createAppServicePlan(id, scope, props, resourceOptions) {
|
|
28
29
|
if (!props)
|
|
29
30
|
throw `Props undefined for ${id}`;
|
|
30
31
|
// Get resource group name
|
|
@@ -38,19 +39,26 @@ export class AzureAppServiceManager {
|
|
|
38
39
|
name: scope.resourceNameFormatter.format(props.name?.toString(), scope.props.resourceNameOptions?.appServicePlan),
|
|
39
40
|
resourceGroupName: resourceGroupName,
|
|
40
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,
|
|
41
48
|
tags: props.tags ?? {
|
|
42
49
|
environment: scope.props.stage,
|
|
43
50
|
},
|
|
44
|
-
}, { parent: scope });
|
|
51
|
+
}, { parent: scope, ...resourceOptions });
|
|
45
52
|
}
|
|
46
53
|
/**
|
|
47
54
|
* @summary Method to create a new Linux web app
|
|
48
55
|
* @param id scoped id of the resource
|
|
49
56
|
* @param scope scope in which this resource is defined
|
|
50
57
|
* @param props web app properties
|
|
58
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
51
59
|
* @see [Pulumi Azure Native Web App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
|
|
52
60
|
*/
|
|
53
|
-
createLinuxWebApp(id, scope, props) {
|
|
61
|
+
createLinuxWebApp(id, scope, props, resourceOptions) {
|
|
54
62
|
if (!props)
|
|
55
63
|
throw `Props undefined for ${id}`;
|
|
56
64
|
// Get resource group name
|
|
@@ -77,6 +85,6 @@ export class AzureAppServiceManager {
|
|
|
77
85
|
tags: props.tags ?? {
|
|
78
86
|
environment: scope.props.stage,
|
|
79
87
|
},
|
|
80
|
-
}, { parent: scope });
|
|
88
|
+
}, { parent: scope, ...resourceOptions });
|
|
81
89
|
}
|
|
82
90
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ResourceOptions } from '@pulumi/pulumi';
|
|
1
2
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
2
|
-
import { ApplicationInsightsProps } from './types.js';
|
|
3
|
+
import { ApplicationInsightsProps, ComponentCurrentBillingFeatureProps } from './types.js';
|
|
3
4
|
/**
|
|
4
5
|
* @classdesc Provides operations on Azure Application Insights using Pulumi
|
|
5
6
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
@@ -19,11 +20,21 @@ import { ApplicationInsightsProps } from './types.js';
|
|
|
19
20
|
*/
|
|
20
21
|
export declare class AzureApplicationInsightsManager {
|
|
21
22
|
/**
|
|
22
|
-
* @summary Method to create a new application insights
|
|
23
|
+
* @summary Method to create a new application insights component
|
|
23
24
|
* @param id scoped id of the resource
|
|
24
25
|
* @param scope scope in which this resource is defined
|
|
25
|
-
* @param props application insights properties
|
|
26
|
+
* @param props application insights component properties
|
|
27
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
26
28
|
* @see [Pulumi Azure Native Application Insights Component]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/component/}
|
|
27
29
|
*/
|
|
28
|
-
createComponent(id: string, scope: CommonAzureConstruct, props: ApplicationInsightsProps): import("@pulumi/azure-native/applicationinsights/component.js").Component;
|
|
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;
|
|
29
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplicationType, Component } from '@pulumi/azure-native/applicationinsights/index.js';
|
|
1
|
+
import { ApplicationType, Component, ComponentCurrentBillingFeature, } from '@pulumi/azure-native/applicationinsights/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* @classdesc Provides operations on Azure Application Insights using Pulumi
|
|
4
4
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
@@ -18,13 +18,14 @@ import { ApplicationType, Component } from '@pulumi/azure-native/applicationinsi
|
|
|
18
18
|
*/
|
|
19
19
|
export class AzureApplicationInsightsManager {
|
|
20
20
|
/**
|
|
21
|
-
* @summary Method to create a new application insights
|
|
21
|
+
* @summary Method to create a new application insights component
|
|
22
22
|
* @param id scoped id of the resource
|
|
23
23
|
* @param scope scope in which this resource is defined
|
|
24
|
-
* @param props application insights properties
|
|
24
|
+
* @param props application insights component properties
|
|
25
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
25
26
|
* @see [Pulumi Azure Native Application Insights Component]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/component/}
|
|
26
27
|
*/
|
|
27
|
-
createComponent(id, scope, props) {
|
|
28
|
+
createComponent(id, scope, props, resourceOptions) {
|
|
28
29
|
if (!props)
|
|
29
30
|
throw `Props undefined for ${id}`;
|
|
30
31
|
// Get resource group name
|
|
@@ -33,7 +34,7 @@ export class AzureApplicationInsightsManager {
|
|
|
33
34
|
: props.resourceGroupName;
|
|
34
35
|
if (!resourceGroupName)
|
|
35
36
|
throw `Resource group name undefined for ${id}`;
|
|
36
|
-
|
|
37
|
+
const component = new Component(`${id}-ai`, {
|
|
37
38
|
...props,
|
|
38
39
|
resourceName: scope.resourceNameFormatter.format(props.resourceName?.toString(), scope.props.resourceNameOptions?.applicationInsights),
|
|
39
40
|
resourceGroupName: resourceGroupName,
|
|
@@ -42,6 +43,26 @@ export class AzureApplicationInsightsManager {
|
|
|
42
43
|
tags: props.tags ?? {
|
|
43
44
|
environment: scope.props.stage,
|
|
44
45
|
},
|
|
45
|
-
}, { parent: scope });
|
|
46
|
+
}, { parent: scope, ...resourceOptions });
|
|
47
|
+
if (props.billingFeatures) {
|
|
48
|
+
this.createComponentCurrentBillingFeature(`${id}-billing`, scope, props.billingFeatures, {
|
|
49
|
+
parent: scope,
|
|
50
|
+
...resourceOptions,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return component;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @summary Method to create a new application insights component billing feature
|
|
57
|
+
* @param id scoped id of the resource
|
|
58
|
+
* @param scope scope in which this resource is defined
|
|
59
|
+
* @param props application insights properties component billing featureø
|
|
60
|
+
* @param resourceOptions Optional settings to control resource behaviour
|
|
61
|
+
* @see [Pulumi Azure Native Application Insights Billing Feature]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/componentcurrentbillingfeature/}
|
|
62
|
+
*/
|
|
63
|
+
createComponentCurrentBillingFeature(id, scope, props, resourceOptions) {
|
|
64
|
+
if (!props)
|
|
65
|
+
throw `Props undefined for ${id}`;
|
|
66
|
+
return new ComponentCurrentBillingFeature(`${id}`, props, { parent: scope, ...resourceOptions });
|
|
46
67
|
}
|
|
47
68
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { ComponentArgs } from '@pulumi/azure-native/applicationinsights/index.js';
|
|
1
|
+
import { ComponentArgs, ComponentCurrentBillingFeatureArgs } from '@pulumi/azure-native/applicationinsights/index.js';
|
|
2
|
+
export interface ComponentCurrentBillingFeatureProps extends ComponentCurrentBillingFeatureArgs {
|
|
3
|
+
}
|
|
2
4
|
export interface ApplicationInsightsProps extends ComponentArgs {
|
|
5
|
+
billingFeatures?: ComponentCurrentBillingFeatureProps;
|
|
3
6
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary Enumerations for publicly available built in RBAC roles
|
|
3
|
+
* @see https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles
|
|
4
|
+
*/
|
|
5
|
+
export declare enum RoleDefinitionId {
|
|
6
|
+
APP_CONFIGURATION_DATA_READER = "/providers/Microsoft.Authorization/roleDefinitions/516239f1-63e1-4d78-a4de-a74fb236a071",
|
|
7
|
+
APP_CONFIGURATION_DATA_OWNER = "/providers/Microsoft.Authorization/roleDefinitions/5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b",
|
|
8
|
+
EVENTGRID_DATA_SENDER = "/providers/Microsoft.Authorization/roleDefinitions/d5a91429-5739-47e2-a06b-3470a27159e7",
|
|
9
|
+
KEY_VAULT_CERTIFICATE_USER = "/providers/Microsoft.Authorization/roleDefinitions/db79e9a7-68ee-4b58-9aeb-b90e7c24fcba",
|
|
10
|
+
KEY_VAULT_SECRETS_USER = "/providers/Microsoft.Authorization/roleDefinitions/4633458b-17de-408a-b874-0445c86b69e6",
|
|
11
|
+
STORAGE_BLOB_DATA_CONTRIBUTOR = "/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe",
|
|
12
|
+
STORAGE_TABLE_DATA_CONTRIBUTOR = "/providers/Microsoft.Authorization/roleDefinitions/0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3"
|
|
13
|
+
}
|