@gradientedge/cdk-utils 10.1.0 → 10.3.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 (133) hide show
  1. package/dist/src/lib/azure/common/constants.d.ts +3 -2
  2. package/dist/src/lib/azure/common/constants.js +2 -1
  3. package/dist/src/lib/azure/common/construct.d.ts +26 -12
  4. package/dist/src/lib/azure/common/construct.js +31 -45
  5. package/dist/src/lib/azure/common/resource-name-formatter.d.ts +9 -4
  6. package/dist/src/lib/azure/common/resource-name-formatter.js +9 -5
  7. package/dist/src/lib/azure/common/stack.d.ts +18 -32
  8. package/dist/src/lib/azure/common/stack.js +77 -74
  9. package/dist/src/lib/azure/common/tagging.d.ts +29 -8
  10. package/dist/src/lib/azure/common/tagging.js +72 -26
  11. package/dist/src/lib/azure/common/types.d.ts +19 -4
  12. package/dist/src/lib/azure/services/api-management/main.d.ts +29 -32
  13. package/dist/src/lib/azure/services/api-management/main.js +100 -121
  14. package/dist/src/lib/azure/services/api-management/types.d.ts +33 -18
  15. package/dist/src/lib/azure/services/app-configuration/main.d.ts +6 -7
  16. package/dist/src/lib/azure/services/app-configuration/main.js +23 -26
  17. package/dist/src/lib/azure/services/app-configuration/types.d.ts +2 -2
  18. package/dist/src/lib/azure/services/app-service/main.d.ts +10 -12
  19. package/dist/src/lib/azure/services/app-service/main.js +37 -49
  20. package/dist/src/lib/azure/services/app-service/types.d.ts +4 -4
  21. package/dist/src/lib/azure/services/application-insights/main.d.ts +7 -8
  22. package/dist/src/lib/azure/services/application-insights/main.js +20 -26
  23. package/dist/src/lib/azure/services/application-insights/types.d.ts +2 -4
  24. package/dist/src/lib/azure/services/cosmosdb/main.d.ts +12 -15
  25. package/dist/src/lib/azure/services/cosmosdb/main.js +42 -61
  26. package/dist/src/lib/azure/services/cosmosdb/types.d.ts +4 -6
  27. package/dist/src/lib/azure/services/dns/main.d.ts +13 -17
  28. package/dist/src/lib/azure/services/dns/main.js +33 -51
  29. package/dist/src/lib/azure/services/dns/types.d.ts +5 -8
  30. package/dist/src/lib/azure/services/eventgrid/main.d.ts +20 -22
  31. package/dist/src/lib/azure/services/eventgrid/main.js +61 -89
  32. package/dist/src/lib/azure/services/eventgrid/types.d.ts +7 -8
  33. package/dist/src/lib/azure/services/function/main.d.ts +15 -15
  34. package/dist/src/lib/azure/services/function/main.js +54 -59
  35. package/dist/src/lib/azure/services/function/types.d.ts +18 -6
  36. package/dist/src/lib/azure/services/index.d.ts +1 -1
  37. package/dist/src/lib/azure/services/index.js +1 -1
  38. package/dist/src/lib/azure/services/key-vault/main.d.ts +6 -7
  39. package/dist/src/lib/azure/services/key-vault/main.js +29 -28
  40. package/dist/src/lib/azure/services/key-vault/types.d.ts +3 -2
  41. package/dist/src/lib/azure/services/monitor/main.d.ts +7 -8
  42. package/dist/src/lib/azure/services/monitor/main.js +10 -15
  43. package/dist/src/lib/azure/services/monitor/types.d.ts +2 -2
  44. package/dist/src/lib/azure/services/operational-insights/main.d.ts +29 -0
  45. package/dist/src/lib/azure/services/operational-insights/main.js +50 -0
  46. package/dist/src/lib/azure/services/operational-insights/types.d.ts +3 -0
  47. package/dist/src/lib/azure/services/redis/main.d.ts +8 -9
  48. package/dist/src/lib/azure/services/redis/main.js +24 -26
  49. package/dist/src/lib/azure/services/redis/types.d.ts +2 -2
  50. package/dist/src/lib/azure/services/resource-group/main.d.ts +6 -7
  51. package/dist/src/lib/azure/services/resource-group/main.js +9 -14
  52. package/dist/src/lib/azure/services/resource-group/types.d.ts +2 -2
  53. package/dist/src/lib/azure/services/servicebus/main.d.ts +17 -22
  54. package/dist/src/lib/azure/services/servicebus/main.js +47 -70
  55. package/dist/src/lib/azure/services/servicebus/types.d.ts +6 -10
  56. package/dist/src/lib/azure/services/storage/main.d.ts +24 -27
  57. package/dist/src/lib/azure/services/storage/main.js +70 -88
  58. package/dist/src/lib/azure/services/storage/types.d.ts +10 -8
  59. package/dist/src/lib/azure/types/index.d.ts +2 -1
  60. package/dist/src/lib/azure/utils/index.d.ts +19 -3
  61. package/dist/src/lib/azure/utils/index.js +19 -13
  62. package/dist/src/lib/cloudflare/common/stack.js +1 -1
  63. package/dist/src/lib/cloudflare/services/access/main.js +23 -23
  64. package/dist/src/lib/cloudflare/services/api-shield/main.js +11 -11
  65. package/dist/src/lib/cloudflare/services/argo/main.js +5 -5
  66. package/dist/src/lib/cloudflare/services/filter/main.js +3 -3
  67. package/dist/src/lib/cloudflare/services/firewall/main.js +3 -3
  68. package/dist/src/lib/cloudflare/services/page/main.js +7 -7
  69. package/dist/src/lib/cloudflare/services/record/main.js +3 -3
  70. package/dist/src/lib/cloudflare/services/rule-set/main.d.ts +1 -1
  71. package/dist/src/lib/cloudflare/services/rule-set/main.js +4 -5
  72. package/dist/src/lib/cloudflare/services/worker/main.js +13 -13
  73. package/dist/src/lib/cloudflare/services/zone/main.js +18 -18
  74. package/package.json +2 -1
  75. package/src/lib/azure/common/constants.ts +2 -1
  76. package/src/lib/azure/common/construct.ts +32 -48
  77. package/src/lib/azure/common/resource-name-formatter.ts +10 -6
  78. package/src/lib/azure/common/stack.ts +78 -78
  79. package/src/lib/azure/common/tagging.ts +78 -29
  80. package/src/lib/azure/common/types.ts +21 -4
  81. package/src/lib/azure/services/api-management/main.ts +172 -169
  82. package/src/lib/azure/services/api-management/types.ts +39 -16
  83. package/src/lib/azure/services/app-configuration/main.ts +33 -31
  84. package/src/lib/azure/services/app-configuration/types.ts +2 -2
  85. package/src/lib/azure/services/app-service/main.ts +61 -62
  86. package/src/lib/azure/services/app-service/types.ts +4 -4
  87. package/src/lib/azure/services/application-insights/main.ts +29 -30
  88. package/src/lib/azure/services/application-insights/types.ts +2 -5
  89. package/src/lib/azure/services/cosmosdb/main.ts +78 -77
  90. package/src/lib/azure/services/cosmosdb/types.ts +10 -6
  91. package/src/lib/azure/services/dns/main.ts +65 -72
  92. package/src/lib/azure/services/dns/types.ts +9 -9
  93. package/src/lib/azure/services/eventgrid/main.ts +120 -122
  94. package/src/lib/azure/services/eventgrid/types.ts +13 -8
  95. package/src/lib/azure/services/function/main.ts +75 -72
  96. package/src/lib/azure/services/function/types.ts +21 -6
  97. package/src/lib/azure/services/index.ts +1 -1
  98. package/src/lib/azure/services/key-vault/main.ts +38 -32
  99. package/src/lib/azure/services/key-vault/types.ts +4 -2
  100. package/src/lib/azure/services/monitor/main.ts +17 -21
  101. package/src/lib/azure/services/monitor/types.ts +2 -2
  102. package/src/lib/azure/services/operational-insights/main.ts +61 -0
  103. package/src/lib/azure/services/operational-insights/types.ts +3 -0
  104. package/src/lib/azure/services/redis/main.ts +30 -30
  105. package/src/lib/azure/services/redis/types.ts +2 -2
  106. package/src/lib/azure/services/resource-group/main.ts +20 -20
  107. package/src/lib/azure/services/resource-group/types.ts +2 -2
  108. package/src/lib/azure/services/servicebus/main.ts +103 -94
  109. package/src/lib/azure/services/servicebus/types.ts +17 -11
  110. package/src/lib/azure/services/storage/main.ts +113 -114
  111. package/src/lib/azure/services/storage/types.ts +16 -8
  112. package/src/lib/azure/types/index.ts +2 -1
  113. package/src/lib/azure/utils/index.ts +20 -22
  114. package/src/lib/cloudflare/common/stack.ts +1 -1
  115. package/src/lib/cloudflare/services/access/main.ts +114 -58
  116. package/src/lib/cloudflare/services/api-shield/main.ts +48 -22
  117. package/src/lib/cloudflare/services/argo/main.ts +17 -9
  118. package/src/lib/cloudflare/services/filter/main.ts +9 -5
  119. package/src/lib/cloudflare/services/firewall/main.ts +9 -5
  120. package/src/lib/cloudflare/services/page/main.ts +27 -15
  121. package/src/lib/cloudflare/services/record/main.ts +9 -5
  122. package/src/lib/cloudflare/services/rule-set/main.ts +10 -8
  123. package/src/lib/cloudflare/services/worker/main.ts +60 -29
  124. package/src/lib/cloudflare/services/zone/main.ts +75 -35
  125. package/dist/src/lib/azure/services/log-analytics-workspace/main.d.ts +0 -30
  126. package/dist/src/lib/azure/services/log-analytics-workspace/main.js +0 -55
  127. package/dist/src/lib/azure/services/log-analytics-workspace/types.d.ts +0 -3
  128. package/src/lib/azure/services/log-analytics-workspace/main.ts +0 -61
  129. package/src/lib/azure/services/log-analytics-workspace/types.ts +0 -3
  130. /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.d.ts +0 -0
  131. /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.js +0 -0
  132. /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/types.js +0 -0
  133. /package/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.ts +0 -0
