@gradientedge/cdk-utils 10.1.0 → 10.2.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/src/lib/azure/common/constants.d.ts +3 -2
- package/dist/src/lib/azure/common/constants.js +2 -1
- package/dist/src/lib/azure/common/construct.d.ts +26 -12
- package/dist/src/lib/azure/common/construct.js +31 -45
- package/dist/src/lib/azure/common/resource-name-formatter.d.ts +9 -4
- package/dist/src/lib/azure/common/resource-name-formatter.js +9 -5
- package/dist/src/lib/azure/common/stack.d.ts +18 -32
- package/dist/src/lib/azure/common/stack.js +77 -74
- package/dist/src/lib/azure/common/tagging.d.ts +29 -8
- package/dist/src/lib/azure/common/tagging.js +72 -26
- package/dist/src/lib/azure/common/types.d.ts +19 -4
- package/dist/src/lib/azure/services/api-management/main.d.ts +29 -32
- package/dist/src/lib/azure/services/api-management/main.js +100 -121
- package/dist/src/lib/azure/services/api-management/types.d.ts +33 -18
- package/dist/src/lib/azure/services/app-configuration/main.d.ts +6 -7
- package/dist/src/lib/azure/services/app-configuration/main.js +23 -26
- package/dist/src/lib/azure/services/app-configuration/types.d.ts +2 -2
- package/dist/src/lib/azure/services/app-service/main.d.ts +10 -12
- package/dist/src/lib/azure/services/app-service/main.js +37 -49
- package/dist/src/lib/azure/services/app-service/types.d.ts +4 -4
- package/dist/src/lib/azure/services/application-insights/main.d.ts +7 -8
- package/dist/src/lib/azure/services/application-insights/main.js +20 -26
- package/dist/src/lib/azure/services/application-insights/types.d.ts +2 -4
- package/dist/src/lib/azure/services/cosmosdb/main.d.ts +12 -15
- package/dist/src/lib/azure/services/cosmosdb/main.js +42 -61
- package/dist/src/lib/azure/services/cosmosdb/types.d.ts +4 -6
- package/dist/src/lib/azure/services/dns/main.d.ts +13 -17
- package/dist/src/lib/azure/services/dns/main.js +33 -51
- package/dist/src/lib/azure/services/dns/types.d.ts +5 -8
- package/dist/src/lib/azure/services/eventgrid/main.d.ts +20 -22
- package/dist/src/lib/azure/services/eventgrid/main.js +61 -89
- package/dist/src/lib/azure/services/eventgrid/types.d.ts +7 -8
- package/dist/src/lib/azure/services/function/main.d.ts +15 -15
- package/dist/src/lib/azure/services/function/main.js +54 -59
- package/dist/src/lib/azure/services/function/types.d.ts +18 -6
- package/dist/src/lib/azure/services/index.d.ts +1 -1
- package/dist/src/lib/azure/services/index.js +1 -1
- package/dist/src/lib/azure/services/key-vault/main.d.ts +6 -7
- package/dist/src/lib/azure/services/key-vault/main.js +29 -28
- package/dist/src/lib/azure/services/key-vault/types.d.ts +3 -2
- package/dist/src/lib/azure/services/monitor/main.d.ts +7 -8
- package/dist/src/lib/azure/services/monitor/main.js +10 -15
- package/dist/src/lib/azure/services/monitor/types.d.ts +2 -2
- package/dist/src/lib/azure/services/operational-insights/main.d.ts +29 -0
- package/dist/src/lib/azure/services/operational-insights/main.js +50 -0
- package/dist/src/lib/azure/services/operational-insights/types.d.ts +3 -0
- package/dist/src/lib/azure/services/redis/main.d.ts +8 -9
- package/dist/src/lib/azure/services/redis/main.js +24 -26
- package/dist/src/lib/azure/services/redis/types.d.ts +2 -2
- package/dist/src/lib/azure/services/resource-group/main.d.ts +6 -7
- package/dist/src/lib/azure/services/resource-group/main.js +9 -14
- package/dist/src/lib/azure/services/resource-group/types.d.ts +2 -2
- package/dist/src/lib/azure/services/servicebus/main.d.ts +17 -22
- package/dist/src/lib/azure/services/servicebus/main.js +47 -70
- package/dist/src/lib/azure/services/servicebus/types.d.ts +6 -10
- package/dist/src/lib/azure/services/storage/main.d.ts +24 -27
- package/dist/src/lib/azure/services/storage/main.js +70 -88
- package/dist/src/lib/azure/services/storage/types.d.ts +10 -8
- package/dist/src/lib/azure/types/index.d.ts +2 -1
- package/dist/src/lib/azure/utils/index.d.ts +19 -3
- package/dist/src/lib/azure/utils/index.js +19 -13
- package/dist/src/lib/cloudflare/common/stack.js +1 -1
- package/package.json +2 -1
- package/src/lib/azure/common/constants.ts +2 -1
- package/src/lib/azure/common/construct.ts +32 -48
- package/src/lib/azure/common/resource-name-formatter.ts +10 -6
- package/src/lib/azure/common/stack.ts +78 -78
- package/src/lib/azure/common/tagging.ts +78 -29
- package/src/lib/azure/common/types.ts +21 -4
- package/src/lib/azure/services/api-management/main.ts +172 -169
- package/src/lib/azure/services/api-management/types.ts +39 -16
- package/src/lib/azure/services/app-configuration/main.ts +33 -31
- package/src/lib/azure/services/app-configuration/types.ts +2 -2
- package/src/lib/azure/services/app-service/main.ts +61 -62
- package/src/lib/azure/services/app-service/types.ts +4 -4
- package/src/lib/azure/services/application-insights/main.ts +29 -30
- package/src/lib/azure/services/application-insights/types.ts +2 -5
- package/src/lib/azure/services/cosmosdb/main.ts +78 -77
- package/src/lib/azure/services/cosmosdb/types.ts +10 -6
- package/src/lib/azure/services/dns/main.ts +65 -72
- package/src/lib/azure/services/dns/types.ts +9 -9
- package/src/lib/azure/services/eventgrid/main.ts +120 -122
- package/src/lib/azure/services/eventgrid/types.ts +13 -8
- package/src/lib/azure/services/function/main.ts +75 -72
- package/src/lib/azure/services/function/types.ts +21 -6
- package/src/lib/azure/services/index.ts +1 -1
- package/src/lib/azure/services/key-vault/main.ts +38 -32
- package/src/lib/azure/services/key-vault/types.ts +4 -2
- package/src/lib/azure/services/monitor/main.ts +17 -21
- package/src/lib/azure/services/monitor/types.ts +2 -2
- package/src/lib/azure/services/operational-insights/main.ts +61 -0
- package/src/lib/azure/services/operational-insights/types.ts +3 -0
- package/src/lib/azure/services/redis/main.ts +30 -30
- package/src/lib/azure/services/redis/types.ts +2 -2
- package/src/lib/azure/services/resource-group/main.ts +20 -20
- package/src/lib/azure/services/resource-group/types.ts +2 -2
- package/src/lib/azure/services/servicebus/main.ts +103 -94
- package/src/lib/azure/services/servicebus/types.ts +17 -11
- package/src/lib/azure/services/storage/main.ts +113 -114
- package/src/lib/azure/services/storage/types.ts +16 -8
- package/src/lib/azure/types/index.ts +2 -1
- package/src/lib/azure/utils/index.ts +20 -22
- package/src/lib/cloudflare/common/stack.ts +1 -1
- package/dist/src/lib/azure/services/log-analytics-workspace/main.d.ts +0 -30
- package/dist/src/lib/azure/services/log-analytics-workspace/main.js +0 -55
- package/dist/src/lib/azure/services/log-analytics-workspace/types.d.ts +0 -3
- package/src/lib/azure/services/log-analytics-workspace/main.ts +0 -61
- package/src/lib/azure/services/log-analytics-workspace/types.ts +0 -3
- /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.d.ts +0 -0
- /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.js +0 -0
- /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/types.js +0 -0
- /package/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.ts +0 -0
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { AppConfiguration } from '@cdktf/provider-azurerm/lib/app-configuration/index.js';
|
|
2
1
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
3
2
|
import { AppConfigurationProps } from './types.js';
|
|
4
3
|
/**
|
|
5
|
-
* @classdesc Provides operations on Azure App Configuration
|
|
4
|
+
* @classdesc Provides operations on Azure App Configuration using Pulumi
|
|
6
5
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
7
6
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
8
7
|
* @example
|
|
9
|
-
* ```
|
|
8
|
+
* ```typescript
|
|
10
9
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
11
10
|
*
|
|
12
11
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
13
|
-
* constructor(
|
|
14
|
-
* super(
|
|
12
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
13
|
+
* super(name, props)
|
|
15
14
|
* this.props = props
|
|
16
15
|
* this.appConfigurationManager.createAppConfiguration('MyAppConfiguration', this, props)
|
|
17
16
|
* }
|
|
@@ -24,7 +23,7 @@ export declare class AzureAppConfigurationManager {
|
|
|
24
23
|
* @param id scoped id of the resource
|
|
25
24
|
* @param scope scope in which this resource is defined
|
|
26
25
|
* @param props app configuration properties
|
|
27
|
-
* @see [
|
|
26
|
+
* @see [Pulumi Azure Native App Configuration]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/appconfiguration/configurationstore/}
|
|
28
27
|
*/
|
|
29
|
-
|
|
28
|
+
createConfigurationStore(id: string, scope: CommonAzureConstruct, props: AppConfigurationProps): import("@pulumi/azure-native/appconfiguration/configurationStore.js").ConfigurationStore;
|
|
30
29
|
}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js';
|
|
3
|
-
import { createAzureTfOutput } from '../../utils/index.js';
|
|
1
|
+
import { ConfigurationStore, IdentityType } from '@pulumi/azure-native/appconfiguration/index.js';
|
|
4
2
|
/**
|
|
5
|
-
* @classdesc Provides operations on Azure App Configuration
|
|
3
|
+
* @classdesc Provides operations on Azure App Configuration using Pulumi
|
|
6
4
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
7
5
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
8
6
|
* @example
|
|
9
|
-
* ```
|
|
7
|
+
* ```typescript
|
|
10
8
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
11
9
|
*
|
|
12
10
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
13
|
-
* constructor(
|
|
14
|
-
* super(
|
|
11
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
12
|
+
* super(name, props)
|
|
15
13
|
* this.props = props
|
|
16
14
|
* this.appConfigurationManager.createAppConfiguration('MyAppConfiguration', this, props)
|
|
17
15
|
* }
|
|
@@ -24,32 +22,31 @@ export class AzureAppConfigurationManager {
|
|
|
24
22
|
* @param id scoped id of the resource
|
|
25
23
|
* @param scope scope in which this resource is defined
|
|
26
24
|
* @param props app configuration properties
|
|
27
|
-
* @see [
|
|
25
|
+
* @see [Pulumi Azure Native App Configuration]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/appconfiguration/configurationstore/}
|
|
28
26
|
*/
|
|
29
|
-
|
|
27
|
+
createConfigurationStore(id, scope, props) {
|
|
30
28
|
if (!props)
|
|
31
29
|
throw `Props undefined for ${id}`;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const appConfiguration = new AppConfiguration(scope, `${id}-ac`, {
|
|
30
|
+
// Get resource group name
|
|
31
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
32
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
33
|
+
: props.resourceGroupName;
|
|
34
|
+
if (!resourceGroupName)
|
|
35
|
+
throw `Resource group name undefined for ${id}`;
|
|
36
|
+
return new ConfigurationStore(`${id}-ac`, {
|
|
40
37
|
...props,
|
|
41
|
-
|
|
42
|
-
resourceGroupName:
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
configStoreName: scope.resourceNameFormatter.format(props.configStoreName?.toString(), scope.props.resourceNameOptions?.appConfiguration),
|
|
39
|
+
resourceGroupName: resourceGroupName,
|
|
40
|
+
location: props.location ?? scope.props.location,
|
|
41
|
+
identity: props.identity ?? {
|
|
42
|
+
type: IdentityType.SystemAssigned,
|
|
43
|
+
},
|
|
44
|
+
sku: props.sku ?? {
|
|
45
|
+
name: 'standard',
|
|
45
46
|
},
|
|
46
47
|
tags: props.tags ?? {
|
|
47
48
|
environment: scope.props.stage,
|
|
48
49
|
},
|
|
49
|
-
});
|
|
50
|
-
createAzureTfOutput(`${id}-appConfigurationName`, scope, appConfiguration.name);
|
|
51
|
-
createAzureTfOutput(`${id}-appConfigurationFriendlyUniqueId`, scope, appConfiguration.friendlyUniqueId);
|
|
52
|
-
createAzureTfOutput(`${id}-appConfigurationId`, scope, appConfiguration.id);
|
|
53
|
-
return appConfiguration;
|
|
50
|
+
}, { parent: scope });
|
|
54
51
|
}
|
|
55
52
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface AppConfigurationProps extends
|
|
1
|
+
import { ConfigurationStoreArgs } from '@pulumi/azure-native/appconfiguration/index.js';
|
|
2
|
+
export interface AppConfigurationProps extends ConfigurationStoreArgs {
|
|
3
3
|
}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { LinuxWebApp } from '@cdktf/provider-azurerm/lib/linux-web-app/index.js';
|
|
2
|
-
import { ServicePlan } from '@cdktf/provider-azurerm/lib/service-plan/index.js';
|
|
3
1
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
4
2
|
import { LinuxWebAppProps, ServicePlanProps } from './types.js';
|
|
5
3
|
/**
|
|
6
|
-
* @classdesc Provides operations on Azure App Service
|
|
4
|
+
* @classdesc Provides operations on Azure App Service using Pulumi
|
|
7
5
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
8
6
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
9
7
|
* @example
|
|
10
|
-
* ```
|
|
8
|
+
* ```typescript
|
|
11
9
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
12
10
|
*
|
|
13
11
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
14
|
-
* constructor(
|
|
15
|
-
* super(
|
|
12
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
13
|
+
* super(name, props)
|
|
16
14
|
* this.props = props
|
|
17
|
-
* this.appServiceManager.
|
|
15
|
+
* this.appServiceManager.createAppServicePlan('MyAppService', this, props)
|
|
18
16
|
* }
|
|
19
17
|
* }
|
|
20
18
|
* ```
|
|
@@ -25,15 +23,15 @@ export declare class AzureAppServiceManager {
|
|
|
25
23
|
* @param id scoped id of the resource
|
|
26
24
|
* @param scope scope in which this resource is defined
|
|
27
25
|
* @param props app service plan properties
|
|
28
|
-
* @see [
|
|
26
|
+
* @see [Pulumi Azure Native App Service Plan]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/appserviceplan/}
|
|
29
27
|
*/
|
|
30
|
-
createAppServicePlan(id: string, scope: CommonAzureConstruct, props: ServicePlanProps):
|
|
28
|
+
createAppServicePlan(id: string, scope: CommonAzureConstruct, props: ServicePlanProps): import("@pulumi/azure-native/web/appServicePlan.js").AppServicePlan;
|
|
31
29
|
/**
|
|
32
|
-
* @summary Method to create a new web app
|
|
30
|
+
* @summary Method to create a new Linux web app
|
|
33
31
|
* @param id scoped id of the resource
|
|
34
32
|
* @param scope scope in which this resource is defined
|
|
35
33
|
* @param props web app properties
|
|
36
|
-
* @see [
|
|
34
|
+
* @see [Pulumi Azure Native Web App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
|
|
37
35
|
*/
|
|
38
|
-
createLinuxWebApp(id: string, scope: CommonAzureConstruct, props: LinuxWebAppProps):
|
|
36
|
+
createLinuxWebApp(id: string, scope: CommonAzureConstruct, props: LinuxWebAppProps): import("@pulumi/azure-native/web/webApp.js").WebApp;
|
|
39
37
|
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LinuxWebApp } from '@cdktf/provider-azurerm/lib/linux-web-app/index.js';
|
|
3
|
-
import { ServicePlan } from '@cdktf/provider-azurerm/lib/service-plan/index.js';
|
|
4
|
-
import { createAzureTfOutput } from '../../utils/index.js';
|
|
1
|
+
import { AppServicePlan, ManagedServiceIdentityType, SupportedTlsVersions, WebApp, } from '@pulumi/azure-native/web/index.js';
|
|
5
2
|
/**
|
|
6
|
-
* @classdesc Provides operations on Azure App Service
|
|
3
|
+
* @classdesc Provides operations on Azure App Service using Pulumi
|
|
7
4
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
8
5
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
9
6
|
* @example
|
|
10
|
-
* ```
|
|
7
|
+
* ```typescript
|
|
11
8
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
12
9
|
*
|
|
13
10
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
14
|
-
* constructor(
|
|
15
|
-
* super(
|
|
11
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
12
|
+
* super(name, props)
|
|
16
13
|
* this.props = props
|
|
17
|
-
* this.appServiceManager.
|
|
14
|
+
* this.appServiceManager.createAppServicePlan('MyAppService', this, props)
|
|
18
15
|
* }
|
|
19
16
|
* }
|
|
20
17
|
* ```
|
|
@@ -25,70 +22,61 @@ export class AzureAppServiceManager {
|
|
|
25
22
|
* @param id scoped id of the resource
|
|
26
23
|
* @param scope scope in which this resource is defined
|
|
27
24
|
* @param props app service plan properties
|
|
28
|
-
* @see [
|
|
25
|
+
* @see [Pulumi Azure Native App Service Plan]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/appserviceplan/}
|
|
29
26
|
*/
|
|
30
27
|
createAppServicePlan(id, scope, props) {
|
|
31
28
|
if (!props)
|
|
32
29
|
throw `Props undefined for ${id}`;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const appServicePlan = new ServicePlan(scope, `${id}-as`, {
|
|
30
|
+
// Get resource group name
|
|
31
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
32
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
33
|
+
: props.resourceGroupName;
|
|
34
|
+
if (!resourceGroupName)
|
|
35
|
+
throw `Resource group name undefined for ${id}`;
|
|
36
|
+
return new AppServicePlan(`${id}-as`, {
|
|
41
37
|
...props,
|
|
42
|
-
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.appServicePlan),
|
|
43
|
-
resourceGroupName:
|
|
38
|
+
name: scope.resourceNameFormatter.format(props.name?.toString(), scope.props.resourceNameOptions?.appServicePlan),
|
|
39
|
+
resourceGroupName: resourceGroupName,
|
|
40
|
+
location: props.location ?? scope.props.location,
|
|
44
41
|
tags: props.tags ?? {
|
|
45
42
|
environment: scope.props.stage,
|
|
46
43
|
},
|
|
47
|
-
});
|
|
48
|
-
createAzureTfOutput(`${id}-appServicePlanName`, scope, appServicePlan.name);
|
|
49
|
-
createAzureTfOutput(`${id}-appServicePlanFriendlyUniqueId`, scope, appServicePlan.friendlyUniqueId);
|
|
50
|
-
createAzureTfOutput(`${id}-appServicePlanId`, scope, appServicePlan.id);
|
|
51
|
-
return appServicePlan;
|
|
44
|
+
}, { parent: scope });
|
|
52
45
|
}
|
|
53
46
|
/**
|
|
54
|
-
* @summary Method to create a new web app
|
|
47
|
+
* @summary Method to create a new Linux web app
|
|
55
48
|
* @param id scoped id of the resource
|
|
56
49
|
* @param scope scope in which this resource is defined
|
|
57
50
|
* @param props web app properties
|
|
58
|
-
* @see [
|
|
51
|
+
* @see [Pulumi Azure Native Web App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
|
|
59
52
|
*/
|
|
60
53
|
createLinuxWebApp(id, scope, props) {
|
|
61
54
|
if (!props)
|
|
62
55
|
throw `Props undefined for ${id}`;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const linuxWebApp = new LinuxWebApp(scope, `${id}-lwa`, {
|
|
56
|
+
// Get resource group name
|
|
57
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
58
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
59
|
+
: props.resourceGroupName;
|
|
60
|
+
if (!resourceGroupName)
|
|
61
|
+
throw `Resource group name undefined for ${id}`;
|
|
62
|
+
return new WebApp(`${id}-lwa`, {
|
|
71
63
|
...props,
|
|
72
|
-
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.linuxWebApp),
|
|
73
|
-
resourceGroupName:
|
|
64
|
+
name: scope.resourceNameFormatter.format(props.name?.toString(), scope.props.resourceNameOptions?.linuxWebApp),
|
|
65
|
+
resourceGroupName: resourceGroupName,
|
|
66
|
+
location: props.location ?? scope.props.location,
|
|
74
67
|
httpsOnly: props.httpsOnly ?? true,
|
|
68
|
+
kind: props.kind ?? 'app,linux',
|
|
75
69
|
identity: props.identity ?? {
|
|
76
|
-
type:
|
|
70
|
+
type: ManagedServiceIdentityType.SystemAssigned,
|
|
77
71
|
},
|
|
78
|
-
siteConfig: {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
minimumTlsVersion: props.siteConfig.minimumTlsVersion ?? '1.3',
|
|
72
|
+
siteConfig: props.siteConfig ?? {
|
|
73
|
+
alwaysOn: true,
|
|
74
|
+
linuxFxVersion: 'NODE|22-lts',
|
|
75
|
+
minTlsVersion: SupportedTlsVersions.SupportedTlsVersions_1_3,
|
|
83
76
|
},
|
|
84
77
|
tags: props.tags ?? {
|
|
85
78
|
environment: scope.props.stage,
|
|
86
79
|
},
|
|
87
|
-
});
|
|
88
|
-
createAzureTfOutput(`${id}-linuxWebAppName`, scope, linuxWebApp.name);
|
|
89
|
-
createAzureTfOutput(`${id}-linuxWebAppFriendlyUniqueId`, scope, linuxWebApp.friendlyUniqueId);
|
|
90
|
-
createAzureTfOutput(`${id}-linuxWebAppId`, scope, linuxWebApp.id);
|
|
91
|
-
createAzureTfOutput(`${id}-linuxWebAppDefaultHostname`, scope, linuxWebApp.defaultHostname);
|
|
92
|
-
return linuxWebApp;
|
|
80
|
+
}, { parent: scope });
|
|
93
81
|
}
|
|
94
82
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export interface ServicePlanProps extends
|
|
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
4
|
}
|
|
5
|
-
export interface LinuxWebAppProps extends
|
|
5
|
+
export interface LinuxWebAppProps extends WebAppArgs {
|
|
6
6
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { ApplicationInsights } from '@cdktf/provider-azurerm/lib/application-insights/index.js';
|
|
2
1
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
3
2
|
import { ApplicationInsightsProps } from './types.js';
|
|
4
3
|
/**
|
|
5
|
-
* @classdesc Provides operations on Azure Application Insights
|
|
4
|
+
* @classdesc Provides operations on Azure Application Insights using Pulumi
|
|
6
5
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
7
6
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
8
7
|
* @example
|
|
9
|
-
* ```
|
|
8
|
+
* ```typescript
|
|
10
9
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
11
10
|
*
|
|
12
11
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
13
|
-
* constructor(
|
|
14
|
-
* super(
|
|
12
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
13
|
+
* super(name, props)
|
|
15
14
|
* this.props = props
|
|
16
|
-
* this.
|
|
15
|
+
* this.applicationInsightsManager.createApplicationInsights('MyApplicationInsights', this, props)
|
|
17
16
|
* }
|
|
18
17
|
* }
|
|
19
18
|
* ```
|
|
@@ -24,7 +23,7 @@ export declare class AzureApplicationInsightsManager {
|
|
|
24
23
|
* @param id scoped id of the resource
|
|
25
24
|
* @param scope scope in which this resource is defined
|
|
26
25
|
* @param props application insights properties
|
|
27
|
-
* @see [
|
|
26
|
+
* @see [Pulumi Azure Native Application Insights Component]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/component/}
|
|
28
27
|
*/
|
|
29
|
-
|
|
28
|
+
createComponent(id: string, scope: CommonAzureConstruct, props: ApplicationInsightsProps): import("@pulumi/azure-native/applicationinsights/component.js").Component;
|
|
30
29
|
}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js';
|
|
3
|
-
import { createAzureTfOutput } from '../../utils/index.js';
|
|
1
|
+
import { ApplicationType, Component } from '@pulumi/azure-native/applicationinsights/index.js';
|
|
4
2
|
/**
|
|
5
|
-
* @classdesc Provides operations on Azure Application Insights
|
|
3
|
+
* @classdesc Provides operations on Azure Application Insights using Pulumi
|
|
6
4
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
7
5
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
8
6
|
* @example
|
|
9
|
-
* ```
|
|
7
|
+
* ```typescript
|
|
10
8
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
11
9
|
*
|
|
12
10
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
13
|
-
* constructor(
|
|
14
|
-
* super(
|
|
11
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
12
|
+
* super(name, props)
|
|
15
13
|
* this.props = props
|
|
16
|
-
* this.
|
|
14
|
+
* this.applicationInsightsManager.createApplicationInsights('MyApplicationInsights', this, props)
|
|
17
15
|
* }
|
|
18
16
|
* }
|
|
19
17
|
* ```
|
|
@@ -24,30 +22,26 @@ export class AzureApplicationInsightsManager {
|
|
|
24
22
|
* @param id scoped id of the resource
|
|
25
23
|
* @param scope scope in which this resource is defined
|
|
26
24
|
* @param props application insights properties
|
|
27
|
-
* @see [
|
|
25
|
+
* @see [Pulumi Azure Native Application Insights Component]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/component/}
|
|
28
26
|
*/
|
|
29
|
-
|
|
27
|
+
createComponent(id, scope, props) {
|
|
30
28
|
if (!props)
|
|
31
29
|
throw `Props undefined for ${id}`;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const applicationInsights = new ApplicationInsights(scope, `${id}-ai`, {
|
|
30
|
+
// Get resource group name
|
|
31
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
32
|
+
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
33
|
+
: props.resourceGroupName;
|
|
34
|
+
if (!resourceGroupName)
|
|
35
|
+
throw `Resource group name undefined for ${id}`;
|
|
36
|
+
return new Component(`${id}-ai`, {
|
|
40
37
|
...props,
|
|
41
|
-
|
|
42
|
-
resourceGroupName:
|
|
43
|
-
applicationType: props.applicationType ??
|
|
38
|
+
resourceName: scope.resourceNameFormatter.format(props.resourceName?.toString(), scope.props.resourceNameOptions?.applicationInsights),
|
|
39
|
+
resourceGroupName: resourceGroupName,
|
|
40
|
+
applicationType: props.applicationType ?? ApplicationType.Web,
|
|
41
|
+
kind: props.kind ?? 'web',
|
|
44
42
|
tags: props.tags ?? {
|
|
45
43
|
environment: scope.props.stage,
|
|
46
44
|
},
|
|
47
|
-
});
|
|
48
|
-
createAzureTfOutput(`${id}-applicationInsightsName`, scope, applicationInsights.name);
|
|
49
|
-
createAzureTfOutput(`${id}-applicationInsightsFriendlyUniqueId`, scope, applicationInsights.friendlyUniqueId);
|
|
50
|
-
createAzureTfOutput(`${id}-applicationInsightsId`, scope, applicationInsights.id);
|
|
51
|
-
return applicationInsights;
|
|
45
|
+
}, { parent: scope });
|
|
52
46
|
}
|
|
53
47
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ApplicationInsightsProps extends
|
|
3
|
-
name?: string | undefined;
|
|
4
|
-
applicationType?: string | undefined;
|
|
1
|
+
import { ComponentArgs } from '@pulumi/azure-native/applicationinsights/index.js';
|
|
2
|
+
export interface ApplicationInsightsProps extends ComponentArgs {
|
|
5
3
|
}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import { CosmosdbAccount } from '@cdktf/provider-azurerm/lib/cosmosdb-account/index.js';
|
|
2
|
-
import { CosmosdbSqlContainer } from '@cdktf/provider-azurerm/lib/cosmosdb-sql-container/index.js';
|
|
3
|
-
import { CosmosdbSqlDatabase } from '@cdktf/provider-azurerm/lib/cosmosdb-sql-database/index.js';
|
|
4
1
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
5
2
|
import { CosmosdbAccountProps, CosmosdbSqlContainerProps, CosmosdbSqlDatabaseProps } from './types.js';
|
|
6
3
|
/**
|
|
7
|
-
* @classdesc Provides operations on Azure CosmosDB
|
|
4
|
+
* @classdesc Provides operations on Azure CosmosDB using Pulumi
|
|
8
5
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
9
6
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
10
7
|
* @example
|
|
11
|
-
* ```
|
|
8
|
+
* ```typescript
|
|
12
9
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
13
10
|
*
|
|
14
11
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
15
|
-
* constructor(
|
|
16
|
-
* super(
|
|
12
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
13
|
+
* super(name, props)
|
|
17
14
|
* this.props = props
|
|
18
|
-
* this.CosmosDbManager.
|
|
15
|
+
* this.CosmosDbManager.createCosmosDbAccount('MyCosmosDb', this, props)
|
|
19
16
|
* }
|
|
20
17
|
* }
|
|
21
18
|
* ```
|
|
@@ -26,23 +23,23 @@ export declare class AzureCosmosDbManager {
|
|
|
26
23
|
* @param id scoped id of the resource
|
|
27
24
|
* @param scope scope in which this resource is defined
|
|
28
25
|
* @param props cosmosdb account properties
|
|
29
|
-
* @see [
|
|
26
|
+
* @see [Pulumi Azure Native CosmosDB Account]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/databaseaccount/}
|
|
30
27
|
*/
|
|
31
|
-
createCosmosDbAccount(id: string, scope: CommonAzureConstruct, props: CosmosdbAccountProps):
|
|
28
|
+
createCosmosDbAccount(id: string, scope: CommonAzureConstruct, props: CosmosdbAccountProps): import("@pulumi/azure-native/cosmosdb/databaseAccount.js").DatabaseAccount;
|
|
32
29
|
/**
|
|
33
30
|
* @summary Method to create a new cosmosdb database
|
|
34
31
|
* @param id scoped id of the resource
|
|
35
32
|
* @param scope scope in which this resource is defined
|
|
36
|
-
* @param props cosmosdb
|
|
37
|
-
* @see [
|
|
33
|
+
* @param props cosmosdb database properties
|
|
34
|
+
* @see [Pulumi Azure Native CosmosDB SQL Database]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/sqlresourcesqldatabase/}
|
|
38
35
|
*/
|
|
39
|
-
createCosmosDbDatabase(id: string, scope: CommonAzureConstruct, props: CosmosdbSqlDatabaseProps):
|
|
36
|
+
createCosmosDbDatabase(id: string, scope: CommonAzureConstruct, props: CosmosdbSqlDatabaseProps): import("@pulumi/azure-native/cosmosdb/sqlResourceSqlDatabase.js").SqlResourceSqlDatabase;
|
|
40
37
|
/**
|
|
41
38
|
* @summary Method to create a new cosmosdb container
|
|
42
39
|
* @param id scoped id of the resource
|
|
43
40
|
* @param scope scope in which this resource is defined
|
|
44
41
|
* @param props cosmosdb container properties
|
|
45
|
-
* @see [
|
|
42
|
+
* @see [Pulumi Azure Native CosmosDB SQL Container]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/sqlresourcesqlcontainer/}
|
|
46
43
|
*/
|
|
47
|
-
createCosmosDbContainer(id: string, scope: CommonAzureConstruct, props: CosmosdbSqlContainerProps):
|
|
44
|
+
createCosmosDbContainer(id: string, scope: CommonAzureConstruct, props: CosmosdbSqlContainerProps): import("@pulumi/azure-native/cosmosdb/sqlResourceSqlContainer.js").SqlResourceSqlContainer;
|
|
48
45
|
}
|