@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,23 +1,17 @@
1
- import { DataAzurermEventgridTopic, } from '@cdktf/provider-azurerm/lib/data-azurerm-eventgrid-topic/index.js';
2
- import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js';
3
- import { EventgridEventSubscription } from '@cdktf/provider-azurerm/lib/eventgrid-event-subscription/index.js';
4
- import { EventgridSystemTopicEventSubscription } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic-event-subscription/index.js';
5
- import { EventgridSystemTopic } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic/index.js';
6
- import { EventgridTopic } from '@cdktf/provider-azurerm/lib/eventgrid-topic/index.js';
7
- import { createAzureTfOutput } from '../../utils/index.js';
1
+ import { EventDeliverySchema, EventSubscription, getTopicOutput, SystemTopic, SystemTopicEventSubscription, Topic, } from '@pulumi/azure-native/eventgrid/index.js';
8
2
  /**
9
- * @classdesc Provides operations on Azure Event Grid
3
+ * @classdesc Provides operations on Azure Event Grid using Pulumi
10
4
  * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
11
5
  * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
12
6
  * @example
13
- * ```
7
+ * ```typescript
14
8
  * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
15
9
  *
16
10
  * class CustomConstruct extends CommonAzureConstruct {
17
- * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
18
- * super(parent, id, props)
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
19
13
  * this.props = props
20
- * this.EventGridManager.createEventGrid('MyEventGrid', this, props)
14
+ * this.EventGridManager.createEventgridTopic('MyEventGrid', this, props)
21
15
  * }
22
16
  * }
23
17
  * ```
@@ -28,138 +22,116 @@ export class AzureEventgridManager {
28
22
  * @param id scoped id of the resource
29
23
  * @param scope scope in which this resource is defined
30
24
  * @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}
25
+ * @see [Pulumi Azure Native Event Grid Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
32
26
  */
