@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.
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 +2 -1
  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,19 +1,18 @@
1
- import { ResourceGroup } from '@cdktf/provider-azurerm/lib/resource-group/index.js'
1
+ import { ResourceGroup } from '@pulumi/azure-native/resources/index.js'
2
2
  import { CommonAzureConstruct } from '../../common/index.js'
3
- import { createAzureTfOutput } from '../../utils/index.js'
4
3
  import { ResourceGroupProps } from './types.js'
5
4
 
6
5
  /**
7
- * @classdesc Provides operations on Azure Resource Group
6
+ * @classdesc Provides operations on Azure Resource Group using Pulumi
8
7
  * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
9
8
  * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
10
9
  * @example
11
- * ```
10
+ * ```typescript
12
11
  * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
13
12
  *
14
13
  * class CustomConstruct extends CommonAzureConstruct {
15
- * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
16
- * super(parent, id, props)
14
+ * constructor(name: string, props: CommonAzureStackProps) {
15
+ * super(name, props)
17
16
  * this.props = props
18
17
  * this.resourceGroupManager.createResourceGroup('MyResourceGroup', this, props)
19
18
  * }
@@ -26,24 +25,25 @@ export class AzureResourceGroupManager {
26
25
  * @param id scoped id of the resource
27
26
  * @param scope scope in which this resource is defined
28
27
  * @param props resource group properties
29
- * @see [CDKTF Resource Group Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/resourceGroup.typescript.md}
28
+ * @see [Pulumi Azure Native Resource Group]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/resources/resourcegroup/}
30
29
  */
31
30
  public createResourceGroup(id: string, scope: CommonAzureConstruct, props: ResourceGroupProps) {
32
31
  if (!props) throw `Props undefined for ${id}`
33
32
 
34
- const resourceGroup = new ResourceGroup(scope, `${id}-rg`, {
35
- ...props,
36
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.resourceGroup),
37
- location: props.location,
38
- tags: props.tags ?? {
39
- environment: scope.props.stage,
33
+ return new ResourceGroup(
34
+ `${id}-rg`,
35
+ {
36
+ ...props,
37
+ resourceGroupName: scope.resourceNameFormatter.format(
38
+ props.resourceGroupName?.toString(),
39
+ scope.props.resourceNameOptions?.resourceGroup
40
+ ),
41
+ location: props.location,
42
+ tags: props.tags ?? {
43
+ environment: scope.props.stage,
44
+ },
40
45
  },
41
- })
42
-
43
- createAzureTfOutput(`${id}-resourceGroupName`, scope, resourceGroup.name)
44
- createAzureTfOutput(`${id}-resourceGroupFriendlyUniqueId`, scope, resourceGroup.friendlyUniqueId)
45
- createAzureTfOutput(`${id}-resourceGroupId`, scope, resourceGroup.id)
46
-
47
- return resourceGroup
46
+ { parent: scope }
47
+ )
48
48
  }
49
49
  }
@@ -1,3 +1,3 @@
1
- import { ResourceGroupConfig } from '@cdktf/provider-azurerm/lib/resource-group/index.js'
1
+ import { ResourceGroupArgs } from '@pulumi/azure-native/resources/index.js'
2
2
 
3
- export interface ResourceGroupProps extends ResourceGroupConfig {}
3
+ export interface ResourceGroupProps extends ResourceGroupArgs {}
@@ -1,13 +1,15 @@
1
- import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js'
2
- import { DataAzurermServicebusQueue } from '@cdktf/provider-azurerm/lib/data-azurerm-servicebus-queue/index.js'
3
- import { ServicebusNamespace } from '@cdktf/provider-azurerm/lib/servicebus-namespace/index.js'
4
- import { ServicebusQueue } from '@cdktf/provider-azurerm/lib/servicebus-queue/index.js'
5
- import { ServicebusSubscription } from '@cdktf/provider-azurerm/lib/servicebus-subscription/index.js'
6
- import { ServicebusTopic } from '@cdktf/provider-azurerm/lib/servicebus-topic/index.js'
1
+ import {
2
+ getQueueOutput,
3
+ ManagedServiceIdentityType,
4
+ Namespace,
5
+ Queue,
6
+ SkuName,
7
+ Subscription,
8
+ Topic,
9
+ } from '@pulumi/azure-native/servicebus/index.js'
7
10
  import { CommonAzureConstruct } from '../../common/index.js'
