@gradientedge/cdk-utils 10.0.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.
Files changed (112) 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/package.json +28 -27
  64. package/src/lib/azure/common/constants.ts +2 -1
  65. package/src/lib/azure/common/construct.ts +32 -48
  66. package/src/lib/azure/common/resource-name-formatter.ts +10 -6
  67. package/src/lib/azure/common/stack.ts +78 -78
  68. package/src/lib/azure/common/tagging.ts +78 -29
  69. package/src/lib/azure/common/types.ts +21 -4
  70. package/src/lib/azure/services/api-management/main.ts +172 -169
  71. package/src/lib/azure/services/api-management/types.ts +39 -16
  72. package/src/lib/azure/services/app-configuration/main.ts +33 -31
  73. package/src/lib/azure/services/app-configuration/types.ts +2 -2
  74. package/src/lib/azure/services/app-service/main.ts +61 -62
  75. package/src/lib/azure/services/app-service/types.ts +4 -4
  76. package/src/lib/azure/services/application-insights/main.ts +29 -30
  77. package/src/lib/azure/services/application-insights/types.ts +2 -5
  78. package/src/lib/azure/services/cosmosdb/main.ts +78 -77
  79. package/src/lib/azure/services/cosmosdb/types.ts +10 -6
  80. package/src/lib/azure/services/dns/main.ts +65 -72
  81. package/src/lib/azure/services/dns/types.ts +9 -9
  82. package/src/lib/azure/services/eventgrid/main.ts +120 -122
  83. package/src/lib/azure/services/eventgrid/types.ts +13 -8
  84. package/src/lib/azure/services/function/main.ts +75 -72
  85. package/src/lib/azure/services/function/types.ts +21 -6
  86. package/src/lib/azure/services/index.ts +1 -1
  87. package/src/lib/azure/services/key-vault/main.ts +38 -32
  88. package/src/lib/azure/services/key-vault/types.ts +4 -2
  89. package/src/lib/azure/services/monitor/main.ts +17 -21
  90. package/src/lib/azure/services/monitor/types.ts +2 -2
  91. package/src/lib/azure/services/operational-insights/main.ts +61 -0
  92. package/src/lib/azure/services/operational-insights/types.ts +3 -0
  93. package/src/lib/azure/services/redis/main.ts +30 -30
  94. package/src/lib/azure/services/redis/types.ts +2 -2
  95. package/src/lib/azure/services/resource-group/main.ts +20 -20
  96. package/src/lib/azure/services/resource-group/types.ts +2 -2
  97. package/src/lib/azure/services/servicebus/main.ts +103 -94
  98. package/src/lib/azure/services/servicebus/types.ts +17 -11
  99. package/src/lib/azure/services/storage/main.ts +113 -114
  100. package/src/lib/azure/services/storage/types.ts +16 -8
  101. package/src/lib/azure/types/index.ts +2 -1
  102. package/src/lib/azure/utils/index.ts +20 -22
  103. package/src/lib/cloudflare/common/stack.ts +1 -1
  104. package/dist/src/lib/azure/services/log-analytics-workspace/main.d.ts +0 -30
  105. package/dist/src/lib/azure/services/log-analytics-workspace/main.js +0 -55
  106. package/dist/src/lib/azure/services/log-analytics-workspace/types.d.ts +0 -3
  107. package/src/lib/azure/services/log-analytics-workspace/main.ts +0 -61
  108. package/src/lib/azure/services/log-analytics-workspace/types.ts +0 -3
  109. /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.d.ts +0 -0
  110. /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.js +0 -0
  111. /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/types.js +0 -0
  112. /package/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.ts +0 -0
