@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,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { KeyVault } from '@cdktf/provider-azurerm/lib/key-vault/index.js';
|
|
3
|
-
import { createAzureTfOutput } from '../../utils/index.js';
|
|
1
|
+
import { SkuFamily, SkuName, Vault } from '@pulumi/azure-native/keyvault/index.js';
|
|
4
2
|
/**
|
|
5
|
-
* @classdesc Provides operations on Azure Key Vault
|
|
3
|
+
* @classdesc Provides operations on Azure Key Vault 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.keyVaultManager.createKeyVault('MyKeyVault', this, props)
|
|
17
15
|
* }
|
|
@@ -24,34 +22,37 @@ export class AzureKeyVaultManager {
|
|
|
24
22
|
* @param id scoped id of the resource
|
|
25
23
|
* @param scope scope in which this resource is defined
|
|
26
24
|
* @param props key vault properties
|
|
27
|
-
* @see [
|
|
25
|
+
* @see [Pulumi Azure Native Key Vault]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/keyvault/vault/}
|
|
28
26
|
*/
|
|
29
27
|
createKeyVault(id, scope, props) {
|
|
30
28
|
if (!props)
|
|
31
29
|
throw `Props undefined for ${id}`;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const keyVault = new KeyVault(scope, `${id}-kv`, {
|
|
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 Vault(`${id}-kv`, {
|
|
40
37
|
...props,
|
|
41
|
-
|
|
42
|
-
location:
|
|
43
|
-
resourceGroupName:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
vaultName: scope.resourceNameFormatter.format(props.vaultName?.toString(), scope.props.resourceNameOptions?.keyVault),
|
|
39
|
+
location: props.location ?? scope.props.location,
|
|
40
|
+
resourceGroupName: resourceGroupName,
|
|
41
|
+
properties: {
|
|
42
|
+
...props.properties,
|
|
43
|
+
sku: props.properties?.sku ?? {
|
|
44
|
+
family: SkuFamily.A,
|
|
45
|
+
name: SkuName.Standard,
|
|
46
|
+
},
|
|
47
|
+
tenantId: props.properties?.tenantId ?? scope.props.tenantId ?? '',
|
|
48
|
+
enableRbacAuthorization: props.properties?.enableRbacAuthorization ?? true,
|
|
49
|
+
enableSoftDelete: props.properties?.enableSoftDelete ?? true,
|
|
50
|
+
softDeleteRetentionInDays: props.properties?.softDeleteRetentionInDays ?? 90,
|
|
51
|
+
enablePurgeProtection: props.properties?.enablePurgeProtection ?? true,
|
|
52
|
+
},
|
|
48
53
|
tags: props.tags ?? {
|
|
49
54
|
environment: scope.props.stage,
|
|
50
55
|
},
|
|
51
|
-
});
|
|
52
|
-
createAzureTfOutput(`${id}-keyVaultName`, scope, keyVault.name);
|
|
53
|
-
createAzureTfOutput(`${id}-keyVaultFriendlyUniqueId`, scope, keyVault.friendlyUniqueId);
|
|
54
|
-
createAzureTfOutput(`${id}-keyVaultId`, scope, keyVault.id);
|
|
55
|
-
return keyVault;
|
|
56
|
+
}, { parent: scope });
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface KeyVaultProps extends
|
|
1
|
+
import { VaultArgs } from '@pulumi/azure-native/keyvault/index.js';
|
|
2
|
+
export interface KeyVaultProps extends VaultArgs {
|
|
3
|
+
name?: string;
|
|
3
4
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { MonitorDiagnosticSetting } from '@cdktf/provider-azurerm/lib/monitor-diagnostic-setting/index.js';
|
|
2
1
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
3
2
|
import { MonitorDiagnosticSettingProps } from './types.js';
|
|
4
3
|
/**
|
|
5
|
-
* @classdesc Provides operations on Azure
|
|
4
|
+
* @classdesc Provides operations on Azure Monitor 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.monitorManager.
|
|
15
|
+
* this.monitorManager.createMonitorDiagnosticSettings('MyMonitor', this, props)
|
|
17
16
|
* }
|
|
18
17
|
* }
|
|
19
18
|
* ```
|
|
@@ -24,7 +23,7 @@ export declare class AzureMonitorManager {
|
|
|
24
23
|
* @param id scoped id of the resource
|
|
25
24
|
* @param scope scope in which this resource is defined
|
|
26
25
|
* @param props monitor diagnostics settings properties
|
|
27
|
-
* @see [
|
|
26
|
+
* @see [Pulumi Azure Native Monitor Diagnostic Settings]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/diagnosticsetting/}
|
|
28
27
|
*/
|
|
29
|
-
createMonitorDiagnosticSettings(id: string, scope: CommonAzureConstruct, props: MonitorDiagnosticSettingProps):
|
|
28
|
+
createMonitorDiagnosticSettings(id: string, scope: CommonAzureConstruct, props: MonitorDiagnosticSettingProps): import("@pulumi/azure-native/monitor/diagnosticSetting.js").DiagnosticSetting;
|
|
30
29
|
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createAzureTfOutput } from '../../utils/index.js';
|
|
1
|
+
import { DiagnosticSetting } from '@pulumi/azure-native/monitor/index.js';
|
|
3
2
|
/**
|
|
4
|
-
* @classdesc Provides operations on Azure
|
|
3
|
+
* @classdesc Provides operations on Azure Monitor using Pulumi
|
|
5
4
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
6
5
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
7
6
|
* @example
|
|
8
|
-
* ```
|
|
7
|
+
* ```typescript
|
|
9
8
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
10
9
|
*
|
|
11
10
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
12
|
-
* constructor(
|
|
13
|
-
* super(
|
|
11
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
12
|
+
* super(name, props)
|
|
14
13
|
* this.props = props
|
|
15
|
-
* this.monitorManager.
|
|
14
|
+
* this.monitorManager.createMonitorDiagnosticSettings('MyMonitor', this, props)
|
|
16
15
|
* }
|
|
17
16
|
* }
|
|
18
17
|
* ```
|
|
@@ -23,18 +22,14 @@ export class AzureMonitorManager {
|
|
|
23
22
|
* @param id scoped id of the resource
|
|
24
23
|
* @param scope scope in which this resource is defined
|
|
25
24
|
* @param props monitor diagnostics settings properties
|
|
26
|
-
* @see [
|
|
25
|
+
* @see [Pulumi Azure Native Monitor Diagnostic Settings]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/diagnosticsetting/}
|
|
27
26
|
*/
|
|
28
27
|
createMonitorDiagnosticSettings(id, scope, props) {
|
|
29
28
|
if (!props)
|
|
30
29
|
throw `Props undefined for ${id}`;
|
|
31
|
-
|
|
30
|
+
return new DiagnosticSetting(`${id}-ds`, {
|
|
32
31
|
...props,
|
|
33
|
-
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.monitorDiagnosticSetting),
|
|
34
|
-
});
|
|
35
|
-
createAzureTfOutput(`${id}-monitorDiagnosticSettingName`, scope, monitorDiagnosticSetting.name);
|
|
36
|
-
createAzureTfOutput(`${id}-monitorDiagnosticSettingFriendlyUniqueId`, scope, monitorDiagnosticSetting.friendlyUniqueId);
|
|
37
|
-
createAzureTfOutput(`${id}-monitorDiagnosticSettingId`, scope, monitorDiagnosticSetting.id);
|
|
38
|
-
return monitorDiagnosticSetting;
|
|
32
|
+
name: scope.resourceNameFormatter.format(props.name?.toString(), scope.props.resourceNameOptions?.monitorDiagnosticSetting),
|
|
33
|
+
}, { parent: scope });
|
|
39
34
|
}
|
|
40
35
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface MonitorDiagnosticSettingProps extends
|
|
1
|
+
import { DiagnosticSettingArgs } from '@pulumi/azure-native/monitor/index.js';
|
|
2
|
+
export interface MonitorDiagnosticSettingProps extends DiagnosticSettingArgs {
|
|
3
3
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CommonAzureConstruct } from '../../common/index.js';
|
|
2
|
+
import { WorkspaceProps } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @classdesc Provides operations on Azure Log Analytics Workspace using Pulumi
|
|
5
|
+
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
6
|
+
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
10
|
+
*
|
|
11
|
+
* class CustomConstruct extends CommonAzureConstruct {
|
|
12
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
13
|
+
* super(name, props)
|
|
14
|
+
* this.props = props
|
|
15
|
+
* this.logAnalyticsWorkspaceManager.createLogAnalyticsWorkspace('MyLogAnalyticsWorkspace', this, props)
|
|
16
|
+
* }
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class AzureOperationalInsightsManager {
|
|
21
|
+
/**
|
|
22
|
+
* @summary Method to create a new log analytics workspace
|
|
23
|
+
* @param id scoped id of the resource
|
|
24
|
+
* @param scope scope in which this resource is defined
|
|
25
|
+
* @param props log analytics workspace properties
|
|
26
|
+
* @see [Pulumi Azure Native Operational Insights Workspace]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/operationalinsights/workspace/}
|
|
27
|
+
*/
|
|
28
|
+
createWorkspace(id: string, scope: CommonAzureConstruct, props: WorkspaceProps): import("@pulumi/azure-native/operationalinsights/workspace.js").Workspace;
|
|
29
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Workspace, WorkspaceSkuNameEnum } from '@pulumi/azure-native/operationalinsights/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* @classdesc Provides operations on Azure Log Analytics Workspace using Pulumi
|
|
4
|
+
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
5
|
+
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
9
|
+
*
|
|
10
|
+
* class CustomConstruct extends CommonAzureConstruct {
|
|
11
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
12
|
+
* super(name, props)
|
|
13
|
+
* this.props = props
|
|
14
|
+
* this.logAnalyticsWorkspaceManager.createLogAnalyticsWorkspace('MyLogAnalyticsWorkspace', this, props)
|
|
15
|
+
* }
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export class AzureOperationalInsightsManager {
|
|
20
|
+
/**
|
|
21
|
+
* @summary Method to create a new log analytics workspace
|
|
22
|
+
* @param id scoped id of the resource
|
|
23
|
+
* @param scope scope in which this resource is defined
|
|
24
|
+
* @param props log analytics workspace properties
|
|
25
|
+
* @see [Pulumi Azure Native Operational Insights Workspace]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/operationalinsights/workspace/}
|
|
26
|
+
*/
|
|
27
|
+
createWorkspace(id, scope, props) {
|
|
28
|
+
if (!props)
|
|
29
|
+
throw `Props undefined for ${id}`;
|
|
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 Workspace(`${id}-lw`, {
|
|
37
|
+
...props,
|
|
38
|
+
workspaceName: scope.resourceNameFormatter.format(props.workspaceName?.toString(), scope.props.resourceNameOptions?.logAnalyticsWorkspace),
|
|
39
|
+
location: props.location ?? scope.props.location,
|
|
40
|
+
resourceGroupName: resourceGroupName,
|
|
41
|
+
sku: props.sku ?? {
|
|
42
|
+
name: WorkspaceSkuNameEnum.PerGB2018,
|
|
43
|
+
},
|
|
44
|
+
retentionInDays: props.retentionInDays ?? 30,
|
|
45
|
+
tags: props.tags ?? {
|
|
46
|
+
environment: scope.props.stage,
|
|
47
|
+
},
|
|
48
|
+
}, { parent: scope });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import { ManagedRedis } from '@cdktf/provider-azurerm/lib/managed-redis/index.js';
|
|
2
1
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
3
2
|
import { ManagedRedisProps } from './types.js';
|
|
4
3
|
/**
|
|
5
|
-
* @classdesc Provides operations on Azure Redis
|
|
4
|
+
* @classdesc Provides operations on Azure Redis 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.redisManager.
|
|
15
|
+
* this.redisManager.createManagedRedis('MyManagedRedis', this, props)
|
|
17
16
|
* }
|
|
18
17
|
* }
|
|
19
18
|
* ```
|
|
20
19
|
*/
|
|
21
20
|
export declare class AzureRedisManager {
|
|
22
21
|
/**
|
|
23
|
-
* @summary Method to create a new redis cache
|
|
22
|
+
* @summary Method to create a new managed redis cache
|
|
24
23
|
* @param id scoped id of the resource
|
|
25
24
|
* @param scope scope in which this resource is defined
|
|
26
25
|
* @param props redis cache properties
|
|
27
|
-
* @see [
|
|
26
|
+
* @see [Pulumi Azure Native Redis]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/cache/redis/}
|
|
28
27
|
*/
|
|
29
|
-
createManagedRedis(id: string, scope: CommonAzureConstruct, props: ManagedRedisProps):
|
|
28
|
+
createManagedRedis(id: string, scope: CommonAzureConstruct, props: ManagedRedisProps): import("@pulumi/azure-native/redis/redis.js").Redis;
|
|
30
29
|
}
|
|
@@ -1,53 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ManagedRedis } from '@cdktf/provider-azurerm/lib/managed-redis/index.js';
|
|
3
|
-
import { createAzureTfOutput } from '../../utils/index.js';
|
|
1
|
+
import { Redis, SkuFamily, SkuName } from '@pulumi/azure-native/redis/index.js';
|
|
4
2
|
/**
|
|
5
|
-
* @classdesc Provides operations on Azure Redis
|
|
3
|
+
* @classdesc Provides operations on Azure Redis 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.redisManager.
|
|
14
|
+
* this.redisManager.createManagedRedis('MyManagedRedis', this, props)
|
|
17
15
|
* }
|
|
18
16
|
* }
|
|
19
17
|
* ```
|
|
20
18
|
*/
|
|
21
19
|
export class AzureRedisManager {
|
|
22
20
|
/**
|
|
23
|
-
* @summary Method to create a new redis cache
|
|
21
|
+
* @summary Method to create a new managed redis cache
|
|
24
22
|
* @param id scoped id of the resource
|
|
25
23
|
* @param scope scope in which this resource is defined
|
|
26
24
|
* @param props redis cache properties
|
|
27
|
-
* @see [
|
|
25
|
+
* @see [Pulumi Azure Native Redis]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/cache/redis/}
|
|
28
26
|
*/
|
|
29
27
|
createManagedRedis(id, scope, props) {
|
|
30
28
|
if (!props)
|
|
31
29
|
throw `Props undefined for ${id}`;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const managedRedis = new ManagedRedis(scope, `${id}-rc`, {
|
|
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 Redis(`${id}-rc`, {
|
|
40
37
|
...props,
|
|
41
|
-
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.managedRedis),
|
|
42
|
-
location:
|
|
43
|
-
resourceGroupName:
|
|
38
|
+
name: scope.resourceNameFormatter.format(props.name?.toString(), scope.props.resourceNameOptions?.managedRedis),
|
|
39
|
+
location: props.location ?? scope.props.location,
|
|
40
|
+
resourceGroupName: resourceGroupName,
|
|
41
|
+
sku: props.sku ?? {
|
|
42
|
+
name: SkuName.Basic,
|
|
43
|
+
family: SkuFamily.C,
|
|
44
|
+
capacity: 0,
|
|
45
|
+
},
|
|
44
46
|
tags: props.tags ?? {
|
|
45
47
|
environment: scope.props.stage,
|
|
46
48
|
},
|
|
47
|
-
});
|
|
48
|
-
createAzureTfOutput(`${id}-managedRedisName`, scope, managedRedis.name);
|
|
49
|
-
createAzureTfOutput(`${id}-managedRedisFriendlyUniqueId`, scope, managedRedis.friendlyUniqueId);
|
|
50
|
-
createAzureTfOutput(`${id}-managedRedisId`, scope, managedRedis.id);
|
|
51
|
-
return managedRedis;
|
|
49
|
+
}, { parent: scope });
|
|
52
50
|
}
|
|
53
51
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ManagedRedisProps extends
|
|
1
|
+
import { RedisArgs } from '@pulumi/azure-native/redis/index.js';
|
|
2
|
+
export interface ManagedRedisProps extends RedisArgs {
|
|
3
3
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { ResourceGroup } from '@cdktf/provider-azurerm/lib/resource-group/index.js';
|
|
2
1
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
3
2
|
import { ResourceGroupProps } from './types.js';
|
|
4
3
|
/**
|
|
5
|
-
* @classdesc Provides operations on Azure Resource Group
|
|
4
|
+
* @classdesc Provides operations on Azure Resource Group 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.resourceGroupManager.createResourceGroup('MyResourceGroup', this, props)
|
|
17
16
|
* }
|
|
@@ -24,7 +23,7 @@ export declare class AzureResourceGroupManager {
|
|
|
24
23
|
* @param id scoped id of the resource
|
|
25
24
|
* @param scope scope in which this resource is defined
|
|
26
25
|
* @param props resource group properties
|
|
27
|
-
* @see [
|
|
26
|
+
* @see [Pulumi Azure Native Resource Group]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/resources/resourcegroup/}
|
|
28
27
|
*/
|
|
29
|
-
createResourceGroup(id: string, scope: CommonAzureConstruct, props: ResourceGroupProps): ResourceGroup;
|
|
28
|
+
createResourceGroup(id: string, scope: CommonAzureConstruct, props: ResourceGroupProps): import("@pulumi/azure-native/resources/resourceGroup.js").ResourceGroup;
|
|
30
29
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { ResourceGroup } from '@
|
|
2
|
-
import { createAzureTfOutput } from '../../utils/index.js';
|
|
1
|
+
import { ResourceGroup } from '@pulumi/azure-native/resources/index.js';
|
|
3
2
|
/**
|
|
4
|
-
* @classdesc Provides operations on Azure Resource Group
|
|
3
|
+
* @classdesc Provides operations on Azure Resource Group using Pulumi
|
|
5
4
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
6
5
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
7
6
|
* @example
|
|
8
|
-
* ```
|
|
7
|
+
* ```typescript
|
|
9
8
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
10
9
|
*
|
|
11
10
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
12
|
-
* constructor(
|
|
13
|
-
* super(
|
|
11
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
12
|
+
* super(name, props)
|
|
14
13
|
* this.props = props
|
|
15
14
|
* this.resourceGroupManager.createResourceGroup('MyResourceGroup', this, props)
|
|
16
15
|
* }
|
|
@@ -23,22 +22,18 @@ export class AzureResourceGroupManager {
|
|
|
23
22
|
* @param id scoped id of the resource
|
|
24
23
|
* @param scope scope in which this resource is defined
|
|
25
24
|
* @param props resource group properties
|
|
26
|
-
* @see [
|
|
25
|
+
* @see [Pulumi Azure Native Resource Group]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/resources/resourcegroup/}
|
|
27
26
|
*/
|
|
28
27
|
createResourceGroup(id, scope, props) {
|
|
29
28
|
if (!props)
|
|
30
29
|
throw `Props undefined for ${id}`;
|
|
31
|
-
|
|
30
|
+
return new ResourceGroup(`${id}-rg`, {
|
|
32
31
|
...props,
|
|
33
|
-
|
|
32
|
+
resourceGroupName: scope.resourceNameFormatter.format(props.resourceGroupName?.toString(), scope.props.resourceNameOptions?.resourceGroup),
|
|
34
33
|
location: props.location,
|
|
35
34
|
tags: props.tags ?? {
|
|
36
35
|
environment: scope.props.stage,
|
|
37
36
|
},
|
|
38
|
-
});
|
|
39
|
-
createAzureTfOutput(`${id}-resourceGroupName`, scope, resourceGroup.name);
|
|
40
|
-
createAzureTfOutput(`${id}-resourceGroupFriendlyUniqueId`, scope, resourceGroup.friendlyUniqueId);
|
|
41
|
-
createAzureTfOutput(`${id}-resourceGroupId`, scope, resourceGroup.id);
|
|
42
|
-
return resourceGroup;
|
|
37
|
+
}, { parent: scope });
|
|
43
38
|
}
|
|
44
39
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ResourceGroupProps extends
|
|
1
|
+
import { ResourceGroupArgs } from '@pulumi/azure-native/resources/index.js';
|
|
2
|
+
export interface ResourceGroupProps extends ResourceGroupArgs {
|
|
3
3
|
}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { DataAzurermServicebusQueue } from '@cdktf/provider-azurerm/lib/data-azurerm-servicebus-queue/index.js';
|
|
2
|
-
import { ServicebusNamespace } from '@cdktf/provider-azurerm/lib/servicebus-namespace/index.js';
|
|
3
|
-
import { ServicebusQueue } from '@cdktf/provider-azurerm/lib/servicebus-queue/index.js';
|
|
4
|
-
import { ServicebusSubscription } from '@cdktf/provider-azurerm/lib/servicebus-subscription/index.js';
|
|
5
|
-
import { ServicebusTopic } from '@cdktf/provider-azurerm/lib/servicebus-topic/index.js';
|
|
6
1
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
7
|
-
import {
|
|
2
|
+
import { ResolveServicebusQueueProps, ServicebusNamespaceProps, ServicebusQueueProps, ServicebusSubscriptionProps, ServicebusTopicProps } from './types.js';
|
|
8
3
|
/**
|
|
9
|
-
* @classdesc Provides operations on Azure Servicebus
|
|
4
|
+
* @classdesc Provides operations on Azure Servicebus using Pulumi
|
|
10
5
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
11
6
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
12
7
|
* @example
|
|
13
|
-
* ```
|
|
8
|
+
* ```typescript
|
|
14
9
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
15
10
|
*
|
|
16
11
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
17
|
-
* constructor(
|
|
18
|
-
* super(
|
|
12
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
13
|
+
* super(name, props)
|
|
19
14
|
* this.props = props
|
|
20
15
|
* this.ServicebusManager.createServicebusTopic('MyServicebusTopic', this, props)
|
|
21
16
|
* }
|
|
@@ -28,39 +23,39 @@ export declare class AzureServicebusManager {
|
|
|
28
23
|
* @param id scoped id of the resource
|
|
29
24
|
* @param scope scope in which this resource is defined
|
|
30
25
|
* @param props servicebus namespace properties
|
|
31
|
-
* @see [
|
|
26
|
+
* @see [Pulumi Azure Native Service Bus Namespace]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/servicebus/namespace/}
|
|
32
27
|
*/
|
|
33
|
-
createServicebusNamespace(id: string, scope: CommonAzureConstruct, props: ServicebusNamespaceProps):
|
|
28
|
+
createServicebusNamespace(id: string, scope: CommonAzureConstruct, props: ServicebusNamespaceProps): import("@pulumi/azure-native/servicebus/namespace.js").Namespace;
|
|
34
29
|
/**
|
|
35
30
|
* @summary Method to create a new servicebus topic
|
|
36
31
|
* @param id scoped id of the resource
|
|
37
32
|
* @param scope scope in which this resource is defined
|
|
38
33
|
* @param props servicebus topic properties
|
|
39
|
-
* @see [
|
|
34
|
+
* @see [Pulumi Azure Native Service Bus Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/servicebus/topic/}
|
|
40
35
|
*/
|
|
41
|
-
createServicebusTopic(id: string, scope: CommonAzureConstruct, props: ServicebusTopicProps):
|
|
36
|
+
createServicebusTopic(id: string, scope: CommonAzureConstruct, props: ServicebusTopicProps): import("@pulumi/azure-native/servicebus/topic.js").Topic;
|
|
42
37
|
/**
|
|
43
38
|
* @summary Method to create a new servicebus queue
|
|
44
39
|
* @param id scoped id of the resource
|
|
45
40
|
* @param scope scope in which this resource is defined
|
|
46
41
|
* @param props servicebus queue properties
|
|
47
|
-
* @see [
|
|
42
|
+
* @see [Pulumi Azure Native Service Bus Queue]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/servicebus/queue/}
|
|
48
43
|
*/
|
|
49
|
-
createServicebusQueue(id: string, scope: CommonAzureConstruct, props: ServicebusQueueProps):
|
|
44
|
+
createServicebusQueue(id: string, scope: CommonAzureConstruct, props: ServicebusQueueProps): import("@pulumi/azure-native/servicebus/queue.js").Queue;
|
|
50
45
|
/**
|
|
51
46
|
* @summary Method to create a new servicebus subscription
|
|
52
47
|
* @param id scoped id of the resource
|
|
53
48
|
* @param scope scope in which this resource is defined
|
|
54
49
|
* @param props servicebus subscription properties
|
|
55
|
-
* @see [
|
|
50
|
+
* @see [Pulumi Azure Native Service Bus Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/servicebus/subscription/}
|
|
56
51
|
*/
|
|
57
|
-
createServicebusSubscription(id: string, scope: CommonAzureConstruct, props: ServicebusSubscriptionProps):
|
|
52
|
+
createServicebusSubscription(id: string, scope: CommonAzureConstruct, props: ServicebusSubscriptionProps): import("@pulumi/azure-native/servicebus/subscription.js").Subscription;
|
|
58
53
|
/**
|
|
59
|
-
* @summary Method to resolve
|
|
54
|
+
* @summary Method to resolve an existing servicebus queue
|
|
60
55
|
* @param id scoped id of the resource
|
|
61
56
|
* @param scope scope in which this resource is defined
|
|
62
|
-
* @param props servicebus queue properties
|
|
63
|
-
* @see [
|
|
57
|
+
* @param props servicebus queue properties for lookup
|
|
58
|
+
* @see [Pulumi Azure Native Service Bus Queue Lookup]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/servicebus/queue/}
|
|
64
59
|
*/
|
|
65
|
-
resolveServicebusQueue(id: string, scope: CommonAzureConstruct, props:
|
|
60
|
+
resolveServicebusQueue(id: string, scope: CommonAzureConstruct, props: ResolveServicebusQueueProps): import("@pulumi/pulumi").Output<import("@pulumi/azure-native/servicebus/getQueue.js").GetQueueResult>;
|
|
66
61
|
}
|