@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.
- 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/dist/src/lib/cloudflare/services/access/main.js +23 -23
- package/dist/src/lib/cloudflare/services/api-shield/main.js +11 -11
- package/dist/src/lib/cloudflare/services/argo/main.js +5 -5
- package/dist/src/lib/cloudflare/services/filter/main.js +3 -3
- package/dist/src/lib/cloudflare/services/firewall/main.js +3 -3
- package/dist/src/lib/cloudflare/services/page/main.js +7 -7
- package/dist/src/lib/cloudflare/services/record/main.js +3 -3
- package/dist/src/lib/cloudflare/services/rule-set/main.d.ts +1 -1
- package/dist/src/lib/cloudflare/services/rule-set/main.js +4 -5
- package/dist/src/lib/cloudflare/services/worker/main.js +13 -13
- package/dist/src/lib/cloudflare/services/zone/main.js +18 -18
- 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/src/lib/cloudflare/services/access/main.ts +114 -58
- package/src/lib/cloudflare/services/api-shield/main.ts +48 -22
- package/src/lib/cloudflare/services/argo/main.ts +17 -9
- package/src/lib/cloudflare/services/filter/main.ts +9 -5
- package/src/lib/cloudflare/services/firewall/main.ts +9 -5
- package/src/lib/cloudflare/services/page/main.ts +27 -15
- package/src/lib/cloudflare/services/record/main.ts +9 -5
- package/src/lib/cloudflare/services/rule-set/main.ts +10 -8
- package/src/lib/cloudflare/services/worker/main.ts +60 -29
- package/src/lib/cloudflare/services/zone/main.ts +75 -35
- 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,25 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DnsARecord } from '@cdktf/provider-azurerm/lib/dns-a-record/index.js'
|
|
3
|
-
import { DnsCnameRecord } from '@cdktf/provider-azurerm/lib/dns-cname-record/index.js'
|
|
4
|
-
import { DnsTxtRecord } from '@cdktf/provider-azurerm/lib/dns-txt-record/index.js'
|
|
5
|
-
import { DnsZone } from '@cdktf/provider-azurerm/lib/dns-zone/index.js'
|
|
1
|
+
import { RecordSet, Zone } from '@pulumi/azure-native/dns/index.js'
|
|
6
2
|
import { CommonAzureConstruct } from '../../common/index.js'
|
|
7
|
-
import { createAzureTfOutput } from '../../utils/index.js'
|
|
8
3
|
import { DnsARecordProps, DnsCnameRecordProps, DnsTxtRecordProps, DnsZoneProps } from './types.js'
|
|
9
4
|
|
|
10
5
|
/**
|
|
11
|
-
* @classdesc Provides operations on Azure DNS
|
|
6
|
+
* @classdesc Provides operations on Azure DNS using Pulumi
|
|
12
7
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
13
8
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
14
9
|
* @example
|
|
15
|
-
* ```
|
|
10
|
+
* ```typescript
|
|
16
11
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
17
12
|
*
|
|
18
13
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
19
|
-
* constructor(
|
|
20
|
-
* super(
|
|
14
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
15
|
+
* super(name, props)
|
|
21
16
|
* this.props = props
|
|
22
|
-
* this.dnsManager.
|
|
17
|
+
* this.dnsManager.createDnsZone('MyDnsZone', this, props)
|
|
23
18
|
* }
|
|
24
19
|
* }
|
|
25
20
|
* ```
|
|
@@ -30,33 +25,34 @@ export class AzureDnsManager {
|
|
|
30
25
|
* @param id scoped id of the resource
|
|
31
26
|
* @param scope scope in which this resource is defined
|
|
32
27
|
* @param props dns zone properties
|
|
33
|
-
* @see [
|
|
28
|
+
* @see [Pulumi Azure Native DNS Zone]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/zone/}
|
|
34
29
|
*/
|
|
35
30
|
public createDnsZone(id: string, scope: CommonAzureConstruct, props: DnsZoneProps) {
|
|
36
31
|
if (!props) throw `Props undefined for ${id}`
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
33
|
+
// Get resource group name
|
|
34
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
35
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
36
|
+
: props.resourceGroupName
|
|
37
|
+
|
|
38
|
+
if (!resourceGroupName) throw `Resource group name undefined for ${id}`
|
|
39
|
+
|
|
40
|
+
return new Zone(
|
|
41
|
+
`${id}-dz`,
|
|
42
|
+
{
|
|
43
|
+
...props,
|
|
44
|
+
zoneName: scope.resourceNameFormatter.format(
|
|
45
|
+
props.zoneName?.toString(),
|
|
46
|
+
scope.props.resourceNameOptions?.dnsZone
|
|
47
|
+
),
|
|
48
|
+
resourceGroupName: resourceGroupName,
|
|
49
|
+
location: 'global', // DNS zones are always global
|
|
50
|
+
tags: props.tags ?? {
|
|
51
|
+
environment: scope.props.stage,
|
|
52
|
+
},
|
|
52
53
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
createAzureTfOutput(`${id}-dnsZoneName`, scope, dnsZone.name)
|
|
56
|
-
createAzureTfOutput(`${id}-dnsZoneFriendlyUniqueId`, scope, dnsZone.friendlyUniqueId)
|
|
57
|
-
createAzureTfOutput(`${id}-dnsZoneId`, scope, dnsZone.id)
|
|
58
|
-
|
|
59
|
-
return dnsZone
|
|
54
|
+
{ parent: scope }
|
|
55
|
+
)
|
|
60
56
|
}
|
|
61
57
|
|
|
62
58
|
/**
|
|
@@ -64,24 +60,23 @@ export class AzureDnsManager {
|
|
|
64
60
|
* @param id scoped id of the resource
|
|
65
61
|
* @param scope scope in which this resource is defined
|
|
66
62
|
* @param props dns a record properties
|
|
67
|
-
* @see [
|
|
63
|
+
* @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
|
|
68
64
|
*/
|
|
69
65
|
public createDnsARecord(id: string, scope: CommonAzureConstruct, props: DnsARecordProps) {
|
|
70
66
|
if (!props) throw `Props undefined for ${id}`
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
return new RecordSet(
|
|
69
|
+
`${id}-da`,
|
|
70
|
+
{
|
|
71
|
+
...props,
|
|
72
|
+
recordType: 'A',
|
|
73
|
+
ttl: props.ttl ?? 300,
|
|
74
|
+
metadata: props.metadata ?? {
|
|
75
|
+
environment: scope.props.stage,
|
|
76
|
+
},
|
|
77
77
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
createAzureTfOutput(`${id}-dnsARecordName`, scope, dnsARecord.name)
|
|
81
|
-
createAzureTfOutput(`${id}-dnsARecordFriendlyUniqueId`, scope, dnsARecord.friendlyUniqueId)
|
|
82
|
-
createAzureTfOutput(`${id}-dnsARecordId`, scope, dnsARecord.id)
|
|
83
|
-
|
|
84
|
-
return dnsARecord
|
|
78
|
+
{ parent: scope }
|
|
79
|
+
)
|
|
85
80
|
}
|
|
86
81
|
|
|
87
82
|
/**
|
|
@@ -89,24 +84,23 @@ export class AzureDnsManager {
|
|
|
89
84
|
* @param id scoped id of the resource
|
|
90
85
|
* @param scope scope in which this resource is defined
|
|
91
86
|
* @param props dns cname record properties
|
|
92
|
-
* @see [
|
|
87
|
+
* @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
|
|
93
88
|
*/
|
|
94
89
|
public createDnsCnameRecord(id: string, scope: CommonAzureConstruct, props: DnsCnameRecordProps) {
|
|
95
90
|
if (!props) throw `Props undefined for ${id}`
|
|
96
91
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
92
|
+
return new RecordSet(
|
|
93
|
+
`${id}-dc`,
|
|
94
|
+
{
|
|
95
|
+
...props,
|
|
96
|
+
recordType: 'CNAME',
|
|
97
|
+
ttl: props.ttl ?? 300,
|
|
98
|
+
metadata: props.metadata ?? {
|
|
99
|
+
environment: scope.props.stage,
|
|
100
|
+
},
|
|
102
101
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
createAzureTfOutput(`${id}-dnsCnameRecordName`, scope, dnsCnameRecord.name)
|
|
106
|
-
createAzureTfOutput(`${id}-dnsCnameRecordFriendlyUniqueId`, scope, dnsCnameRecord.friendlyUniqueId)
|
|
107
|
-
createAzureTfOutput(`${id}-dnsCnameRecordId`, scope, dnsCnameRecord.id)
|
|
108
|
-
|
|
109
|
-
return dnsCnameRecord
|
|
102
|
+
{ parent: scope }
|
|
103
|
+
)
|
|
110
104
|
}
|
|
111
105
|
|
|
112
106
|
/**
|
|
@@ -114,23 +108,22 @@ export class AzureDnsManager {
|
|
|
114
108
|
* @param id scoped id of the resource
|
|
115
109
|
* @param scope scope in which this resource is defined
|
|
116
110
|
* @param props dns txt record properties
|
|
117
|
-
* @see [
|
|
111
|
+
* @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
|
|
118
112
|
*/
|
|
119
113
|
public createDnsTxtRecord(id: string, scope: CommonAzureConstruct, props: DnsTxtRecordProps) {
|
|
120
114
|
if (!props) throw `Props undefined for ${id}`
|
|
121
115
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
116
|
+
return new RecordSet(
|
|
117
|
+
`${id}-dt`,
|
|
118
|
+
{
|
|
119
|
+
...props,
|
|
120
|
+
recordType: 'TXT',
|
|
121
|
+
ttl: props.ttl ?? 300,
|
|
122
|
+
metadata: props.metadata ?? {
|
|
123
|
+
environment: scope.props.stage,
|
|
124
|
+
},
|
|
127
125
|
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
createAzureTfOutput(`${id}-dnsTxtRecordName`, scope, dnsTxtRecord.name)
|
|
131
|
-
createAzureTfOutput(`${id}-dnsTxtRecordFriendlyUniqueId`, scope, dnsTxtRecord.friendlyUniqueId)
|
|
132
|
-
createAzureTfOutput(`${id}-dnsTxtRecordId`, scope, dnsTxtRecord.id)
|
|
133
|
-
|
|
134
|
-
return dnsTxtRecord
|
|
126
|
+
{ parent: scope }
|
|
127
|
+
)
|
|
135
128
|
}
|
|
136
129
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export interface
|
|
8
|
-
|
|
9
|
-
export interface DnsTxtRecordProps extends
|
|
1
|
+
import { RecordSetArgs, ZoneArgs } from '@pulumi/azure-native/dns/index.js'
|
|
2
|
+
|
|
3
|
+
export interface DnsZoneProps extends ZoneArgs {}
|
|
4
|
+
|
|
5
|
+
export interface DnsARecordProps extends RecordSetArgs {}
|
|
6
|
+
|
|
7
|
+
export interface DnsCnameRecordProps extends RecordSetArgs {}
|
|
8
|
+
|
|
9
|
+
export interface DnsTxtRecordProps extends RecordSetArgs {}
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
EventDeliverySchema,
|
|
3
|
+
EventSubscription,
|
|
4
|
+
getTopicOutput,
|
|
5
|
+
GetTopicResult,
|
|
6
|
+
SystemTopic,
|
|
7
|
+
SystemTopicEventSubscription,
|
|
8
|
+
Topic,
|
|
9
|
+
} from '@pulumi/azure-native/eventgrid/index.js'
|
|
10
|
+
import * as pulumi from '@pulumi/pulumi'
|
|
10
11
|
import { CommonAzureConstruct } from '../../common/index.js'
|
|
11
|
-
import { createAzureTfOutput } from '../../utils/index.js'
|
|
12
12
|
import {
|
|
13
13
|
EventgridEventSubscriptionProps,
|
|
14
14
|
EventgridSystemTopicEventSubscriptionProps,
|
|
15
15
|
EventgridSystemTopicProps,
|
|
16
16
|
EventgridTopicProps,
|
|
17
|
+
ResolveEventgridTopicProps,
|
|
17
18
|
} from './types.js'
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
|
-
* @classdesc Provides operations on Azure Event Grid
|
|
21
|
+
* @classdesc Provides operations on Azure Event Grid using Pulumi
|
|
21
22
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
22
23
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
23
24
|
* @example
|
|
24
|
-
* ```
|
|
25
|
+
* ```typescript
|
|
25
26
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
26
27
|
*
|
|
27
28
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
28
|
-
* constructor(
|
|
29
|
-
* super(
|
|
29
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
30
|
+
* super(name, props)
|
|
30
31
|
* this.props = props
|
|
31
|
-
* this.EventGridManager.
|
|
32
|
+
* this.EventGridManager.createEventgridTopic('MyEventGrid', this, props)
|
|
32
33
|
* }
|
|
33
34
|
* }
|
|
34
35
|
* ```
|
|
@@ -39,35 +40,34 @@ export class AzureEventgridManager {
|
|
|
39
40
|
* @param id scoped id of the resource
|
|
40
41
|
* @param scope scope in which this resource is defined
|
|
41
42
|
* @param props eventgrid topic properties
|
|
42
|
-
* @see [
|
|
43
|
+
* @see [Pulumi Azure Native Event Grid Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
|
|
43
44
|
*/
|
|
44
45
|
public createEventgridTopic(id: string, scope: CommonAzureConstruct, props: EventgridTopicProps) {
|
|
45
46
|
if (!props) throw `Props undefined for ${id}`
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
// Get resource group name
|
|
49
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
50
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
51
|
+
: props.resourceGroupName
|
|
52
|
+
|
|
53
|
+
if (!resourceGroupName) throw `Resource group name undefined for ${id}`
|
|
54
|
+
|
|
55
|
+
return new Topic(
|
|
56
|
+
`${id}-et`,
|
|
57
|
+
{
|
|
58
|
+
...props,
|
|
59
|
+
topicName: scope.resourceNameFormatter.format(
|
|
60
|
+
props.topicName?.toString(),
|
|
61
|
+
scope.props.resourceNameOptions?.eventGridTopic
|
|
62
|
+
),
|
|
63
|
+
location: props.location ?? scope.props.location,
|
|
64
|
+
resourceGroupName: resourceGroupName,
|
|
65
|
+
tags: props.tags ?? {
|
|
66
|
+
environment: scope.props.stage,
|
|
67
|
+
},
|
|
62
68
|
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
createAzureTfOutput(`${id}-eventgridTopicName`, scope, eventgridTopic.name)
|
|
66
|
-
createAzureTfOutput(`${id}-eventgridTopicFriendlyUniqueId`, scope, eventgridTopic.friendlyUniqueId)
|
|
67
|
-
createAzureTfOutput(`${id}-eventgridTopicId`, scope, eventgridTopic.id)
|
|
68
|
-
createAzureTfOutput(`${id}-eventgridTopicEndpoint`, scope, eventgridTopic.endpoint)
|
|
69
|
-
|
|
70
|
-
return eventgridTopic
|
|
69
|
+
{ parent: scope }
|
|
70
|
+
)
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/**
|
|
@@ -75,53 +75,51 @@ export class AzureEventgridManager {
|
|
|
75
75
|
* @param id scoped id of the resource
|
|
76
76
|
* @param scope scope in which this resource is defined
|
|
77
77
|
* @param props eventgrid topic properties
|
|
78
|
-
* @see [
|
|
78
|
+
* @see [Pulumi Azure Native Event Grid Topic Lookup]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
|
|
79
79
|
*/
|
|
80
|
-
public resolveEventgridTopic(id: string, scope: CommonAzureConstruct, props:
|
|
80
|
+
public resolveEventgridTopic(id: string, scope: CommonAzureConstruct, props: ResolveEventgridTopicProps) {
|
|
81
81
|
if (!props) throw `Props undefined for ${id}`
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return eventgridTopic
|
|
83
|
+
return getTopicOutput(
|
|
84
|
+
{
|
|
85
|
+
topicName: scope.resourceNameFormatter.format(
|
|
86
|
+
props.topicName?.toString(),
|
|
87
|
+
scope.props.resourceNameOptions?.eventGridTopic
|
|
88
|
+
),
|
|
89
|
+
resourceGroupName: scope.props.resourceGroupName
|
|
90
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
91
|
+
: props.resourceGroupName,
|
|
92
|
+
},
|
|
93
|
+
{ parent: scope }
|
|
94
|
+
)
|
|
97
95
|
}
|
|
98
96
|
|
|
99
97
|
/**
|
|
100
98
|
* @summary Method to create a new eventgrid subscription
|
|
101
99
|
* @param id scoped id of the resource
|
|
102
100
|
* @param scope scope in which this resource is defined
|
|
103
|
-
* @param props eventgrid
|
|
104
|
-
* @see [
|
|
101
|
+
* @param props eventgrid subscription properties
|
|
102
|
+
* @see [Pulumi Azure Native Event Grid Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/eventsubscription/}
|
|
105
103
|
*/
|
|
106
104
|
public createEventgridSubscription(id: string, scope: CommonAzureConstruct, props: EventgridEventSubscriptionProps) {
|
|
107
105
|
if (!props) throw `Props undefined for ${id}`
|
|
108
106
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
return new EventSubscription(
|
|
108
|
+
`${id}-es`,
|
|
109
|
+
{
|
|
110
|
+
...props,
|
|
111
|
+
eventSubscriptionName: scope.resourceNameFormatter.format(
|
|
112
|
+
props.eventSubscriptionName?.toString(),
|
|
113
|
+
scope.props.resourceNameOptions?.eventGridEventSubscription
|
|
114
|
+
),
|
|
115
|
+
eventDeliverySchema: props.eventDeliverySchema ?? EventDeliverySchema.CloudEventSchemaV1_0,
|
|
116
|
+
retryPolicy: props.retryPolicy ?? {
|
|
117
|
+
eventTimeToLiveInMinutes: 1440,
|
|
118
|
+
maxDeliveryAttempts: 7,
|
|
119
|
+
},
|
|
117
120
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
createAzureTfOutput(`${id}-eventgridSubscriptiontName`, scope, eventgridSubscription.name)
|
|
121
|
-
createAzureTfOutput(`${id}-eventgridSubscriptionFriendlyUniqueId`, scope, eventgridSubscription.friendlyUniqueId)
|
|
122
|
-
createAzureTfOutput(`${id}-eventgridSubscriptionId`, scope, eventgridSubscription.id)
|
|
123
|
-
|
|
124
|
-
return eventgridSubscription
|
|
121
|
+
{ parent: scope }
|
|
122
|
+
)
|
|
125
123
|
}
|
|
126
124
|
|
|
127
125
|
/**
|
|
@@ -129,34 +127,34 @@ export class AzureEventgridManager {
|
|
|
129
127
|
* @param id scoped id of the resource
|
|
130
128
|
* @param scope scope in which this resource is defined
|
|
131
129
|
* @param props eventgrid system topic properties
|
|
132
|
-
* @see [
|
|
130
|
+
* @see [Pulumi Azure Native Event Grid System Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopic/}
|
|
133
131
|
*/
|
|
134
132
|
public createEventgridSystemTopic(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicProps) {
|
|
135
133
|
if (!props) throw `Props undefined for ${id}`
|
|
136
134
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
135
|
+
// Get resource group name
|
|
136
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
137
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
138
|
+
: props.resourceGroupName
|
|
139
|
+
|
|
140
|
+
if (!resourceGroupName) throw `Resource group name undefined for ${id}`
|
|
141
|
+
|
|
142
|
+
return new SystemTopic(
|
|
143
|
+
`${id}-est`,
|
|
144
|
+
{
|
|
145
|
+
...props,
|
|
146
|
+
systemTopicName: scope.resourceNameFormatter.format(
|
|
147
|
+
props.systemTopicName?.toString(),
|
|
148
|
+
scope.props.resourceNameOptions?.eventGridSystemTopic
|
|
149
|
+
),
|
|
150
|
+
location: props.location ?? scope.props.location,
|
|
151
|
+
resourceGroupName: resourceGroupName,
|
|
152
|
+
tags: props.tags ?? {
|
|
153
|
+
environment: scope.props.stage,
|
|
154
|
+
},
|
|
152
155
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
createAzureTfOutput(`${id}-eventgridSystemTopicName`, scope, eventgridSystemTopic.name)
|
|
156
|
-
createAzureTfOutput(`${id}-eventgridSystemTopicFriendlyUniqueId`, scope, eventgridSystemTopic.friendlyUniqueId)
|
|
157
|
-
createAzureTfOutput(`${id}-eventgridSystemTopicId`, scope, eventgridSystemTopic.id)
|
|
158
|
-
|
|
159
|
-
return eventgridSystemTopic
|
|
156
|
+
{ parent: scope }
|
|
157
|
+
)
|
|
160
158
|
}
|
|
161
159
|
|
|
162
160
|
/**
|
|
@@ -164,42 +162,42 @@ export class AzureEventgridManager {
|
|
|
164
162
|
* @param id scoped id of the resource
|
|
165
163
|
* @param scope scope in which this resource is defined
|
|
166
164
|
* @param props eventgrid system topic subscription properties
|
|
167
|
-
* @
|
|
165
|
+
* @param systemTopic The system topic to attach this subscription to
|
|
166
|
+
* @see [Pulumi Azure Native Event Grid System Topic Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopiceventsubscription/}
|
|
168
167
|
*/
|
|
169
168
|
public createEventgridSystemTopicEventSubscription(
|
|
170
169
|
id: string,
|
|
171
170
|
scope: CommonAzureConstruct,
|
|
172
171
|
props: EventgridSystemTopicEventSubscriptionProps,
|
|
173
|
-
systemTopic:
|
|
172
|
+
systemTopic: SystemTopic | pulumi.Output<GetTopicResult>
|
|
174
173
|
) {
|
|
175
174
|
if (!props) throw `Props undefined for ${id}`
|
|
176
175
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
176
|
+
// Get resource group name
|
|
177
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
178
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
179
|
+
: props.resourceGroupName
|
|
180
|
+
|
|
181
|
+
if (!resourceGroupName) throw `Resource group name undefined for ${id}`
|
|
182
|
+
|
|
183
|
+
// Extract system topic name
|
|
184
|
+
const systemTopicName =
|
|
185
|
+
systemTopic instanceof SystemTopic
|
|
186
|
+
? systemTopic.name
|
|
187
|
+
: (systemTopic as pulumi.Output<GetTopicResult>).apply(t => t.name)
|
|
188
|
+
|
|
189
|
+
return new SystemTopicEventSubscription(
|
|
190
|
+
`${id}-ests`,
|
|
191
|
+
{
|
|
192
|
+
...props,
|
|
193
|
+
eventSubscriptionName: scope.resourceNameFormatter.format(
|
|
194
|
+
props.eventSubscriptionName?.toString(),
|
|
195
|
+
scope.props.resourceNameOptions?.eventGridSystemTopicEventSubscription
|
|
196
|
+
),
|
|
197
|
+
systemTopicName: systemTopicName,
|
|
198
|
+
resourceGroupName: resourceGroupName,
|
|
199
|
+
},
|
|
200
|
+
{ parent: scope }
|
|
200
201
|
)
|
|
201
|
-
createAzureTfOutput(`${id}-eventgridSystemTopicEventSubscriptionId`, scope, eventgridSystemTopicSubscription.id)
|
|
202
|
-
|
|
203
|
-
return eventgridSystemTopicSubscription
|
|
204
202
|
}
|
|
205
203
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
EventSubscriptionArgs,
|
|
3
|
+
GetTopicOutputArgs,
|
|
4
|
+
SystemTopicArgs,
|
|
5
|
+
SystemTopicEventSubscriptionArgs,
|
|
6
|
+
TopicArgs,
|
|
7
|
+
} from '@pulumi/azure-native/eventgrid/index.js'
|
|
5
8
|
|
|
6
|
-
export interface EventgridTopicProps extends
|
|
9
|
+
export interface EventgridTopicProps extends TopicArgs {}
|
|
7
10
|
|
|
8
|
-
export interface EventgridEventSubscriptionProps extends
|
|
11
|
+
export interface EventgridEventSubscriptionProps extends EventSubscriptionArgs {}
|
|
9
12
|
|
|
10
|
-
export interface EventgridSystemTopicProps extends
|
|
13
|
+
export interface EventgridSystemTopicProps extends SystemTopicArgs {}
|
|
11
14
|
|
|
12
|
-
export interface EventgridSystemTopicEventSubscriptionProps extends
|
|
15
|
+
export interface EventgridSystemTopicEventSubscriptionProps extends SystemTopicEventSubscriptionArgs {}
|
|
16
|
+
|
|
17
|
+
export interface ResolveEventgridTopicProps extends GetTopicOutputArgs {}
|