@@ -1,21 +1,17 @@
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
- import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js';
5
- import { createAzureTfOutput } from '../../utils/index.js';
1
+ import { DatabaseAccount, ResourceIdentityType, SqlResourceSqlContainer, SqlResourceSqlDatabase, } from '@pulumi/azure-native/cosmosdb/index.js';
6
2
  /**
7
- * @classdesc Provides operations on Azure CosmosDB
3
+ * @classdesc Provides operations on Azure CosmosDB using Pulumi
8
4
  * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
9
5
  * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
10
6
  * @example
11
- * ```
7
+ * ```typescript
12
8
  * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
13
9
  *
14
10
  * class CustomConstruct extends CommonAzureConstruct {
15
- * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
16
- * super(parent, id, props)
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
17
13
  * this.props = props
18
- * this.CosmosDbManager.createCosmosAccount('MyCosmosDb', this, props)
14
+ * this.CosmosDbManager.createCosmosDbAccount('MyCosmosDb', this, props)
19
15
  * }
20
16
  * }
21
17
  * ```
@@ -26,87 +22,72 @@ export class AzureCosmosDbManager {
26
22
  * @param id scoped id of the resource
27
23
  * @param scope scope in which this resource is defined
28
24
  * @param props cosmosdb account properties
29
- * @see [CDKTF CosmosDb Account Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/cosmosdbAccount.typescript.md}
25
+ * @see [Pulumi Azure Native CosmosDB Account]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/databaseaccount/}
30
26
  */
31
27
  createCosmosDbAccount(id, scope, props) {
32
28
  if (!props)
33
29
  throw `Props undefined for ${id}`;
34
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-ca-rg`, {
35
- name: scope.props.resourceGroupName
36
- ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
37
- : `${props.resourceGroupName}`,
38
- });
39
- if (!resourceGroup)
40
- throw `Resource group undefined for ${id}`;
41
- const cosmosdbAccount = new CosmosdbAccount(scope, `${id}-ca`, {
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 DatabaseAccount(`${id}-ca`, {
42
37
  ...props,
43
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.cosmosDbAccount),
44
- location: resourceGroup.location,
45
- resourceGroupName: resourceGroup.name,
38
+ accountName: scope.resourceNameFormatter.format(props.accountName?.toString(), scope.props.resourceNameOptions?.cosmosDbAccount),
39
+ location: props.location ?? scope.props.location,
40
+ resourceGroupName: resourceGroupName,
46
41
  tags: props.tags ?? {
47
42
  environment: scope.props.stage,
48
43
  },
49
44
  identity: props.identity ?? {
50
- type: 'SystemAssigned',
45
+ type: ResourceIdentityType.SystemAssigned,
51
46
  },
52
- });
53
- createAzureTfOutput(`${id}-cosmosdbAccountName`, scope, cosmosdbAccount.name);
54
- createAzureTfOutput(`${id}-cosmosdbAccountFriendlyUniqueId`, scope, cosmosdbAccount.friendlyUniqueId);
55
- createAzureTfOutput(`${id}-cosmosdbAccountId`, scope, cosmosdbAccount.id);
56
- return cosmosdbAccount;
47
+ }, { parent: scope });
57
48
  }
58
49
  /**
59
50
  * @summary Method to create a new cosmosdb database
60
51
  * @param id scoped id of the resource
61
52
  * @param scope scope in which this resource is defined
62
- * @param props cosmosdb container properties
63
- * @see [CDKTF CosmosDb Container Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/cosmosdbSqlContainer.typescript.md}
53
+ * @param props cosmosdb database properties
54
+ * @see [Pulumi Azure Native CosmosDB SQL Database]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/sqlresourcesqldatabase/}
64
55
  */
65
56
  createCosmosDbDatabase(id, scope, props) {
66
57
  if (!props)
67
58
  throw `Props undefined for ${id}`;
68
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-cd-rg`, {
69
- name: scope.props.resourceGroupName
70
- ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
71
- : `${props.resourceGroupName}`,
72
- });
73
- if (!resourceGroup)
74
- throw `Resource group undefined for ${id}`;
75
- const cosmosdbDatatbase = new CosmosdbSqlDatabase(scope, `${id}-cd`, {
59
+ // Get resource group name
60
+ const resourceGroupName = scope.props.resourceGroupName
61
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
62
+ : props.resourceGroupName;
63
+ if (!resourceGroupName)
64
+ throw `Resource group name undefined for ${id}`;
65
+ return new SqlResourceSqlDatabase(`${id}-cd`, {
76
66
  ...props,
77
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.cosmosDbSqlDatabase),
78
- resourceGroupName: resourceGroup.name,
79
- });
80
- createAzureTfOutput(`${id}-cosmosdbDatatbasetName`, scope, cosmosdbDatatbase.name);
81
- createAzureTfOutput(`${id}-cosmosdbDatatbaseFriendlyUniqueId`, scope, cosmosdbDatatbase.friendlyUniqueId);
82
- createAzureTfOutput(`${id}-cosmosdbDatatbaseId`, scope, cosmosdbDatatbase.id);
83
- return cosmosdbDatatbase;
67
+ databaseName: scope.resourceNameFormatter.format(props.databaseName?.toString(), scope.props.resourceNameOptions?.cosmosDbSqlDatabase),
68
+ resourceGroupName: resourceGroupName,
69
+ }, { parent: scope });
84
70
  }
