@gradientedge/cdk-utils 9.33.0 → 9.35.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 (46) hide show
  1. package/dist/src/lib/azure/common/construct.d.ts +5 -2
  2. package/dist/src/lib/azure/common/construct.js +8 -2
  3. package/dist/src/lib/azure/services/api-management/main.d.ts +30 -2
  4. package/dist/src/lib/azure/services/api-management/main.js +115 -2
  5. package/dist/src/lib/azure/services/api-management/types.d.ts +14 -0
  6. package/dist/src/lib/azure/services/app-configuration/index.d.ts +2 -0
  7. package/dist/src/lib/azure/services/app-configuration/index.js +18 -0
  8. package/dist/src/lib/azure/services/app-configuration/main.d.ts +30 -0
  9. package/dist/src/lib/azure/services/app-configuration/main.js +56 -0
  10. package/dist/src/lib/azure/services/app-configuration/types.d.ts +3 -0
  11. package/dist/src/lib/azure/services/app-configuration/types.js +2 -0
  12. package/dist/src/lib/azure/services/app-service/index.d.ts +2 -0
  13. package/dist/src/lib/azure/services/app-service/index.js +18 -0
  14. package/dist/src/lib/azure/services/app-service/main.d.ts +30 -0
  15. package/dist/src/lib/azure/services/app-service/main.js +56 -0
  16. package/dist/src/lib/azure/services/app-service/types.d.ts +3 -0
  17. package/dist/src/lib/azure/services/app-service/types.js +2 -0
  18. package/dist/src/lib/azure/services/application-insights/index.d.ts +2 -0
  19. package/dist/src/lib/azure/services/application-insights/index.js +18 -0
  20. package/dist/src/lib/azure/services/application-insights/main.d.ts +30 -0
  21. package/dist/src/lib/azure/services/application-insights/main.js +56 -0
  22. package/dist/src/lib/azure/services/application-insights/types.d.ts +3 -0
  23. package/dist/src/lib/azure/services/application-insights/types.js +2 -0
  24. package/dist/src/lib/azure/services/function/main.d.ts +2 -2
  25. package/dist/src/lib/azure/services/function/main.js +4 -15
  26. package/dist/src/lib/azure/services/function/types.d.ts +3 -5
  27. package/dist/src/lib/azure/services/index.d.ts +3 -0
  28. package/dist/src/lib/azure/services/index.js +3 -0
  29. package/dist/src/lib/azure/services/storage/main.js +4 -4
  30. package/package.json +1 -1
  31. package/src/lib/azure/common/construct.ts +11 -2
  32. package/src/lib/azure/services/api-management/main.ts +162 -3
  33. package/src/lib/azure/services/api-management/types.ts +16 -0
  34. package/src/lib/azure/services/app-configuration/index.ts +2 -0
  35. package/src/lib/azure/services/app-configuration/main.ts +58 -0
  36. package/src/lib/azure/services/app-configuration/types.ts +3 -0
  37. package/src/lib/azure/services/app-service/index.ts +2 -0
  38. package/src/lib/azure/services/app-service/main.ts +58 -0
  39. package/src/lib/azure/services/app-service/types.ts +3 -0
  40. package/src/lib/azure/services/application-insights/index.ts +2 -0
  41. package/src/lib/azure/services/application-insights/main.ts +58 -0
  42. package/src/lib/azure/services/application-insights/types.ts +3 -0
  43. package/src/lib/azure/services/function/main.ts +4 -17
  44. package/src/lib/azure/services/function/types.ts +3 -5
  45. package/src/lib/azure/services/index.ts +3 -0
  46. package/src/lib/azure/services/storage/main.ts +4 -4
@@ -1,13 +1,16 @@
1
1
  import { TerraformStack } from 'cdktf';
2
2
  import { Construct } from 'constructs';