33
27
  createEventgridTopic(id, scope, props) {
34
28
  if (!props)
35
29
  throw `Props undefined for ${id}`;
36
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-et-rg`, {
37
- name: scope.props.resourceGroupName
38
- ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
39
- : `${props.resourceGroupName}`,
40
- });
41
- if (!resourceGroup)
42
- throw `Resource group undefined for ${id}`;
43
- const eventgridTopic = new EventgridTopic(scope, `${id}-et`, {
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 Topic(`${id}-et`, {
44
37
  ...props,
45
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventGridTopic),
46
- location: resourceGroup.location,
47
- resourceGroupName: resourceGroup.name,
38
+ topicName: scope.resourceNameFormatter.format(props.topicName?.toString(), scope.props.resourceNameOptions?.eventGridTopic),
39
+ location: props.location ?? scope.props.location,
40
+ resourceGroupName: resourceGroupName,
48
41
  tags: props.tags ?? {
49
42
  environment: scope.props.stage,
50
43
  },
51
- });
52
- createAzureTfOutput(`${id}-eventgridTopicName`, scope, eventgridTopic.name);
53
- createAzureTfOutput(`${id}-eventgridTopicFriendlyUniqueId`, scope, eventgridTopic.friendlyUniqueId);
54
- createAzureTfOutput(`${id}-eventgridTopicId`, scope, eventgridTopic.id);
55
- createAzureTfOutput(`${id}-eventgridTopicEndpoint`, scope, eventgridTopic.endpoint);
56
- return eventgridTopic;
44
+ }, { parent: scope });
57
45
  }
58
46
  /**
59
47
  * @summary Method to resolve an existing eventgrid topic
60
48
  * @param id scoped id of the resource
61
49
  * @param scope scope in which this resource is defined
62
50
  * @param props eventgrid topic properties
63
- * @see [CDKTF Eventgrid Topic Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridTopic.typescript.md}
51
+ * @see [Pulumi Azure Native Event Grid Topic Lookup]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
64
52
  */
65
53
  resolveEventgridTopic(id, scope, props) {
66
54
  if (!props)
67
55
  throw `Props undefined for ${id}`;
68
- const eventgridTopic = new DataAzurermEventgridTopic(scope, `${id}-et`, {
69
- ...props,
70
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventGridTopic),
56
+ return getTopicOutput({
57
+ topicName: scope.resourceNameFormatter.format(props.topicName?.toString(), scope.props.resourceNameOptions?.eventGridTopic),
71
58
  resourceGroupName: scope.props.resourceGroupName
72
59
  ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
73
- : `${props.resourceGroupName}`,
74
- });
75
- createAzureTfOutput(`${id}-eventgridTopicName`, scope, eventgridTopic.name);
76
- createAzureTfOutput(`${id}-eventgridTopicFriendlyUniqueId`, scope, eventgridTopic.friendlyUniqueId);
77
- createAzureTfOutput(`${id}-eventgridTopicId`, scope, eventgridTopic.id);
78
- createAzureTfOutput(`${id}-eventgridTopicEndpoint`, scope, eventgridTopic.endpoint);
79
- return eventgridTopic;
60
+ : props.resourceGroupName,
61
+ }, { parent: scope });
80
62
  }
81
63
  /**
82
64
  * @summary Method to create a new eventgrid subscription
83
65
  * @param id scoped id of the resource
84
66
  * @param scope scope in which this resource is defined
85
- * @param props eventgrid subsription properties
86
- * @see [CDKTF Eventgrid Subscription Container Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridEventSubscription.typescript.md}
67
+ * @param props eventgrid subscription properties
68
+ * @see [Pulumi Azure Native Event Grid Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/eventsubscription/}
87
69
  */
88
70
  createEventgridSubscription(id, scope, props) {
89
71
  if (!props)
90
72
  throw `Props undefined for ${id}`;
91
- const eventgridSubscription = new EventgridEventSubscription(scope, `${id}-es`, {
73
+ return new EventSubscription(`${id}-es`, {
92
74
  ...props,
93
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventGridEventSubscription),
94
- eventDeliverySchema: props.eventDeliverySchema ?? 'CloudEventSchemaV1_0',
95
- advancedFilteringOnArraysEnabled: props.advancedFilteringOnArraysEnabled ?? true,
96
- retryPolicy: {
97
- eventTimeToLive: props.retryPolicy?.eventTimeToLive ?? 1440,
98
- maxDeliveryAttempts: props.retryPolicy?.maxDeliveryAttempts ?? 7,
75
+ eventSubscriptionName: scope.resourceNameFormatter.format(props.eventSubscriptionName?.toString(), scope.props.resourceNameOptions?.eventGridEventSubscription),
76
+ eventDeliverySchema: props.eventDeliverySchema ?? EventDeliverySchema.CloudEventSchemaV1_0,
77
+ retryPolicy: props.retryPolicy ?? {
78
+ eventTimeToLiveInMinutes: 1440,
79
+ maxDeliveryAttempts: 7,
99
80
  },
100
- });
101
- createAzureTfOutput(`${id}-eventgridSubscriptiontName`, scope, eventgridSubscription.name);
102
- createAzureTfOutput(`${id}-eventgridSubscriptionFriendlyUniqueId`, scope, eventgridSubscription.friendlyUniqueId);
103
- createAzureTfOutput(`${id}-eventgridSubscriptionId`, scope, eventgridSubscription.id);
104
- return eventgridSubscription;
81
+ }, { parent: scope });
105
82
  }
106
83
  /**
107
84
  * @summary Method to create a new eventgrid system topic
108
85
  * @param id scoped id of the resource
109
86
  * @param scope scope in which this resource is defined
110
87
  * @param props eventgrid system topic properties
111
- * @see [CDKTF Eventgrid System Topic Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridSystemTopic.typescript.md}
88
+ * @see [Pulumi Azure Native Event Grid System Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopic/}
112
89
  */
113
90
  createEventgridSystemTopic(id, scope, props) {
114
91
  if (!props)
115
92
  throw `Props undefined for ${id}`;
116
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-est-rg`, {
117
- name: scope.props.resourceGroupName
118
- ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
119
- : `${props.resourceGroupName}`,
120
- });
121
- if (!resourceGroup)
122
- throw `Resource group undefined for ${id}`;
123
- const eventgridSystemTopic = new EventgridSystemTopic(scope, `${id}-est`, {
93
+ // Get resource group name
94
+ const resourceGroupName = scope.props.resourceGroupName
95
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
96
+ : props.resourceGroupName;
97
+ if (!resourceGroupName)
98
+ throw `Resource group name undefined for ${id}`;
99
+ return new SystemTopic(`${id}-est`, {
124
100
  ...props,
125
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventGridSystemTopic),
126
- location: resourceGroup.location,
127
- resourceGroupName: resourceGroup.name,
101
+ systemTopicName: scope.resourceNameFormatter.format(props.systemTopicName?.toString(), scope.props.resourceNameOptions?.eventGridSystemTopic),
102
+ location: props.location ?? scope.props.location,
103
+ resourceGroupName: resourceGroupName,
128
104
  tags: props.tags ?? {
129
105
  environment: scope.props.stage,
130
106
  },
131
- });
132
- createAzureTfOutput(`${id}-eventgridSystemTopicName`, scope, eventgridSystemTopic.name);
133
- createAzureTfOutput(`${id}-eventgridSystemTopicFriendlyUniqueId`, scope, eventgridSystemTopic.friendlyUniqueId);
134
- createAzureTfOutput(`${id}-eventgridSystemTopicId`, scope, eventgridSystemTopic.id);
135
- return eventgridSystemTopic;
107
+ }, { parent: scope });
136
108
  }