85
71
  /**
86
72
  * @summary Method to create a new cosmosdb container
87
73
  * @param id scoped id of the resource
88
74
  * @param scope scope in which this resource is defined
89
75
  * @param props cosmosdb container properties
90
- * @see [CDKTF CosmosDb Container Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/cosmosdbSqlContainer.typescript.md}
76
+ * @see [Pulumi Azure Native CosmosDB SQL Container]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/sqlresourcesqlcontainer/}
91
77
  */
92
78
  createCosmosDbContainer(id, scope, props) {
93
79
  if (!props)
94
80
  throw `Props undefined for ${id}`;
95
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-cc-rg`, {
96
- name: scope.props.resourceGroupName
97
- ? `${scope.props.resourceGroupName}-${scope.props.stage}`
98
- : `${props.resourceGroupName}`,
99
- });
100
- if (!resourceGroup)
101
- throw `Resource group undefined for ${id}`;
102
- const cosmosdbContainer = new CosmosdbSqlContainer(scope, `${id}-cc`, {
81
+ // Get resource group name
82
+ const resourceGroupName = scope.props.resourceGroupName
83
+ ? `${scope.props.resourceGroupName}-${scope.props.stage}`
84
+ : props.resourceGroupName;
85
+ if (!resourceGroupName)
86
+ throw `Resource group name undefined for ${id}`;
87
+ return new SqlResourceSqlContainer(`${id}-cc`, {
103
88
  ...props,
104
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.cosmosDbSqlContainer),
105
- resourceGroupName: resourceGroup.name,
106
- });
107
- createAzureTfOutput(`${id}-cosmosdbContainertName`, scope, cosmosdbContainer.name);
108
- createAzureTfOutput(`${id}-cosmosdbContainerFriendlyUniqueId`, scope, cosmosdbContainer.friendlyUniqueId);
109
- createAzureTfOutput(`${id}-cosmosdbContainerId`, scope, cosmosdbContainer.id);
110
- return cosmosdbContainer;
89
+ containerName: scope.resourceNameFormatter.format(props.containerName?.toString(), scope.props.resourceNameOptions?.cosmosDbSqlContainer),
90
+ resourceGroupName: resourceGroupName,
91
+ }, { parent: scope });
111
92
  }
112
93
  }
@@ -1,9 +1,7 @@
1
- import { CosmosdbAccountConfig } from '@cdktf/provider-azurerm/lib/cosmosdb-account/index.js';
2
- import { CosmosdbSqlDatabaseConfig } from '@cdktf/provider-azurerm/lib/cosmosdb-sql-database/index.js';
3
- import { CosmosdbSqlContainerConfig } from '@cdktf/provider-azurerm/lib/cosmosdb-sql-container/index.js';
4
- export interface CosmosdbAccountProps extends CosmosdbAccountConfig {
1
+ import { DatabaseAccountArgs, SqlResourceSqlContainerArgs, SqlResourceSqlDatabaseArgs } from '@pulumi/azure-native/cosmosdb/index.js';
2
+ export interface CosmosdbAccountProps extends DatabaseAccountArgs {
5
3
  }
6
- export interface CosmosdbSqlDatabaseProps extends CosmosdbSqlDatabaseConfig {
4
+ export interface CosmosdbSqlDatabaseProps extends SqlResourceSqlDatabaseArgs {
7
5
  }
8
- export interface CosmosdbSqlContainerProps extends CosmosdbSqlContainerConfig {
6
+ export interface CosmosdbSqlContainerProps extends SqlResourceSqlContainerArgs {
9
7
  }
@@ -1,22 +1,18 @@
1
- import { DnsARecord } from '@cdktf/provider-azurerm/lib/dns-a-record/index.js';
2
- import { DnsCnameRecord } from '@cdktf/provider-azurerm/lib/dns-cname-record/index.js';
3
- import { DnsTxtRecord } from '@cdktf/provider-azurerm/lib/dns-txt-record/index.js';
4
- import { DnsZone } from '@cdktf/provider-azurerm/lib/dns-zone/index.js';
5
1
  import { CommonAzureConstruct } from '../../common/index.js';
6
2
  import { DnsARecordProps, DnsCnameRecordProps, DnsTxtRecordProps, DnsZoneProps } from './types.js';
7
3
  /**
8
- * @classdesc Provides operations on Azure DNS
4
+ * @classdesc Provides operations on Azure DNS using Pulumi
9
5
  * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
10
6
  * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
11
7
  * @example
12
- * ```
8
+ * ```typescript
13
9
  * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
14
10
  *
15
11
  * class CustomConstruct extends CommonAzureConstruct {
16
- * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
17
- * super(parent, id, props)
12
+ * constructor(name: string, props: CommonAzureStackProps) {
13
+ * super(name, props)
18
14
  * this.props = props
19
- * this.dnsManager.createAppService('MyDnsZone', this, props)
15
+ * this.dnsManager.createDnsZone('MyDnsZone', this, props)
20
16
  * }
21
17
  * }
22
18
  * ```
@@ -27,31 +23,31 @@ export declare class AzureDnsManager {
27
23
  * @param id scoped id of the resource
28
24
  * @param scope scope in which this resource is defined
29
25
  * @param props dns zone properties
30
- * @see [CDKTF DNS Zone Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsZone.typescript.md}
26
+ * @see [Pulumi Azure Native DNS Zone]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/zone/}
31
27
  */
32
- createDnsZone(id: string, scope: CommonAzureConstruct, props: DnsZoneProps): DnsZone;
28
+ createDnsZone(id: string, scope: CommonAzureConstruct, props: DnsZoneProps): import("@pulumi/azure-native/dns/zone.js").Zone;
33
29
  /**
34
30
  * @summary Method to create a new DNS A Record
35
31
  * @param id scoped id of the resource
36
32
  * @param scope scope in which this resource is defined
37
33
  * @param props dns a record properties
38
- * @see [CDKTF DNS A Record Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsARecord.typescript.md}
34
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
39
35
  */
40
- createDnsARecord(id: string, scope: CommonAzureConstruct, props: DnsARecordProps): DnsARecord;
36
+ createDnsARecord(id: string, scope: CommonAzureConstruct, props: DnsARecordProps): import("@pulumi/azure-native/dns/recordSet.js").RecordSet;
41
37
  /**
42
38
  * @summary Method to create a new DNS CNAME Record
43
39
  * @param id scoped id of the resource
44
40
  * @param scope scope in which this resource is defined
45
41
  * @param props dns cname record properties
46
- * @see [CDKTF DNS CNAME Record Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsCnameRecord.typescript.md}
42
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
47
43
  */
48
- createDnsCnameRecord(id: string, scope: CommonAzureConstruct, props: DnsCnameRecordProps): DnsCnameRecord;
44
+ createDnsCnameRecord(id: string, scope: CommonAzureConstruct, props: DnsCnameRecordProps): import("@pulumi/azure-native/dns/recordSet.js").RecordSet;
49
45
  /**
50
46
  * @summary Method to create a new DNS TXT Record
51
47
  * @param id scoped id of the resource
52
48
  * @param scope scope in which this resource is defined
53
49
  * @param props dns txt record properties
54
- * @see [CDKTF DNS TXT Record Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsCnameRecord.typescript.md}
50
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
55
51
  */
56
- createDnsTxtRecord(id: string, scope: CommonAzureConstruct, props: DnsTxtRecordProps): DnsTxtRecord;
52
+ createDnsTxtRecord(id: string, scope: CommonAzureConstruct, props: DnsTxtRecordProps): import("@pulumi/azure-native/dns/recordSet.js").RecordSet;
57
53
  }