3
- import { AzureStorageManager, AzureKeyVaultManager, AzureApiManagementManager, AzureFunctionManager, AzureResourceGroupManager } from '../services';
3
+ import { AzureStorageManager, AzureKeyVaultManager, AzureApiManagementManager, AzureFunctionManager, AzureResourceGroupManager, AzureAppServiceManager, AzureApplicationInsightsManager, AzureAppConfigurationManager } from '../services';
4
4
  import { CommonAzureStackProps } from './types';
5
5
  export declare class CommonAzureConstruct extends TerraformStack {
6
6
  props: CommonAzureStackProps;
7
7
  id: string;
8
8
  fullyQualifiedDomainName: string;
9
9
  tenantId: string;
10
- apiManagementtManager: AzureApiManagementManager;
10
+ apiManagementManager: AzureApiManagementManager;
11
+ appServiceManager: AzureAppServiceManager;
12
+ applicationInsightsManager: AzureApplicationInsightsManager;
13
+ appConfigurationManager: AzureAppConfigurationManager;
11
14
  functiontManager: AzureFunctionManager;
12
15
  keyVaultManager: AzureKeyVaultManager;
13
16
  resourceGroupManager: AzureResourceGroupManager;
@@ -11,7 +11,10 @@ class CommonAzureConstruct extends cdktf_1.TerraformStack {
11
11
  id;
12
12
  fullyQualifiedDomainName;
13
13
  tenantId;
14
- apiManagementtManager;
14
+ apiManagementManager;
15
+ appServiceManager;
16
+ applicationInsightsManager;
17
+ appConfigurationManager;
15
18
  functiontManager;
16
19
  keyVaultManager;
17
20
  resourceGroupManager;
@@ -20,7 +23,10 @@ class CommonAzureConstruct extends cdktf_1.TerraformStack {
20
23
  super(scope, id);
21
24
  this.props = props;
22
25
  this.id = id;
23
- this.apiManagementtManager = new services_1.AzureApiManagementManager();
26
+ this.apiManagementManager = new services_1.AzureApiManagementManager();
27
+ this.appServiceManager = new services_1.AzureAppServiceManager();
28
+ this.applicationInsightsManager = new services_1.AzureApplicationInsightsManager();
29
+ this.appConfigurationManager = new services_1.AzureAppConfigurationManager();
24
30
  this.functiontManager = new services_1.AzureFunctionManager();
25
31
  this.keyVaultManager = new services_1.AzureKeyVaultManager();
26
32
  this.resourceGroupManager = new services_1.AzureResourceGroupManager();
@@ -1,6 +1,10 @@
1
+ import { DataAzurermApiManagement, DataAzurermApiManagementConfig } from '@cdktf/provider-azurerm/lib/data-azurerm-api-management';
2
+ import { ApiManagementBackend } from '@cdktf/provider-azurerm/lib/api-management-backend';
1
3
  import { ApiManagement } from '@cdktf/provider-azurerm/lib/api-management';
4
+ import { ApiManagementApi } from '@cdktf/provider-azurerm/lib/api-management-api';
5
+ import { ApiManagementLoggerApplicationInsights } from '@cdktf/provider-azurerm/lib/api-management-logger';
2
6
  import { CommonAzureConstruct } from '../../common';
3
- import { ApiManagementProps } from './types';
7
+ import { ApiManagementProps, ApiManagementBackendProps, ApiManagementApiProps } from './types';
4
8
  /**
5
9
  * @classdesc Provides operations on Azure Api Management
6
10
  * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
@@ -26,5 +30,29 @@ export declare class AzureApiManagementManager {
26
30
  * @param props api management properties
27
31
  * @see [CDKTF Api management Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/apiManagement.typescript.md}
28
32
  */
29
- createApiManagement(id: string, scope: CommonAzureConstruct, props: ApiManagementProps): ApiManagement;
33
+ createApiManagement(id: string, scope: CommonAzureConstruct, props: ApiManagementProps, applicationInsightsKey?: ApiManagementLoggerApplicationInsights['instrumentationKey']): ApiManagement;
34
+ /**
35
+ * @summary Method to resolve an api management
36
+ * @param id scoped id of the resource
37
+ * @param scope scope in which this resource is defined
38
+ * @param props api management properties
39
+ * @see [CDKTF Api management Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/apiManagement.typescript.md}
40
+ */
41
+ resolveApiManagement(id: string, scope: CommonAzureConstruct, props: DataAzurermApiManagementConfig): DataAzurermApiManagement;
42
+ /**
43
+ * @summary Method to create a new api management backend
44
+ * @param id scoped id of the resource
45
+ * @param scope scope in which this resource is defined
46
+ * @param props api management backend properties
47
+ * @see [CDKTF Api management Backend Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/ApiManagementBackend.typescript.md}
48
+ */
49
+ createApiManagementBackend(id: string, scope: CommonAzureConstruct, props: ApiManagementBackendProps): ApiManagementBackend;
50
+ /**
51
+ * @summary Method to create a new api management api
52
+ * @param id scoped id of the resource
53
+ * @param scope scope in which this resource is defined
54
+ * @param props api management api properties
55
+ * @see [CDKTF Api management Api Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/ApiManagementApi.typescript.md}
56
+ */
57
+ createApiManagementApi(id: string, scope: CommonAzureConstruct, props: ApiManagementApiProps): ApiManagementApi;
30
58
  }
@@ -1,9 +1,19 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.AzureApiManagementManager = void 0;
4
7
  const data_azurerm_resource_group_1 = require("@cdktf/provider-azurerm/lib/data-azurerm-resource-group");
8
+ const data_azurerm_api_management_1 = require("@cdktf/provider-azurerm/lib/data-azurerm-api-management");
9
+ const api_management_backend_1 = require("@cdktf/provider-azurerm/lib/api-management-backend");
5
10
  const api_management_1 = require("@cdktf/provider-azurerm/lib/api-management");
11
+ const api_management_api_1 = require("@cdktf/provider-azurerm/lib/api-management-api");
12
+ const api_management_api_operation_1 = require("@cdktf/provider-azurerm/lib/api-management-api-operation");
13
+ const api_management_api_operation_policy_1 = require("@cdktf/provider-azurerm/lib/api-management-api-operation-policy");
14
+ const api_management_logger_1 = require("@cdktf/provider-azurerm/lib/api-management-logger");
6
15
  const utils_1 = require("../../utils");
16
+ const lodash_1 = __importDefault(require("lodash"));
7
17
  /**
8
18
  * @classdesc Provides operations on Azure Api Management
9
19
  * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
@@ -29,13 +39,13 @@ class AzureApiManagementManager {
29
39
  * @param props api management properties
30
40
  * @see [CDKTF Api management Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/apiManagement.typescript.md}
31
41
  */
32
- createApiManagement(id, scope, props) {
42
+ createApiManagement(id, scope, props, applicationInsightsKey) {
33
43
  if (!props)
34
44
  throw `Props undefined for ${id}`;
35
45
  const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-am-rg`, {
36
46
  name: scope.props.resourceGroupName
37
47
  ? `${scope.props.resourceGroupName}-${scope.props.stage}`
38
- : `${props.resourceGroupName}-${scope.props.stage}`,
48
+ : `${props.resourceGroupName}`,
39
49
  });
40
50
  if (!resourceGroup)
41
51
  throw `Resource group undefined for ${id}`;
@@ -47,10 +57,113 @@ class AzureApiManagementManager {
47
57
  environment: scope.props.stage,
48
58
  },
49
59
  });
60
+ if (applicationInsightsKey) {
61
+ new api_management_logger_1.ApiManagementLogger(scope, `${id}-am-logger`, {
62
+ name: `${props.name}-${scope.props.stage}`,
63
+ resourceGroupName: resourceGroup.name,
64
+ apiManagementName: apiManagement.name,
65
+ applicationInsights: {
66
+ instrumentationKey: applicationInsightsKey,
67
+ },
68
+ });
69
+ }
50
70
  (0, utils_1.createAzureTfOutput)(`${id}-apiManagementName`, scope, apiManagement.name);
51
71
  (0, utils_1.createAzureTfOutput)(`${id}-apiManagementFriendlyUniqueId`, scope, apiManagement.friendlyUniqueId);
52
72
  (0, utils_1.createAzureTfOutput)(`${id}-apiManagementId`, scope, apiManagement.id);
53
73
  return apiManagement;
54
74
  }
75
+ /**
76
+ * @summary Method to resolve an api management
77
+ * @param id scoped id of the resource
78
+ * @param scope scope in which this resource is defined
79
+ * @param props api management properties
80
+ * @see [CDKTF Api management Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/apiManagement.typescript.md}
81
+ */
82
+ resolveApiManagement(id, scope, props) {
83
+ if (!props)
84
+ throw `Props undefined for ${id}`;
85
+ const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-am-rg`, {
86
+ name: scope.props.resourceGroupName
87
+ ? `${scope.props.resourceGroupName}-${scope.props.stage}`
88
+ : `${props.resourceGroupName}`,
89
+ });
90
+ if (!resourceGroup)
91
+ throw `Resource group undefined for ${id}`;
92
+ const apiManagement = new data_azurerm_api_management_1.DataAzurermApiManagement(scope, `${id}-am`, {
93
+ ...props,
94
+ name: `${props.name}-${scope.props.stage}`,
95
+ resourceGroupName: scope.props.resourceGroupName
96
+ ? `${scope.props.resourceGroupName}-${scope.props.stage}`
97
+ : `${props.resourceGroupName}`,
98
+ });
99
+ return apiManagement;
100
+ }
101
+ /**
102
+ * @summary Method to create a new api management backend
103
+ * @param id scoped id of the resource
104
+ * @param scope scope in which this resource is defined
105
+ * @param props api management backend properties
106
+ * @see [CDKTF Api management Backend Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/ApiManagementBackend.typescript.md}
107
+ */
108
+ createApiManagementBackend(id, scope, props) {
109
+ if (!props)
110
+ throw `Props undefined for ${id}`;
111
+ const apiManagementBackend = new api_management_backend_1.ApiManagementBackend(scope, `${id}-am-be`, {
112
+ ...props,
113
+ name: `${props.name}-${scope.props.stage}`,
114
+ description: props.description || `Backend for ${props.name}-${scope.props.stage}`,
115
+ protocol: props.protocol || 'http',
116
+ });
117
+ (0, utils_1.createAzureTfOutput)(`${id}-apiManagementBackendName`, scope, apiManagementBackend.name);
118
+ (0, utils_1.createAzureTfOutput)(`${id}-apiManagementBackendFriendlyUniqueId`, scope, apiManagementBackend.friendlyUniqueId);
119
+ (0, utils_1.createAzureTfOutput)(`${id}-apiManagementBackendId`, scope, apiManagementBackend.id);
120
+ return apiManagementBackend;
121
+ }
122
+ /**
123
+ * @summary Method to create a new api management api
124
+ * @param id scoped id of the resource
125
+ * @param scope scope in which this resource is defined
126
+ * @param props api management api properties
127
+ * @see [CDKTF Api management Api Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/ApiManagementApi.typescript.md}
128
+ */
129
+ createApiManagementApi(id, scope, props) {
130
+ if (!props)
131
+ throw `Props undefined for ${id}`;
132
+ const apiManagementApi = new api_management_api_1.ApiManagementApi(scope, `${id}-am-api`, {
133
+ ...props,
134
+ name: `${props.name}-${scope.props.stage}`,
135
+ displayName: props.displayName || props.name,
136
+ revision: props.revision || '1',
137
+ protocols: props.protocols || ['https'],
138
+ subscriptionRequired: props.subscriptionRequired || true,
139
+ });
140
+ lodash_1.default.forEach(props.operations, operation => {
141
+ const apimOperation = new api_management_api_operation_1.ApiManagementApiOperation(scope, `${id}-apim-api-operation-${operation.path}-${operation.method}`, {
142
+ operationId: `${operation.path}-${operation.method}`,
143
+ method: operation.method.toUpperCase(),
144
+ apiManagementName: apiManagementApi.apiManagementName,
145
+ resourceGroupName: apiManagementApi.resourceGroupName,
146
+ apiName: apiManagementApi.name,
147
+ displayName: `/${operation.path}`,
148
+ urlTemplate: `/${operation.path}`,
149
+ });
150
+ const apimOperationPolicy = new api_management_api_operation_policy_1.ApiManagementApiOperationPolicy(scope, `${id}-apim-api-operation-policy-${operation.path}-${operation.method}`, {
151
+ apiManagementName: apiManagementApi.apiManagementName,
152
+ resourceGroupName: apiManagementApi.resourceGroupName,
153
+ apiName: apiManagementApi.name,
154
+ operationId: apimOperation.operationId,
155
+ xmlContent: operation.xmlContent,
156
+ });
157
+ (0, utils_1.createAzureTfOutput)(`${id}-${operation.path}-${operation.method}-apimOperationOperationId`, scope, apimOperation.operationId);
158
+ (0, utils_1.createAzureTfOutput)(`${id}-${operation.path}-${operation.method}-apimOperationFriendlyUniqueId`, scope, apimOperation.friendlyUniqueId);
159
+ (0, utils_1.createAzureTfOutput)(`${id}-${operation.path}-${operation.method}-apimOperationId`, scope, apimOperation.id);
160
+ (0, utils_1.createAzureTfOutput)(`${id}-${operation.path}-${operation.method}-apimOperationPolicyFriendlyUniqueId`, scope, apimOperationPolicy.friendlyUniqueId);
161
+ (0, utils_1.createAzureTfOutput)(`${id}-${operation.path}-${operation.method}-apimOperationPolicyId`, scope, apimOperationPolicy.id);
162
+ });
163
+ (0, utils_1.createAzureTfOutput)(`${id}-apiManagementApiName`, scope, apiManagementApi.name);
164
+ (0, utils_1.createAzureTfOutput)(`${id}-apiManagementApiFriendlyUniqueId`, scope, apiManagementApi.friendlyUniqueId);
165
+ (0, utils_1.createAzureTfOutput)(`${id}-apiManagementApiId`, scope, apiManagementApi.id);
166
+ return apiManagementApi;
167
+ }
55
168
  }
56
169
  exports.AzureApiManagementManager = AzureApiManagementManager;
@@ -1,3 +1,17 @@
1
1
  import { ApiManagementConfig } from '@cdktf/provider-azurerm/lib/api-management';
2
+ import { ApiManagementBackendConfig } from '@cdktf/provider-azurerm/lib/api-management-backend';
3
+ import { ApiManagementApiConfig } from '@cdktf/provider-azurerm/lib/api-management-api';
4
+ import { ApiManagementApiOperationConfig } from '@cdktf/provider-azurerm/lib/api-management-api-operation';
5
+ import { ApiManagementApiOperationPolicyConfig } from '@cdktf/provider-azurerm/lib/api-management-api-operation-policy';
2
6
  export interface ApiManagementProps extends ApiManagementConfig {
3
7
  }
8
+ export interface ApiManagementBackendProps extends ApiManagementBackendConfig {
9
+ }
10
+ export interface ApiManagementApiProps extends ApiManagementApiConfig {
11
+ operations: OperationsProps[];
12
+ }
13
+ export interface OperationsProps {
14
+ path: ApiManagementApiOperationConfig['urlTemplate'];
15
+ method: ApiManagementApiOperationConfig['method'];
16
+ xmlContent?: ApiManagementApiOperationPolicyConfig['xmlContent'];
17
+ }
@@ -0,0 +1,2 @@
1
+ export * from './main';
2
+ export * from './types';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./main"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,30 @@
1
+ import { AppConfiguration } from '@cdktf/provider-azurerm/lib/app-configuration';
2
+ import { CommonAzureConstruct } from '../../common';
3
+ import { AppConfigurationProps } from './types';
4
+ /**
5
+ * @classdesc Provides operations on Azure App Configuration
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
+ * ```
10
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
11
+ *
12
+ * class CustomConstruct extends CommonAzureConstruct {
13
+ * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
14
+ * super(parent, id, 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
+ * @see [CDKTF App Configuration plan Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/appConfiguration.typescript.md}
28
+ */
29
+ createAppConfiguration(id: string, scope: CommonAzureConstruct, props: AppConfigurationProps): AppConfiguration;
30
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AzureAppConfigurationManager = void 0;
4
+ const data_azurerm_resource_group_1 = require("@cdktf/provider-azurerm/lib/data-azurerm-resource-group");
5
+ const app_configuration_1 = require("@cdktf/provider-azurerm/lib/app-configuration");
6
+ const utils_1 = require("../../utils");
7
+ /**
8
+ * @classdesc Provides operations on Azure App Configuration
9
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
10
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
11
+ * @example
12
+ * ```
13
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
14
+ *
15
+ * class CustomConstruct extends CommonAzureConstruct {
16
+ * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
17
+ * super(parent, id, props)
18
+ * this.props = props
19
+ * this.appConfigurationManager.createAppConfiguration('MyAppConfiguration', this, props)
20
+ * }
21
+ * }
22
+ * ```
23
+ */
24
+ class AzureAppConfigurationManager {
25
+ /**
26
+ * @summary Method to create a new app configuration
27
+ * @param id scoped id of the resource
28
+ * @param scope scope in which this resource is defined
29
+ * @param props app configuration properties
30
+ * @see [CDKTF App Configuration plan Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/appConfiguration.typescript.md}
31
+ */
32
+ createAppConfiguration(id, scope, props) {
33
+ if (!props)
34
+ throw `Props undefined for ${id}`;
35
+ const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-am-rg`, {
36
+ name: scope.props.resourceGroupName
37
+ ? `${scope.props.resourceGroupName}-${scope.props.stage}`
38
+ : `${props.resourceGroupName}`,
39
+ });
40
+ if (!resourceGroup)
41
+ throw `Resource group undefined for ${id}`;
42
+ const appConfiguration = new app_configuration_1.AppConfiguration(scope, `${id}-am`, {
43
+ ...props,
44
+ name: `${props.name}-${scope.props.stage}`,
45
+ resourceGroupName: resourceGroup.name,
46
+ tags: props.tags ?? {
47
+ environment: scope.props.stage,
48
+ },
49
+ });
50
+ (0, utils_1.createAzureTfOutput)(`${id}-appConfigurationName`, scope, appConfiguration.name);
51
+ (0, utils_1.createAzureTfOutput)(`${id}-appConfigurationFriendlyUniqueId`, scope, appConfiguration.friendlyUniqueId);
52
+ (0, utils_1.createAzureTfOutput)(`${id}-appConfigurationId`, scope, appConfiguration.id);
53
+ return appConfiguration;
54
+ }
55
+ }
56
+ exports.AzureAppConfigurationManager = AzureAppConfigurationManager;
@@ -0,0 +1,3 @@
1
+ import { AppConfigurationConfig } from '@cdktf/provider-azurerm/lib/app-configuration';
2
+ export interface AppConfigurationProps extends AppConfigurationConfig {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './main';
2
+ export * from './types';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./main"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,30 @@
1
+ import { ServicePlan } from '@cdktf/provider-azurerm/lib/service-plan';
2
+ import { CommonAzureConstruct } from '../../common';
3
+ import { ServicePlanProps } from './types';
4
+ /**
5
+ * @classdesc Provides operations on Azure App Service
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
+ * ```
10
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
11
+ *
12
+ * class CustomConstruct extends CommonAzureConstruct {
13
+ * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
14
+ * super(parent, id, props)
15
+ * this.props = props
16
+ * this.appServiceManager.createAppService('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
+ * @see [CDKTF App service plan Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/appServicePlan.typescript.md}
28
+ */
29
+ createAppServicePlan(id: string, scope: CommonAzureConstruct, props: ServicePlanProps): ServicePlan;
30
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AzureAppServiceManager = void 0;
4
+ const data_azurerm_resource_group_1 = require("@cdktf/provider-azurerm/lib/data-azurerm-resource-group");
5
+ const service_plan_1 = require("@cdktf/provider-azurerm/lib/service-plan");
6
+ const utils_1 = require("../../utils");
7
+ /**
8
+ * @classdesc Provides operations on Azure App Service
9
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
10
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
11
+ * @example
12
+ * ```
13
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
14
+ *
15
+ * class CustomConstruct extends CommonAzureConstruct {
16
+ * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
17
+ * super(parent, id, props)
18
+ * this.props = props
19
+ * this.appServiceManager.createAppService('MyAppService', this, props)
20
+ * }
21
+ * }
22
+ * ```
23
+ */
24
+ class AzureAppServiceManager {
25
+ /**
26
+ * @summary Method to create a new app service plan
27
+ * @param id scoped id of the resource
28
+ * @param scope scope in which this resource is defined
29
+ * @param props app service plan properties
30
+ * @see [CDKTF App service plan Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/appServicePlan.typescript.md}
31
+ */
32
+ createAppServicePlan(id, scope, props) {
33
+ if (!props)
34
+ throw `Props undefined for ${id}`;
35
+ const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-am-rg`, {
36
+ name: scope.props.resourceGroupName
37
+ ? `${scope.props.resourceGroupName}-${scope.props.stage}`
38
+ : `${props.resourceGroupName}`,
39
+ });
40
+ if (!resourceGroup)
41
+ throw `Resource group undefined for ${id}`;
42
+ const appServicePlan = new service_plan_1.ServicePlan(scope, `${id}-am`, {
43
+ ...props,
44
+ name: `${props.name}-${scope.props.stage}`,
45
+ resourceGroupName: resourceGroup.name,
46
+ tags: props.tags ?? {
47
+ environment: scope.props.stage,
48
+ },
49
+ });
50
+ (0, utils_1.createAzureTfOutput)(`${id}-appServicePlanName`, scope, appServicePlan.name);
51
+ (0, utils_1.createAzureTfOutput)(`${id}-appServicePlanFriendlyUniqueId`, scope, appServicePlan.friendlyUniqueId);
52
+ (0, utils_1.createAzureTfOutput)(`${id}-appServicePlanId`, scope, appServicePlan.id);
53
+ return appServicePlan;
54
+ }
55
+ }
56
+ exports.AzureAppServiceManager = AzureAppServiceManager;
@@ -0,0 +1,3 @@
1
+ import { ServicePlanConfig } from '@cdktf/provider-azurerm/lib/service-plan';
2
+ export interface ServicePlanProps extends ServicePlanConfig {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './main';
2
+ export * from './types';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./main"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,30 @@
1
+ import { ApplicationInsights } from '@cdktf/provider-azurerm/lib/application-insights';
2
+ import { CommonAzureConstruct } from '../../common';
3
+ import { ApplicationInsightsProps } from './types';
4
+ /**
5
+ * @classdesc Provides operations on Azure Application Insights
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
+ * ```
10
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
11
+ *
12
+ * class CustomConstruct extends CommonAzureConstruct {
13
+ * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
14
+ * super(parent, id, props)
15
+ * this.props = props
16
+ * this.applicationInsightseManager.createApplicationInsights('MyApplicationInsights', this, props)
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ export declare class AzureApplicationInsightsManager {
22
+ /**
23
+ * @summary Method to create a new application insights
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props application insights properties
27
+ * @see [CDKTF Application insights Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/applicationInsights.typescript.md}
28
+ */
29
+ createApplicationInsights(id: string, scope: CommonAzureConstruct, props: ApplicationInsightsProps): ApplicationInsights;
30
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AzureApplicationInsightsManager = void 0;
4
+ const data_azurerm_resource_group_1 = require("@cdktf/provider-azurerm/lib/data-azurerm-resource-group");
5
+ const application_insights_1 = require("@cdktf/provider-azurerm/lib/application-insights");
6
+ const utils_1 = require("../../utils");
7
+ /**
8
+ * @classdesc Provides operations on Azure Application Insights
9
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
10
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
11
+ * @example
12
+ * ```
13
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
14
+ *
15
+ * class CustomConstruct extends CommonAzureConstruct {
16
+ * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
17
+ * super(parent, id, props)
18
+ * this.props = props
19
+ * this.applicationInsightseManager.createApplicationInsights('MyApplicationInsights', this, props)
20
+ * }
21
+ * }
22
+ * ```
23
+ */
24
+ class AzureApplicationInsightsManager {
25
+ /**
26
+ * @summary Method to create a new application insights
27
+ * @param id scoped id of the resource
28
+ * @param scope scope in which this resource is defined
29
+ * @param props application insights properties
30
+ * @see [CDKTF Application insights Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/applicationInsights.typescript.md}
31
+ */
32
+ createApplicationInsights(id, scope, props) {
33
+ if (!props)
34
+ throw `Props undefined for ${id}`;
35
+ const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-am-rg`, {
36
+ name: scope.props.resourceGroupName
37
+ ? `${scope.props.resourceGroupName}-${scope.props.stage}`
38
+ : `${props.resourceGroupName}`,
39
+ });
40
+ if (!resourceGroup)
41
+ throw `Resource group undefined for ${id}`;
42
+ const applicationInsights = new application_insights_1.ApplicationInsights(scope, `${id}-am`, {
43
+ ...props,
44
+ name: `${props.name}-${scope.props.stage}`,
45
+ resourceGroupName: resourceGroup.name,
46
+ tags: props.tags ?? {
47
+ environment: scope.props.stage,
48
+ },
49
+ });
50
+ (0, utils_1.createAzureTfOutput)(`${id}-applicationInsightsName`, scope, applicationInsights.name);
51
+ (0, utils_1.createAzureTfOutput)(`${id}-applicationInsightsFriendlyUniqueId`, scope, applicationInsights.friendlyUniqueId);
52
+ (0, utils_1.createAzureTfOutput)(`${id}-applicationInsightsId`, scope, applicationInsights.id);
53
+ return applicationInsights;
54
+ }
55
+ }
56
+ exports.AzureApplicationInsightsManager = AzureApplicationInsightsManager;
@@ -0,0 +1,3 @@
1
+ import { ApplicationInsightsConfig } from '@cdktf/provider-azurerm/lib/application-insights';
2
+ export interface ApplicationInsightsProps extends ApplicationInsightsConfig {
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { FunctionApp } from '@cdktf/provider-azurerm/lib/function-app';
1
+ import { LinuxFunctionApp } from '@cdktf/provider-azurerm/lib/linux-function-app';
2
2
  import { FunctionAppFunction } from '@cdktf/provider-azurerm/lib/function-app-function';
3
3
  import { CommonAzureConstruct } from '../../common';
4
4
  import { FunctionAppProps, FunctionProps } from './types';
@@ -27,7 +27,7 @@ export declare class AzureFunctionManager {
27
27
  * @param props function app properties
28
28
  * @see [CDKTF Function App Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/functionApp.typescript.md}
29
29
  */
30
- createFunctionApp(id: string, scope: CommonAzureConstruct, props: FunctionAppProps): FunctionApp;
30
+ createFunctionApp(id: string, scope: CommonAzureConstruct, props: FunctionAppProps): LinuxFunctionApp;
31
31
  /**
32
32
  * @summary Method to create a new function
33
33
  * @param id scoped id of the resource