@@ -1,17 +1,15 @@
1
- import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js';
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(parent: Construct, id: string, props: CommonAzureStackProps) {
14
- * super(parent, id, props)
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 [CDKTF Key Vault Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/keyVault.typescript.md}
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
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-kv-rg`, {
33
- name: scope.props.resourceGroupName
34
- ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
35
- : `${props.resourceGroupName}`,
36
- });
37
- if (!resourceGroup)
38
- throw `Resource group undefined for ${id}`;
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
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.keyVault),
42
- location: resourceGroup.location,
43
- resourceGroupName: resourceGroup.name,
44
- skuName: props.skuName ?? 'standard',
45
- rbacAuthorizationEnabled: props.rbacAuthorizationEnabled ?? true,
46
- softDeleteRetentionDays: props.softDeleteRetentionDays ?? 90,
47
- purgeProtectionEnabled: props.purgeProtectionEnabled ?? true,
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 { KeyVaultConfig } from '@cdktf/provider-azurerm/lib/key-vault/index.js';
2
- export interface KeyVaultProps extends KeyVaultConfig {
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 Key Vault
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(parent: Construct, id: string, props: CommonAzureStackProps) {
14
- * super(parent, id, props)
12
+ * constructor(name: string, props: CommonAzureStackProps) {
13
+ * super(name, props)
15
14
  * this.props = props
16
- * this.monitorManager.createMonitor('MyMonitor', this, props)
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 [CDKTF Monitor Diagnostics Settings Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/monitorDiagnosticSetting.typescript.md}
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): MonitorDiagnosticSetting;
28
+ createMonitorDiagnosticSettings(id: string, scope: CommonAzureConstruct, props: MonitorDiagnosticSettingProps): import("@pulumi/azure-native/monitor/diagnosticSetting.js").DiagnosticSetting;
30
29
  }
@@ -1,18 +1,17 @@
1
- import { MonitorDiagnosticSetting } from '@cdktf/provider-azurerm/lib/monitor-diagnostic-setting/index.js';
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 Key Vault
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(parent: Construct, id: string, props: CommonAzureStackProps) {
13
- * super(parent, id, props)
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
14
13
  * this.props = props
15
- * this.monitorManager.createMonitor('MyMonitor', this, props)
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 [CDKTF Monitor Diagnostics Settings Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/monitorDiagnosticSetting.typescript.md}
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
- const monitorDiagnosticSetting = new MonitorDiagnosticSetting(scope, `${id}-ds`, {
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 { MonitorDiagnosticSettingConfig } from '@cdktf/provider-azurerm/lib/monitor-diagnostic-setting/index.js';
2
- export interface MonitorDiagnosticSettingProps extends MonitorDiagnosticSettingConfig {
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
+ }
@@ -0,0 +1,3 @@
1
+ import { WorkspaceArgs } from '@pulumi/azure-native/operationalinsights/index.js';
2
+ export interface WorkspaceProps extends WorkspaceArgs {
3
+ }
@@ -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(parent: Construct, id: string, props: CommonAzureStackProps) {
14
- * super(parent, id, props)
12
+ * constructor(name: string, props: CommonAzureStackProps) {
13
+ * super(name, props)
15
14
  * this.props = props
16
- * this.redisManager.createRedis('MyManagedRedis', this, props)
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 [CDKTF Redis Cache Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/managedRedis.typescript.md}
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): ManagedRedis;
28
+ createManagedRedis(id: string, scope: CommonAzureConstruct, props: ManagedRedisProps): import("@pulumi/azure-native/redis/redis.js").Redis;
30
29
  }
@@ -1,53 +1,51 @@
1
- import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js';
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(parent: Construct, id: string, props: CommonAzureStackProps) {
14
- * super(parent, id, props)
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
15
13
  * this.props = props
16
- * this.redisManager.createRedis('MyManagedRedis', this, props)
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 [CDKTF Redis Cache Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/managedRedis.typescript.md}
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
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-rc-rg`, {
33
- name: scope.props.resourceGroupName
34
- ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
35
- : `${props.resourceGroupName}`,
36
- });
37
- if (!resourceGroup)
38
- throw `Resource group undefined for ${id}`;
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: resourceGroup.location,
43
- resourceGroupName: resourceGroup.name,
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 { ManagedRedisConfig } from '@cdktf/provider-azurerm/lib/managed-redis/index.js';
2
- export interface ManagedRedisProps extends ManagedRedisConfig {
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(parent: Construct, id: string, props: CommonAzureStackProps) {
14
- * super(parent, id, props)
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 [CDKTF Resource Group Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/resourceGroup.typescript.md}
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 '@cdktf/provider-azurerm/lib/resource-group/index.js';
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(parent: Construct, id: string, props: CommonAzureStackProps) {
13
- * super(parent, id, props)
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 [CDKTF Resource Group Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/resourceGroup.typescript.md}
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
- const resourceGroup = new ResourceGroup(scope, `${id}-rg`, {
30
+ return new ResourceGroup(`${id}-rg`, {
32
31
  ...props,
33
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.resourceGroup),
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 { ResourceGroupConfig } from '@cdktf/provider-azurerm/lib/resource-group/index.js';
2
- export interface ResourceGroupProps extends ResourceGroupConfig {
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 { DataAzurermServicebusQueueProps, ServicebusNamespaceProps, ServicebusQueueProps, ServicebusSubscriptionProps, ServicebusTopicProps } from './types.js';
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(parent: Construct, id: string, props: CommonAzureStackProps) {
18
- * super(parent, id, props)
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 [CDKTF Servicebus Namespace Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusNamespace.typescript.md}
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): ServicebusNamespace;
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 [CDKTF Servicebus Topic Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusTopic.typescript.md}
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): ServicebusTopic;
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 [CDKTF Servicebus Queue Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusQueue.typescript.md}
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): ServicebusQueue;
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 [CDKTF Servicebus Subscription Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusSubscription.typescript.md}
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): ServicebusSubscription;
52
+ createServicebusSubscription(id: string, scope: CommonAzureConstruct, props: ServicebusSubscriptionProps): import("@pulumi/azure-native/servicebus/subscription.js").Subscription;
58
53
  /**
59
- * @summary Method to resolve a new servicebus queue
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 [CDKTF Servicebus Queue Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusQueue.typescript.md}
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: DataAzurermServicebusQueueProps): DataAzurermServicebusQueue;
60
+ resolveServicebusQueue(id: string, scope: CommonAzureConstruct, props: ResolveServicebusQueueProps): import("@pulumi/pulumi").Output<import("@pulumi/azure-native/servicebus/getQueue.js").GetQueueResult>;
66
61
  }