@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.
- package/dist/src/lib/azure/common/constants.d.ts +3 -2
- package/dist/src/lib/azure/common/constants.js +2 -1
- package/dist/src/lib/azure/common/construct.d.ts +26 -12
- package/dist/src/lib/azure/common/construct.js +31 -45
- package/dist/src/lib/azure/common/resource-name-formatter.d.ts +9 -4
- package/dist/src/lib/azure/common/resource-name-formatter.js +9 -5
- package/dist/src/lib/azure/common/stack.d.ts +18 -32
- package/dist/src/lib/azure/common/stack.js +77 -74
- package/dist/src/lib/azure/common/tagging.d.ts +29 -8
- package/dist/src/lib/azure/common/tagging.js +72 -26
- package/dist/src/lib/azure/common/types.d.ts +19 -4
- package/dist/src/lib/azure/services/api-management/main.d.ts +29 -32
- package/dist/src/lib/azure/services/api-management/main.js +100 -121
- package/dist/src/lib/azure/services/api-management/types.d.ts +33 -18
- package/dist/src/lib/azure/services/app-configuration/main.d.ts +6 -7
- package/dist/src/lib/azure/services/app-configuration/main.js +23 -26
- package/dist/src/lib/azure/services/app-configuration/types.d.ts +2 -2
- package/dist/src/lib/azure/services/app-service/main.d.ts +10 -12
- package/dist/src/lib/azure/services/app-service/main.js +37 -49
- package/dist/src/lib/azure/services/app-service/types.d.ts +4 -4
- package/dist/src/lib/azure/services/application-insights/main.d.ts +7 -8
- package/dist/src/lib/azure/services/application-insights/main.js +20 -26
- package/dist/src/lib/azure/services/application-insights/types.d.ts +2 -4
- package/dist/src/lib/azure/services/cosmosdb/main.d.ts +12 -15
- package/dist/src/lib/azure/services/cosmosdb/main.js +42 -61
- package/dist/src/lib/azure/services/cosmosdb/types.d.ts +4 -6
- package/dist/src/lib/azure/services/dns/main.d.ts +13 -17
- package/dist/src/lib/azure/services/dns/main.js +33 -51
- package/dist/src/lib/azure/services/dns/types.d.ts +5 -8
- package/dist/src/lib/azure/services/eventgrid/main.d.ts +20 -22
- package/dist/src/lib/azure/services/eventgrid/main.js +61 -89
- package/dist/src/lib/azure/services/eventgrid/types.d.ts +7 -8
- package/dist/src/lib/azure/services/function/main.d.ts +15 -15
- package/dist/src/lib/azure/services/function/main.js +54 -59
- package/dist/src/lib/azure/services/function/types.d.ts +18 -6
- package/dist/src/lib/azure/services/index.d.ts +1 -1
- package/dist/src/lib/azure/services/index.js +1 -1
- package/dist/src/lib/azure/services/key-vault/main.d.ts +6 -7
- package/dist/src/lib/azure/services/key-vault/main.js +29 -28
- package/dist/src/lib/azure/services/key-vault/types.d.ts +3 -2
- package/dist/src/lib/azure/services/monitor/main.d.ts +7 -8
- package/dist/src/lib/azure/services/monitor/main.js +10 -15
- package/dist/src/lib/azure/services/monitor/types.d.ts +2 -2
- package/dist/src/lib/azure/services/operational-insights/main.d.ts +29 -0
- package/dist/src/lib/azure/services/operational-insights/main.js +50 -0
- package/dist/src/lib/azure/services/operational-insights/types.d.ts +3 -0
- package/dist/src/lib/azure/services/redis/main.d.ts +8 -9
- package/dist/src/lib/azure/services/redis/main.js +24 -26
- package/dist/src/lib/azure/services/redis/types.d.ts +2 -2
- package/dist/src/lib/azure/services/resource-group/main.d.ts +6 -7
- package/dist/src/lib/azure/services/resource-group/main.js +9 -14
- package/dist/src/lib/azure/services/resource-group/types.d.ts +2 -2
- package/dist/src/lib/azure/services/servicebus/main.d.ts +17 -22
- package/dist/src/lib/azure/services/servicebus/main.js +47 -70
- package/dist/src/lib/azure/services/servicebus/types.d.ts +6 -10
- package/dist/src/lib/azure/services/storage/main.d.ts +24 -27
- package/dist/src/lib/azure/services/storage/main.js +70 -88
- package/dist/src/lib/azure/services/storage/types.d.ts +10 -8
- package/dist/src/lib/azure/types/index.d.ts +2 -1
- package/dist/src/lib/azure/utils/index.d.ts +19 -3
- package/dist/src/lib/azure/utils/index.js +19 -13
- package/dist/src/lib/cloudflare/common/stack.js +1 -1
- package/package.json +2 -1
- package/src/lib/azure/common/constants.ts +2 -1
- package/src/lib/azure/common/construct.ts +32 -48
- package/src/lib/azure/common/resource-name-formatter.ts +10 -6
- package/src/lib/azure/common/stack.ts +78 -78
- package/src/lib/azure/common/tagging.ts +78 -29
- package/src/lib/azure/common/types.ts +21 -4
- package/src/lib/azure/services/api-management/main.ts +172 -169
- package/src/lib/azure/services/api-management/types.ts +39 -16
- package/src/lib/azure/services/app-configuration/main.ts +33 -31
- package/src/lib/azure/services/app-configuration/types.ts +2 -2
- package/src/lib/azure/services/app-service/main.ts +61 -62
- package/src/lib/azure/services/app-service/types.ts +4 -4
- package/src/lib/azure/services/application-insights/main.ts +29 -30
- package/src/lib/azure/services/application-insights/types.ts +2 -5
- package/src/lib/azure/services/cosmosdb/main.ts +78 -77
- package/src/lib/azure/services/cosmosdb/types.ts +10 -6
- package/src/lib/azure/services/dns/main.ts +65 -72
- package/src/lib/azure/services/dns/types.ts +9 -9
- package/src/lib/azure/services/eventgrid/main.ts +120 -122
- package/src/lib/azure/services/eventgrid/types.ts +13 -8
- package/src/lib/azure/services/function/main.ts +75 -72
- package/src/lib/azure/services/function/types.ts +21 -6
- package/src/lib/azure/services/index.ts +1 -1
- package/src/lib/azure/services/key-vault/main.ts +38 -32
- package/src/lib/azure/services/key-vault/types.ts +4 -2
- package/src/lib/azure/services/monitor/main.ts +17 -21
- package/src/lib/azure/services/monitor/types.ts +2 -2
- package/src/lib/azure/services/operational-insights/main.ts +61 -0
- package/src/lib/azure/services/operational-insights/types.ts +3 -0
- package/src/lib/azure/services/redis/main.ts +30 -30
- package/src/lib/azure/services/redis/types.ts +2 -2
- package/src/lib/azure/services/resource-group/main.ts +20 -20
- package/src/lib/azure/services/resource-group/types.ts +2 -2
- package/src/lib/azure/services/servicebus/main.ts +103 -94
- package/src/lib/azure/services/servicebus/types.ts +17 -11
- package/src/lib/azure/services/storage/main.ts +113 -114
- package/src/lib/azure/services/storage/types.ts +16 -8
- package/src/lib/azure/types/index.ts +2 -1
- package/src/lib/azure/utils/index.ts +20 -22
- package/src/lib/cloudflare/common/stack.ts +1 -1
- package/dist/src/lib/azure/services/log-analytics-workspace/main.d.ts +0 -30
- package/dist/src/lib/azure/services/log-analytics-workspace/main.js +0 -55
- package/dist/src/lib/azure/services/log-analytics-workspace/types.d.ts +0 -3
- package/src/lib/azure/services/log-analytics-workspace/main.ts +0 -61
- package/src/lib/azure/services/log-analytics-workspace/types.ts +0 -3
- /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.d.ts +0 -0
- /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.js +0 -0
- /package/dist/src/lib/azure/services/{log-analytics-workspace → operational-insights}/types.js +0 -0
- /package/src/lib/azure/services/{log-analytics-workspace → operational-insights}/index.ts +0 -0
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import {
|
|
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(
|
|
18
|
-
* super(
|
|
11
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
12
|
+
* super(name, props)
|
|
19
13
|
* this.props = props
|
|
20
|
-
* this.EventGridManager.
|
|
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 [
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
46
|
-
location:
|
|
47
|
-
resourceGroupName:
|
|
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 [
|
|
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
|
-
|
|
69
|
-
|
|
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
|
-
:
|
|
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
|
|
86
|
-
* @see [
|
|
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
|
-
|
|
73
|
+
return new EventSubscription(`${id}-es`, {
|
|
92
74
|
...props,
|
|
93
|
-
|
|
94
|
-
eventDeliverySchema: props.eventDeliverySchema ??
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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 [
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
126
|
-
location:
|
|
127
|
-
resourceGroupName:
|
|
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
|
-
* @
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const
|
|
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
|
-
|
|
157
|
-
|
|
158
|
-
resourceGroupName:
|
|
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 {
|
|
2
|
-
|
|
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
|
|
4
|
+
export interface EventgridEventSubscriptionProps extends EventSubscriptionArgs {
|
|
8
5
|
}
|
|
9
|
-
export interface EventgridSystemTopicProps extends
|
|
6
|
+
export interface EventgridSystemTopicProps extends SystemTopicArgs {
|
|
10
7
|
}
|
|
11
|
-
export interface EventgridSystemTopicEventSubscriptionProps extends
|
|
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(
|
|
16
|
-
* super(
|
|
17
|
-
* this.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 [
|
|
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):
|
|
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 [
|
|
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):
|
|
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):
|
|
46
|
+
createFunctionAppFlexConsumption(id: string, scope: CommonAzureConstruct, props: FunctionAppFlexConsumptionProps): import("@pulumi/azure-native/web/webApp.js").WebApp;
|
|
47
47
|
}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import {
|
|
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(
|
|
16
|
-
* super(
|
|
17
|
-
* this.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 [
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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:
|
|
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 [
|
|
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
|
-
|
|
65
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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:
|
|
94
|
-
resourceGroupName:
|
|
95
|
-
|
|
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:
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
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
|
|
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 './
|
|
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 './
|
|
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(
|
|
14
|
-
* super(
|
|
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 [
|
|
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):
|
|
28
|
+
createKeyVault(id: string, scope: CommonAzureConstruct, props: KeyVaultProps): import("@pulumi/azure-native/keyvault/vault.js").Vault;
|
|
30
29
|
}
|