137
109
  /**
138
110
  * @summary Method to create a new eventgrid system topic subscription
139
111
  * @param id scoped id of the resource
140
112
  * @param scope scope in which this resource is defined
141
113
  * @param props eventgrid system topic subscription properties
142
- * @see [CDKTF Eventgrid System Topic Subscription Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridSystemTopicEventSubscription.typescript.md}
114
+ * @param systemTopic The system topic to attach this subscription to
115
+ * @see [Pulumi Azure Native Event Grid System Topic Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopiceventsubscription/}
143
116
  */
144
117
  createEventgridSystemTopicEventSubscription(id, scope, props, systemTopic) {
145
118
  if (!props)
146
119
  throw `Props undefined for ${id}`;
147
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-ests-rg`, {
148
- name: scope.props.resourceGroupName
149
- ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
150
- : `${props.resourceGroupName}`,
151
- });
152
- if (!resourceGroup)
153
- throw `Resource group undefined for ${id}`;
154
- const eventgridSystemTopicSubscription = new EventgridSystemTopicEventSubscription(scope, `${id}-ests`, {
120
+ // Get resource group name
121
+ const resourceGroupName = scope.props.resourceGroupName
122
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
123
+ : props.resourceGroupName;
124
+ if (!resourceGroupName)
125
+ throw `Resource group name undefined for ${id}`;
126
+ // Extract system topic name
127
+ const systemTopicName = systemTopic instanceof SystemTopic
128
+ ? systemTopic.name
129
+ : systemTopic.apply(t => t.name);
130
+ return new SystemTopicEventSubscription(`${id}-ests`, {
155
131
  ...props,
156
- name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventGridSystemTopicEventSubscription),
157
- systemTopic: systemTopic.name,
158
- resourceGroupName: resourceGroup.name,
159
- });
160
- createAzureTfOutput(`${id}-eventgridSystemTopicEventSubscriptionName`, scope, eventgridSystemTopicSubscription.name);
161
- createAzureTfOutput(`${id}-eventgridSystemTopicEventSubscriptionFriendlyUniqueId`, scope, eventgridSystemTopicSubscription.friendlyUniqueId);
162
- createAzureTfOutput(`${id}-eventgridSystemTopicEventSubscriptionId`, scope, eventgridSystemTopicSubscription.id);
163
- return eventgridSystemTopicSubscription;
132
+ eventSubscriptionName: scope.resourceNameFormatter.format(props.eventSubscriptionName?.toString(), scope.props.resourceNameOptions?.eventGridSystemTopicEventSubscription),
133
+ systemTopicName: systemTopicName,
134
+ resourceGroupName: resourceGroupName,
135
+ }, { parent: scope });
164
136
  }
165
137
  }
@@ -1,12 +1,11 @@
1
- import { EventgridEventSubscriptionConfig } from '@cdktf/provider-azurerm/lib/eventgrid-event-subscription/index.js';
2
- import { EventgridSystemTopicEventSubscriptionConfig } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic-event-subscription/index.js';
3
- import { EventgridSystemTopicConfig } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic/index.js';
4
- import { EventgridTopicConfig } from '@cdktf/provider-azurerm/lib/eventgrid-topic/index.js';
5
- export interface EventgridTopicProps extends EventgridTopicConfig {
1
+ import { EventSubscriptionArgs, GetTopicOutputArgs, SystemTopicArgs, SystemTopicEventSubscriptionArgs, TopicArgs } from '@pulumi/azure-native/eventgrid/index.js';
2
+ export interface EventgridTopicProps extends TopicArgs {
6
3
  }
7
- export interface EventgridEventSubscriptionProps extends EventgridEventSubscriptionConfig {
4
+ export interface EventgridEventSubscriptionProps extends EventSubscriptionArgs {
8
5
  }
9
- export interface EventgridSystemTopicProps extends EventgridSystemTopicConfig {
6
+ export interface EventgridSystemTopicProps extends SystemTopicArgs {
10
7
  }
11
- export interface EventgridSystemTopicEventSubscriptionProps extends EventgridSystemTopicEventSubscriptionConfig {
8
+ export interface EventgridSystemTopicEventSubscriptionProps extends SystemTopicEventSubscriptionArgs {
9
+ }
10
+ export interface ResolveEventgridTopicProps extends GetTopicOutputArgs {
12
11
  }
@@ -1,20 +1,17 @@
1
- import { FunctionAppFlexConsumption } from '@cdktf/provider-azurerm/lib/function-app-flex-consumption/index.js';
2
- import { FunctionAppFunction } from '@cdktf/provider-azurerm/lib/function-app-function/index.js';
3
- import { LinuxFunctionApp } from '@cdktf/provider-azurerm/lib/linux-function-app/index.js';
4
1
  import { CommonAzureConstruct } from '../../common/index.js';
5
2
  import { FunctionAppFlexConsumptionProps, FunctionAppProps, FunctionProps } from './types.js';
6
3
  /**
7
- * @classdesc Provides operations on Azure Functions
4
+ * @classdesc Provides operations on Azure Functions using Pulumi
8
5
  * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
9
6
  * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
10
7
  * @example
11
- * ```
8
+ * ```typescript
12
9
  * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
13
10
  *
14
11
  * class CustomConstruct extends CommonAzureConstruct {
15
- * constructor(parent: Construct, id: string, props: CommonAzureStackProps) {
16
- * super(parent, id, props)
17
- * this.props: props
12
+ * constructor(name: string, props: CommonAzureStackProps) {
13
+ * super(name, props)
14
+ * this.props = props
18
15
  * this.functionManager.createFunctionApp('MyFunctionApp', this, props)
19
16
  * }
20
17
  * }
@@ -22,26 +19,29 @@ import { FunctionAppFlexConsumptionProps, FunctionAppProps, FunctionProps } from
22
19
  */
23
20
  export declare class AzureFunctionManager {
24
21
  /**
25
- * @summary Method to create a new function app
22
+ * @summary Method to create a new Linux function app
26
23
  * @param id scoped id of the resource
27
24
  * @param scope scope in which this resource is defined
28
25
  * @param props function app properties
29
- * @see [CDKTF Function App Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/functionApp.typescript.md}
26
+ * @see [Pulumi Azure Native Function App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
30
27
  */
31
- createFunctionApp(id: string, scope: CommonAzureConstruct, props: FunctionAppProps): LinuxFunctionApp;
28
+ createFunctionApp(id: string, scope: CommonAzureConstruct, props: FunctionAppProps): import("@pulumi/azure-native/web/webApp.js").WebApp;
32
29
  /**
33
- * @summary Method to create a new function
30
+ * @summary Method to create a new function within a function app
34
31
  * @param id scoped id of the resource
35
32
  * @param scope scope in which this resource is defined
36
33
  * @param props function properties
37
- * @see [CDKTF Function Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/functionAppFunction.typescript.md}
34
+ * @see [Pulumi Azure Native Function Envelope]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webappfunction/}
35
+ * @note In Pulumi, individual functions are typically deployed via code deployment rather than as separate infrastructure resources.
36
+ * This method is provided for API compatibility but may require additional setup.
38
37
  */
39
- createFunction(id: string, scope: CommonAzureConstruct, props: FunctionProps): FunctionAppFunction;
38
+ createFunction(id: string, scope: CommonAzureConstruct, props: FunctionProps): import("@pulumi/azure-native/web/webAppFunction.js").WebAppFunction;
40
39
  /**
41
40
  * @summary Method to create a new flex consumption function app
42
41
  * @param id scoped id of the resource
43
42
  * @param scope scope in which this resource is defined
44
43
  * @param props flex consumption function app properties
44
+ * @see [Pulumi Azure Native Function App (Flex Consumption)]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
45
45
  */
46
- createFunctionAppFlexConsumption(id: string, scope: CommonAzureConstruct, props: FunctionAppFlexConsumptionProps): FunctionAppFlexConsumption;
46
+ createFunctionAppFlexConsumption(id: string, scope: CommonAzureConstruct, props: FunctionAppFlexConsumptionProps): import("@pulumi/azure-native/web/webApp.js").WebApp;
47
47
  }
@@ -1,20 +1,16 @@
1
- import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js';
2
- import { FunctionAppFlexConsumption } from '@cdktf/provider-azurerm/lib/function-app-flex-consumption/index.js';
3
- import { FunctionAppFunction } from '@cdktf/provider-azurerm/lib/function-app-function/index.js';
4
- import { LinuxFunctionApp } from '@cdktf/provider-azurerm/lib/linux-function-app/index.js';
5
- import { createAzureTfOutput } from '../../utils/index.js';
1
+ import { ManagedServiceIdentityType, WebApp, WebAppFunction } from '@pulumi/azure-native/web/index.js';
6
2
  /**
7
- * @classdesc Provides operations on Azure Functions
3
+ * @classdesc Provides operations on Azure Functions 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)
17
- * this.props: props
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
13
+ * this.props = props
18
14
  * this.functionManager.createFunctionApp('MyFunctionApp', this, props)
19
15
  * }
20
16
  * }
@@ -22,93 +18,92 @@ import { createAzureTfOutput } from '../../utils/index.js';
22
18
  */
23
19
  export class AzureFunctionManager {
24
20
  /**
25
- * @summary Method to create a new function app
21
+ * @summary Method to create a new Linux function app
26
22
  * @param id scoped id of the resource
27
23
  * @param scope scope in which this resource is defined
28
24
  * @param props function app properties
29
- * @see [CDKTF Function App Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/functionApp.typescript.md}
25
+ * @see [Pulumi Azure Native Function App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
30
26
  */
31
27
  createFunctionApp(id, scope, props) {
32
28
  if (!props)
33
29
  throw `Props undefined for ${id}`;
34
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-fa-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 functionApp = new LinuxFunctionApp(scope, `${id}-fa`, {
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 WebApp(`${id}-fa`, {
42
37
  ...props,
43
38
  name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.linuxFunctionApp),
44
- resourceGroupName: resourceGroup.name,
39
+ resourceGroupName: resourceGroupName,
40
+ location: props.location ?? scope.props.location,
41
+ kind: props.kind ?? 'functionapp,linux',
42
+ identity: props.identity ?? {
43
+ type: ManagedServiceIdentityType.SystemAssigned,
44
+ },
45
45
  tags: props.tags ?? {
46
46
  environment: scope.props.stage,
47
47
  },
48
- });
49
- createAzureTfOutput(`${id}-functionAppName`, scope, functionApp.name);
50
- createAzureTfOutput(`${id}-functionAppFriendlyUniqueId`, scope, functionApp.friendlyUniqueId);
51
- createAzureTfOutput(`${id}-functionAppId`, scope, functionApp.id);
52
- return functionApp;
48
+ }, { parent: scope });
53
49
  }
54
50
  /**
55
- * @summary Method to create a new function
51
+ * @summary Method to create a new function within a function app
56
52
  * @param id scoped id of the resource
57
53
  * @param scope scope in which this resource is defined
58
54
  * @param props function properties
59
- * @see [CDKTF Function Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/functionAppFunction.typescript.md}
55
+ * @see [Pulumi Azure Native Function Envelope]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webappfunction/}
56
+ * @note In Pulumi, individual functions are typically deployed via code deployment rather than as separate infrastructure resources.
57
+ * This method is provided for API compatibility but may require additional setup.
60
58
  */
61
59
  createFunction(id, scope, props) {
62
60
  if (!props)
63
61
  throw `Props undefined for ${id}`;
64
- const functionAppFunction = new FunctionAppFunction(scope, `${id}-fc`, {
65
- ...props,
62
+ // Get resource group name
63
+ const resourceGroupName = scope.props.resourceGroupName
64
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
65
+ : '';
66
+ return new WebAppFunction(`${id}-fc`, {
66
67
  name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.functionAppFunction),
67
- configJson: JSON.stringify(props.configJson ?? {}),
68
- });
69
- createAzureTfOutput(`${id}-functionName`, scope, functionAppFunction.name);
70
- createAzureTfOutput(`${id}-functionFriendlyUniqueId`, scope, functionAppFunction.friendlyUniqueId);
71
- createAzureTfOutput(`${id}-functionId`, scope, functionAppFunction.id);
72
- return functionAppFunction;
68
+ resourceGroupName: resourceGroupName,
69
+ functionAppId: props.functionAppId,
70
+ config: props.configJson,
71
+ isDisabled: props.enabled !== undefined ? !props.enabled : false,
72
+ testData: props.testData,
73
+ }, { parent: scope });
73
74
  }
74
75
  /**
75
76
  * @summary Method to create a new flex consumption function app
76
77
  * @param id scoped id of the resource
77
78
  * @param scope scope in which this resource is defined
78
79
  * @param props flex consumption function app properties
80
+ * @see [Pulumi Azure Native Function App (Flex Consumption)]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
79
81
  */
80
82
  createFunctionAppFlexConsumption(id, scope, props) {
81
83
  if (!props)
82
84
  throw `Props undefined for ${id}`;
83
- const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-fa-rg`, {
84
- name: scope.props.resourceGroupName
85
- ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
86
- : `${props.resourceGroupName}`,
87
- });
88
- if (!resourceGroup)
89
- throw `Resource group undefined for ${id}`;
90
- const functionApp = new FunctionAppFlexConsumption(scope, `${id}-fc`, {
85
+ // Get resource group name
86
+ const resourceGroupName = scope.props.resourceGroupName
87
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
88
+ : props.resourceGroupName;
89
+ if (!resourceGroupName)
90
+ throw `Resource group name undefined for ${id}`;
91
+ return new WebApp(`${id}-fc`, {
91
92
  ...props,
92
93
  name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.functionApp),
93
- location: resourceGroup.location,
94
- resourceGroupName: resourceGroup.name,
95
- runtimeName: props.runtimeName ?? 'node',
96
- runtimeVersion: props.runtimeVersion ?? '22',
97
- storageAuthenticationType: props.storageAuthenticationType ?? 'StorageAccountConnectionString',
98
- storageContainerType: props.storageContainerType ?? 'blobContainer',
99
- maximumInstanceCount: props.maximumInstanceCount ?? 40,
100
- instanceMemoryInMb: props.instanceMemoryInMb ?? 2048,
101
- siteConfig: {
102
- http2Enabled: props.siteConfig.http2Enabled ?? true,
103
- ...props.siteConfig,
104
- },
94
+ location: props.location ?? scope.props.location,
95
+ resourceGroupName: resourceGroupName,
96
+ kind: props.kind ?? 'functionapp,linux',
105
97
  identity: props.identity ?? {
106
- type: 'SystemAssigned',
98
+ type: ManagedServiceIdentityType.SystemAssigned,
99
+ },
100
+ siteConfig: props.siteConfig ?? {
101
+ http20Enabled: true,
102
+ linuxFxVersion: `${props.runtimeName ?? 'node'}|${props.runtimeVersion ?? '22'}`,
107
103
  },
108
104
  tags: props.tags ?? {
109
105
  environment: scope.props.stage,
110
106
  },
111
- });
112
- return functionApp;
107
+ }, { parent: scope });
113
108
  }