@@ -1,22 +1,17 @@
1
- import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js';
2
- import { DnsARecord } from '@cdktf/provider-azurerm/lib/dns-a-record/index.js';
3
- import { DnsCnameRecord } from '@cdktf/provider-azurerm/lib/dns-cname-record/index.js';
4
- import { DnsTxtRecord } from '@cdktf/provider-azurerm/lib/dns-txt-record/index.js';
5
- import { DnsZone } from '@cdktf/provider-azurerm/lib/dns-zone/index.js';
6
- import { createAzureTfOutput } from '../../utils/index.js';
1
+ import { RecordSet, Zone } from '@pulumi/azure-native/dns/index.js';
7
2
  /**
8
- * @classdesc Provides operations on Azure DNS
3
+ * @classdesc Provides operations on Azure DNS using Pulumi
9
4
  * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
10
5
  * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
11
6
  * @example
12
- * ```
7
+ * ```typescript
13
8
  * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
14
9
  *
15
10
  * class CustomConstruct extends CommonAzureConstruct {
16
- * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
17
- * super(parent, id, props)
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
18
13
  * this.props = props
19
- * this.dnsManager.createAppService('MyDnsZone', this, props)
14
+ * this.dnsManager.createDnsZone('MyDnsZone', this, props)
20
15
  * }
21
16
  * }
22
17
  * ```
@@ -27,95 +22,82 @@ export class AzureDnsManager {
27
22
  * @param id scoped id of the resource
28
23
  * @param scope scope in which this resource is defined
29
24
  * @param props dns zone properties
30
- * @see [CDKTF DNS Zone Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsZone.typescript.md}
25
+ * @see [Pulumi Azure Native DNS Zone]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/zone/}
31
26
  */
