@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.
- package/LICENSE +21 -0
- package/dist/src/common/constants.d.ts +83 -0
- package/dist/src/common/constants.js +87 -0
- package/dist/src/common/construct.d.ts +80 -0
- package/dist/src/common/construct.js +128 -0
- package/dist/src/common/index.d.ts +6 -0
- package/dist/src/common/index.js +6 -0
- package/dist/src/common/resource-name-formatter.d.ts +18 -0
- package/dist/src/common/resource-name-formatter.js +34 -0
- package/dist/src/common/stack.d.ts +46 -0
- package/dist/src/common/stack.js +120 -0
- package/dist/src/common/tagging.d.ts +29 -0
- package/dist/src/common/tagging.js +78 -0
- package/dist/src/common/types.d.ts +57 -0
- package/dist/src/common/types.js +1 -0
- package/dist/src/construct/event-handler/index.d.ts +2 -0
- package/dist/src/construct/event-handler/index.js +2 -0
- package/dist/src/construct/event-handler/main.d.ts +61 -0
- package/dist/src/construct/event-handler/main.js +180 -0
- package/dist/src/construct/event-handler/types.d.ts +35 -0
- package/dist/src/construct/event-handler/types.js +1 -0
- package/dist/src/construct/function-app/index.d.ts +2 -0
- package/dist/src/construct/function-app/index.js +2 -0
- package/dist/src/construct/function-app/main.d.ts +128 -0
- package/dist/src/construct/function-app/main.js +374 -0
- package/dist/src/construct/function-app/types.d.ts +33 -0
- package/dist/src/construct/function-app/types.js +1 -0
- package/dist/src/construct/index.d.ts +6 -0
- package/dist/src/construct/index.js +6 -0
- package/dist/src/construct/rest-api/index.d.ts +2 -0
- package/dist/src/construct/rest-api/index.js +2 -0
- package/dist/src/construct/rest-api/main.d.ts +64 -0
- package/dist/src/construct/rest-api/main.js +216 -0
- package/dist/src/construct/rest-api/types.d.ts +25 -0
- package/dist/src/construct/rest-api/types.js +1 -0
- package/dist/src/construct/rest-api-function/index.d.ts +2 -0
- package/dist/src/construct/rest-api-function/index.js +2 -0
- package/dist/src/construct/rest-api-function/main.d.ts +66 -0
- package/dist/src/construct/rest-api-function/main.js +302 -0
- package/dist/src/construct/rest-api-function/types.d.ts +29 -0
- package/dist/src/construct/rest-api-function/types.js +1 -0
- package/dist/src/construct/rest-api-with-cache/index.d.ts +2 -0
- package/dist/src/construct/rest-api-with-cache/index.js +2 -0
- package/dist/src/construct/rest-api-with-cache/main.d.ts +41 -0
- package/dist/src/construct/rest-api-with-cache/main.js +85 -0
- package/dist/src/construct/rest-api-with-cache/types.d.ts +13 -0
- package/dist/src/construct/rest-api-with-cache/types.js +1 -0
- package/dist/src/construct/site-with-webapp/index.d.ts +2 -0
- package/dist/src/construct/site-with-webapp/index.js +2 -0
- package/dist/src/construct/site-with-webapp/main.d.ts +60 -0
- package/dist/src/construct/site-with-webapp/main.js +176 -0
- package/dist/src/construct/site-with-webapp/types.d.ts +30 -0
- package/dist/src/construct/site-with-webapp/types.js +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +4 -0
- package/dist/src/services/api-management/index.d.ts +2 -0
- package/dist/src/services/api-management/index.js +2 -0
- package/dist/src/services/api-management/main.d.ts +143 -0
- package/dist/src/services/api-management/main.js +244 -0
- package/dist/src/services/api-management/types.d.ts +72 -0
- package/dist/src/services/api-management/types.js +1 -0
- package/dist/src/services/app-configuration/index.d.ts +2 -0
- package/dist/src/services/app-configuration/index.js +2 -0
- package/dist/src/services/app-configuration/main.d.ts +41 -0
- package/dist/src/services/app-configuration/main.js +71 -0
- package/dist/src/services/app-configuration/types.d.ts +3 -0
- package/dist/src/services/app-configuration/types.js +1 -0
- package/dist/src/services/app-service/index.d.ts +2 -0
- package/dist/src/services/app-service/index.js +2 -0
- package/dist/src/services/app-service/main.d.ts +40 -0
- package/dist/src/services/app-service/main.js +90 -0
- package/dist/src/services/app-service/types.d.ts +6 -0
- package/dist/src/services/app-service/types.js +1 -0
- package/dist/src/services/application-insights/index.d.ts +2 -0
- package/dist/src/services/application-insights/index.js +2 -0
- package/dist/src/services/application-insights/main.d.ts +40 -0
- package/dist/src/services/application-insights/main.js +68 -0
- package/dist/src/services/application-insights/types.d.ts +6 -0
- package/dist/src/services/application-insights/types.js +1 -0
- package/dist/src/services/authorisation/constants.d.ts +13 -0
- package/dist/src/services/authorisation/constants.js +14 -0
- package/dist/src/services/authorisation/index.d.ts +3 -0
- package/dist/src/services/authorisation/index.js +3 -0
- package/dist/src/services/authorisation/main.d.ts +84 -0
- package/dist/src/services/authorisation/main.js +120 -0
- package/dist/src/services/authorisation/types.d.ts +3 -0
- package/dist/src/services/authorisation/types.js +1 -0
- package/dist/src/services/cosmosdb/constants.d.ts +8 -0
- package/dist/src/services/cosmosdb/constants.js +10 -0
- package/dist/src/services/cosmosdb/index.d.ts +3 -0
- package/dist/src/services/cosmosdb/index.js +3 -0
- package/dist/src/services/cosmosdb/main.d.ts +87 -0
- package/dist/src/services/cosmosdb/main.js +162 -0
- package/dist/src/services/cosmosdb/types.d.ts +9 -0
- package/dist/src/services/cosmosdb/types.js +1 -0
- package/dist/src/services/dns/index.d.ts +2 -0
- package/dist/src/services/dns/index.js +2 -0
- package/dist/src/services/dns/main.d.ts +58 -0
- package/dist/src/services/dns/main.js +107 -0
- package/dist/src/services/dns/types.d.ts +9 -0
- package/dist/src/services/dns/types.js +1 -0
- package/dist/src/services/eventgrid/index.d.ts +2 -0
- package/dist/src/services/eventgrid/index.js +2 -0
- package/dist/src/services/eventgrid/main.d.ts +69 -0
- package/dist/src/services/eventgrid/main.js +136 -0
- package/dist/src/services/eventgrid/types.d.ts +11 -0
- package/dist/src/services/eventgrid/types.js +1 -0
- package/dist/src/services/function/index.d.ts +2 -0
- package/dist/src/services/function/index.js +2 -0
- package/dist/src/services/function/main.d.ts +60 -0
- package/dist/src/services/function/main.js +223 -0
- package/dist/src/services/function/types.d.ts +20 -0
- package/dist/src/services/function/types.js +1 -0
- package/dist/src/services/index.d.ts +18 -0
- package/dist/src/services/index.js +18 -0
- package/dist/src/services/key-vault/index.d.ts +2 -0
- package/dist/src/services/key-vault/index.js +2 -0
- package/dist/src/services/key-vault/main.d.ts +49 -0
- package/dist/src/services/key-vault/main.js +83 -0
- package/dist/src/services/key-vault/types.d.ts +5 -0
- package/dist/src/services/key-vault/types.js +1 -0
- package/dist/src/services/monitor/index.d.ts +2 -0
- package/dist/src/services/monitor/index.js +2 -0
- package/dist/src/services/monitor/main.d.ts +31 -0
- package/dist/src/services/monitor/main.js +36 -0
- package/dist/src/services/monitor/types.d.ts +3 -0
- package/dist/src/services/monitor/types.js +1 -0
- package/dist/src/services/operational-insights/index.d.ts +2 -0
- package/dist/src/services/operational-insights/index.js +2 -0
- package/dist/src/services/operational-insights/main.d.ts +40 -0
- package/dist/src/services/operational-insights/main.js +64 -0
- package/dist/src/services/operational-insights/types.d.ts +5 -0
- package/dist/src/services/operational-insights/types.js +1 -0
- package/dist/src/services/portal/error.d.ts +5 -0
- package/dist/src/services/portal/error.js +10 -0
- package/dist/src/services/portal/index.d.ts +4 -0
- package/dist/src/services/portal/index.js +4 -0
- package/dist/src/services/portal/main.d.ts +33 -0
- package/dist/src/services/portal/main.js +51 -0
- package/dist/src/services/portal/renderer.d.ts +11 -0
- package/dist/src/services/portal/renderer.js +156 -0
- package/dist/src/services/portal/types.d.ts +40 -0
- package/dist/src/services/portal/types.js +1 -0
- package/dist/src/services/redis/index.d.ts +2 -0
- package/dist/src/services/redis/index.js +2 -0
- package/dist/src/services/redis/main.d.ts +31 -0
- package/dist/src/services/redis/main.js +52 -0
- package/dist/src/services/redis/types.d.ts +3 -0
- package/dist/src/services/redis/types.js +1 -0
- package/dist/src/services/resource-group/index.d.ts +2 -0
- package/dist/src/services/resource-group/index.js +2 -0
- package/dist/src/services/resource-group/main.d.ts +38 -0
- package/dist/src/services/resource-group/main.js +53 -0
- package/dist/src/services/resource-group/types.d.ts +3 -0
- package/dist/src/services/resource-group/types.js +1 -0
- package/dist/src/services/security-center/index.d.ts +2 -0
- package/dist/src/services/security-center/index.js +2 -0
- package/dist/src/services/security-center/main.d.ts +31 -0
- package/dist/src/services/security-center/main.js +33 -0
- package/dist/src/services/security-center/types.d.ts +3 -0
- package/dist/src/services/security-center/types.js +1 -0
- package/dist/src/services/servicebus/index.d.ts +2 -0
- package/dist/src/services/servicebus/index.js +2 -0
- package/dist/src/services/servicebus/main.d.ts +67 -0
- package/dist/src/services/servicebus/main.js +127 -0
- package/dist/src/services/servicebus/types.d.ts +11 -0
- package/dist/src/services/servicebus/types.js +1 -0
- package/dist/src/services/storage/index.d.ts +2 -0
- package/dist/src/services/storage/index.js +2 -0
- package/dist/src/services/storage/main.d.ts +88 -0
- package/dist/src/services/storage/main.js +173 -0
- package/dist/src/services/storage/types.d.ts +20 -0
- package/dist/src/services/storage/types.js +1 -0
- package/dist/src/types/index.d.ts +4 -0
- package/dist/src/types/index.js +1 -0
- 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,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,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
|
+
}
|