@gradientedge/cdk-utils-azure 1.0.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 (176) hide show
  1. package/LICENSE +21 -0
  2. package/dist/src/common/constants.d.ts +83 -0
  3. package/dist/src/common/constants.js +87 -0
  4. package/dist/src/common/construct.d.ts +80 -0
  5. package/dist/src/common/construct.js +128 -0
  6. package/dist/src/common/index.d.ts +6 -0
  7. package/dist/src/common/index.js +6 -0
  8. package/dist/src/common/resource-name-formatter.d.ts +18 -0
  9. package/dist/src/common/resource-name-formatter.js +34 -0
  10. package/dist/src/common/stack.d.ts +46 -0
  11. package/dist/src/common/stack.js +120 -0
  12. package/dist/src/common/tagging.d.ts +29 -0
  13. package/dist/src/common/tagging.js +78 -0
  14. package/dist/src/common/types.d.ts +57 -0
  15. package/dist/src/common/types.js +1 -0
  16. package/dist/src/construct/event-handler/index.d.ts +2 -0
  17. package/dist/src/construct/event-handler/index.js +2 -0
  18. package/dist/src/construct/event-handler/main.d.ts +61 -0
  19. package/dist/src/construct/event-handler/main.js +180 -0
  20. package/dist/src/construct/event-handler/types.d.ts +35 -0
  21. package/dist/src/construct/event-handler/types.js +1 -0
  22. package/dist/src/construct/function-app/index.d.ts +2 -0
  23. package/dist/src/construct/function-app/index.js +2 -0
  24. package/dist/src/construct/function-app/main.d.ts +128 -0
  25. package/dist/src/construct/function-app/main.js +374 -0
  26. package/dist/src/construct/function-app/types.d.ts +33 -0
  27. package/dist/src/construct/function-app/types.js +1 -0
  28. package/dist/src/construct/index.d.ts +6 -0
  29. package/dist/src/construct/index.js +6 -0
  30. package/dist/src/construct/rest-api/index.d.ts +2 -0
  31. package/dist/src/construct/rest-api/index.js +2 -0
  32. package/dist/src/construct/rest-api/main.d.ts +64 -0
  33. package/dist/src/construct/rest-api/main.js +216 -0
  34. package/dist/src/construct/rest-api/types.d.ts +25 -0
  35. package/dist/src/construct/rest-api/types.js +1 -0
  36. package/dist/src/construct/rest-api-function/index.d.ts +2 -0
  37. package/dist/src/construct/rest-api-function/index.js +2 -0
  38. package/dist/src/construct/rest-api-function/main.d.ts +66 -0
  39. package/dist/src/construct/rest-api-function/main.js +302 -0
  40. package/dist/src/construct/rest-api-function/types.d.ts +29 -0
  41. package/dist/src/construct/rest-api-function/types.js +1 -0
  42. package/dist/src/construct/rest-api-with-cache/index.d.ts +2 -0
  43. package/dist/src/construct/rest-api-with-cache/index.js +2 -0
  44. package/dist/src/construct/rest-api-with-cache/main.d.ts +41 -0
  45. package/dist/src/construct/rest-api-with-cache/main.js +85 -0
  46. package/dist/src/construct/rest-api-with-cache/types.d.ts +13 -0
  47. package/dist/src/construct/rest-api-with-cache/types.js +1 -0
  48. package/dist/src/construct/site-with-webapp/index.d.ts +2 -0
  49. package/dist/src/construct/site-with-webapp/index.js +2 -0
  50. package/dist/src/construct/site-with-webapp/main.d.ts +60 -0
  51. package/dist/src/construct/site-with-webapp/main.js +176 -0
  52. package/dist/src/construct/site-with-webapp/types.d.ts +30 -0
  53. package/dist/src/construct/site-with-webapp/types.js +1 -0
  54. package/dist/src/index.d.ts +4 -0
  55. package/dist/src/index.js +4 -0
  56. package/dist/src/services/api-management/index.d.ts +2 -0
  57. package/dist/src/services/api-management/index.js +2 -0
  58. package/dist/src/services/api-management/main.d.ts +143 -0
  59. package/dist/src/services/api-management/main.js +244 -0
  60. package/dist/src/services/api-management/types.d.ts +72 -0
  61. package/dist/src/services/api-management/types.js +1 -0
  62. package/dist/src/services/app-configuration/index.d.ts +2 -0
  63. package/dist/src/services/app-configuration/index.js +2 -0
  64. package/dist/src/services/app-configuration/main.d.ts +41 -0
  65. package/dist/src/services/app-configuration/main.js +71 -0
  66. package/dist/src/services/app-configuration/types.d.ts +3 -0
  67. package/dist/src/services/app-configuration/types.js +1 -0
  68. package/dist/src/services/app-service/index.d.ts +2 -0
  69. package/dist/src/services/app-service/index.js +2 -0
  70. package/dist/src/services/app-service/main.d.ts +40 -0
  71. package/dist/src/services/app-service/main.js +90 -0
  72. package/dist/src/services/app-service/types.d.ts +6 -0
  73. package/dist/src/services/app-service/types.js +1 -0
  74. package/dist/src/services/application-insights/index.d.ts +2 -0
  75. package/dist/src/services/application-insights/index.js +2 -0
  76. package/dist/src/services/application-insights/main.d.ts +40 -0
  77. package/dist/src/services/application-insights/main.js +68 -0
  78. package/dist/src/services/application-insights/types.d.ts +6 -0
  79. package/dist/src/services/application-insights/types.js +1 -0
  80. package/dist/src/services/authorisation/constants.d.ts +13 -0
  81. package/dist/src/services/authorisation/constants.js +14 -0
  82. package/dist/src/services/authorisation/index.d.ts +3 -0
  83. package/dist/src/services/authorisation/index.js +3 -0
  84. package/dist/src/services/authorisation/main.d.ts +84 -0
  85. package/dist/src/services/authorisation/main.js +120 -0
  86. package/dist/src/services/authorisation/types.d.ts +3 -0
  87. package/dist/src/services/authorisation/types.js +1 -0
  88. package/dist/src/services/cosmosdb/constants.d.ts +8 -0
  89. package/dist/src/services/cosmosdb/constants.js +10 -0
  90. package/dist/src/services/cosmosdb/index.d.ts +3 -0
  91. package/dist/src/services/cosmosdb/index.js +3 -0
  92. package/dist/src/services/cosmosdb/main.d.ts +87 -0
  93. package/dist/src/services/cosmosdb/main.js +162 -0
  94. package/dist/src/services/cosmosdb/types.d.ts +9 -0
  95. package/dist/src/services/cosmosdb/types.js +1 -0
  96. package/dist/src/services/dns/index.d.ts +2 -0
  97. package/dist/src/services/dns/index.js +2 -0
  98. package/dist/src/services/dns/main.d.ts +58 -0
  99. package/dist/src/services/dns/main.js +107 -0
  100. package/dist/src/services/dns/types.d.ts +9 -0
  101. package/dist/src/services/dns/types.js +1 -0
  102. package/dist/src/services/eventgrid/index.d.ts +2 -0
  103. package/dist/src/services/eventgrid/index.js +2 -0
  104. package/dist/src/services/eventgrid/main.d.ts +69 -0
  105. package/dist/src/services/eventgrid/main.js +136 -0
  106. package/dist/src/services/eventgrid/types.d.ts +11 -0
  107. package/dist/src/services/eventgrid/types.js +1 -0
  108. package/dist/src/services/function/index.d.ts +2 -0
  109. package/dist/src/services/function/index.js +2 -0
  110. package/dist/src/services/function/main.d.ts +60 -0
  111. package/dist/src/services/function/main.js +223 -0
  112. package/dist/src/services/function/types.d.ts +20 -0
  113. package/dist/src/services/function/types.js +1 -0
  114. package/dist/src/services/index.d.ts +18 -0
  115. package/dist/src/services/index.js +18 -0
  116. package/dist/src/services/key-vault/index.d.ts +2 -0
  117. package/dist/src/services/key-vault/index.js +2 -0
  118. package/dist/src/services/key-vault/main.d.ts +49 -0
  119. package/dist/src/services/key-vault/main.js +83 -0
  120. package/dist/src/services/key-vault/types.d.ts +5 -0
  121. package/dist/src/services/key-vault/types.js +1 -0
  122. package/dist/src/services/monitor/index.d.ts +2 -0
  123. package/dist/src/services/monitor/index.js +2 -0
  124. package/dist/src/services/monitor/main.d.ts +31 -0
  125. package/dist/src/services/monitor/main.js +36 -0
  126. package/dist/src/services/monitor/types.d.ts +3 -0
  127. package/dist/src/services/monitor/types.js +1 -0
  128. package/dist/src/services/operational-insights/index.d.ts +2 -0
  129. package/dist/src/services/operational-insights/index.js +2 -0
  130. package/dist/src/services/operational-insights/main.d.ts +40 -0
  131. package/dist/src/services/operational-insights/main.js +64 -0
  132. package/dist/src/services/operational-insights/types.d.ts +5 -0
  133. package/dist/src/services/operational-insights/types.js +1 -0
  134. package/dist/src/services/portal/error.d.ts +5 -0
  135. package/dist/src/services/portal/error.js +10 -0
  136. package/dist/src/services/portal/index.d.ts +4 -0
  137. package/dist/src/services/portal/index.js +4 -0
  138. package/dist/src/services/portal/main.d.ts +33 -0
  139. package/dist/src/services/portal/main.js +51 -0
  140. package/dist/src/services/portal/renderer.d.ts +11 -0
  141. package/dist/src/services/portal/renderer.js +156 -0
  142. package/dist/src/services/portal/types.d.ts +40 -0
  143. package/dist/src/services/portal/types.js +1 -0
  144. package/dist/src/services/redis/index.d.ts +2 -0
  145. package/dist/src/services/redis/index.js +2 -0
  146. package/dist/src/services/redis/main.d.ts +31 -0
  147. package/dist/src/services/redis/main.js +52 -0
  148. package/dist/src/services/redis/types.d.ts +3 -0
  149. package/dist/src/services/redis/types.js +1 -0
  150. package/dist/src/services/resource-group/index.d.ts +2 -0
  151. package/dist/src/services/resource-group/index.js +2 -0
  152. package/dist/src/services/resource-group/main.d.ts +38 -0
  153. package/dist/src/services/resource-group/main.js +53 -0
  154. package/dist/src/services/resource-group/types.d.ts +3 -0
  155. package/dist/src/services/resource-group/types.js +1 -0
  156. package/dist/src/services/security-center/index.d.ts +2 -0
  157. package/dist/src/services/security-center/index.js +2 -0
  158. package/dist/src/services/security-center/main.d.ts +31 -0
  159. package/dist/src/services/security-center/main.js +33 -0
  160. package/dist/src/services/security-center/types.d.ts +3 -0
  161. package/dist/src/services/security-center/types.js +1 -0
  162. package/dist/src/services/servicebus/index.d.ts +2 -0
  163. package/dist/src/services/servicebus/index.js +2 -0
  164. package/dist/src/services/servicebus/main.d.ts +67 -0
  165. package/dist/src/services/servicebus/main.js +127 -0
  166. package/dist/src/services/servicebus/types.d.ts +11 -0
  167. package/dist/src/services/servicebus/types.js +1 -0
  168. package/dist/src/services/storage/index.d.ts +2 -0
  169. package/dist/src/services/storage/index.js +2 -0
  170. package/dist/src/services/storage/main.d.ts +88 -0
  171. package/dist/src/services/storage/main.js +173 -0
  172. package/dist/src/services/storage/types.d.ts +20 -0
  173. package/dist/src/services/storage/types.js +1 -0
  174. package/dist/src/types/index.d.ts +4 -0
  175. package/dist/src/types/index.js +1 -0
  176. package/package.json +41 -0
