@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,21 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CosmosdbSqlContainer } from '@cdktf/provider-azurerm/lib/cosmosdb-sql-container/index.js';
|
|
3
|
-
import { CosmosdbSqlDatabase } from '@cdktf/provider-azurerm/lib/cosmosdb-sql-database/index.js';
|
|
4
|
-
import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group/index.js';
|
|
5
|
-
import { createAzureTfOutput } from '../../utils/index.js';
|
|
1
|
+
import { DatabaseAccount, ResourceIdentityType, SqlResourceSqlContainer, SqlResourceSqlDatabase, } from '@pulumi/azure-native/cosmosdb/index.js';
|
|
6
2
|
/**
|
|
7
|
-
* @classdesc Provides operations on Azure CosmosDB
|
|
3
|
+
* @classdesc Provides operations on Azure CosmosDB 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(
|
|
11
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
12
|
+
* super(name, props)
|
|
17
13
|
* this.props = props
|
|
18
|
-
* this.CosmosDbManager.
|
|
14
|
+
* this.CosmosDbManager.createCosmosDbAccount('MyCosmosDb', this, props)
|
|
19
15
|
* }
|
|
20
16
|
* }
|
|
21
17
|
* ```
|
|
@@ -26,87 +22,72 @@ export class AzureCosmosDbManager {
|
|
|
26
22
|
* @param id scoped id of the resource
|
|
27
23
|
* @param scope scope in which this resource is defined
|
|
28
24
|
* @param props cosmosdb account properties
|
|
29
|
-
* @see [
|
|
25
|
+
* @see [Pulumi Azure Native CosmosDB Account]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/databaseaccount/}
|
|
30
26
|
*/
|
|
31
27
|
createCosmosDbAccount(id, scope, props) {
|
|
32
28
|
if (!props)
|
|
33
29
|
throw `Props undefined for ${id}`;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const cosmosdbAccount = new CosmosdbAccount(scope, `${id}-ca`, {
|
|
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 DatabaseAccount(`${id}-ca`, {
|
|
42
37
|
...props,
|
|
43
|
-
|
|
44
|
-
location:
|
|
45
|
-
resourceGroupName:
|
|
38
|
+
accountName: scope.resourceNameFormatter.format(props.accountName?.toString(), scope.props.resourceNameOptions?.cosmosDbAccount),
|
|
39
|
+
location: props.location ?? scope.props.location,
|
|
40
|
+
resourceGroupName: resourceGroupName,
|
|
46
41
|
tags: props.tags ?? {
|
|
47
42
|
environment: scope.props.stage,
|
|
48
43
|
},
|
|
49
44
|
identity: props.identity ?? {
|
|
50
|
-
type:
|
|
45
|
+
type: ResourceIdentityType.SystemAssigned,
|
|
51
46
|
},
|
|
52
|
-
});
|
|
53
|
-
createAzureTfOutput(`${id}-cosmosdbAccountName`, scope, cosmosdbAccount.name);
|
|
54
|
-
createAzureTfOutput(`${id}-cosmosdbAccountFriendlyUniqueId`, scope, cosmosdbAccount.friendlyUniqueId);
|
|
55
|
-
createAzureTfOutput(`${id}-cosmosdbAccountId`, scope, cosmosdbAccount.id);
|
|
56
|
-
return cosmosdbAccount;
|
|
47
|
+
}, { parent: scope });
|
|
57
48
|
}
|
|
58
49
|
/**
|
|
59
50
|
* @summary Method to create a new cosmosdb database
|
|
60
51
|
* @param id scoped id of the resource
|
|
61
52
|
* @param scope scope in which this resource is defined
|
|
62
|
-
* @param props cosmosdb
|
|
63
|
-
* @see [
|
|
53
|
+
* @param props cosmosdb database properties
|
|
54
|
+
* @see [Pulumi Azure Native CosmosDB SQL Database]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/sqlresourcesqldatabase/}
|
|
64
55
|
*/
|
|
65
56
|
createCosmosDbDatabase(id, scope, props) {
|
|
66
57
|
if (!props)
|
|
67
58
|
throw `Props undefined for ${id}`;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const cosmosdbDatatbase = new CosmosdbSqlDatabase(scope, `${id}-cd`, {
|
|
59
|
+
// Get resource group name
|
|
60
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
61
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
62
|
+
: props.resourceGroupName;
|
|
63
|
+
if (!resourceGroupName)
|
|
64
|
+
throw `Resource group name undefined for ${id}`;
|
|
65
|
+
return new SqlResourceSqlDatabase(`${id}-cd`, {
|
|
76
66
|
...props,
|
|
77
|
-
|
|
78
|
-
resourceGroupName:
|
|
79
|
-
});
|
|
80
|
-
createAzureTfOutput(`${id}-cosmosdbDatatbasetName`, scope, cosmosdbDatatbase.name);
|
|
81
|
-
createAzureTfOutput(`${id}-cosmosdbDatatbaseFriendlyUniqueId`, scope, cosmosdbDatatbase.friendlyUniqueId);
|
|
82
|
-
createAzureTfOutput(`${id}-cosmosdbDatatbaseId`, scope, cosmosdbDatatbase.id);
|
|
83
|
-
return cosmosdbDatatbase;
|
|
67
|
+
databaseName: scope.resourceNameFormatter.format(props.databaseName?.toString(), scope.props.resourceNameOptions?.cosmosDbSqlDatabase),
|
|
68
|
+
resourceGroupName: resourceGroupName,
|
|
69
|
+
}, { parent: scope });
|
|
84
70
|
}
|
|
85
71
|
/**
|
|
86
72
|
* @summary Method to create a new cosmosdb container
|
|
87
73
|
* @param id scoped id of the resource
|
|
88
74
|
* @param scope scope in which this resource is defined
|
|
89
75
|
* @param props cosmosdb container properties
|
|
90
|
-
* @see [
|
|
76
|
+
* @see [Pulumi Azure Native CosmosDB SQL Container]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/sqlresourcesqlcontainer/}
|
|
91
77
|
*/
|
|
92
78
|
createCosmosDbContainer(id, scope, props) {
|
|
93
79
|
if (!props)
|
|
94
80
|
throw `Props undefined for ${id}`;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const cosmosdbContainer = new CosmosdbSqlContainer(scope, `${id}-cc`, {
|
|
81
|
+
// Get resource group name
|
|
82
|
+
const resourceGroupName = scope.props.resourceGroupName
|
|
83
|
+
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
84
|
+
: props.resourceGroupName;
|
|
85
|
+
if (!resourceGroupName)
|
|
86
|
+
throw `Resource group name undefined for ${id}`;
|
|
87
|
+
return new SqlResourceSqlContainer(`${id}-cc`, {
|
|
103
88
|
...props,
|
|
104
|
-
|
|
105
|
-
resourceGroupName:
|
|
106
|
-
});
|
|
107
|
-
createAzureTfOutput(`${id}-cosmosdbContainertName`, scope, cosmosdbContainer.name);
|
|
108
|
-
createAzureTfOutput(`${id}-cosmosdbContainerFriendlyUniqueId`, scope, cosmosdbContainer.friendlyUniqueId);
|
|
109
|
-
createAzureTfOutput(`${id}-cosmosdbContainerId`, scope, cosmosdbContainer.id);
|
|
110
|
-
return cosmosdbContainer;
|
|
89
|
+
containerName: scope.resourceNameFormatter.format(props.containerName?.toString(), scope.props.resourceNameOptions?.cosmosDbSqlContainer),
|
|
90
|
+
resourceGroupName: resourceGroupName,
|
|
91
|
+
}, { parent: scope });
|
|
111
92
|
}
|
|
112
93
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { CosmosdbSqlContainerConfig } from '@cdktf/provider-azurerm/lib/cosmosdb-sql-container/index.js';
|
|
4
|
-
export interface CosmosdbAccountProps extends CosmosdbAccountConfig {
|
|
1
|
+
import { DatabaseAccountArgs, SqlResourceSqlContainerArgs, SqlResourceSqlDatabaseArgs } from '@pulumi/azure-native/cosmosdb/index.js';
|
|
2
|
+
export interface CosmosdbAccountProps extends DatabaseAccountArgs {
|
|
5
3
|
}
|
|
6
|
-
export interface CosmosdbSqlDatabaseProps extends
|
|
4
|
+
export interface CosmosdbSqlDatabaseProps extends SqlResourceSqlDatabaseArgs {
|
|
7
5
|
}
|
|
8
|
-
export interface CosmosdbSqlContainerProps extends
|
|
6
|
+
export interface CosmosdbSqlContainerProps extends SqlResourceSqlContainerArgs {
|
|
9
7
|
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import { DnsARecord } from '@cdktf/provider-azurerm/lib/dns-a-record/index.js';
|
|
2
|
-
import { DnsCnameRecord } from '@cdktf/provider-azurerm/lib/dns-cname-record/index.js';
|
|
3
|
-
import { DnsTxtRecord } from '@cdktf/provider-azurerm/lib/dns-txt-record/index.js';
|
|
4
|
-
import { DnsZone } from '@cdktf/provider-azurerm/lib/dns-zone/index.js';
|
|
5
1
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
6
2
|
import { DnsARecordProps, DnsCnameRecordProps, DnsTxtRecordProps, DnsZoneProps } from './types.js';
|
|
7
3
|
/**
|
|
8
|
-
* @classdesc Provides operations on Azure DNS
|
|
4
|
+
* @classdesc Provides operations on Azure DNS using Pulumi
|
|
9
5
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
10
6
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
11
7
|
* @example
|
|
12
|
-
* ```
|
|
8
|
+
* ```typescript
|
|
13
9
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
14
10
|
*
|
|
15
11
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
16
|
-
* constructor(
|
|
17
|
-
* super(
|
|
12
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
13
|
+
* super(name, props)
|
|
18
14
|
* this.props = props
|
|
19
|
-
* this.dnsManager.
|
|
15
|
+
* this.dnsManager.createDnsZone('MyDnsZone', this, props)
|
|
20
16
|
* }
|
|
21
17
|
* }
|
|
22
18
|
* ```
|
|
@@ -27,31 +23,31 @@ export declare class AzureDnsManager {
|
|
|
27
23
|
* @param id scoped id of the resource
|
|
28
24
|
* @param scope scope in which this resource is defined
|
|
29
25
|
* @param props dns zone properties
|
|
30
|
-
* @see [
|
|
26
|
+
* @see [Pulumi Azure Native DNS Zone]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/zone/}
|
|
31
27
|
*/
|
|
32
|
-
createDnsZone(id: string, scope: CommonAzureConstruct, props: DnsZoneProps):
|
|
28
|
+
createDnsZone(id: string, scope: CommonAzureConstruct, props: DnsZoneProps): import("@pulumi/azure-native/dns/zone.js").Zone;
|
|
33
29
|
/**
|
|
34
30
|
* @summary Method to create a new DNS A Record
|
|
35
31
|
* @param id scoped id of the resource
|
|
36
32
|
* @param scope scope in which this resource is defined
|
|
37
33
|
* @param props dns a record properties
|
|
38
|
-
* @see [
|
|
34
|
+
* @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
|
|
39
35
|
*/
|
|
40
|
-
createDnsARecord(id: string, scope: CommonAzureConstruct, props: DnsARecordProps):
|
|
36
|
+
createDnsARecord(id: string, scope: CommonAzureConstruct, props: DnsARecordProps): import("@pulumi/azure-native/dns/recordSet.js").RecordSet;
|
|
41
37
|
/**
|
|
42
38
|
* @summary Method to create a new DNS CNAME Record
|
|
43
39
|
* @param id scoped id of the resource
|
|
44
40
|
* @param scope scope in which this resource is defined
|
|
45
41
|
* @param props dns cname record properties
|
|
46
|
-
* @see [
|
|
42
|
+
* @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
|
|
47
43
|
*/
|
|
48
|
-
createDnsCnameRecord(id: string, scope: CommonAzureConstruct, props: DnsCnameRecordProps):
|
|
44
|
+
createDnsCnameRecord(id: string, scope: CommonAzureConstruct, props: DnsCnameRecordProps): import("@pulumi/azure-native/dns/recordSet.js").RecordSet;
|
|
49
45
|
/**
|
|
50
46
|
* @summary Method to create a new DNS TXT Record
|
|
51
47
|
* @param id scoped id of the resource
|
|
52
48
|
* @param scope scope in which this resource is defined
|
|
53
49
|
* @param props dns txt record properties
|
|
54
|
-
* @see [
|
|
50
|
+
* @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
|
|
55
51
|
*/
|
|
56
|
-
createDnsTxtRecord(id: string, scope: CommonAzureConstruct, props: DnsTxtRecordProps):
|
|
52
|
+
createDnsTxtRecord(id: string, scope: CommonAzureConstruct, props: DnsTxtRecordProps): import("@pulumi/azure-native/dns/recordSet.js").RecordSet;
|
|
57
53
|
}
|
|
@@ -1,22 +1,17 @@
|
|
|
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';
|
|
6
|
-
import { createAzureTfOutput } from '../../utils/index.js';
|
|
1
|
+
import { RecordSet, Zone } from '@pulumi/azure-native/dns/index.js';
|
|
7
2
|
/**
|
|
8
|
-
* @classdesc Provides operations on Azure DNS
|
|
3
|
+
* @classdesc Provides operations on Azure DNS using Pulumi
|
|
9
4
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
10
5
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
11
6
|
* @example
|
|
12
|
-
* ```
|
|
7
|
+
* ```typescript
|
|
13
8
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
14
9
|
*
|
|
15
10
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
16
|
-
* constructor(
|
|
17
|
-
* super(
|
|
11
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
12
|
+
* super(name, props)
|
|
18
13
|
* this.props = props
|
|
19
|
-
* this.dnsManager.
|
|
14
|
+
* this.dnsManager.createDnsZone('MyDnsZone', this, props)
|
|
20
15
|
* }
|
|
21
16
|
* }
|
|
22
17
|
* ```
|
|
@@ -27,95 +22,82 @@ export class AzureDnsManager {
|
|
|
27
22
|
* @param id scoped id of the resource
|
|
28
23
|
* @param scope scope in which this resource is defined
|
|
29
24
|
* @param props dns zone properties
|
|
30
|
-
* @see [
|
|
25
|
+
* @see [Pulumi Azure Native DNS Zone]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/zone/}
|
|
31
26
|
*/
|
|
32
27
|
createDnsZone(id, scope, props) {
|
|
33
28
|
if (!props)
|
|
34
29
|
throw `Props undefined for ${id}`;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const dnsZone = new DnsZone(scope, `${id}-dz`, {
|
|
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 Zone(`${id}-dz`, {
|
|
43
37
|
...props,
|
|
44
|
-
|
|
45
|
-
resourceGroupName:
|
|
38
|
+
zoneName: scope.resourceNameFormatter.format(props.zoneName?.toString(), scope.props.resourceNameOptions?.dnsZone),
|
|
39
|
+
resourceGroupName: resourceGroupName,
|
|
40
|
+
location: 'global', // DNS zones are always global
|
|
46
41
|
tags: props.tags ?? {
|
|
47
42
|
environment: scope.props.stage,
|
|
48
43
|
},
|
|
49
|
-
});
|
|
50
|
-
createAzureTfOutput(`${id}-dnsZoneName`, scope, dnsZone.name);
|
|
51
|
-
createAzureTfOutput(`${id}-dnsZoneFriendlyUniqueId`, scope, dnsZone.friendlyUniqueId);
|
|
52
|
-
createAzureTfOutput(`${id}-dnsZoneId`, scope, dnsZone.id);
|
|
53
|
-
return dnsZone;
|
|
44
|
+
}, { parent: scope });
|
|
54
45
|
}
|
|
55
46
|
/**
|
|
56
47
|
* @summary Method to create a new DNS A Record
|
|
57
48
|
* @param id scoped id of the resource
|
|
58
49
|
* @param scope scope in which this resource is defined
|
|
59
50
|
* @param props dns a record properties
|
|
60
|
-
* @see [
|
|
51
|
+
* @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
|
|
61
52
|
*/
|
|
62
53
|
createDnsARecord(id, scope, props) {
|
|
63
54
|
if (!props)
|
|
64
55
|
throw `Props undefined for ${id}`;
|
|
65
|
-
|
|
56
|
+
return new RecordSet(`${id}-da`, {
|
|
66
57
|
...props,
|
|
58
|
+
recordType: 'A',
|
|
67
59
|
ttl: props.ttl ?? 300,
|
|
68
|
-
|
|
60
|
+
metadata: props.metadata ?? {
|
|
69
61
|
environment: scope.props.stage,
|
|
70
62
|
},
|
|
71
|
-
});
|
|
72
|
-
createAzureTfOutput(`${id}-dnsARecordName`, scope, dnsARecord.name);
|
|
73
|
-
createAzureTfOutput(`${id}-dnsARecordFriendlyUniqueId`, scope, dnsARecord.friendlyUniqueId);
|
|
74
|
-
createAzureTfOutput(`${id}-dnsARecordId`, scope, dnsARecord.id);
|
|
75
|
-
return dnsARecord;
|
|
63
|
+
}, { parent: scope });
|
|
76
64
|
}
|
|
77
65
|
/**
|
|
78
66
|
* @summary Method to create a new DNS CNAME Record
|
|
79
67
|
* @param id scoped id of the resource
|
|
80
68
|
* @param scope scope in which this resource is defined
|
|
81
69
|
* @param props dns cname record properties
|
|
82
|
-
* @see [
|
|
70
|
+
* @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
|
|
83
71
|
*/
|
|
84
72
|
createDnsCnameRecord(id, scope, props) {
|
|
85
73
|
if (!props)
|
|
86
74
|
throw `Props undefined for ${id}`;
|
|
87
|
-
|
|
75
|
+
return new RecordSet(`${id}-dc`, {
|
|
88
76
|
...props,
|
|
77
|
+
recordType: 'CNAME',
|
|
89
78
|
ttl: props.ttl ?? 300,
|
|
90
|
-
|
|
79
|
+
metadata: props.metadata ?? {
|
|
91
80
|
environment: scope.props.stage,
|
|
92
81
|
},
|
|
93
|
-
});
|
|
94
|
-
createAzureTfOutput(`${id}-dnsCnameRecordName`, scope, dnsCnameRecord.name);
|
|
95
|
-
createAzureTfOutput(`${id}-dnsCnameRecordFriendlyUniqueId`, scope, dnsCnameRecord.friendlyUniqueId);
|
|
96
|
-
createAzureTfOutput(`${id}-dnsCnameRecordId`, scope, dnsCnameRecord.id);
|
|
97
|
-
return dnsCnameRecord;
|
|
82
|
+
}, { parent: scope });
|
|
98
83
|
}
|
|
99
84
|
/**
|
|
100
85
|
* @summary Method to create a new DNS TXT Record
|
|
101
86
|
* @param id scoped id of the resource
|
|
102
87
|
* @param scope scope in which this resource is defined
|
|
103
88
|
* @param props dns txt record properties
|
|
104
|
-
* @see [
|
|
89
|
+
* @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
|
|
105
90
|
*/
|
|
106
91
|
createDnsTxtRecord(id, scope, props) {
|
|
107
92
|
if (!props)
|
|
108
93
|
throw `Props undefined for ${id}`;
|
|
109
|
-
|
|
94
|
+
return new RecordSet(`${id}-dt`, {
|
|
110
95
|
...props,
|
|
96
|
+
recordType: 'TXT',
|
|
111
97
|
ttl: props.ttl ?? 300,
|
|
112
|
-
|
|
98
|
+
metadata: props.metadata ?? {
|
|
113
99
|
environment: scope.props.stage,
|
|
114
100
|
},
|
|
115
|
-
});
|
|
116
|
-
createAzureTfOutput(`${id}-dnsTxtRecordName`, scope, dnsTxtRecord.name);
|
|
117
|
-
createAzureTfOutput(`${id}-dnsTxtRecordFriendlyUniqueId`, scope, dnsTxtRecord.friendlyUniqueId);
|
|
118
|
-
createAzureTfOutput(`${id}-dnsTxtRecordId`, scope, dnsTxtRecord.id);
|
|
119
|
-
return dnsTxtRecord;
|
|
101
|
+
}, { parent: scope });
|
|
120
102
|
}
|
|
121
103
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { DnsCnameRecordConfig } from '@cdktf/provider-azurerm/lib/dns-cname-record/index.js';
|
|
4
|
-
import { DnsTxtRecordConfig } from '@cdktf/provider-azurerm/lib/dns-txt-record/index.js';
|
|
5
|
-
export interface DnsZoneProps extends DnsZoneConfig {
|
|
1
|
+
import { RecordSetArgs, ZoneArgs } from '@pulumi/azure-native/dns/index.js';
|
|
2
|
+
export interface DnsZoneProps extends ZoneArgs {
|
|
6
3
|
}
|
|
7
|
-
export interface DnsARecordProps extends
|
|
4
|
+
export interface DnsARecordProps extends RecordSetArgs {
|
|
8
5
|
}
|
|
9
|
-
export interface DnsCnameRecordProps extends
|
|
6
|
+
export interface DnsCnameRecordProps extends RecordSetArgs {
|
|
10
7
|
}
|
|
11
|
-
export interface DnsTxtRecordProps extends
|
|
8
|
+
export interface DnsTxtRecordProps extends RecordSetArgs {
|
|
12
9
|
}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { EventgridSystemTopicEventSubscription } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic-event-subscription/index.js';
|
|
4
|
-
import { EventgridSystemTopic } from '@cdktf/provider-azurerm/lib/eventgrid-system-topic/index.js';
|
|
5
|
-
import { EventgridTopic } from '@cdktf/provider-azurerm/lib/eventgrid-topic/index.js';
|
|
1
|
+
import { GetTopicResult, SystemTopic } from '@pulumi/azure-native/eventgrid/index.js';
|
|
2
|
+
import * as pulumi from '@pulumi/pulumi';
|
|
6
3
|
import { CommonAzureConstruct } from '../../common/index.js';
|
|
7
|
-
import { EventgridEventSubscriptionProps, EventgridSystemTopicEventSubscriptionProps, EventgridSystemTopicProps, EventgridTopicProps } from './types.js';
|
|
4
|
+
import { EventgridEventSubscriptionProps, EventgridSystemTopicEventSubscriptionProps, EventgridSystemTopicProps, EventgridTopicProps, ResolveEventgridTopicProps } from './types.js';
|
|
8
5
|
/**
|
|
9
|
-
* @classdesc Provides operations on Azure Event Grid
|
|
6
|
+
* @classdesc Provides operations on Azure Event Grid using Pulumi
|
|
10
7
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
11
8
|
* - If a custom construct extends {@link CommonAzureConstruct}, an instance is available within the context.
|
|
12
9
|
* @example
|
|
13
|
-
* ```
|
|
10
|
+
* ```typescript
|
|
14
11
|
* import { CommonAzureConstruct, CommonAzureStackProps } from '@gradientedge/cdk-utils'
|
|
15
12
|
*
|
|
16
13
|
* class CustomConstruct extends CommonAzureConstruct {
|
|
17
|
-
* constructor(
|
|
18
|
-
* super(
|
|
14
|
+
* constructor(name: string, props: CommonAzureStackProps) {
|
|
15
|
+
* super(name, props)
|
|
19
16
|
* this.props = props
|
|
20
|
-
* this.EventGridManager.
|
|
17
|
+
* this.EventGridManager.createEventgridTopic('MyEventGrid', this, props)
|
|
21
18
|
* }
|
|
22
19
|
* }
|
|
23
20
|
* ```
|
|
@@ -28,39 +25,40 @@ export declare class AzureEventgridManager {
|
|
|
28
25
|
* @param id scoped id of the resource
|
|
29
26
|
* @param scope scope in which this resource is defined
|
|
30
27
|
* @param props eventgrid topic properties
|
|
31
|
-
* @see [
|
|
28
|
+
* @see [Pulumi Azure Native Event Grid Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
|
|
32
29
|
*/
|
|
33
|
-
createEventgridTopic(id: string, scope: CommonAzureConstruct, props: EventgridTopicProps):
|
|
30
|
+
createEventgridTopic(id: string, scope: CommonAzureConstruct, props: EventgridTopicProps): import("@pulumi/azure-native/eventgrid/topic.js").Topic;
|
|
34
31
|
/**
|
|
35
32
|
* @summary Method to resolve an existing eventgrid topic
|
|
36
33
|
* @param id scoped id of the resource
|
|
37
34
|
* @param scope scope in which this resource is defined
|
|
38
35
|
* @param props eventgrid topic properties
|
|
39
|
-
* @see [
|
|
36
|
+
* @see [Pulumi Azure Native Event Grid Topic Lookup]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
|
|
40
37
|
*/
|
|
41
|
-
resolveEventgridTopic(id: string, scope: CommonAzureConstruct, props:
|
|
38
|
+
resolveEventgridTopic(id: string, scope: CommonAzureConstruct, props: ResolveEventgridTopicProps): pulumi.Output<GetTopicResult>;
|
|
42
39
|
/**
|
|
43
40
|
* @summary Method to create a new eventgrid subscription
|
|
44
41
|
* @param id scoped id of the resource
|
|
45
42
|
* @param scope scope in which this resource is defined
|
|
46
|
-
* @param props eventgrid
|
|
47
|
-
* @see [
|
|
43
|
+
* @param props eventgrid subscription properties
|
|
44
|
+
* @see [Pulumi Azure Native Event Grid Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/eventsubscription/}
|
|
48
45
|
*/
|
|
49
|
-
createEventgridSubscription(id: string, scope: CommonAzureConstruct, props: EventgridEventSubscriptionProps):
|
|
46
|
+
createEventgridSubscription(id: string, scope: CommonAzureConstruct, props: EventgridEventSubscriptionProps): import("@pulumi/azure-native/eventgrid/eventSubscription.js").EventSubscription;
|
|
50
47
|
/**
|
|
51
48
|
* @summary Method to create a new eventgrid system topic
|
|
52
49
|
* @param id scoped id of the resource
|
|
53
50
|
* @param scope scope in which this resource is defined
|
|
54
51
|
* @param props eventgrid system topic properties
|
|
55
|
-
* @see [
|
|
52
|
+
* @see [Pulumi Azure Native Event Grid System Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopic/}
|
|
56
53
|
*/
|
|
57
|
-
createEventgridSystemTopic(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicProps):
|
|
54
|
+
createEventgridSystemTopic(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicProps): import("@pulumi/azure-native/eventgrid/systemTopic.js").SystemTopic;
|
|
58
55
|
/**
|
|
59
56
|
* @summary Method to create a new eventgrid system topic subscription
|
|
60
57
|
* @param id scoped id of the resource
|
|
61
58
|
* @param scope scope in which this resource is defined
|
|
62
59
|
* @param props eventgrid system topic subscription properties
|
|
63
|
-
* @
|
|
60
|
+
* @param systemTopic The system topic to attach this subscription to
|
|
61
|
+
* @see [Pulumi Azure Native Event Grid System Topic Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopiceventsubscription/}
|
|
64
62
|
*/
|
|
65
|
-
createEventgridSystemTopicEventSubscription(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicEventSubscriptionProps, systemTopic:
|
|
63
|
+
createEventgridSystemTopicEventSubscription(id: string, scope: CommonAzureConstruct, props: EventgridSystemTopicEventSubscriptionProps, systemTopic: SystemTopic | pulumi.Output<GetTopicResult>): import("@pulumi/azure-native/eventgrid/systemTopicEventSubscription.js").SystemTopicEventSubscription;
|
|
66
64
|
}
|