@gradientedge/cdk-utils 9.43.2 → 9.43.3
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.d.ts +10 -1
- package/dist/src/lib/azure/services/api-management/main.js +17 -1
- package/dist/src/lib/azure/services/api-management/types.d.ts +3 -0
- package/dist/src/lib/azure/services/dns/main.js +0 -2
- package/dist/src/lib/cloudflare/common/constants.d.ts +2 -1
- package/dist/src/lib/cloudflare/common/constants.js +1 -0
- package/dist/src/lib/cloudflare/common/construct.js +9 -0
- package/dist/src/lib/cloudflare/common/types.d.ts +4 -0
- package/package.json +1 -1
- package/src/lib/azure/services/api-management/main.ts +35 -3
- package/src/lib/azure/services/api-management/types.ts +3 -0
- package/src/lib/azure/services/dns/main.ts +0 -2
- package/src/lib/cloudflare/common/constants.ts +1 -0
- package/src/lib/cloudflare/common/construct.ts +10 -1
- package/src/lib/cloudflare/common/types.ts +4 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { DataAzurermApiManagement, DataAzurermApiManagementConfig } from '@cdktf/provider-azurerm/lib/data-azurerm-api-management';
|
|
2
|
+
import { ApiManagementCustomDomain } from '@cdktf/provider-azurerm/lib/api-management-custom-domain';
|
|
2
3
|
import { ApiManagementBackend } from '@cdktf/provider-azurerm/lib/api-management-backend';
|
|
3
4
|
import { ApiManagement } from '@cdktf/provider-azurerm/lib/api-management';
|
|
4
5
|
import { ApiManagementApi } from '@cdktf/provider-azurerm/lib/api-management-api';
|
|
5
6
|
import { ApiManagementLoggerApplicationInsights } from '@cdktf/provider-azurerm/lib/api-management-logger';
|
|
6
7
|
import { Resource } from '../../.gen/providers/azapi/resource';
|
|
7
8
|
import { CommonAzureConstruct } from '../../common';
|
|
8
|
-
import { ApiManagementProps, ApiManagementBackendProps, ApiManagementApiProps, ApiManagementV2Props } from './types';
|
|
9
|
+
import { ApiManagementProps, ApiManagementBackendProps, ApiManagementApiProps, ApiManagementV2Props, ApiManagementCustomDomainProps } from './types';
|
|
9
10
|
/**
|
|
10
11
|
* @classdesc Provides operations on Azure Api Management
|
|
11
12
|
* - A new instance of this class is injected into {@link CommonAzureConstruct} constructor.
|
|
@@ -64,4 +65,12 @@ export declare class AzureApiManagementManager {
|
|
|
64
65
|
* @see [CDKTF Api management Api Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/ApiManagementApi.typescript.md}
|
|
65
66
|
*/
|
|
66
67
|
createApiManagementApi(id: string, scope: CommonAzureConstruct, props: ApiManagementApiProps): ApiManagementApi;
|
|
68
|
+
/**
|
|
69
|
+
* @summary Method to create a new api management custom domain
|
|
70
|
+
* @param id scoped id of the resource
|
|
71
|
+
* @param scope scope in which this resource is defined
|
|
72
|
+
* @param props api management custom domain properties
|
|
73
|
+
* @see [CDKTF Api management Custom Domain Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/createApiManagementCustomDomain.typescript.md}
|
|
74
|
+
*/
|
|
75
|
+
createApiManagementCustomDomain(id: string, scope: CommonAzureConstruct, props: ApiManagementCustomDomainProps): ApiManagementCustomDomain;
|
|
67
76
|
}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.AzureApiManagementManager = void 0;
|
|
7
7
|
const data_azurerm_resource_group_1 = require("@cdktf/provider-azurerm/lib/data-azurerm-resource-group");
|
|
8
8
|
const data_azurerm_api_management_1 = require("@cdktf/provider-azurerm/lib/data-azurerm-api-management");
|
|
9
|
+
const api_management_custom_domain_1 = require("@cdktf/provider-azurerm/lib/api-management-custom-domain");
|
|
9
10
|
const api_management_backend_1 = require("@cdktf/provider-azurerm/lib/api-management-backend");
|
|
10
11
|
const api_management_1 = require("@cdktf/provider-azurerm/lib/api-management");
|
|
11
12
|
const api_management_api_1 = require("@cdktf/provider-azurerm/lib/api-management-api");
|
|
@@ -134,7 +135,7 @@ class AzureApiManagementManager {
|
|
|
134
135
|
name: props.skuName,
|
|
135
136
|
},
|
|
136
137
|
},
|
|
137
|
-
responseExportValues: ['
|
|
138
|
+
responseExportValues: ['*'],
|
|
138
139
|
identity: [
|
|
139
140
|
{
|
|
140
141
|
type: 'SystemAssigned',
|
|
@@ -228,5 +229,20 @@ class AzureApiManagementManager {
|
|
|
228
229
|
});
|
|
229
230
|
return apiManagementApi;
|
|
230
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* @summary Method to create a new api management custom domain
|
|
234
|
+
* @param id scoped id of the resource
|
|
235
|
+
* @param scope scope in which this resource is defined
|
|
236
|
+
* @param props api management custom domain properties
|
|
237
|
+
* @see [CDKTF Api management Custom Domain Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/createApiManagementCustomDomain.typescript.md}
|
|
238
|
+
*/
|
|
239
|
+
createApiManagementCustomDomain(id, scope, props) {
|
|
240
|
+
if (!props)
|
|
241
|
+
throw `Props undefined for ${id}`;
|
|
242
|
+
const apiManagementCustomDomain = new api_management_custom_domain_1.ApiManagementCustomDomain(scope, `${id}-am-cd`, props);
|
|
243
|
+
(0, utils_1.createAzureTfOutput)(`${id}-apiManagementCustomDomainFriendlyUniqueId`, scope, apiManagementCustomDomain.friendlyUniqueId);
|
|
244
|
+
(0, utils_1.createAzureTfOutput)(`${id}-apiManagementCustomDomainId`, scope, apiManagementCustomDomain.id);
|
|
245
|
+
return apiManagementCustomDomain;
|
|
246
|
+
}
|
|
231
247
|
}
|
|
232
248
|
exports.AzureApiManagementManager = AzureApiManagementManager;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiManagementConfig } from '@cdktf/provider-azurerm/lib/api-management';
|
|
2
2
|
import { ApiManagementBackendConfig } from '@cdktf/provider-azurerm/lib/api-management-backend';
|
|
3
|
+
import { ApiManagementCustomDomainConfig } from '@cdktf/provider-azurerm/lib/api-management-custom-domain';
|
|
3
4
|
import { ApiManagementApiConfig } from '@cdktf/provider-azurerm/lib/api-management-api';
|
|
4
5
|
import { ApiManagementApiOperationConfig } from '@cdktf/provider-azurerm/lib/api-management-api-operation';
|
|
5
6
|
import { ApiManagementApiOperationPolicyConfig } from '@cdktf/provider-azurerm/lib/api-management-api-operation-policy';
|
|
@@ -8,6 +9,8 @@ export interface ApiManagementProps extends ApiManagementConfig {
|
|
|
8
9
|
export interface ApiManagementBackendProps extends ApiManagementBackendConfig {
|
|
9
10
|
backendUrlPath?: string;
|
|
10
11
|
}
|
|
12
|
+
export interface ApiManagementCustomDomainProps extends ApiManagementCustomDomainConfig {
|
|
13
|
+
}
|
|
11
14
|
export interface ApiManagementApiProps extends ApiManagementApiConfig {
|
|
12
15
|
operations: ApiManagementApiOperationConfig[];
|
|
13
16
|
policyXmlContent?: ApiManagementApiOperationPolicyConfig['xmlContent'];
|
|
@@ -67,7 +67,6 @@ class AzureDnsManager {
|
|
|
67
67
|
throw `Props undefined for ${id}`;
|
|
68
68
|
const dnsARecord = new dns_a_record_1.DnsARecord(scope, `${id}-da`, {
|
|
69
69
|
...props,
|
|
70
|
-
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.dnsARecord),
|
|
71
70
|
ttl: props.ttl || 300,
|
|
72
71
|
tags: props.tags ?? {
|
|
73
72
|
environment: scope.props.stage,
|
|
@@ -90,7 +89,6 @@ class AzureDnsManager {
|
|
|
90
89
|
throw `Props undefined for ${id}`;
|
|
91
90
|
const dnsCnameRecord = new dns_cname_record_1.DnsCnameRecord(scope, `${id}-dc`, {
|
|
92
91
|
...props,
|
|
93
|
-
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.dnsCnameRecord),
|
|
94
92
|
ttl: props.ttl || 300,
|
|
95
93
|
tags: props.tags ?? {
|
|
96
94
|
environment: scope.props.stage,
|
|
@@ -78,6 +78,15 @@ class CommonCloudflareConstruct extends cdktf_1.TerraformStack {
|
|
|
78
78
|
region: this.props.remoteBackend.region,
|
|
79
79
|
});
|
|
80
80
|
break;
|
|
81
|
+
case constants_1.RemoteBackend.azurerm:
|
|
82
|
+
new cdktf_1.AzurermBackend(this, {
|
|
83
|
+
storageAccountName: this.props.remoteBackend.storageAccountName,
|
|
84
|
+
containerName: this.props.remoteBackend.containerName,
|
|
85
|
+
key: `${this.id}`,
|
|
86
|
+
subscriptionId: this.props.remoteBackend.subscriptionId,
|
|
87
|
+
resourceGroupName: this.props.remoteBackend.resourceGroupName,
|
|
88
|
+
});
|
|
89
|
+
break;
|
|
81
90
|
case constants_1.RemoteBackend.local:
|
|
82
91
|
if (debug)
|
|
83
92
|
console.debug(`Using local backend for ${this.id}`);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
DataAzurermApiManagement,
|
|
4
4
|
DataAzurermApiManagementConfig,
|
|
5
5
|
} from '@cdktf/provider-azurerm/lib/data-azurerm-api-management'
|
|
6
|
-
|
|
6
|
+
import { ApiManagementCustomDomain } from '@cdktf/provider-azurerm/lib/api-management-custom-domain'
|
|
7
7
|
import { ApiManagementBackend } from '@cdktf/provider-azurerm/lib/api-management-backend'
|
|
8
8
|
import { ApiManagement } from '@cdktf/provider-azurerm/lib/api-management'
|
|
9
9
|
import { ApiManagementApi } from '@cdktf/provider-azurerm/lib/api-management-api'
|
|
@@ -16,7 +16,13 @@ import {
|
|
|
16
16
|
import { Resource } from '../../.gen/providers/azapi/resource'
|
|
17
17
|
import { CommonAzureConstruct } from '../../common'
|
|
18
18
|
import { createAzureTfOutput } from '../../utils'
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
ApiManagementProps,
|
|
21
|
+
ApiManagementBackendProps,
|
|
22
|
+
ApiManagementApiProps,
|
|
23
|
+
ApiManagementV2Props,
|
|
24
|
+
ApiManagementCustomDomainProps,
|
|
25
|
+
} from './types'
|
|
20
26
|
import _ from 'lodash'
|
|
21
27
|
|
|
22
28
|
/**
|
|
@@ -159,7 +165,7 @@ export class AzureApiManagementManager {
|
|
|
159
165
|
},
|
|
160
166
|
},
|
|
161
167
|
|
|
162
|
-
responseExportValues: ['
|
|
168
|
+
responseExportValues: ['*'],
|
|
163
169
|
|
|
164
170
|
identity: [
|
|
165
171
|
{
|
|
@@ -292,4 +298,30 @@ export class AzureApiManagementManager {
|
|
|
292
298
|
|
|
293
299
|
return apiManagementApi
|
|
294
300
|
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @summary Method to create a new api management custom domain
|
|
304
|
+
* @param id scoped id of the resource
|
|
305
|
+
* @param scope scope in which this resource is defined
|
|
306
|
+
* @param props api management custom domain properties
|
|
307
|
+
* @see [CDKTF Api management Custom Domain Module]{@link https://github.com/cdktf/cdktf-provider-azurerm/blob/main/docs/createApiManagementCustomDomain.typescript.md}
|
|
308
|
+
*/
|
|
309
|
+
public createApiManagementCustomDomain(
|
|
310
|
+
id: string,
|
|
311
|
+
scope: CommonAzureConstruct,
|
|
312
|
+
props: ApiManagementCustomDomainProps
|
|
313
|
+
) {
|
|
314
|
+
if (!props) throw `Props undefined for ${id}`
|
|
315
|
+
|
|
316
|
+
const apiManagementCustomDomain = new ApiManagementCustomDomain(scope, `${id}-am-cd`, props)
|
|
317
|
+
|
|
318
|
+
createAzureTfOutput(
|
|
319
|
+
`${id}-apiManagementCustomDomainFriendlyUniqueId`,
|
|
320
|
+
scope,
|
|
321
|
+
apiManagementCustomDomain.friendlyUniqueId
|
|
322
|
+
)
|
|
323
|
+
createAzureTfOutput(`${id}-apiManagementCustomDomainId`, scope, apiManagementCustomDomain.id)
|
|
324
|
+
|
|
325
|
+
return apiManagementCustomDomain
|
|
326
|
+
}
|
|
295
327
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiManagementConfig } from '@cdktf/provider-azurerm/lib/api-management'
|
|
2
2
|
import { ApiManagementBackendConfig } from '@cdktf/provider-azurerm/lib/api-management-backend'
|
|
3
|
+
import { ApiManagementCustomDomainConfig } from '@cdktf/provider-azurerm/lib/api-management-custom-domain'
|
|
3
4
|
import { ApiManagementApiConfig } from '@cdktf/provider-azurerm/lib/api-management-api'
|
|
4
5
|
import { ApiManagementApiOperationConfig } from '@cdktf/provider-azurerm/lib/api-management-api-operation'
|
|
5
6
|
import { ApiManagementApiOperationPolicyConfig } from '@cdktf/provider-azurerm/lib/api-management-api-operation-policy'
|
|
@@ -10,6 +11,8 @@ export interface ApiManagementBackendProps extends ApiManagementBackendConfig {
|
|
|
10
11
|
backendUrlPath?: string
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
export interface ApiManagementCustomDomainProps extends ApiManagementCustomDomainConfig {}
|
|
15
|
+
|
|
13
16
|
export interface ApiManagementApiProps extends ApiManagementApiConfig {
|
|
14
17
|
operations: ApiManagementApiOperationConfig[]
|
|
15
18
|
policyXmlContent?: ApiManagementApiOperationPolicyConfig['xmlContent']
|
|
@@ -71,7 +71,6 @@ export class AzureDnsManager {
|
|
|
71
71
|
|
|
72
72
|
const dnsARecord = new DnsARecord(scope, `${id}-da`, {
|
|
73
73
|
...props,
|
|
74
|
-
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.dnsARecord),
|
|
75
74
|
ttl: props.ttl || 300,
|
|
76
75
|
tags: props.tags ?? {
|
|
77
76
|
environment: scope.props.stage,
|
|
@@ -97,7 +96,6 @@ export class AzureDnsManager {
|
|
|
97
96
|
|
|
98
97
|
const dnsCnameRecord = new DnsCnameRecord(scope, `${id}-dc`, {
|
|
99
98
|
...props,
|
|
100
|
-
name: scope.resourceNameFormatter.format(props.name, scope.props.resourceNameOptions?.dnsCnameRecord),
|
|
101
99
|
ttl: props.ttl || 300,
|
|
102
100
|
tags: props.tags ?? {
|
|
103
101
|
environment: scope.props.stage,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AwsProvider } from '@cdktf/provider-aws/lib/provider'
|
|
2
2
|
import { CloudflareProvider } from '@cdktf/provider-cloudflare/lib/provider'
|
|
3
|
-
import { S3Backend, TerraformStack, TerraformVariable } from 'cdktf'
|
|
3
|
+
import { AzurermBackend, S3Backend, TerraformStack, TerraformVariable } from 'cdktf'
|
|
4
4
|
import { Construct } from 'constructs'
|
|
5
5
|
import { isDevStage, isPrdStage, isTestStage, isUatStage } from '../../common'
|
|
6
6
|
import {
|
|
@@ -97,6 +97,15 @@ export class CommonCloudflareConstruct extends TerraformStack {
|
|
|
97
97
|
region: this.props.remoteBackend.region,
|
|
98
98
|
})
|
|
99
99
|
break
|
|
100
|
+
case RemoteBackend.azurerm:
|
|
101
|
+
new AzurermBackend(this, {
|
|
102
|
+
storageAccountName: this.props.remoteBackend.storageAccountName,
|
|
103
|
+
containerName: this.props.remoteBackend.containerName,
|
|
104
|
+
key: `${this.id}`,
|
|
105
|
+
subscriptionId: this.props.remoteBackend.subscriptionId,
|
|
106
|
+
resourceGroupName: this.props.remoteBackend.resourceGroupName,
|
|
107
|
+
})
|
|
108
|
+
break
|
|
100
109
|
case RemoteBackend.local:
|
|
101
110
|
if (debug) console.debug(`Using local backend for ${this.id}`)
|
|
102
111
|
break
|