@@ -0,0 +1,58 @@
1
+ import { ResourceOptions } from '@pulumi/pulumi';
2
+ import { CommonAzureConstruct } from '../../common/index.js';
3
+ import { DnsARecordProps, DnsCnameRecordProps, DnsTxtRecordProps, DnsZoneProps } from './types.js';
4
+ /**
5
+ * @classdesc Provides operations on Azure DNS using Pulumi
6
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
7
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
8
+ * @example
9
+ * ```typescript
10
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
11
+ *
12
+ * class CustomConstruct extends CommonAzureConstruct {
13
+ * constructor(name: string, props: CommonAzureStackProps) {
14
+ * super(name, props)
15
+ * this.props = props
16
+ * this.dnsManager.createDnsZone('MyDnsZone', this, props)
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ export declare class AzureDnsManager {
22
+ /**
23
+ * @summary Method to create a new DNS Zone
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props dns zone properties
27
+ * @param resourceOptions Optional settings to control resource behaviour
28
+ * @see [Pulumi Azure Native DNS Zone]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/zone/}
29
+ */
30
+ createDnsZone(id: string, scope: CommonAzureConstruct, props: DnsZoneProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/dns/zone.js").Zone;
31
+ /**
32
+ * @summary Method to create a new DNS A Record
33
+ * @param id scoped id of the resource
34
+ * @param scope scope in which this resource is defined
35
+ * @param props dns a record properties
36
+ * @param resourceOptions Optional settings to control resource behaviour
37
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
38
+ */
39
+ createDnsARecord(id: string, scope: CommonAzureConstruct, props: DnsARecordProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/dns/recordSet.js").RecordSet;
40
+ /**
41
+ * @summary Method to create a new DNS CNAME Record
42
+ * @param id scoped id of the resource
43
+ * @param scope scope in which this resource is defined
44
+ * @param props dns cname record properties
45
+ * @param resourceOptions Optional settings to control resource behaviour
46
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
47
+ */
48
+ createDnsCnameRecord(id: string, scope: CommonAzureConstruct, props: DnsCnameRecordProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/dns/recordSet.js").RecordSet;
49
+ /**
50
+ * @summary Method to create a new DNS TXT Record
51
+ * @param id scoped id of the resource
52
+ * @param scope scope in which this resource is defined
53
+ * @param props dns txt record properties
54
+ * @param resourceOptions Optional settings to control resource behaviour
55
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
56
+ */
57
+ createDnsTxtRecord(id: string, scope: CommonAzureConstruct, props: DnsTxtRecordProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/dns/recordSet.js").RecordSet;
58
+ }
@@ -0,0 +1,107 @@
1
+ import { RecordSet, Zone } from '@pulumi/azure-native/dns/index.js';
2
+ /**
3
+ * @classdesc Provides operations on Azure DNS using Pulumi
4
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
5
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
6
+ * @example
7
+ * ```typescript
8
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
9
+ *
10
+ * class CustomConstruct extends CommonAzureConstruct {
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
13
+ * this.props = props
14
+ * this.dnsManager.createDnsZone('MyDnsZone', this, props)
15
+ * }
16
+ * }
17
+ * ```
18
+ */
19
+ export class AzureDnsManager {
20
+ /**
21
+ * @summary Method to create a new DNS Zone
22
+ * @param id scoped id of the resource
23
+ * @param scope scope in which this resource is defined
24
+ * @param props dns zone properties
25
+ * @param resourceOptions Optional settings to control resource behaviour
26
+ * @see [Pulumi Azure Native DNS Zone]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/zone/}
27
+ */
28
+ createDnsZone(id, scope, props, resourceOptions) {
29
+ if (!props)
30
+ throw `Props undefined for ${id}`;
31
+ // Get resource group name
32
+ const resourceGroupName = scope.props.resourceGroupName
33
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
34
+ : props.resourceGroupName;
35
+ if (!resourceGroupName)
36
+ throw `Resource group name undefined for ${id}`;
37
+ return new Zone(`${id}-dz`, {
38
+ ...props,
39
+ zoneName: scope.resourceNameFormatter.format(props.zoneName?.toString(), scope.props.resourceNameOptions?.dnsZone),
40
+ resourceGroupName: resourceGroupName,
41
+ location: 'global', // DNS zones are always global
42
+ tags: props.tags ?? {
43
+ environment: scope.props.stage,
44
+ },
45
+ }, { parent: scope, ...resourceOptions });
46
+ }
47
+ /**
48
+ * @summary Method to create a new DNS A Record
49
+ * @param id scoped id of the resource
50
+ * @param scope scope in which this resource is defined
51
+ * @param props dns a record properties
52
+ * @param resourceOptions Optional settings to control resource behaviour
53
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
54
+ */
55
+ createDnsARecord(id, scope, props, resourceOptions) {
56
+ if (!props)
57
+ throw `Props undefined for ${id}`;
58
+ return new RecordSet(`${id}-da`, {
59
+ ...props,
60
+ recordType: 'A',
61
+ ttl: props.ttl ?? 300,
62
+ metadata: props.metadata ?? {
63
+ environment: scope.props.stage,
64
+ },
65
+ }, { parent: scope, ...resourceOptions });
66
+ }
67
+ /**
68
+ * @summary Method to create a new DNS CNAME Record
69
+ * @param id scoped id of the resource
70
+ * @param scope scope in which this resource is defined
71
+ * @param props dns cname record properties
72
+ * @param resourceOptions Optional settings to control resource behaviour
73
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
74
+ */
75
+ createDnsCnameRecord(id, scope, props, resourceOptions) {
76
+ if (!props)
77
+ throw `Props undefined for ${id}`;
78
+ return new RecordSet(`${id}-dc`, {
79
+ ...props,
80
+ recordType: 'CNAME',
81
+ ttl: props.ttl ?? 300,
82
+ metadata: props.metadata ?? {
83
+ environment: scope.props.stage,
84
+ },
85
+ }, { parent: scope, ...resourceOptions });
86
+ }
87
+ /**
88
+ * @summary Method to create a new DNS TXT Record
89
+ * @param id scoped id of the resource
90
+ * @param scope scope in which this resource is defined
91
+ * @param props dns txt record properties
92
+ * @param resourceOptions Optional settings to control resource behaviour
93
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
94
+ */
95
+ createDnsTxtRecord(id, scope, props, resourceOptions) {
96
+ if (!props)
97
+ throw `Props undefined for ${id}`;
98
+ return new RecordSet(`${id}-dt`, {
99
+ ...props,
100
+ recordType: 'TXT',
101
+ ttl: props.ttl ?? 300,
102
+ metadata: props.metadata ?? {
103
+ environment: scope.props.stage,
104
+ },
105
+ }, { parent: scope, ...resourceOptions });
106
+ }
107
+ }
@@ -0,0 +1,9 @@
1
+ import { RecordSetArgs, ZoneArgs } from '@pulumi/azure-native/dns/index.js';
2
+ export interface DnsZoneProps extends ZoneArgs {
3
+ }
4
+ export interface DnsARecordProps extends RecordSetArgs {
5
+ }
6
+ export interface DnsCnameRecordProps extends RecordSetArgs {
7
+ }
8
+ export interface DnsTxtRecordProps extends RecordSetArgs {
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './main.js';
2
+ export * from './types.js';
@@ -0,0 +1,2 @@
1
+ export * from './main.js';
2
+ export * from './types.js';
@@ -0,0 +1,69 @@
1
+ import { GetSystemTopicResult, SystemTopic } from '@pulumi/azure-native/eventgrid/index.js';
2
+ import { Output, ResourceOptions } from '@pulumi/pulumi';
3
+ import { CommonAzureConstruct } from '../../common/index.js';
4
+ import { EventgridEventSubscriptionProps, EventgridSystemTopicEventSubscriptionProps, EventgridSystemTopicProps, EventgridTopicProps, ResolveEventgridTopicProps } from './types.js';
5
+ /**
6
+ * @classdesc Provides operations on Azure Event Grid using Pulumi
7
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
8
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
9
+ * @example
10
+ * ```typescript
11
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
12
+ *
13
+ * class CustomConstruct extends CommonAzureConstruct {
14
+ * constructor(name: string, props: CommonAzureStackProps) {
15
+ * super(name, props)
16
+ * this.props = props
17
+ * this.EventGridManager.createEventgridTopic('MyEventGrid', this, props)
18
+ * }
19
+ * }
20
+ * ```
21
+ */
22
+ export declare class AzureEventgridManager {
23
+ /**
24
+ * @summary Method to create a new eventgrid topic
25
+ * @param id scoped id of the resource
26
+ * @param scope scope in which this resource is defined
27
+ * @param props eventgrid topic properties
28
+ * @param resourceOptions Optional settings to control resource behaviour
29
+ * @see [Pulumi Azure Native Event Grid Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
30
+ */
31
+ createEventgridTopic(id: string, scope: CommonAzureConstruct, props: EventgridTopicProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/eventgrid/topic.js").Topic;
32
+ /**
33
+ * @summary Method to resolve an existing eventgrid topic
34
+ * @param id scoped id of the resource
35
+ * @param scope scope in which this resource is defined
36
+ * @param props eventgrid topic properties
37
+ * @param resourceOptions Optional settings to control resource behaviour
38
+ * @see [Pulumi Azure Native Event Grid Topic Lookup]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
39
+ */
40
+ resolveEventgridTopic(id: string, scope: CommonAzureConstruct, props: ResolveEventgridTopicProps, resourceOptions?: ResourceOptions): Output<import("@pulumi/azure-native/eventgrid/getTopic.js").GetTopicResult>;
41
+ /**
42
+ * @summary Method to create a new eventgrid subscription
43
+ * @param id scoped id of the resource
44
+ * @param scope scope in which this resource is defined
45
+ * @param props eventgrid subscription properties
46
+ * @param resourceOptions Optional settings to control resource behaviour
47
+ * @see [Pulumi Azure Native Event Grid Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/eventsubscription/}
48
+ */
49
+ createEventgridSubscription(id: string, scope: CommonAzureConstruct, props: EventgridEventSubscriptionProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/eventgrid/eventSubscription.js").EventSubscription;
50
+ /**
51
+ * @summary Method to create a new eventgrid system topic
52
+ * @param id scoped id of the resource
53
+ * @param scope scope in which this resource is defined
54
+ * @param props eventgrid system topic properties
55
+ * @param resourceOptions Optional settings to control resource behaviour
56
+ * @see [Pulumi Azure Native Event Grid System Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopic/}
57
+ */
58
+ createEventgridSystemTopic(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/eventgrid/systemTopic.js").SystemTopic;
59
+ /**
60
+ * @summary Method to create a new eventgrid system topic subscription
61
+ * @param id scoped id of the resource
62
+ * @param scope scope in which this resource is defined
63
+ * @param props eventgrid system topic subscription properties
64
+ * @param systemTopic The system topic to attach this subscription to
65
+ * @param resourceOptions Optional settings to control resource behaviour
66
+ * @see [Pulumi Azure Native Event Grid System Topic Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopiceventsubscription/}
67
+ */
68
+ createEventgridSystemTopicEventSubscription(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicEventSubscriptionProps, systemTopic: SystemTopic | Output<GetSystemTopicResult>, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/eventgrid/systemTopicEventSubscription.js").SystemTopicEventSubscription;
69
+ }
@@ -0,0 +1,136 @@
1
+ import { EventDeliverySchema, EventSubscription, getTopicOutput, SystemTopic, SystemTopicEventSubscription, Topic, } from '@pulumi/azure-native/eventgrid/index.js';
2
+ /**
3
+ * @classdesc Provides operations on Azure Event Grid using Pulumi
4
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
5
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
6
+ * @example
7
+ * ```typescript
8
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
9
+ *
10
+ * class CustomConstruct extends CommonAzureConstruct {
11
+ * constructor(name: string, props: CommonAzureStackProps) {
12
+ * super(name, props)
13
+ * this.props = props
14
+ * this.EventGridManager.createEventgridTopic('MyEventGrid', this, props)
15
+ * }
16
+ * }
17
+ * ```
18
+ */
19
+ export class AzureEventgridManager {
20
+ /**
21
+ * @summary Method to create a new eventgrid topic
22
+ * @param id scoped id of the resource
23
+ * @param scope scope in which this resource is defined
24
+ * @param props eventgrid topic properties
25
+ * @param resourceOptions Optional settings to control resource behaviour
26
+ * @see [Pulumi Azure Native Event Grid Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
27
+ */
28
+ createEventgridTopic(id, scope, props, resourceOptions) {
29
+ if (!props)
30
+ throw `Props undefined for ${id}`;
31
+ // Get resource group name
32
+ const resourceGroupName = scope.props.resourceGroupName
33
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
34
+ : props.resourceGroupName;
35
+ if (!resourceGroupName)
36
+ throw `Resource group name undefined for ${id}`;
37
+ return new Topic(`${id}-et`, {
38
+ ...props,
39
+ topicName: scope.resourceNameFormatter.format(props.topicName?.toString(), scope.props.resourceNameOptions?.eventGridTopic),
40
+ location: props.location ?? scope.props.location,
41
+ resourceGroupName: resourceGroupName,
42
+ tags: props.tags ?? {
43
+ environment: scope.props.stage,
44
+ },
45
+ }, { parent: scope, ...resourceOptions });
46
+ }
47
+ /**
48
+ * @summary Method to resolve an existing eventgrid topic
49
+ * @param id scoped id of the resource
50
+ * @param scope scope in which this resource is defined
51
+ * @param props eventgrid topic properties
52
+ * @param resourceOptions Optional settings to control resource behaviour
53
+ * @see [Pulumi Azure Native Event Grid Topic Lookup]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
54
+ */
55
+ resolveEventgridTopic(id, scope, props, resourceOptions) {
56
+ if (!props)
57
+ throw `Props undefined for ${id}`;
58
+ return getTopicOutput({
59
+ topicName: scope.resourceNameFormatter.format(props.topicName?.toString(), scope.props.resourceNameOptions?.eventGridTopic),
60
+ resourceGroupName: scope.props.resourceGroupName
61
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
62
+ : props.resourceGroupName,
63
+ }, { parent: scope, ...resourceOptions });
64
+ }
65
+ /**
66
+ * @summary Method to create a new eventgrid subscription
67
+ * @param id scoped id of the resource
68
+ * @param scope scope in which this resource is defined
69
+ * @param props eventgrid subscription properties
70
+ * @param resourceOptions Optional settings to control resource behaviour
71
+ * @see [Pulumi Azure Native Event Grid Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/eventsubscription/}
72
+ */
73
+ createEventgridSubscription(id, scope, props, resourceOptions) {
74
+ if (!props)
75
+ throw `Props undefined for ${id}`;
76
+ return new EventSubscription(`${id}-es`, {
77
+ ...props,
78
+ eventSubscriptionName: scope.resourceNameFormatter.format(props.eventSubscriptionName?.toString(), scope.props.resourceNameOptions?.eventGridEventSubscription),
79
+ eventDeliverySchema: props.eventDeliverySchema ?? EventDeliverySchema.CloudEventSchemaV1_0,
80
+ retryPolicy: props.retryPolicy ?? {
81
+ eventTimeToLiveInMinutes: 1440,
82
+ maxDeliveryAttempts: 7,
83
+ },
84
+ }, { parent: scope, ...resourceOptions });
85
+ }
86
+ /**
87
+ * @summary Method to create a new eventgrid system topic
88
+ * @param id scoped id of the resource
89
+ * @param scope scope in which this resource is defined
90
+ * @param props eventgrid system topic properties
91
+ * @param resourceOptions Optional settings to control resource behaviour
92
+ * @see [Pulumi Azure Native Event Grid System Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopic/}
93
+ */
94
+ createEventgridSystemTopic(id, scope, props, resourceOptions) {
95
+ if (!props)
96
+ throw `Props undefined for ${id}`;
97
+ const resourceGroupName = scope.props.resourceGroupName
98
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
99
+ : props.resourceGroupName;
100
+ if (!resourceGroupName)
101
+ throw `Resource group name undefined for ${id}`;
102
+ return new SystemTopic(`${id}-est`, {
103
+ ...props,
104
+ systemTopicName: scope.resourceNameFormatter.format(props.systemTopicName?.toString(), scope.props.resourceNameOptions?.eventGridSystemTopic),
105
+ location: props.location ?? scope.props.location,
106
+ resourceGroupName: resourceGroupName,
107
+ tags: props.tags ?? {
108
+ environment: scope.props.stage,
109
+ },
110
+ }, { parent: scope, ...resourceOptions });
111
+ }
112
+ /**
113
+ * @summary Method to create a new eventgrid system topic subscription
114
+ * @param id scoped id of the resource
115
+ * @param scope scope in which this resource is defined
116
+ * @param props eventgrid system topic subscription properties
117
+ * @param systemTopic The system topic to attach this subscription to
118
+ * @param resourceOptions Optional settings to control resource behaviour
119
+ * @see [Pulumi Azure Native Event Grid System Topic Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopiceventsubscription/}
120
+ */
121
+ createEventgridSystemTopicEventSubscription(id, scope, props, systemTopic, resourceOptions) {
122
+ if (!props)
123
+ throw `Props undefined for ${id}`;
124
+ let resourceGroupName = scope.props.resourceGroupName
125
+ ? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
126
+ : props.resourceGroupName;
127
+ if (!resourceGroupName)
128
+ throw `Resource group name undefined for ${id}`;
129
+ return new SystemTopicEventSubscription(`${id}-ests`, {
130
+ ...props,
131
+ eventSubscriptionName: scope.resourceNameFormatter.format(props.eventSubscriptionName?.toString(), scope.props.resourceNameOptions?.eventGridSystemTopicEventSubscription),
132
+ systemTopicName: systemTopic.name,
133
+ resourceGroupName: props.resourceGroupName ?? resourceGroupName,
134
+ }, { parent: scope, ...resourceOptions });
135
+ }
136
+ }
@@ -0,0 +1,11 @@
1
+ import { EventSubscriptionArgs, GetTopicOutputArgs, SystemTopicArgs, SystemTopicEventSubscriptionArgs, TopicArgs } from '@pulumi/azure-native/eventgrid/index.js';
2
+ export interface EventgridTopicProps extends TopicArgs {
3
+ }
4
+ export interface EventgridEventSubscriptionProps extends EventSubscriptionArgs {
5
+ }
6
+ export interface EventgridSystemTopicProps extends SystemTopicArgs {
7
+ }
8
+ export interface EventgridSystemTopicEventSubscriptionProps extends SystemTopicEventSubscriptionArgs {
9
+ }
10
+ export interface ResolveEventgridTopicProps extends GetTopicOutputArgs {
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './main.js';
2
+ export * from './types.js';
@@ -0,0 +1,2 @@
1
+ export * from './main.js';
2
+ export * from './types.js';
@@ -0,0 +1,60 @@
1
+ import { ResourceOptions } from '@pulumi/pulumi';
2
+ import { CommonAzureConstruct } from '../../common/index.js';
3
+ import { FunctionAppFlexConsumptionProps, FunctionAppProps, FunctionProps } from './types.js';
4
+ /**
5
+ * @classdesc Provides operations on Azure Functions using Pulumi
6
+ * - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
7
+ * - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
8
+ * @example
9
+ * ```typescript
10
+ * import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
11
+ *
12
+ * class CustomConstruct extends CommonAzureConstruct {
13
+ * constructor(name: string, props: CommonAzureStackProps) {
14
+ * super(name, props)
15
+ * this.props = props
16
+ * this.functionManager.createFunctionApp('MyFunctionApp', this, props)
17
+ * }
18
+ * }
19
+ * ```
20
+ */
21
+ export declare class AzureFunctionManager {
22
+ /**
23
+ * @summary Method to create a new Linux function app
24
+ * @param id scoped id of the resource
25
+ * @param scope scope in which this resource is defined
26
+ * @param props function app properties
27
+ * @param resourceOptions Optional settings to control resource behaviour
28
+ * @see [Pulumi Azure Native Function App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
29
+ */
30
+ createFunctionApp(id: string, scope: CommonAzureConstruct, props: FunctionAppProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/web/webApp.js").WebApp;
31
+ /**
32
+ * @summary Method to create a new function within a function app
33
+ * @param id scoped id of the resource
34
+ * @param scope scope in which this resource is defined
35
+ * @param props function properties
36
+ * @param resourceOptions Optional settings to control resource behaviour
37
+ * @see [Pulumi Azure Native Function Envelope]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webappfunction/}
38
+ * @note In Pulumi, individual functions are typically deployed via code deployment rather than as separate infrastructure resources.
39
+ * This method is provided for API compatibility but may require additional setup.
40
+ */
41
+ createFunction(id: string, scope: CommonAzureConstruct, props: FunctionProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/web/webAppFunction.js").WebAppFunction;
42
+ /**
43
+ * @summary Method to create a new flex consumption function app
44
+ * @param id scoped id of the resource
45
+ * @param scope scope in which this resource is defined
46
+ * @param props flex consumption function app properties
47
+ * @param resourceOptions Optional settings to control resource behaviour
48
+ * @see [Pulumi Azure Native Function App (Flex Consumption)]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
49
+ */
50
+ createFunctionAppFlexConsumption(id: string, scope: CommonAzureConstruct, props: FunctionAppFlexConsumptionProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/web/webApp.js").WebApp;
51
+ /**
52
+ * @summary Method to create a new flex consumption function app
53
+ * @param id scoped id of the resource
54
+ * @param scope scope in which this resource is defined
55
+ * @param props flex consumption function app properties
56
+ * @param resourceOptions Optional settings to control resource behaviour
57
+ * @see [Pulumi Azure Native Function App (Flex Consumption)]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
58
+ */
59
+ createFunctionAppFlexConsumptionResource(id: string, scope: CommonAzureConstruct, props: FunctionAppFlexConsumptionProps, resourceOptions?: ResourceOptions): import("@pulumi/azure-native/resources/resource.js").Resource;
60
+ }