8
- import { createAzureTfOutput } from '../../utils/index.js'
9
11
  import {
10
- DataAzurermServicebusQueueProps,
12
+ ResolveServicebusQueueProps,
11
13
  ServicebusNamespaceProps,
12
14
  ServicebusQueueProps,
13
15
  ServicebusSubscriptionProps,
@@ -15,16 +17,16 @@ import {
15
17
  } from './types.js'
16
18
 
17
19
  /**
18
- * @classdesc Provides operations on Azure Servicebus
20
+ * @classdesc Provides operations on Azure Servicebus using Pulumi
19
21
  * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
20
22
  * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
21
23
  * @example
22
- * ```
24
+ * ```typescript
23
25
  * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
24
26
  *
25
27
  * class CustomConstruct extends CommonAzureConstruct {
26
- * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
27
- * super(parent, id, props)
28
+ * constructor(name: string, props: CommonAzureStackProps) {
29
+ * super(name, props)
28
30
  * this.props = props
29
31
  * this.ServicebusManager.createServicebusTopic('MyServicebusTopic', this, props)
30
32
  * }
@@ -37,38 +39,40 @@ export class AzureServicebusManager {
37
39
  * @param id scoped id of the resource
38
40
  * @param scope scope in which this resource is defined
39
41
  * @param props servicebus namespace properties
40
- * @see [CDKTF Servicebus Namespace Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusNamespace.typescript.md}
42
+ * @see [Pulumi Azure Native Service Bus Namespace]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/servicebus/namespace/}
41
43
  */
42
44
  public createServicebusNamespace(id: string, scope: CommonAzureConstruct, props: ServicebusNamespaceProps) {
43
45
  if (!props) throw `Props undefined for ${id}`
44
46
 
45
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-sn-rg`, {
46
- name: scope.props.resourceGroupName
47
- ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
48
- : `${props.resourceGroupName}`,
49
- })
50
-
51
- if (!resourceGroup) throw `Resource group undefined for ${id}`
52
-
53
- const servicebusNamespace = new ServicebusNamespace(scope, `${id}-sn`, {
54
- ...props,
55
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.serviceBusNamespace),
56
- resourceGroupName: resourceGroup.name,
57
- location: resourceGroup.location,
58
- identity: {
59
- type: props.identity?.type ?? 'SystemAssigned',
60
- },
61
- sku: props.sku ?? 'Standard',
62
- tags: props.tags ?? {
63
- environment: scope.props.stage,
47
+ // Get resource group name
48
+ const resourceGroupName = scope.props.resourceGroupName
49
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
50
+ : props.resourceGroupName
51
+
52
+ if (!resourceGroupName) throw `Resource group name undefined for ${id}`
53
+
54
+ return new Namespace(
55
+ `${id}-sn`,
56
+ {
57
+ ...props,
58
+ namespaceName: scope.resourceNameFormatter.format(
59
+ props.namespaceName?.toString(),
60
+ scope.props.resourceNameOptions?.serviceBusNamespace
61
+ ),
62
+ resourceGroupName: resourceGroupName,
63
+ location: props.location ?? scope.props.location,
64
+ identity: props.identity ?? {
65
+ type: ManagedServiceIdentityType.SystemAssigned,
66
+ },
67
+ sku: props.sku ?? {
68
+ name: SkuName.Standard,
69
+ },
70
+ tags: props.tags ?? {
71
+ environment: scope.props.stage,
72
+ },
64
73
  },
65
- })
66
-
67
- createAzureTfOutput(`${id}-servicebusNamespaceName`, scope, servicebusNamespace.name)
68
- createAzureTfOutput(`${id}-servicebusNamespaceFriendlyUniqueId`, scope, servicebusNamespace.friendlyUniqueId)
69
- createAzureTfOutput(`${id}-servicebusNamespaceId`, scope, servicebusNamespace.id)
70
-
71
- return servicebusNamespace
74
+ { parent: scope }
75
+ )
72
76
  }
73
77
 
74
78
  /**
@@ -76,22 +80,24 @@ export class AzureServicebusManager {
76
80
  * @param id scoped id of the resource
77
81
  * @param scope scope in which this resource is defined
78
82
  * @param props servicebus topic properties
79
- * @see [CDKTF Servicebus Topic Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusTopic.typescript.md}
83
+ * @see [Pulumi Azure Native Service Bus Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/servicebus/topic/}
80
84
  */
81
85
  public createServicebusTopic(id: string, scope: CommonAzureConstruct, props: ServicebusTopicProps) {
82
86
  if (!props) throw `Props undefined for ${id}`
83
87
 
84
- const servicebusTopic = new ServicebusTopic(scope, `${id}-st`, {
85
- ...props,
86
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.serviceBusTopic),
87
- namespaceId: props.namespaceId,
88
- })
89
-
90
- createAzureTfOutput(`${id}-servicebusTopicName`, scope, servicebusTopic.name)
91
- createAzureTfOutput(`${id}-servicebusTopicFriendlyUniqueId`, scope, servicebusTopic.friendlyUniqueId)
92
- createAzureTfOutput(`${id}-servicebusTopicId`, scope, servicebusTopic.id)
93
-
94
- return servicebusTopic
88
+ return new Topic(
89
+ `${id}-st`,
90
+ {
91
+ ...props,
92
+ topicName: scope.resourceNameFormatter.format(
93
+ props.topicName?.toString(),
94
+ scope.props.resourceNameOptions?.serviceBusTopic
95
+ ),
96
+ namespaceName: props.namespaceName,
97
+ resourceGroupName: props.resourceGroupName,
98
+ },
99
+ { parent: scope }
100
+ )
95
101
  }
96
102
 
97
103
  /**
@@ -99,26 +105,28 @@ export class AzureServicebusManager {
99
105
  * @param id scoped id of the resource
100
106
  * @param scope scope in which this resource is defined
101
107
  * @param props servicebus queue properties
102
- * @see [CDKTF Servicebus Queue Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusQueue.typescript.md}
108
+ * @see [Pulumi Azure Native Service Bus Queue]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/servicebus/queue/}
103
109
  */
104
110
  public createServicebusQueue(id: string, scope: CommonAzureConstruct, props: ServicebusQueueProps) {
105
111
  if (!props) throw `Props undefined for ${id}`
106
112
 
107
- const servicebusQueue = new ServicebusQueue(scope, `${id}-sq`, {
108
- ...props,
109
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.serviceBusQueue),
110
- namespaceId: props.namespaceId,
111
- duplicateDetectionHistoryTimeWindow: props.duplicateDetectionHistoryTimeWindow ?? 'PT1M',
112
- requiresDuplicateDetection: props.requiresDuplicateDetection ?? true,
113
- deadLetteringOnMessageExpiration: props.deadLetteringOnMessageExpiration ?? true,
114
- defaultMessageTtl: props.defaultMessageTtl ?? 'P2D',
115
- })
116
-
117
- createAzureTfOutput(`${id}-servicebusQueueName`, scope, servicebusQueue.name)
118
- createAzureTfOutput(`${id}-servicebusQueueFriendlyUniqueId`, scope, servicebusQueue.friendlyUniqueId)
119
- createAzureTfOutput(`${id}-servicebusQueueId`, scope, servicebusQueue.id)
120
-
121
- return servicebusQueue
113
+ return new Queue(
114
+ `${id}-sq`,
115
+ {
116
+ ...props,
117
+ queueName: scope.resourceNameFormatter.format(
118
+ props.queueName?.toString(),
119
+ scope.props.resourceNameOptions?.serviceBusQueue
120
+ ),
121
+ namespaceName: props.namespaceName,
122
+ resourceGroupName: props.resourceGroupName,
123
+ duplicateDetectionHistoryTimeWindow: props.duplicateDetectionHistoryTimeWindow ?? 'PT1M',
124
+ requiresDuplicateDetection: props.requiresDuplicateDetection ?? true,
125
+ deadLetteringOnMessageExpiration: props.deadLetteringOnMessageExpiration ?? true,
126
+ defaultMessageTimeToLive: (props as any).defaultMessageTtl ?? 'P2D',
127
+ },
128
+ { parent: scope }
129
+ )
122
130
  }
123
131
 
124
132
  /**
@@ -126,44 +134,45 @@ export class AzureServicebusManager {
126
134
  * @param id scoped id of the resource
127
135
  * @param scope scope in which this resource is defined
128
136
  * @param props servicebus subscription properties
129
- * @see [CDKTF Servicebus Subscription Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusSubscription.typescript.md}
137
+ * @see [Pulumi Azure Native Service Bus Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/servicebus/subscription/}
130
138
  */
131
139
  public createServicebusSubscription(id: string, scope: CommonAzureConstruct, props: ServicebusSubscriptionProps) {
132
140
  if (!props) throw `Props undefined for ${id}`
133
141
 
134
- const servicebusSubscription = new ServicebusSubscription(scope, `${id}-ss`, {
135
- ...props,
136
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.serviceBusSubscription),
137
- maxDeliveryCount: props.maxDeliveryCount ?? 1,
138
- })
139
-
140
- createAzureTfOutput(`${id}-servicebusSubscriptionName`, scope, servicebusSubscription.name)
141
- createAzureTfOutput(`${id}-servicebusSubscriptionFriendlyUniqueId`, scope, servicebusSubscription.friendlyUniqueId)
142
- createAzureTfOutput(`${id}-servicebusSubscriptionId`, scope, servicebusSubscription.id)
143
-
144
- return servicebusSubscription
142
+ return new Subscription(
143
+ `${id}-ss`,
144
+ {
145
+ ...props,
146
+ subscriptionName: scope.resourceNameFormatter.format(
147
+ props.subscriptionName?.toString(),
148
+ scope.props.resourceNameOptions?.serviceBusSubscription
149
+ ),
150
+ maxDeliveryCount: props.maxDeliveryCount ?? 1,
151
+ },
152
+ { parent: scope }
153
+ )
145
154
  }
146
155
 
147
156
  /**
148
- * @summary Method to resolve a new servicebus queue
157
+ * @summary Method to resolve an existing servicebus queue
149
158
  * @param id scoped id of the resource
150
159
  * @param scope scope in which this resource is defined
151
- * @param props servicebus queue properties
152
- * @see [CDKTF Servicebus Queue Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/servicebusQueue.typescript.md}
160
+ * @param props servicebus queue properties for lookup
161
+ * @see [Pulumi Azure Native Service Bus Queue Lookup]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/servicebus/queue/}
153
162
  */
154
- public resolveServicebusQueue(id: string, scope: CommonAzureConstruct, props: DataAzurermServicebusQueueProps) {
163
+ public resolveServicebusQueue(id: string, scope: CommonAzureConstruct, props: ResolveServicebusQueueProps) {
155
164
  if (!props) throw `Props undefined for ${id}`
156
165
 
157
- const servicebusQueue = new DataAzurermServicebusQueue(scope, `${id}-sq`, {
158
- ...props,
159
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.serviceBusQueue),
160
- namespaceId: props.namespaceId,
161
- })
162
-
163
- createAzureTfOutput(`${id}-servicebusQueueName`, scope, servicebusQueue.name)
164
- createAzureTfOutput(`${id}-servicebusQueueFriendlyUniqueId`, scope, servicebusQueue.friendlyUniqueId)
165
- createAzureTfOutput(`${id}-servicebusQueueId`, scope, servicebusQueue.id)
166
-
167
- return servicebusQueue
166
+ return getQueueOutput(
167
+ {
168
+ queueName: scope.resourceNameFormatter.format(
169
+ props.queueName?.toString(),
170
+ scope.props.resourceNameOptions?.serviceBusQueue
171
+ ),
172
+ namespaceName: props.namespaceName,
173
+ resourceGroupName: props.resourceGroupName,
174
+ },
175
+ { parent: scope }
176
+ )
168
177
  }
169
178
  }
@@ -1,11 +1,17 @@
1
- import { ServicebusNamespaceConfig } from '@cdktf/provider-azurerm/lib/servicebus-namespace/index.js'
2
- import { ServicebusTopicConfig } from '@cdktf/provider-azurerm/lib/servicebus-topic/index.js'
3
- import { ServicebusQueueConfig } from '@cdktf/provider-azurerm/lib/servicebus-queue/index.js'
4
- import { ServicebusSubscriptionConfig } from '@cdktf/provider-azurerm/lib/servicebus-subscription/index.js'
5
- import { DataAzurermServicebusQueueConfig } from '@cdktf/provider-azurerm/lib/data-azurerm-servicebus-queue/index.js'
6
-
7
- export interface ServicebusNamespaceProps extends ServicebusNamespaceConfig {}
8
- export interface ServicebusTopicProps extends ServicebusTopicConfig {}
9
- export interface ServicebusQueueProps extends ServicebusQueueConfig {}
10
- export interface ServicebusSubscriptionProps extends ServicebusSubscriptionConfig {}
11
- export interface DataAzurermServicebusQueueProps extends DataAzurermServicebusQueueConfig {}
1
+ import {
2
+ GetQueueOutputArgs,
3
+ NamespaceArgs,
4
+ QueueArgs,
5
+ SubscriptionArgs,
6
+ TopicArgs,
7
+ } from '@pulumi/azure-native/servicebus/index.js'
8
+
9
+ export interface ServicebusNamespaceProps extends NamespaceArgs {}
10
+
11
+ export interface ServicebusTopicProps extends TopicArgs {}
12
+
13
+ export interface ServicebusQueueProps extends QueueArgs {}
14
+
15
+ export interface ServicebusSubscriptionProps extends SubscriptionArgs {}
16
+
17
+ export interface ResolveServicebusQueueProps extends GetQueueOutputArgs {}