32
27
  createDnsZone(id, scope, props) {
33
28
  if (!props)
34
29
  throw `Props undefined for ${id}`;
35
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-dz-rg`, {
36
- name: scope.props.resourceGroupName
37
- ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
38
- : `${props.resourceGroupName}`,
39
- });
40
- if (!resourceGroup)
41
- throw `Resource group undefined for ${id}`;
42
- const dnsZone = new DnsZone(scope, `${id}-dz`, {
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 Zone(`${id}-dz`, {
43
37
  ...props,
44
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.dnsZone),
45
- resourceGroupName: resourceGroup.name,
38
+ zoneName: scope.resourceNameFormatter.format(props.zoneName?.toString(), scope.props.resourceNameOptions?.dnsZone),
39
+ resourceGroupName: resourceGroupName,
40
+ location: 'global', // DNS zones are always global
46
41
  tags: props.tags ?? {
47
42
  environment: scope.props.stage,
48
43
  },
49
- });
50
- createAzureTfOutput(`${id}-dnsZoneName`, scope, dnsZone.name);
51
- createAzureTfOutput(`${id}-dnsZoneFriendlyUniqueId`, scope, dnsZone.friendlyUniqueId);
52
- createAzureTfOutput(`${id}-dnsZoneId`, scope, dnsZone.id);
53
- return dnsZone;
44
+ }, { parent: scope });
54
45
  }
55
46
  /**
56
47
  * @summary Method to create a new DNS A Record
57
48
  * @param id scoped id of the resource
58
49
  * @param scope scope in which this resource is defined
59
50
  * @param props dns a record properties
60
- * @see [CDKTF DNS A Record Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsARecord.typescript.md}
51
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
61
52
  */
62
53
  createDnsARecord(id, scope, props) {
63
54
  if (!props)
64
55
  throw `Props undefined for ${id}`;
65
- const dnsARecord = new DnsARecord(scope, `${id}-da`, {
56
+ return new RecordSet(`${id}-da`, {
66
57
  ...props,
58
+ recordType: 'A',
67
59
  ttl: props.ttl ?? 300,
68
- tags: props.tags ?? {
60
+ metadata: props.metadata ?? {
69
61
  environment: scope.props.stage,
70
62
  },
71
- });
72
- createAzureTfOutput(`${id}-dnsARecordName`, scope, dnsARecord.name);
73
- createAzureTfOutput(`${id}-dnsARecordFriendlyUniqueId`, scope, dnsARecord.friendlyUniqueId);
74
- createAzureTfOutput(`${id}-dnsARecordId`, scope, dnsARecord.id);
75
- return dnsARecord;
63
+ }, { parent: scope });
76
64
  }
77
65
  /**
78
66
  * @summary Method to create a new DNS CNAME Record
79
67
  * @param id scoped id of the resource
80
68
  * @param scope scope in which this resource is defined
81
69
  * @param props dns cname record properties
82
- * @see [CDKTF DNS CNAME Record Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsCnameRecord.typescript.md}
70
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
83
71
  */
84
72
  createDnsCnameRecord(id, scope, props) {
85
73
  if (!props)
86
74
  throw `Props undefined for ${id}`;
87
- const dnsCnameRecord = new DnsCnameRecord(scope, `${id}-dc`, {
75
+ return new RecordSet(`${id}-dc`, {
88
76
  ...props,
77
+ recordType: 'CNAME',
89
78
  ttl: props.ttl ?? 300,
90
- tags: props.tags ?? {
79
+ metadata: props.metadata ?? {
91
80
  environment: scope.props.stage,
92
81
  },
93
- });
94
- createAzureTfOutput(`${id}-dnsCnameRecordName`, scope, dnsCnameRecord.name);
95
- createAzureTfOutput(`${id}-dnsCnameRecordFriendlyUniqueId`, scope, dnsCnameRecord.friendlyUniqueId);
96
- createAzureTfOutput(`${id}-dnsCnameRecordId`, scope, dnsCnameRecord.id);
97
- return dnsCnameRecord;
82
+ }, { parent: scope });
98
83
  }
99
84
  /**
100
85
  * @summary Method to create a new DNS TXT Record
101
86
  * @param id scoped id of the resource
102
87
  * @param scope scope in which this resource is defined
103
88
  * @param props dns txt record properties
104
- * @see [CDKTF DNS TXT Record Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsCnameRecord.typescript.md}
89
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
105
90
  */
106
91
  createDnsTxtRecord(id, scope, props) {
107
92
  if (!props)
108
93
  throw `Props undefined for ${id}`;
109
- const dnsTxtRecord = new DnsTxtRecord(scope, `${id}-dc`, {
94
+ return new RecordSet(`${id}-dt`, {
110
95
  ...props,
96
+ recordType: 'TXT',
111
97
  ttl: props.ttl ?? 300,
112
- tags: props.tags ?? {
98
+ metadata: props.metadata ?? {
113
99
  environment: scope.props.stage,
114
100
  },
115
- });
116
- createAzureTfOutput(`${id}-dnsTxtRecordName`, scope, dnsTxtRecord.name);
117
- createAzureTfOutput(`${id}-dnsTxtRecordFriendlyUniqueId`, scope, dnsTxtRecord.friendlyUniqueId);
118
- createAzureTfOutput(`${id}-dnsTxtRecordId`, scope, dnsTxtRecord.id);
119
- return dnsTxtRecord;
101
+ }, { parent: scope });
120
102
  }
121
103
  }
@@ -1,12 +1,9 @@
1
- import { DnsZoneConfig } from '@cdktf/provider-azurerm/lib/dns-zone/index.js';
2
- import { DnsARecordConfig } from '@cdktf/provider-azurerm/lib/dns-a-record/index.js';
3
- import { DnsCnameRecordConfig } from '@cdktf/provider-azurerm/lib/dns-cname-record/index.js';
4
- import { DnsTxtRecordConfig } from '@cdktf/provider-azurerm/lib/dns-txt-record/index.js';
5
- export interface DnsZoneProps extends DnsZoneConfig {
1
+ import { RecordSetArgs, ZoneArgs } from '@pulumi/azure-native/dns/index.js';
2
+ export interface DnsZoneProps extends ZoneArgs {
6
3
  }
7
- export interface DnsARecordProps extends DnsARecordConfig {
4
+ export interface DnsARecordProps extends RecordSetArgs {
8
5
  }
9
- export interface DnsCnameRecordProps extends DnsCnameRecordConfig {
6
+ export interface DnsCnameRecordProps extends RecordSetArgs {
10
7
  }
11
- export interface DnsTxtRecordProps extends DnsTxtRecordConfig {
8
+ export interface DnsTxtRecordProps extends RecordSetArgs {
12
9
  }
@@ -1,23 +1,20 @@
1
- import { DataAzurermEventgridTopic, DataAzurermEventgridTopicConfig } from '@cdktf/provider-azurerm/lib/data-azurerm-eventgrid-topic/index.js';
2
- import { EventgridEventSubscription } from '@cdktf/provider-azurerm/lib/eventgrid-event-subscription/index.js';
3
- import { EventgridSystemTopicEventSubscription } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic-event-subscription/index.js';
4
- import { EventgridSystemTopic } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic/index.js';
5
- import { EventgridTopic } from '@cdktf/provider-azurerm/lib/eventgrid-topic/index.js';
1
+ import { GetTopicResult, SystemTopic } from '@pulumi/azure-native/eventgrid/index.js';
2
+ import * as pulumi from '@pulumi/pulumi';
6
3
  import { CommonAzureConstruct } from '../../common/index.js';
7
- import { EventgridEventSubscriptionProps, EventgridSystemTopicEventSubscriptionProps, EventgridSystemTopicProps, EventgridTopicProps } from './types.js';
4
+ import { EventgridEventSubscriptionProps, EventgridSystemTopicEventSubscriptionProps, EventgridSystemTopicProps, EventgridTopicProps, ResolveEventgridTopicProps } from './types.js';
8
5
  /**
9
- * @classdesc Provides operations on Azure Event Grid
6
+ * @classdesc Provides operations on Azure Event Grid using Pulumi
10
7
  * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
11
8
  * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
12
9
  * @example
13
- * ```
10
+ * ```typescript
14
11
  * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
15
12
  *
16
13
  * class CustomConstruct extends CommonAzureConstruct {
17
- * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
18
- * super(parent, id, props)
14
+ * constructor(name: string, props: CommonAzureStackProps) {
15
+ * super(name, props)
19
16
  * this.props = props
20
- * this.EventGridManager.createEventGrid('MyEventGrid', this, props)
17
+ * this.EventGridManager.createEventgridTopic('MyEventGrid', this, props)
21
18
  * }
22
19
  * }
23
20
  * ```
@@ -28,39 +25,40 @@ export declare class AzureEventgridManager {
28
25
  * @param id scoped id of the resource
29
26
  * @param scope scope in which this resource is defined
30
27
  * @param props eventgrid topic properties
31
- * @see [CDKTF Eventgrid Topic Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridTopic.typescript.md}
28
+ * @see [Pulumi Azure Native Event Grid Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
32
29
  */
33
- createEventgridTopic(id: string, scope: CommonAzureConstruct, props: EventgridTopicProps): EventgridTopic;
30
+ createEventgridTopic(id: string, scope: CommonAzureConstruct, props: EventgridTopicProps): import("@pulumi/azure-native/eventgrid/topic.js").Topic;
34
31
  /**
35
32
  * @summary Method to resolve an existing eventgrid topic
36
33
  * @param id scoped id of the resource
37
34
  * @param scope scope in which this resource is defined
38
35
  * @param props eventgrid topic properties
39
- * @see [CDKTF Eventgrid Topic Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridTopic.typescript.md}
36
+ * @see [Pulumi Azure Native Event Grid Topic Lookup]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
40
37
  */
41
- resolveEventgridTopic(id: string, scope: CommonAzureConstruct, props: DataAzurermEventgridTopicConfig): DataAzurermEventgridTopic;
38
+ resolveEventgridTopic(id: string, scope: CommonAzureConstruct, props: ResolveEventgridTopicProps): pulumi.Output<GetTopicResult>;
42
39
  /**
43
40
  * @summary Method to create a new eventgrid subscription
44
41
  * @param id scoped id of the resource
45
42
  * @param scope scope in which this resource is defined
46
- * @param props eventgrid subsription properties
47
- * @see [CDKTF Eventgrid Subscription Container Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridEventSubscription.typescript.md}
43
+ * @param props eventgrid subscription properties
44
+ * @see [Pulumi Azure Native Event Grid Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/eventsubscription/}
48
45
  */
49
- createEventgridSubscription(id: string, scope: CommonAzureConstruct, props: EventgridEventSubscriptionProps): EventgridEventSubscription;
46
+ createEventgridSubscription(id: string, scope: CommonAzureConstruct, props: EventgridEventSubscriptionProps): import("@pulumi/azure-native/eventgrid/eventSubscription.js").EventSubscription;
50
47
  /**
51
48
  * @summary Method to create a new eventgrid system topic
52
49
  * @param id scoped id of the resource
53
50
  * @param scope scope in which this resource is defined
54
51
  * @param props eventgrid system topic properties
55
- * @see [CDKTF Eventgrid System Topic Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridSystemTopic.typescript.md}
52
+ * @see [Pulumi Azure Native Event Grid System Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopic/}
56
53
  */
57
- createEventgridSystemTopic(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicProps): EventgridSystemTopic;
54
+ createEventgridSystemTopic(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicProps): import("@pulumi/azure-native/eventgrid/systemTopic.js").SystemTopic;
58
55
  /**
59
56
  * @summary Method to create a new eventgrid system topic subscription
60
57
  * @param id scoped id of the resource
61
58
  * @param scope scope in which this resource is defined
62
59
  * @param props eventgrid system topic subscription properties
63
- * @see [CDKTF Eventgrid System Topic Subscription Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridSystemTopicEventSubscription.typescript.md}
60
+ * @param systemTopic The system topic to attach this subscription to
61
+ * @see [Pulumi Azure Native Event Grid System Topic Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopiceventsubscription/}
64
62
  */
65
- createEventgridSystemTopicEventSubscription(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicEventSubscriptionProps, systemTopic: EventgridSystemTopic | DataAzurermEventgridTopic): EventgridSystemTopicEventSubscription;
63
+ createEventgridSystemTopicEventSubscription(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicEventSubscriptionProps, systemTopic: SystemTopic | pulumi.Output<GetTopicResult>): import("@pulumi/azure-native/eventgrid/systemTopicEventSubscription.js").SystemTopicEventSubscription;
66
64
  }