@gradientedge/cdk-utils 9.41.0 → 9.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/lib/azure/services/api-management/main.js +7 -9
- package/dist/src/lib/azure/services/api-management/types.d.ts +1 -2
- package/dist/src/lib/azure/services/app-configuration/main.js +5 -3
- package/dist/src/lib/azure/services/app-service/main.js +5 -3
- package/dist/src/lib/azure/services/application-insights/main.js +5 -3
- package/dist/src/lib/azure/services/cosmosdb/main.js +6 -2
- package/dist/src/lib/azure/services/dns/main.d.ts +10 -1
- package/dist/src/lib/azure/services/dns/main.js +29 -15
- package/dist/src/lib/azure/services/dns/types.d.ts +3 -0
- package/dist/src/lib/azure/services/eventgrid/main.js +7 -3
- package/dist/src/lib/azure/services/eventgrid/types.d.ts +1 -2
- package/dist/src/lib/azure/services/function/main.js +6 -2
- package/dist/src/lib/azure/services/key-vault/main.js +3 -1
- package/dist/src/lib/azure/services/log-analytics-workspace/main.js +3 -1
- package/dist/src/lib/azure/services/resource-group/main.js +1 -1
- package/dist/src/lib/azure/services/servicebus/main.js +3 -1
- package/dist/src/lib/azure/services/storage/main.js +1 -1
- package/package.json +1 -1
- package/src/lib/azure/services/api-management/main.ts +7 -12
- package/src/lib/azure/services/api-management/types.ts +1 -3
- package/src/lib/azure/services/app-configuration/main.ts +5 -6
- package/src/lib/azure/services/app-service/main.ts +5 -6
- package/src/lib/azure/services/application-insights/main.ts +5 -6
- package/src/lib/azure/services/cosmosdb/main.ts +6 -8
- package/src/lib/azure/services/dns/main.ts +33 -21
- package/src/lib/azure/services/dns/types.ts +2 -0
- package/src/lib/azure/services/eventgrid/main.ts +7 -9
- package/src/lib/azure/services/eventgrid/types.ts +1 -3
- package/src/lib/azure/services/function/main.ts +6 -8
- package/src/lib/azure/services/key-vault/main.ts +3 -4
- package/src/lib/azure/services/log-analytics-workspace/main.ts +3 -4
- package/src/lib/azure/services/resource-group/main.ts +1 -1
- package/src/lib/azure/services/servicebus/main.ts +3 -4
- package/src/lib/azure/services/storage/main.ts +1 -1
|
@@ -43,13 +43,13 @@ class AzureApiManagementManager {
|
|
|
43
43
|
if (!props)
|
|
44
44
|
throw `Props undefined for ${id}`;
|
|
45
45
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-am-rg`, {
|
|
46
|
-
name: scope.
|
|
46
|
+
name: scope.props.resourceGroupName || props.resourceGroupName,
|
|
47
47
|
});
|
|
48
48
|
if (!resourceGroup)
|
|
49
49
|
throw `Resource group undefined for ${id}`;
|
|
50
50
|
const apiManagement = new api_management_1.ApiManagement(scope, `${id}-am`, {
|
|
51
51
|
...props,
|
|
52
|
-
name:
|
|
52
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
53
53
|
resourceGroupName: resourceGroup.name,
|
|
54
54
|
tags: props.tags ?? {
|
|
55
55
|
environment: scope.props.stage,
|
|
@@ -57,7 +57,7 @@ class AzureApiManagementManager {
|
|
|
57
57
|
});
|
|
58
58
|
if (applicationInsightsKey) {
|
|
59
59
|
new api_management_logger_1.ApiManagementLogger(scope, `${id}-am-logger`, {
|
|
60
|
-
name:
|
|
60
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
61
61
|
resourceGroupName: resourceGroup.name,
|
|
62
62
|
apiManagementName: apiManagement.name,
|
|
63
63
|
applicationInsights: {
|
|
@@ -81,15 +81,13 @@ class AzureApiManagementManager {
|
|
|
81
81
|
if (!props)
|
|
82
82
|
throw `Props undefined for ${id}`;
|
|
83
83
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-am-rg`, {
|
|
84
|
-
name: scope.props.resourceGroupName
|
|
85
|
-
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
86
|
-
: `${props.resourceGroupName}`,
|
|
84
|
+
name: scope.props.resourceGroupName || props.resourceGroupName,
|
|
87
85
|
});
|
|
88
86
|
if (!resourceGroup)
|
|
89
87
|
throw `Resource group undefined for ${id}`;
|
|
90
88
|
const apiManagement = new data_azurerm_api_management_1.DataAzurermApiManagement(scope, `${id}-am`, {
|
|
91
89
|
...props,
|
|
92
|
-
name:
|
|
90
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
93
91
|
resourceGroupName: scope.props.resourceGroupName
|
|
94
92
|
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
95
93
|
: `${props.resourceGroupName}`,
|
|
@@ -108,7 +106,7 @@ class AzureApiManagementManager {
|
|
|
108
106
|
throw `Props undefined for ${id}`;
|
|
109
107
|
const apiManagementBackend = new api_management_backend_1.ApiManagementBackend(scope, `${id}-am-be`, {
|
|
110
108
|
...props,
|
|
111
|
-
name:
|
|
109
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
112
110
|
description: props.description || `Backend for ${props.name}-${scope.props.stage}`,
|
|
113
111
|
protocol: props.protocol || 'http',
|
|
114
112
|
});
|
|
@@ -129,7 +127,7 @@ class AzureApiManagementManager {
|
|
|
129
127
|
throw `Props undefined for ${id}`;
|
|
130
128
|
const apiManagementApi = new api_management_api_1.ApiManagementApi(scope, `${id}-am-api`, {
|
|
131
129
|
...props,
|
|
132
|
-
name:
|
|
130
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
133
131
|
displayName: props.displayName || props.name,
|
|
134
132
|
revision: props.revision || '1',
|
|
135
133
|
protocols: props.protocols || ['https'],
|
|
@@ -3,8 +3,7 @@ import { ApiManagementBackendConfig } from '@cdktf/provider-azurerm/lib/api-mana
|
|
|
3
3
|
import { ApiManagementApiConfig } from '@cdktf/provider-azurerm/lib/api-management-api';
|
|
4
4
|
import { ApiManagementApiOperationConfig } from '@cdktf/provider-azurerm/lib/api-management-api-operation';
|
|
5
5
|
import { ApiManagementApiOperationPolicyConfig } from '@cdktf/provider-azurerm/lib/api-management-api-operation-policy';
|
|
6
|
-
export interface ApiManagementProps extends
|
|
7
|
-
name?: string | undefined;
|
|
6
|
+
export interface ApiManagementProps extends ApiManagementConfig {
|
|
8
7
|
}
|
|
9
8
|
export interface ApiManagementBackendProps extends ApiManagementBackendConfig {
|
|
10
9
|
}
|
|
@@ -32,12 +32,14 @@ class AzureAppConfigurationManager {
|
|
|
32
32
|
createAppConfiguration(id, scope, props) {
|
|
33
33
|
if (!props)
|
|
34
34
|
throw `Props undefined for ${id}`;
|
|
35
|
-
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-
|
|
36
|
-
name: scope.
|
|
35
|
+
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-ac-rg`, {
|
|
36
|
+
name: scope.props.resourceGroupName
|
|
37
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
38
|
+
: `${props.resourceGroupName}`,
|
|
37
39
|
});
|
|
38
40
|
if (!resourceGroup)
|
|
39
41
|
throw `Resource group undefined for ${id}`;
|
|
40
|
-
const appConfiguration = new app_configuration_1.AppConfiguration(scope, `${id}-
|
|
42
|
+
const appConfiguration = new app_configuration_1.AppConfiguration(scope, `${id}-ac`, {
|
|
41
43
|
...props,
|
|
42
44
|
name: `${props.name}-${scope.props.stage}`,
|
|
43
45
|
resourceGroupName: resourceGroup.name,
|
|
@@ -32,12 +32,14 @@ class AzureAppServiceManager {
|
|
|
32
32
|
createAppServicePlan(id, scope, props) {
|
|
33
33
|
if (!props)
|
|
34
34
|
throw `Props undefined for ${id}`;
|
|
35
|
-
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-
|
|
36
|
-
name: scope.
|
|
35
|
+
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-as-rg`, {
|
|
36
|
+
name: scope.props.resourceGroupName
|
|
37
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
38
|
+
: `${props.resourceGroupName}`,
|
|
37
39
|
});
|
|
38
40
|
if (!resourceGroup)
|
|
39
41
|
throw `Resource group undefined for ${id}`;
|
|
40
|
-
const appServicePlan = new service_plan_1.ServicePlan(scope, `${id}-
|
|
42
|
+
const appServicePlan = new service_plan_1.ServicePlan(scope, `${id}-as`, {
|
|
41
43
|
...props,
|
|
42
44
|
name: scope.resourceNameFormatter.format(props.name),
|
|
43
45
|
resourceGroupName: resourceGroup.name,
|
|
@@ -32,12 +32,14 @@ class AzureApplicationInsightsManager {
|
|
|
32
32
|
createApplicationInsights(id, scope, props) {
|
|
33
33
|
if (!props)
|
|
34
34
|
throw `Props undefined for ${id}`;
|
|
35
|
-
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-
|
|
36
|
-
name: scope.
|
|
35
|
+
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-ai-rg`, {
|
|
36
|
+
name: scope.props.resourceGroupName
|
|
37
|
+
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
38
|
+
: `${props.resourceGroupName}`,
|
|
37
39
|
});
|
|
38
40
|
if (!resourceGroup)
|
|
39
41
|
throw `Resource group undefined for ${id}`;
|
|
40
|
-
const applicationInsights = new application_insights_1.ApplicationInsights(scope, `${id}-
|
|
42
|
+
const applicationInsights = new application_insights_1.ApplicationInsights(scope, `${id}-ai`, {
|
|
41
43
|
...props,
|
|
42
44
|
name: `${props.name}-${scope.props.stage}` || '',
|
|
43
45
|
resourceGroupName: resourceGroup.name,
|
|
@@ -35,7 +35,9 @@ class AzureCosmosDbManager {
|
|
|
35
35
|
if (!props)
|
|
36
36
|
throw `Props undefined for ${id}`;
|
|
37
37
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-ca-rg`, {
|
|
38
|
-
name: scope.
|
|
38
|
+
name: scope.props.resourceGroupName
|
|
39
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
40
|
+
: `${props.resourceGroupName}`,
|
|
39
41
|
});
|
|
40
42
|
if (!resourceGroup)
|
|
41
43
|
throw `Resource group undefined for ${id}`;
|
|
@@ -64,7 +66,9 @@ class AzureCosmosDbManager {
|
|
|
64
66
|
if (!props)
|
|
65
67
|
throw `Props undefined for ${id}`;
|
|
66
68
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-cd-rg`, {
|
|
67
|
-
name: scope.
|
|
69
|
+
name: scope.props.resourceGroupName
|
|
70
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
71
|
+
: `${props.resourceGroupName}`,
|
|
68
72
|
});
|
|
69
73
|
if (!resourceGroup)
|
|
70
74
|
throw `Resource group undefined for ${id}`;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { DnsZone } from '@cdktf/provider-azurerm/lib/dns-zone';
|
|
2
2
|
import { DnsARecord } from '@cdktf/provider-azurerm/lib/dns-a-record';
|
|
3
3
|
import { DnsCnameRecord } from '@cdktf/provider-azurerm/lib/dns-cname-record';
|
|
4
|
+
import { DnsTxtRecord } from '@cdktf/provider-azurerm/lib/dns-txt-record';
|
|
4
5
|
import { CommonAzureConstruct } from '../../common';
|
|
5
|
-
import { DnsZoneProps, DnsARecordProps, DnsCnameRecordProps } from './types';
|
|
6
|
+
import { DnsZoneProps, DnsARecordProps, DnsCnameRecordProps, DnsTxtRecordProps } from './types';
|
|
6
7
|
/**
|
|
7
8
|
* @classdesc Provides operations on Azure DNS
|
|
8
9
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
@@ -45,4 +46,12 @@ export declare class AzureDnsManager {
|
|
|
45
46
|
* @see [CDKTF DNS CNAME Record Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsCnameRecord.typescript.md}
|
|
46
47
|
*/
|
|
47
48
|
createDnsCnameRecord(id: string, scope: CommonAzureConstruct, props: DnsCnameRecordProps): DnsCnameRecord;
|
|
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
|
+
* @see [CDKTF DNS TXT Record Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsCnameRecord.typescript.md}
|
|
55
|
+
*/
|
|
56
|
+
createDnsTxtRecord(id: string, scope: CommonAzureConstruct, props: DnsTxtRecordProps): DnsTxtRecord;
|
|
48
57
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AzureDnsManager = void 0;
|
|
4
4
|
const data_azurerm_resource_group_1 = require("@cdktf/provider-azurerm/lib/data-azurerm-resource-group");
|
|
5
|
-
const data_azurerm_dns_zone_1 = require("@cdktf/provider-azurerm/lib/data-azurerm-dns-zone");
|
|
6
5
|
const dns_zone_1 = require("@cdktf/provider-azurerm/lib/dns-zone");
|
|
7
6
|
const dns_a_record_1 = require("@cdktf/provider-azurerm/lib/dns-a-record");
|
|
8
7
|
const dns_cname_record_1 = require("@cdktf/provider-azurerm/lib/dns-cname-record");
|
|
8
|
+
const dns_txt_record_1 = require("@cdktf/provider-azurerm/lib/dns-txt-record");
|
|
9
9
|
const utils_1 = require("../../utils");
|
|
10
10
|
/**
|
|
11
11
|
* @classdesc Provides operations on Azure DNS
|
|
@@ -35,8 +35,10 @@ class AzureDnsManager {
|
|
|
35
35
|
createDnsZone(id, scope, props) {
|
|
36
36
|
if (!props)
|
|
37
37
|
throw `Props undefined for ${id}`;
|
|
38
|
-
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-
|
|
39
|
-
name: scope.
|
|
38
|
+
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-dz-rg`, {
|
|
39
|
+
name: scope.props.resourceGroupName
|
|
40
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
41
|
+
: `${props.resourceGroupName}`,
|
|
40
42
|
});
|
|
41
43
|
if (!resourceGroup)
|
|
42
44
|
throw `Resource group undefined for ${id}`;
|
|
@@ -63,15 +65,10 @@ class AzureDnsManager {
|
|
|
63
65
|
createDnsARecord(id, scope, props) {
|
|
64
66
|
if (!props)
|
|
65
67
|
throw `Props undefined for ${id}`;
|
|
66
|
-
const dnsZone = new data_azurerm_dns_zone_1.DataAzurermDnsZone(scope, `${id}-da-dz`, {
|
|
67
|
-
name: props.zoneName,
|
|
68
|
-
resourceGroupName: props.resourceGroupName,
|
|
69
|
-
});
|
|
70
68
|
const dnsARecord = new dns_a_record_1.DnsARecord(scope, `${id}-da`, {
|
|
71
69
|
...props,
|
|
72
70
|
name: scope.resourceNameFormatter.format(props.name),
|
|
73
|
-
|
|
74
|
-
zoneName: dnsZone.name,
|
|
71
|
+
ttl: props.ttl || 300,
|
|
75
72
|
tags: props.tags ?? {
|
|
76
73
|
environment: scope.props.stage,
|
|
77
74
|
},
|
|
@@ -91,15 +88,10 @@ class AzureDnsManager {
|
|
|
91
88
|
createDnsCnameRecord(id, scope, props) {
|
|
92
89
|
if (!props)
|
|
93
90
|
throw `Props undefined for ${id}`;
|
|
94
|
-
const dnsZone = new data_azurerm_dns_zone_1.DataAzurermDnsZone(scope, `${id}-dc-dz`, {
|
|
95
|
-
name: props.zoneName,
|
|
96
|
-
resourceGroupName: props.resourceGroupName,
|
|
97
|
-
});
|
|
98
91
|
const dnsCnameRecord = new dns_cname_record_1.DnsCnameRecord(scope, `${id}-dc`, {
|
|
99
92
|
...props,
|
|
100
93
|
name: scope.resourceNameFormatter.format(props.name),
|
|
101
|
-
|
|
102
|
-
zoneName: dnsZone.name,
|
|
94
|
+
ttl: props.ttl || 300,
|
|
103
95
|
tags: props.tags ?? {
|
|
104
96
|
environment: scope.props.stage,
|
|
105
97
|
},
|
|
@@ -109,5 +101,27 @@ class AzureDnsManager {
|
|
|
109
101
|
(0, utils_1.createAzureTfOutput)(`${id}-dnsCnameRecordId`, scope, dnsCnameRecord.id);
|
|
110
102
|
return dnsCnameRecord;
|
|
111
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* @summary Method to create a new DNS TXT Record
|
|
106
|
+
* @param id scoped id of the resource
|
|
107
|
+
* @param scope scope in which this resource is defined
|
|
108
|
+
* @param props dns txt record properties
|
|
109
|
+
* @see [CDKTF DNS TXT Record Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsCnameRecord.typescript.md}
|
|
110
|
+
*/
|
|
111
|
+
createDnsTxtRecord(id, scope, props) {
|
|
112
|
+
if (!props)
|
|
113
|
+
throw `Props undefined for ${id}`;
|
|
114
|
+
const dnsTxtRecord = new dns_txt_record_1.DnsTxtRecord(scope, `${id}-dc`, {
|
|
115
|
+
...props,
|
|
116
|
+
ttl: props.ttl || 300,
|
|
117
|
+
tags: props.tags ?? {
|
|
118
|
+
environment: scope.props.stage,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
(0, utils_1.createAzureTfOutput)(`${id}-dnsTxtRecordName`, scope, dnsTxtRecord.name);
|
|
122
|
+
(0, utils_1.createAzureTfOutput)(`${id}-dnsTxtRecordFriendlyUniqueId`, scope, dnsTxtRecord.friendlyUniqueId);
|
|
123
|
+
(0, utils_1.createAzureTfOutput)(`${id}-dnsTxtRecordId`, scope, dnsTxtRecord.id);
|
|
124
|
+
return dnsTxtRecord;
|
|
125
|
+
}
|
|
112
126
|
}
|
|
113
127
|
exports.AzureDnsManager = AzureDnsManager;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { DnsZoneConfig } from '@cdktf/provider-azurerm/lib/dns-zone';
|
|
2
2
|
import { DnsARecordConfig } from '@cdktf/provider-azurerm/lib/dns-a-record';
|
|
3
3
|
import { DnsCnameRecordConfig } from '@cdktf/provider-azurerm/lib/dns-cname-record';
|
|
4
|
+
import { DnsTxtRecordConfig } from '@cdktf/provider-azurerm/lib/dns-txt-record';
|
|
4
5
|
export interface DnsZoneProps extends DnsZoneConfig {
|
|
5
6
|
}
|
|
6
7
|
export interface DnsARecordProps extends DnsARecordConfig {
|
|
7
8
|
}
|
|
8
9
|
export interface DnsCnameRecordProps extends DnsCnameRecordConfig {
|
|
9
10
|
}
|
|
11
|
+
export interface DnsTxtRecordProps extends DnsTxtRecordConfig {
|
|
12
|
+
}
|
|
@@ -35,13 +35,15 @@ class AzureEventgridManager {
|
|
|
35
35
|
if (!props)
|
|
36
36
|
throw `Props undefined for ${id}`;
|
|
37
37
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-et-rg`, {
|
|
38
|
-
name: scope.
|
|
38
|
+
name: scope.props.resourceGroupName
|
|
39
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
40
|
+
: `${props.resourceGroupName}`,
|
|
39
41
|
});
|
|
40
42
|
if (!resourceGroup)
|
|
41
43
|
throw `Resource group undefined for ${id}`;
|
|
42
44
|
const eventgridTopic = new eventgrid_topic_1.EventgridTopic(scope, `${id}-et`, {
|
|
43
45
|
...props,
|
|
44
|
-
name:
|
|
46
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
45
47
|
location: resourceGroup.location,
|
|
46
48
|
resourceGroupName: resourceGroup.name,
|
|
47
49
|
tags: props.tags ?? {
|
|
@@ -65,7 +67,9 @@ class AzureEventgridManager {
|
|
|
65
67
|
if (!props)
|
|
66
68
|
throw `Props undefined for ${id}`;
|
|
67
69
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-et-rg`, {
|
|
68
|
-
name: scope.
|
|
70
|
+
name: scope.props.resourceGroupName
|
|
71
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
72
|
+
: `${props.resourceGroupName}`,
|
|
69
73
|
});
|
|
70
74
|
if (!resourceGroup)
|
|
71
75
|
throw `Resource group undefined for ${id}`;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EventgridTopicConfig } from '@cdktf/provider-azurerm/lib/eventgrid-topic';
|
|
2
2
|
import { EventgridEventSubscriptionConfig } from '@cdktf/provider-azurerm/lib/eventgrid-event-subscription';
|
|
3
|
-
export interface EventgridTopicProps extends
|
|
4
|
-
name?: string | undefined;
|
|
3
|
+
export interface EventgridTopicProps extends EventgridTopicConfig {
|
|
5
4
|
}
|
|
6
5
|
export interface EventgridEventSubscriptionProps extends EventgridEventSubscriptionConfig {
|
|
7
6
|
}
|
|
@@ -36,7 +36,9 @@ class AzureFunctionManager {
|
|
|
36
36
|
if (!props)
|
|
37
37
|
throw `Props undefined for ${id}`;
|
|
38
38
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-fa-rg`, {
|
|
39
|
-
name: scope.
|
|
39
|
+
name: scope.props.resourceGroupName
|
|
40
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
41
|
+
: `${props.resourceGroupName}`,
|
|
40
42
|
});
|
|
41
43
|
if (!resourceGroup)
|
|
42
44
|
throw `Resource group undefined for ${id}`;
|
|
@@ -83,7 +85,9 @@ class AzureFunctionManager {
|
|
|
83
85
|
if (!props)
|
|
84
86
|
throw `Props undefined for ${id}`;
|
|
85
87
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-fa-rg`, {
|
|
86
|
-
name: scope.
|
|
88
|
+
name: scope.props.resourceGroupName
|
|
89
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
90
|
+
: `${props.resourceGroupName}`,
|
|
87
91
|
});
|
|
88
92
|
if (!resourceGroup)
|
|
89
93
|
throw `Resource group undefined for ${id}`;
|
|
@@ -33,7 +33,9 @@ class AzureKeyVaultManager {
|
|
|
33
33
|
if (!props)
|
|
34
34
|
throw `Props undefined for ${id}`;
|
|
35
35
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-kv-rg`, {
|
|
36
|
-
name: scope.
|
|
36
|
+
name: scope.props.resourceGroupName
|
|
37
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
38
|
+
: `${props.resourceGroupName}`,
|
|
37
39
|
});
|
|
38
40
|
if (!resourceGroup)
|
|
39
41
|
throw `Resource group undefined for ${id}`;
|
|
@@ -33,7 +33,9 @@ class AzureLogAnalyticsWorkspaceManager {
|
|
|
33
33
|
if (!props)
|
|
34
34
|
throw `Props undefined for ${id}`;
|
|
35
35
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-lw-rg`, {
|
|
36
|
-
name: scope.
|
|
36
|
+
name: scope.props.resourceGroupName
|
|
37
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
38
|
+
: `${props.resourceGroupName}`,
|
|
37
39
|
});
|
|
38
40
|
if (!resourceGroup)
|
|
39
41
|
throw `Resource group undefined for ${id}`;
|
|
@@ -33,7 +33,7 @@ class AzureResourceGroupManager {
|
|
|
33
33
|
throw `Props undefined for ${id}`;
|
|
34
34
|
const resourceGroup = new resource_group_1.ResourceGroup(scope, `${id}-rg`, {
|
|
35
35
|
...props,
|
|
36
|
-
name: props.name,
|
|
36
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
37
37
|
location: props.location,
|
|
38
38
|
tags: props.tags ?? {
|
|
39
39
|
environment: scope.props.stage,
|
|
@@ -36,7 +36,9 @@ class AzureServicebusManager {
|
|
|
36
36
|
if (!props)
|
|
37
37
|
throw `Props undefined for ${id}`;
|
|
38
38
|
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-sn-rg`, {
|
|
39
|
-
name: scope.
|
|
39
|
+
name: scope.props.resourceGroupName
|
|
40
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
41
|
+
: `${props.resourceGroupName}`,
|
|
40
42
|
});
|
|
41
43
|
if (!resourceGroup)
|
|
42
44
|
throw `Resource group undefined for ${id}`;
|
|
@@ -36,7 +36,7 @@ class AzureStorageManager {
|
|
|
36
36
|
createStorageAccount(id, scope, props) {
|
|
37
37
|
if (!props)
|
|
38
38
|
throw `Props undefined for ${id}`;
|
|
39
|
-
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-
|
|
39
|
+
const resourceGroup = new data_azurerm_resource_group_1.DataAzurermResourceGroup(scope, `${id}-sa-rg`, {
|
|
40
40
|
name: scope.resourceNameFormatter.format(scope.props.resourceGroupName || props.resourceGroupName, scope.props.resourceNameOptions?.resourceGroup),
|
|
41
41
|
});
|
|
42
42
|
if (!resourceGroup)
|
package/package.json
CHANGED
|
@@ -51,17 +51,14 @@ export class AzureApiManagementManager {
|
|
|
51
51
|
if (!props) throw `Props undefined for ${id}`
|
|
52
52
|
|
|
53
53
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-am-rg`, {
|
|
54
|
-
name: scope.
|
|
55
|
-
scope.props.resourceGroupName || props.resourceGroupName,
|
|
56
|
-
scope.props.resourceNameOptions?.resourceGroup
|
|
57
|
-
),
|
|
54
|
+
name: scope.props.resourceGroupName || props.resourceGroupName,
|
|
58
55
|
})
|
|
59
56
|
|
|
60
57
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
61
58
|
|
|
62
59
|
const apiManagement = new ApiManagement(scope, `${id}-am`, {
|
|
63
60
|
...props,
|
|
64
|
-
name:
|
|
61
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
65
62
|
resourceGroupName: resourceGroup.name,
|
|
66
63
|
tags: props.tags ?? {
|
|
67
64
|
environment: scope.props.stage,
|
|
@@ -70,7 +67,7 @@ export class AzureApiManagementManager {
|
|
|
70
67
|
|
|
71
68
|
if (applicationInsightsKey) {
|
|
72
69
|
new ApiManagementLogger(scope, `${id}-am-logger`, {
|
|
73
|
-
name:
|
|
70
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
74
71
|
resourceGroupName: resourceGroup.name,
|
|
75
72
|
apiManagementName: apiManagement.name,
|
|
76
73
|
applicationInsights: {
|
|
@@ -97,16 +94,14 @@ export class AzureApiManagementManager {
|
|
|
97
94
|
if (!props) throw `Props undefined for ${id}`
|
|
98
95
|
|
|
99
96
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-am-rg`, {
|
|
100
|
-
name: scope.props.resourceGroupName
|
|
101
|
-
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
102
|
-
: `${props.resourceGroupName}`,
|
|
97
|
+
name: scope.props.resourceGroupName || props.resourceGroupName,
|
|
103
98
|
})
|
|
104
99
|
|
|
105
100
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
106
101
|
|
|
107
102
|
const apiManagement = new DataAzurermApiManagement(scope, `${id}-am`, {
|
|
108
103
|
...props,
|
|
109
|
-
name:
|
|
104
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
110
105
|
resourceGroupName: scope.props.resourceGroupName
|
|
111
106
|
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
112
107
|
: `${props.resourceGroupName}`,
|
|
@@ -127,7 +122,7 @@ export class AzureApiManagementManager {
|
|
|
127
122
|
|
|
128
123
|
const apiManagementBackend = new ApiManagementBackend(scope, `${id}-am-be`, {
|
|
129
124
|
...props,
|
|
130
|
-
name:
|
|
125
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
131
126
|
description: props.description || `Backend for ${props.name}-${scope.props.stage}`,
|
|
132
127
|
protocol: props.protocol || 'http',
|
|
133
128
|
})
|
|
@@ -151,7 +146,7 @@ export class AzureApiManagementManager {
|
|
|
151
146
|
|
|
152
147
|
const apiManagementApi = new ApiManagementApi(scope, `${id}-am-api`, {
|
|
153
148
|
...props,
|
|
154
|
-
name:
|
|
149
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
155
150
|
displayName: props.displayName || props.name,
|
|
156
151
|
revision: props.revision || '1',
|
|
157
152
|
protocols: props.protocols || ['https'],
|
|
@@ -4,9 +4,7 @@ import { ApiManagementApiConfig } from '@cdktf/provider-azurerm/lib/api-manageme
|
|
|
4
4
|
import { ApiManagementApiOperationConfig } from '@cdktf/provider-azurerm/lib/api-management-api-operation'
|
|
5
5
|
import { ApiManagementApiOperationPolicyConfig } from '@cdktf/provider-azurerm/lib/api-management-api-operation-policy'
|
|
6
6
|
|
|
7
|
-
export interface ApiManagementProps extends
|
|
8
|
-
name?: string | undefined
|
|
9
|
-
}
|
|
7
|
+
export interface ApiManagementProps extends ApiManagementConfig {}
|
|
10
8
|
|
|
11
9
|
export interface ApiManagementBackendProps extends ApiManagementBackendConfig {}
|
|
12
10
|
|
|
@@ -32,16 +32,15 @@ export class AzureAppConfigurationManager {
|
|
|
32
32
|
public createAppConfiguration(id: string, scope: CommonAzureConstruct, props: AppConfigurationProps) {
|
|
33
33
|
if (!props) throw `Props undefined for ${id}`
|
|
34
34
|
|
|
35
|
-
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-
|
|
36
|
-
name: scope.
|
|
37
|
-
scope.
|
|
38
|
-
|
|
39
|
-
),
|
|
35
|
+
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-ac-rg`, {
|
|
36
|
+
name: scope.props.resourceGroupName
|
|
37
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
38
|
+
: `${props.resourceGroupName}`,
|
|
40
39
|
})
|
|
41
40
|
|
|
42
41
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
43
42
|
|
|
44
|
-
const appConfiguration = new AppConfiguration(scope, `${id}-
|
|
43
|
+
const appConfiguration = new AppConfiguration(scope, `${id}-ac`, {
|
|
45
44
|
...props,
|
|
46
45
|
name: `${props.name}-${scope.props.stage}`,
|
|
47
46
|
resourceGroupName: resourceGroup.name,
|
|
@@ -32,16 +32,15 @@ export class AzureAppServiceManager {
|
|
|
32
32
|
public createAppServicePlan(id: string, scope: CommonAzureConstruct, props: ServicePlanProps) {
|
|
33
33
|
if (!props) throw `Props undefined for ${id}`
|
|
34
34
|
|
|
35
|
-
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-
|
|
36
|
-
name: scope.
|
|
37
|
-
scope.
|
|
38
|
-
|
|
39
|
-
),
|
|
35
|
+
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-as-rg`, {
|
|
36
|
+
name: scope.props.resourceGroupName
|
|
37
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
38
|
+
: `${props.resourceGroupName}`,
|
|
40
39
|
})
|
|
41
40
|
|
|
42
41
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
43
42
|
|
|
44
|
-
const appServicePlan = new ServicePlan(scope, `${id}-
|
|
43
|
+
const appServicePlan = new ServicePlan(scope, `${id}-as`, {
|
|
45
44
|
...props,
|
|
46
45
|
name: scope.resourceNameFormatter.format(props.name),
|
|
47
46
|
resourceGroupName: resourceGroup.name,
|
|
@@ -32,16 +32,15 @@ export class AzureApplicationInsightsManager {
|
|
|
32
32
|
public createApplicationInsights(id: string, scope: CommonAzureConstruct, props: ApplicationInsightsProps) {
|
|
33
33
|
if (!props) throw `Props undefined for ${id}`
|
|
34
34
|
|
|
35
|
-
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-
|
|
36
|
-
name: scope.
|
|
37
|
-
scope.props.resourceGroupName
|
|
38
|
-
|
|
39
|
-
),
|
|
35
|
+
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-ai-rg`, {
|
|
36
|
+
name: scope.props.resourceGroupName
|
|
37
|
+
? `${scope.props.resourceGroupName}-${scope.props.stage}`
|
|
38
|
+
: `${props.resourceGroupName}`,
|
|
40
39
|
})
|
|
41
40
|
|
|
42
41
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
43
42
|
|
|
44
|
-
const applicationInsights = new ApplicationInsights(scope, `${id}-
|
|
43
|
+
const applicationInsights = new ApplicationInsights(scope, `${id}-ai`, {
|
|
45
44
|
...props,
|
|
46
45
|
name: `${props.name}-${scope.props.stage}` || '',
|
|
47
46
|
resourceGroupName: resourceGroup.name,
|
|
@@ -35,10 +35,9 @@ export class AzureCosmosDbManager {
|
|
|
35
35
|
if (!props) throw `Props undefined for ${id}`
|
|
36
36
|
|
|
37
37
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-ca-rg`, {
|
|
38
|
-
name: scope.
|
|
39
|
-
scope.
|
|
40
|
-
|
|
41
|
-
),
|
|
38
|
+
name: scope.props.resourceGroupName
|
|
39
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
40
|
+
: `${props.resourceGroupName}`,
|
|
42
41
|
})
|
|
43
42
|
|
|
44
43
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
@@ -71,10 +70,9 @@ export class AzureCosmosDbManager {
|
|
|
71
70
|
if (!props) throw `Props undefined for ${id}`
|
|
72
71
|
|
|
73
72
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-cd-rg`, {
|
|
74
|
-
name: scope.
|
|
75
|
-
scope.
|
|
76
|
-
|
|
77
|
-
),
|
|
73
|
+
name: scope.props.resourceGroupName
|
|
74
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
75
|
+
: `${props.resourceGroupName}`,
|
|
78
76
|
})
|
|
79
77
|
|
|
80
78
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DataAzurermResourceGroup } from '@cdktf/provider-azurerm/lib/data-azurerm-resource-group'
|
|
2
|
-
import { DataAzurermDnsZone } from '@cdktf/provider-azurerm/lib/data-azurerm-dns-zone'
|
|
3
2
|
import { DnsZone } from '@cdktf/provider-azurerm/lib/dns-zone'
|
|
4
3
|
import { DnsARecord } from '@cdktf/provider-azurerm/lib/dns-a-record'
|
|
5
4
|
import { DnsCnameRecord } from '@cdktf/provider-azurerm/lib/dns-cname-record'
|
|
5
|
+
import { DnsTxtRecord } from '@cdktf/provider-azurerm/lib/dns-txt-record'
|
|
6
6
|
import { CommonAzureConstruct } from '../../common'
|
|
7
7
|
import { createAzureTfOutput } from '../../utils'
|
|
8
|
-
import { DnsZoneProps, DnsARecordProps, DnsCnameRecordProps } from './types'
|
|
8
|
+
import { DnsZoneProps, DnsARecordProps, DnsCnameRecordProps, DnsTxtRecordProps } from './types'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @classdesc Provides operations on Azure DNS
|
|
@@ -35,11 +35,10 @@ export class AzureDnsManager {
|
|
|
35
35
|
public createDnsZone(id: string, scope: CommonAzureConstruct, props: DnsZoneProps) {
|
|
36
36
|
if (!props) throw `Props undefined for ${id}`
|
|
37
37
|
|
|
38
|
-
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-
|
|
39
|
-
name: scope.
|
|
40
|
-
scope.
|
|
41
|
-
|
|
42
|
-
),
|
|
38
|
+
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-dz-rg`, {
|
|
39
|
+
name: scope.props.resourceGroupName
|
|
40
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
41
|
+
: `${props.resourceGroupName}`,
|
|
43
42
|
})
|
|
44
43
|
|
|
45
44
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
@@ -70,16 +69,10 @@ export class AzureDnsManager {
|
|
|
70
69
|
public createDnsARecord(id: string, scope: CommonAzureConstruct, props: DnsARecordProps) {
|
|
71
70
|
if (!props) throw `Props undefined for ${id}`
|
|
72
71
|
|
|
73
|
-
const dnsZone = new DataAzurermDnsZone(scope, `${id}-da-dz`, {
|
|
74
|
-
name: props.zoneName,
|
|
75
|
-
resourceGroupName: props.resourceGroupName,
|
|
76
|
-
})
|
|
77
|
-
|
|
78
72
|
const dnsARecord = new DnsARecord(scope, `${id}-da`, {
|
|
79
73
|
...props,
|
|
80
74
|
name: scope.resourceNameFormatter.format(props.name),
|
|
81
|
-
|
|
82
|
-
zoneName: dnsZone.name,
|
|
75
|
+
ttl: props.ttl || 300,
|
|
83
76
|
tags: props.tags ?? {
|
|
84
77
|
environment: scope.props.stage,
|
|
85
78
|
},
|
|
@@ -102,16 +95,10 @@ export class AzureDnsManager {
|
|
|
102
95
|
public createDnsCnameRecord(id: string, scope: CommonAzureConstruct, props: DnsCnameRecordProps) {
|
|
103
96
|
if (!props) throw `Props undefined for ${id}`
|
|
104
97
|
|
|
105
|
-
const dnsZone = new DataAzurermDnsZone(scope, `${id}-dc-dz`, {
|
|
106
|
-
name: props.zoneName,
|
|
107
|
-
resourceGroupName: props.resourceGroupName,
|
|
108
|
-
})
|
|
109
|
-
|
|
110
98
|
const dnsCnameRecord = new DnsCnameRecord(scope, `${id}-dc`, {
|
|
111
99
|
...props,
|
|
112
100
|
name: scope.resourceNameFormatter.format(props.name),
|
|
113
|
-
|
|
114
|
-
zoneName: dnsZone.name,
|
|
101
|
+
ttl: props.ttl || 300,
|
|
115
102
|
tags: props.tags ?? {
|
|
116
103
|
environment: scope.props.stage,
|
|
117
104
|
},
|
|
@@ -123,4 +110,29 @@ export class AzureDnsManager {
|
|
|
123
110
|
|
|
124
111
|
return dnsCnameRecord
|
|
125
112
|
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @summary Method to create a new DNS TXT Record
|
|
116
|
+
* @param id scoped id of the resource
|
|
117
|
+
* @param scope scope in which this resource is defined
|
|
118
|
+
* @param props dns txt record properties
|
|
119
|
+
* @see [CDKTF DNS TXT Record Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/DnsCnameRecord.typescript.md}
|
|
120
|
+
*/
|
|
121
|
+
public createDnsTxtRecord(id: string, scope: CommonAzureConstruct, props: DnsTxtRecordProps) {
|
|
122
|
+
if (!props) throw `Props undefined for ${id}`
|
|
123
|
+
|
|
124
|
+
const dnsTxtRecord = new DnsTxtRecord(scope, `${id}-dc`, {
|
|
125
|
+
...props,
|
|
126
|
+
ttl: props.ttl || 300,
|
|
127
|
+
tags: props.tags ?? {
|
|
128
|
+
environment: scope.props.stage,
|
|
129
|
+
},
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
createAzureTfOutput(`${id}-dnsTxtRecordName`, scope, dnsTxtRecord.name)
|
|
133
|
+
createAzureTfOutput(`${id}-dnsTxtRecordFriendlyUniqueId`, scope, dnsTxtRecord.friendlyUniqueId)
|
|
134
|
+
createAzureTfOutput(`${id}-dnsTxtRecordId`, scope, dnsTxtRecord.id)
|
|
135
|
+
|
|
136
|
+
return dnsTxtRecord
|
|
137
|
+
}
|
|
126
138
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { DnsZoneConfig } from '@cdktf/provider-azurerm/lib/dns-zone'
|
|
2
2
|
import { DnsARecordConfig } from '@cdktf/provider-azurerm/lib/dns-a-record'
|
|
3
3
|
import { DnsCnameRecordConfig } from '@cdktf/provider-azurerm/lib/dns-cname-record'
|
|
4
|
+
import { DnsTxtRecordConfig } from '@cdktf/provider-azurerm/lib/dns-txt-record'
|
|
4
5
|
|
|
5
6
|
export interface DnsZoneProps extends DnsZoneConfig {}
|
|
6
7
|
export interface DnsARecordProps extends DnsARecordConfig {}
|
|
7
8
|
export interface DnsCnameRecordProps extends DnsCnameRecordConfig {}
|
|
9
|
+
export interface DnsTxtRecordProps extends DnsTxtRecordConfig {}
|
|
@@ -38,17 +38,16 @@ export class AzureEventgridManager {
|
|
|
38
38
|
if (!props) throw `Props undefined for ${id}`
|
|
39
39
|
|
|
40
40
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-et-rg`, {
|
|
41
|
-
name: scope.
|
|
42
|
-
scope.
|
|
43
|
-
|
|
44
|
-
),
|
|
41
|
+
name: scope.props.resourceGroupName
|
|
42
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
43
|
+
: `${props.resourceGroupName}`,
|
|
45
44
|
})
|
|
46
45
|
|
|
47
46
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
48
47
|
|
|
49
48
|
const eventgridTopic = new EventgridTopic(scope, `${id}-et`, {
|
|
50
49
|
...props,
|
|
51
|
-
name:
|
|
50
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
52
51
|
location: resourceGroup.location,
|
|
53
52
|
resourceGroupName: resourceGroup.name,
|
|
54
53
|
tags: props.tags ?? {
|
|
@@ -75,10 +74,9 @@ export class AzureEventgridManager {
|
|
|
75
74
|
if (!props) throw `Props undefined for ${id}`
|
|
76
75
|
|
|
77
76
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-et-rg`, {
|
|
78
|
-
name: scope.
|
|
79
|
-
scope.
|
|
80
|
-
|
|
81
|
-
),
|
|
77
|
+
name: scope.props.resourceGroupName
|
|
78
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
79
|
+
: `${props.resourceGroupName}`,
|
|
82
80
|
})
|
|
83
81
|
|
|
84
82
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { EventgridTopicConfig } from '@cdktf/provider-azurerm/lib/eventgrid-topic'
|
|
2
2
|
import { EventgridEventSubscriptionConfig } from '@cdktf/provider-azurerm/lib/eventgrid-event-subscription'
|
|
3
3
|
|
|
4
|
-
export interface EventgridTopicProps extends
|
|
5
|
-
name?: string | undefined
|
|
6
|
-
}
|
|
4
|
+
export interface EventgridTopicProps extends EventgridTopicConfig {}
|
|
7
5
|
|
|
8
6
|
export interface EventgridEventSubscriptionProps extends EventgridEventSubscriptionConfig {}
|
|
@@ -36,10 +36,9 @@ export class AzureFunctionManager {
|
|
|
36
36
|
if (!props) throw `Props undefined for ${id}`
|
|
37
37
|
|
|
38
38
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-fa-rg`, {
|
|
39
|
-
name: scope.
|
|
40
|
-
scope.
|
|
41
|
-
|
|
42
|
-
),
|
|
39
|
+
name: scope.props.resourceGroupName
|
|
40
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
41
|
+
: `${props.resourceGroupName}`,
|
|
43
42
|
})
|
|
44
43
|
|
|
45
44
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
@@ -97,10 +96,9 @@ export class AzureFunctionManager {
|
|
|
97
96
|
if (!props) throw `Props undefined for ${id}`
|
|
98
97
|
|
|
99
98
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-fa-rg`, {
|
|
100
|
-
name: scope.
|
|
101
|
-
scope.
|
|
102
|
-
|
|
103
|
-
),
|
|
99
|
+
name: scope.props.resourceGroupName
|
|
100
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
101
|
+
: `${props.resourceGroupName}`,
|
|
104
102
|
})
|
|
105
103
|
|
|
106
104
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
@@ -33,10 +33,9 @@ export class AzureKeyVaultManager {
|
|
|
33
33
|
if (!props) throw `Props undefined for ${id}`
|
|
34
34
|
|
|
35
35
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-kv-rg`, {
|
|
36
|
-
name: scope.
|
|
37
|
-
scope.
|
|
38
|
-
|
|
39
|
-
),
|
|
36
|
+
name: scope.props.resourceGroupName
|
|
37
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
38
|
+
: `${props.resourceGroupName}`,
|
|
40
39
|
})
|
|
41
40
|
|
|
42
41
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
@@ -33,10 +33,9 @@ export class AzureLogAnalyticsWorkspaceManager {
|
|
|
33
33
|
if (!props) throw `Props undefined for ${id}`
|
|
34
34
|
|
|
35
35
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-lw-rg`, {
|
|
36
|
-
name: scope.
|
|
37
|
-
scope.
|
|
38
|
-
|
|
39
|
-
),
|
|
36
|
+
name: scope.props.resourceGroupName
|
|
37
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
38
|
+
: `${props.resourceGroupName}`,
|
|
40
39
|
})
|
|
41
40
|
|
|
42
41
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
@@ -33,7 +33,7 @@ export class AzureResourceGroupManager {
|
|
|
33
33
|
|
|
34
34
|
const resourceGroup = new ResourceGroup(scope, `${id}-rg`, {
|
|
35
35
|
...props,
|
|
36
|
-
name: props.name,
|
|
36
|
+
name: scope.resourceNameFormatter.format(props.name),
|
|
37
37
|
location: props.location,
|
|
38
38
|
tags: props.tags ?? {
|
|
39
39
|
environment: scope.props.stage,
|
|
@@ -41,10 +41,9 @@ export class AzureServicebusManager {
|
|
|
41
41
|
if (!props) throw `Props undefined for ${id}`
|
|
42
42
|
|
|
43
43
|
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-sn-rg`, {
|
|
44
|
-
name: scope.
|
|
45
|
-
scope.
|
|
46
|
-
|
|
47
|
-
),
|
|
44
|
+
name: scope.props.resourceGroupName
|
|
45
|
+
? scope.resourceNameFormatter.format(scope.props.resourceGroupName)
|
|
46
|
+
: `${props.resourceGroupName}`,
|
|
48
47
|
})
|
|
49
48
|
|
|
50
49
|
if (!resourceGroup) throw `Resource group undefined for ${id}`
|
|
@@ -36,7 +36,7 @@ export class AzureStorageManager {
|
|
|
36
36
|
public createStorageAccount(id: string, scope: CommonAzureConstruct, props: StorageAccountProps) {
|
|
37
37
|
if (!props) throw `Props undefined for ${id}`
|
|
38
38
|
|
|
39
|
-
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-
|
|
39
|
+
const resourceGroup = new DataAzurermResourceGroup(scope, `${id}-sa-rg`, {
|
|
40
40
|
name: scope.resourceNameFormatter.format(
|
|
41
41
|
scope.props.resourceGroupName || props.resourceGroupName,
|
|
42
42
|
scope.props.resourceNameOptions?.resourceGroup
|