114
109
  }
@@ -1,9 +1,21 @@
1
- import { LinuxFunctionAppConfig } from '@cdktf/provider-azurerm/lib/linux-function-app/index.js';
2
- import { FunctionAppFunctionConfig } from '@cdktf/provider-azurerm/lib/function-app-function/index.js';
3
- import { FunctionAppFlexConsumptionConfig } from '@cdktf/provider-azurerm/lib/function-app-flex-consumption/index.js';
4
- export interface FunctionAppProps extends LinuxFunctionAppConfig {
1
+ import { WebAppArgs } from '@pulumi/azure-native/web/index.js';
2
+ export interface FunctionAppProps extends WebAppArgs {
3
+ name?: string;
5
4
  }
6
- export interface FunctionProps extends FunctionAppFunctionConfig {
5
+ export interface FunctionProps {
6
+ name: string;
7
+ functionAppId: string;
8
+ language?: string;
9
+ configJson?: any;
10
+ testData?: string;
11
+ enabled?: boolean;
7
12
  }
8
- export interface FunctionAppFlexConsumptionProps extends FunctionAppFlexConsumptionConfig {
13
+ export interface FunctionAppFlexConsumptionProps extends WebAppArgs {
14
+ name?: string;
15
+ runtimeName?: string;
16
+ runtimeVersion?: string;
17
+ storageAuthenticationType?: string;
18
+ storageContainerType?: string;
19
+ maximumInstanceCount?: number;
20
+ instanceMemoryInMb?: number;
9
21
  }
@@ -7,7 +7,7 @@ export * from './dns/index.js';
7
7
  export * from './eventgrid/index.js';
8
8
  export * from './function/index.js';
9
9
  export * from './key-vault/index.js';
10
- export * from './log-analytics-workspace/index.js';
10
+ export * from './operational-insights/index.js';
11
11
  export * from './monitor/index.js';
12
12
  export * from './redis/index.js';
13
13
  export * from './resource-group/index.js';
@@ -7,7 +7,7 @@ export * from './dns/index.js';
7
7
  export * from './eventgrid/index.js';
8
8
  export * from './function/index.js';
9
9
  export * from './key-vault/index.js';
10
- export * from './log-analytics-workspace/index.js';
10
+ export * from './operational-insights/index.js';
11
11
  export * from './monitor/index.js';
12
12
  export * from './redis/index.js';
13
13
  export * from './resource-group/index.js';
@@ -1,17 +1,16 @@
1
- import { KeyVault } from '@cdktf/provider-azurerm/lib/key-vault/index.js';
2
1
  import { CommonAzureConstruct } from '../../common/index.js';
3
2
  import { KeyVaultProps } from './types.js';
4
3
  /**
5
- * @classdesc Provides operations on Azure Key Vault
4
+ * @classdesc Provides operations on Azure Key Vault 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.keyVaultManager.createKeyVault('MyKeyVault', this, props)
17
16
  * }
@@ -24,7 +23,7 @@ export declare class AzureKeyVaultManager {
24
23
  * @param id scoped id of the resource
25
24
  * @param scope scope in which this resource is defined
26
25
  * @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}
26
+ * @see [Pulumi Azure Native Key Vault]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/keyvault/vault/}
28
27
  */
29
- createKeyVault(id: string, scope: CommonAzureConstruct, props: KeyVaultProps): KeyVault;
28
+ createKeyVault(id: string, scope: CommonAzureConstruct, props: KeyVaultProps): import("@pulumi/azure-native/keyvault/vault.js").Vault;
30
29
  }