@gradientedge/cdk-utils 9.77.0 → 9.78.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/services/eventgrid/main.d.ts +19 -1
- package/dist/src/lib/azure/services/eventgrid/main.js +61 -0
- package/dist/src/lib/azure/services/eventgrid/types.d.ts +6 -0
- package/package.json +1 -1
- package/src/lib/azure/services/eventgrid/main.ts +87 -1
- package/src/lib/azure/services/eventgrid/types.ts +6 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { DataAzurermEventgridTopic, DataAzurermEventgridTopicConfig } from '@cdktf/provider-azurerm/lib/data-azurerm-eventgrid-topic';
|
|
2
2
|
import { EventgridTopic } from '@cdktf/provider-azurerm/lib/eventgrid-topic';
|
|
3
3
|
import { EventgridEventSubscription } from '@cdktf/provider-azurerm/lib/eventgrid-event-subscription';
|
|
4
|
+
import { EventgridSystemTopic } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic';
|
|
5
|
+
import { EventgridSystemTopicEventSubscription } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic-event-subscription/index.js';
|
|
4
6
|
import { CommonAzureConstruct } from '../../common';
|
|
5
|
-
import { EventgridTopicProps, EventgridEventSubscriptionProps } from './types';
|
|
7
|
+
import { EventgridTopicProps, EventgridEventSubscriptionProps, EventgridSystemTopicProps, EventgridSystemTopicEventSubscriptionProps } from './types';
|
|
6
8
|
/**
|
|
7
9
|
* @classdesc Provides operations on Azure Event Grid
|
|
8
10
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
@@ -45,4 +47,20 @@ export declare class AzureEventgridManager {
|
|
|
45
47
|
* @see [CDKTF Eventgrid Subscription Container Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridEventSubscription.typescript.md}
|
|
46
48
|
*/
|
|
47
49
|
createEventgridSubscription(id: string, scope: CommonAzureConstruct, props: EventgridEventSubscriptionProps): EventgridEventSubscription;
|
|
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
|
+
* @see [CDKTF Eventgrid System Topic Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridSystemTopic.typescript.md}
|
|
56
|
+
*/
|
|
57
|
+
createEventgridSystemTopic(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicProps): EventgridSystemTopic;
|
|
58
|
+
/**
|
|
59
|
+
* @summary Method to create a new eventgrid system topic subscription
|
|
60
|
+
* @param id scoped id of the resource
|
|
61
|
+
* @param scope scope in which this resource is defined
|
|
62
|
+
* @param props eventgrid system topic subscription properties
|
|
63
|
+
* @see [CDKTF Eventgrid System Topic Subscription Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridSystemTopicEventSubscription.typescript.md}
|
|
64
|
+
*/
|
|
65
|
+
createEventgridSystemTopicEventSubscription(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicEventSubscriptionProps, systemTopic: EventgridSystemTopic): EventgridSystemTopicEventSubscription;
|
|
48
66
|
}
|
|
@@ -5,6 +5,8 @@ const data_azurerm_resource_group_1 = require("@cdktf/provider-azurerm/lib/data-
|
|
|
5
5
|
const data_azurerm_eventgrid_topic_1 = require("@cdktf/provider-azurerm/lib/data-azurerm-eventgrid-topic");
|
|
6
6
|
const eventgrid_topic_1 = require("@cdktf/provider-azurerm/lib/eventgrid-topic");
|
|
7
7
|
const eventgrid_event_subscription_1 = require("@cdktf/provider-azurerm/lib/eventgrid-event-subscription");
|
|
8
|
+
const eventgrid_system_topic_1 = require("@cdktf/provider-azurerm/lib/eventgrid-system-topic");
|
|
9
|
+
const index_js_1 = require("@cdktf/provider-azurerm/lib/eventgrid-system-topic-event-subscription/index.js");
|
|
8
10
|
const utils_1 = require("../../utils");
|
|
9
11
|
/**
|
|
10
12
|
* @classdesc Provides operations on Azure Event Grid
|
|
@@ -109,5 +111,64 @@ class AzureEventgridManager {
|
|
|
109
111
|
(0, utils_1.createAzureTfOutput)(`${id}-eventgridSubscriptionId`, scope, eventgridSubscription.id);
|
|
110
112
|
return eventgridSubscription;
|
|
111
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* @summary Method to create a new eventgrid system topic
|
|
116
|
+
* @param id scoped id of the resource
|
|
117
|
+
* @param scope scope in which this resource is defined
|
|
118
|
+
* @param props eventgrid system topic properties
|
|
119
|
+
* @see [CDKTF Eventgrid System Topic Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridSystemTopic.typescript.md}
|
|
120
|
+
*/
|
|
121
|
+
createEventgridSystemTopic(id, scope, props) {
|
|
122
|
+
if (!props)
|
|
123
|
+
throw `Props undefined for ${id}`;
|
|
124
|
+
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-est-rg`, {
|
|
125
|
+
name: scope.props.resourceGroupName
|
|
126
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
127
|
+
: `${props.resourceGroupName}`,
|
|
128
|
+
});
|
|
129
|
+
if (!resourceGroup)
|
|
130
|
+
throw `Resource group undefined for ${id}`;
|
|
131
|
+
const eventgridSystemTopic = new eventgrid_system_topic_1.EventgridSystemTopic(scope, `${id}-est`, {
|
|
132
|
+
...props,
|
|
133
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventGridSystemTopic),
|
|
134
|
+
location: resourceGroup.location,
|
|
135
|
+
resourceGroupName: resourceGroup.name,
|
|
136
|
+
tags: props.tags ?? {
|
|
137
|
+
environment: scope.props.stage,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
(0, utils_1.createAzureTfOutput)(`${id}-eventgridSystemTopicName`, scope, eventgridSystemTopic.name);
|
|
141
|
+
(0, utils_1.createAzureTfOutput)(`${id}-eventgridSystemTopicFriendlyUniqueId`, scope, eventgridSystemTopic.friendlyUniqueId);
|
|
142
|
+
(0, utils_1.createAzureTfOutput)(`${id}-eventgridSystemTopicId`, scope, eventgridSystemTopic.id);
|
|
143
|
+
return eventgridSystemTopic;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @summary Method to create a new eventgrid system topic subscription
|
|
147
|
+
* @param id scoped id of the resource
|
|
148
|
+
* @param scope scope in which this resource is defined
|
|
149
|
+
* @param props eventgrid system topic subscription properties
|
|
150
|
+
* @see [CDKTF Eventgrid System Topic Subscription Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridSystemTopicEventSubscription.typescript.md}
|
|
151
|
+
*/
|
|
152
|
+
createEventgridSystemTopicEventSubscription(id, scope, props, systemTopic) {
|
|
153
|
+
if (!props)
|
|
154
|
+
throw `Props undefined for ${id}`;
|
|
155
|
+
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-ests-rg`, {
|
|
156
|
+
name: scope.props.resourceGroupName
|
|
157
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
158
|
+
: `${props.resourceGroupName}`,
|
|
159
|
+
});
|
|
160
|
+
if (!resourceGroup)
|
|
161
|
+
throw `Resource group undefined for ${id}`;
|
|
162
|
+
const eventgridSystemTopicSubscription = new index_js_1.EventgridSystemTopicEventSubscription(scope, `${id}-ests`, {
|
|
163
|
+
...props,
|
|
164
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventGridSystemTopicEventSubscription),
|
|
165
|
+
systemTopic: systemTopic.name,
|
|
166
|
+
resourceGroupName: resourceGroup.name,
|
|
167
|
+
});
|
|
168
|
+
(0, utils_1.createAzureTfOutput)(`${id}-eventgridSystemTopicEventSubscriptionName`, scope, eventgridSystemTopicSubscription.name);
|
|
169
|
+
(0, utils_1.createAzureTfOutput)(`${id}-eventgridSystemTopicEventSubscriptionFriendlyUniqueId`, scope, eventgridSystemTopicSubscription.friendlyUniqueId);
|
|
170
|
+
(0, utils_1.createAzureTfOutput)(`${id}-eventgridSystemTopicEventSubscriptionId`, scope, eventgridSystemTopicSubscription.id);
|
|
171
|
+
return eventgridSystemTopicSubscription;
|
|
172
|
+
}
|
|
112
173
|
}
|
|
113
174
|
exports.AzureEventgridManager = AzureEventgridManager;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { EventgridTopicConfig } from '@cdktf/provider-azurerm/lib/eventgrid-topic';
|
|
2
2
|
import { EventgridEventSubscriptionConfig } from '@cdktf/provider-azurerm/lib/eventgrid-event-subscription';
|
|
3
|
+
import { EventgridSystemTopicConfig } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic';
|
|
4
|
+
import { EventgridSystemTopicEventSubscriptionConfig } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic-event-subscription/index.js';
|
|
3
5
|
export interface EventgridTopicProps extends EventgridTopicConfig {
|
|
4
6
|
}
|
|
5
7
|
export interface EventgridEventSubscriptionProps extends EventgridEventSubscriptionConfig {
|
|
6
8
|
}
|
|
9
|
+
export interface EventgridSystemTopicProps extends EventgridSystemTopicConfig {
|
|
10
|
+
}
|
|
11
|
+
export interface EventgridSystemTopicEventSubscriptionProps extends EventgridSystemTopicEventSubscriptionConfig {
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -5,9 +5,16 @@ import {
|
|
|
5
5
|
} from '@cdktf/provider-azurerm/lib/data-azurerm-eventgrid-topic'
|
|
6
6
|
import { EventgridTopic } from '@cdktf/provider-azurerm/lib/eventgrid-topic'
|
|
7
7
|
import { EventgridEventSubscription } from '@cdktf/provider-azurerm/lib/eventgrid-event-subscription'
|
|
8
|
+
import { EventgridSystemTopic } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic'
|
|
9
|
+
import { EventgridSystemTopicEventSubscription } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic-event-subscription/index.js'
|
|
8
10
|
import { CommonAzureConstruct } from '../../common'
|
|
9
11
|
import { createAzureTfOutput } from '../../utils'
|
|
10
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
EventgridTopicProps,
|
|
14
|
+
EventgridEventSubscriptionProps,
|
|
15
|
+
EventgridSystemTopicProps,
|
|
16
|
+
EventgridSystemTopicEventSubscriptionProps,
|
|
17
|
+
} from './types'
|
|
11
18
|
|
|
12
19
|
/**
|
|
13
20
|
* @classdesc Provides operations on Azure Event Grid
|
|
@@ -122,4 +129,83 @@ export class AzureEventgridManager {
|
|
|
122
129
|
|
|
123
130
|
return eventgridSubscription
|
|
124
131
|
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @summary Method to create a new eventgrid system topic
|
|
135
|
+
* @param id scoped id of the resource
|
|
136
|
+
* @param scope scope in which this resource is defined
|
|
137
|
+
* @param props eventgrid system topic properties
|
|
138
|
+
* @see [CDKTF Eventgrid System Topic Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridSystemTopic.typescript.md}
|
|
139
|
+
*/
|
|
140
|
+
public createEventgridSystemTopic(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicProps) {
|
|
141
|
+
if (!props) throw `Props undefined for ${id}`
|
|
142
|
+
|
|
143
|
+
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-est-rg`, {
|
|
144
|
+
name: scope.props.resourceGroupName
|
|
145
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
146
|
+
: `${props.resourceGroupName}`,
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
150
|
+
|
|
151
|
+
const eventgridSystemTopic = new EventgridSystemTopic(scope, `${id}-est`, {
|
|
152
|
+
...props,
|
|
153
|
+
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.eventGridSystemTopic),
|
|
154
|
+
location: resourceGroup.location,
|
|
155
|
+
resourceGroupName: resourceGroup.name,
|
|
156
|
+
tags: props.tags ?? {
|
|
157
|
+
environment: scope.props.stage,
|
|
158
|
+
},
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
createAzureTfOutput(`${id}-eventgridSystemTopicName`, scope, eventgridSystemTopic.name)
|
|
162
|
+
createAzureTfOutput(`${id}-eventgridSystemTopicFriendlyUniqueId`, scope, eventgridSystemTopic.friendlyUniqueId)
|
|
163
|
+
createAzureTfOutput(`${id}-eventgridSystemTopicId`, scope, eventgridSystemTopic.id)
|
|
164
|
+
|
|
165
|
+
return eventgridSystemTopic
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @summary Method to create a new eventgrid system topic subscription
|
|
170
|
+
* @param id scoped id of the resource
|
|
171
|
+
* @param scope scope in which this resource is defined
|
|
172
|
+
* @param props eventgrid system topic subscription properties
|
|
173
|
+
* @see [CDKTF Eventgrid System Topic Subscription Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/eventgridSystemTopicEventSubscription.typescript.md}
|
|
174
|
+
*/
|
|
175
|
+
public createEventgridSystemTopicEventSubscription(
|
|
176
|
+
id: string,
|
|
177
|
+
scope: CommonAzureConstruct,
|
|
178
|
+
props: EventgridSystemTopicEventSubscriptionProps,
|
|
179
|
+
systemTopic: EventgridSystemTopic
|
|
180
|
+
) {
|
|
181
|
+
if (!props) throw `Props undefined for ${id}`
|
|
182
|
+
|
|
183
|
+
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-ests-rg`, {
|
|
184
|
+
name: scope.props.resourceGroupName
|
|
185
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
186
|
+
: `${props.resourceGroupName}`,
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
190
|
+
|
|
191
|
+
const eventgridSystemTopicSubscription = new EventgridSystemTopicEventSubscription(scope, `${id}-ests`, {
|
|
192
|
+
...props,
|
|
193
|
+
name: scope.resourceNameFormatter.format(
|
|
194
|
+
props.name,
|
|
195
|
+
scope.props.resourceNameOptions?.eventGridSystemTopicEventSubscription
|
|
196
|
+
),
|
|
197
|
+
systemTopic: systemTopic.name,
|
|
198
|
+
resourceGroupName: resourceGroup.name,
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
createAzureTfOutput(`${id}-eventgridSystemTopicEventSubscriptionName`, scope, eventgridSystemTopicSubscription.name)
|
|
202
|
+
createAzureTfOutput(
|
|
203
|
+
`${id}-eventgridSystemTopicEventSubscriptionFriendlyUniqueId`,
|
|
204
|
+
scope,
|
|
205
|
+
eventgridSystemTopicSubscription.friendlyUniqueId
|
|
206
|
+
)
|
|
207
|
+
createAzureTfOutput(`${id}-eventgridSystemTopicEventSubscriptionId`, scope, eventgridSystemTopicSubscription.id)
|
|
208
|
+
|
|
209
|
+
return eventgridSystemTopicSubscription
|
|
210
|
+
}
|
|
125
211
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { EventgridTopicConfig } from '@cdktf/provider-azurerm/lib/eventgrid-topic'
|
|
2
2
|
import { EventgridEventSubscriptionConfig } from '@cdktf/provider-azurerm/lib/eventgrid-event-subscription'
|
|
3
|
+
import { EventgridSystemTopicConfig } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic'
|
|
4
|
+
import { EventgridSystemTopicEventSubscriptionConfig } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic-event-subscription/index.js'
|
|
3
5
|
|
|
4
6
|
export interface EventgridTopicProps extends EventgridTopicConfig {}
|
|
5
7
|
|
|
6
8
|
export interface EventgridEventSubscriptionProps extends EventgridEventSubscriptionConfig {}
|
|
9
|
+
|
|
10
|
+
export interface EventgridSystemTopicProps extends EventgridSystemTopicConfig {}
|
|
11
|
+
|
|
12
|
+
export interface EventgridSystemTopicEventSubscriptionProps extends EventgridSystemTopicEventSubscriptionConfig {}
|