@microsoft/terraform-cdk-constructs 1.4.0 → 1.6.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.
Files changed (78) hide show
  1. package/.jsii +12910 -8935
  2. package/API.md +31954 -26602
  3. package/lib/azure-actiongroup/lib/action-group.js +1 -1
  4. package/lib/azure-activitylogalert/lib/activity-log-alert.js +1 -1
  5. package/lib/azure-aks/lib/aks-cluster.js +1 -1
  6. package/lib/azure-diagnosticsettings/lib/diagnostic-settings.js +1 -1
  7. package/lib/azure-dnsforwardingruleset/lib/dns-forwarding-ruleset.js +1 -1
  8. package/lib/azure-dnsforwardingruleset/lib/forwarding-rule.js +1 -1
  9. package/lib/azure-dnsforwardingruleset/lib/virtual-network-link.js +1 -1
  10. package/lib/azure-dnsresolver/lib/dns-resolver.js +1 -1
  11. package/lib/azure-dnsresolver/lib/inbound-endpoint.js +1 -1
  12. package/lib/azure-dnsresolver/lib/outbound-endpoint.js +1 -1
  13. package/lib/azure-dnszone/lib/dns-zone.js +1 -1
  14. package/lib/azure-metricalert/lib/metric-alert.js +1 -1
  15. package/lib/azure-networkinterface/lib/network-interface.js +1 -1
  16. package/lib/azure-networksecuritygroup/lib/network-security-group.js +1 -1
  17. package/lib/azure-policyassignment/lib/policy-assignment.js +1 -1
  18. package/lib/azure-policydefinition/lib/policy-definition.js +1 -1
  19. package/lib/azure-privatednszone/lib/private-dns-zone.js +1 -1
  20. package/lib/azure-privatednszonelink/lib/private-dns-zone-link.js +1 -1
  21. package/lib/azure-publicipaddress/lib/public-ip-address.js +1 -1
  22. package/lib/azure-resourcegroup/lib/resource-group.js +1 -1
  23. package/lib/azure-roleassignment/lib/role-assignment.js +1 -1
  24. package/lib/azure-roledefinition/lib/role-definition.js +1 -1
  25. package/lib/azure-storageaccount/lib/storage-account.js +1 -1
  26. package/lib/azure-subnet/lib/subnet.js +1 -1
  27. package/lib/azure-virtualmachine/lib/virtual-machine.js +1 -1
  28. package/lib/azure-virtualnetwork/lib/virtual-network.js +1 -1
  29. package/lib/azure-virtualnetworkgateway/index.d.ts +4 -0
  30. package/lib/azure-virtualnetworkgateway/index.js +21 -0
  31. package/lib/azure-virtualnetworkgateway/lib/index.d.ts +5 -0
  32. package/lib/azure-virtualnetworkgateway/lib/index.js +22 -0
  33. package/lib/azure-virtualnetworkgateway/lib/virtual-network-gateway-schemas.d.ts +32 -0
  34. package/lib/azure-virtualnetworkgateway/lib/virtual-network-gateway-schemas.js +298 -0
  35. package/lib/azure-virtualnetworkgateway/lib/virtual-network-gateway.d.ts +368 -0
  36. package/lib/azure-virtualnetworkgateway/lib/virtual-network-gateway.js +285 -0
  37. package/lib/azure-virtualnetworkgateway/test/virtual-network-gateway.integ.d.ts +12 -0
  38. package/lib/azure-virtualnetworkgateway/test/virtual-network-gateway.integ.js +129 -0
  39. package/lib/azure-virtualnetworkgateway/test/virtual-network-gateway.spec.d.ts +8 -0
  40. package/lib/azure-virtualnetworkgateway/test/virtual-network-gateway.spec.js +691 -0
  41. package/lib/azure-virtualnetworkgatewayconnection/index.d.ts +6 -0
  42. package/lib/azure-virtualnetworkgatewayconnection/index.js +23 -0
  43. package/lib/azure-virtualnetworkgatewayconnection/lib/index.d.ts +8 -0
  44. package/lib/azure-virtualnetworkgatewayconnection/lib/index.js +25 -0
  45. package/lib/azure-virtualnetworkgatewayconnection/lib/virtual-network-gateway-connection-schemas.d.ts +32 -0
  46. package/lib/azure-virtualnetworkgatewayconnection/lib/virtual-network-gateway-connection-schemas.js +322 -0
  47. package/lib/azure-virtualnetworkgatewayconnection/lib/virtual-network-gateway-connection.d.ts +333 -0
  48. package/lib/azure-virtualnetworkgatewayconnection/lib/virtual-network-gateway-connection.js +310 -0
  49. package/lib/azure-virtualnetworkgatewayconnection/test/virtual-network-gateway-connection.integ.d.ts +12 -0
  50. package/lib/azure-virtualnetworkgatewayconnection/test/virtual-network-gateway-connection.integ.js +216 -0
  51. package/lib/azure-virtualnetworkgatewayconnection/test/virtual-network-gateway-connection.spec.d.ts +8 -0
  52. package/lib/azure-virtualnetworkgatewayconnection/test/virtual-network-gateway-connection.spec.js +706 -0
  53. package/lib/azure-virtualnetworkmanager/lib/connectivity-configuration.js +1 -1
  54. package/lib/azure-virtualnetworkmanager/lib/ipam-pool-static-cidr.js +1 -1
  55. package/lib/azure-virtualnetworkmanager/lib/ipam-pool.js +1 -1
  56. package/lib/azure-virtualnetworkmanager/lib/network-group-static-member.js +1 -1
  57. package/lib/azure-virtualnetworkmanager/lib/network-group.js +1 -1
  58. package/lib/azure-virtualnetworkmanager/lib/security-admin-configuration.js +1 -1
  59. package/lib/azure-virtualnetworkmanager/lib/security-admin-rule-collection.js +1 -1
  60. package/lib/azure-virtualnetworkmanager/lib/security-admin-rule.js +1 -1
  61. package/lib/azure-virtualnetworkmanager/lib/virtual-network-manager.js +1 -1
  62. package/lib/azure-vmss/lib/virtual-machine-scale-set.js +1 -1
  63. package/lib/core-azure/lib/azapi/azapi-resource.js +2 -2
  64. package/lib/core-azure/lib/azapi/providers-azapi/data-azapi-client-config/index.js +2 -2
  65. package/lib/core-azure/lib/azapi/providers-azapi/data-azapi-resource/index.js +5 -5
  66. package/lib/core-azure/lib/azapi/providers-azapi/provider/index.js +1 -1
  67. package/lib/core-azure/lib/azapi/providers-azapi/resource/index.js +5 -5
  68. package/lib/core-azure/lib/azapi/providers-azapi/resource-action/index.js +3 -3
  69. package/lib/core-azure/lib/azapi/providers-azapi/update-resource/index.js +3 -3
  70. package/lib/core-azure/lib/azapi/schema-mapper/schema-mapper.js +1 -1
  71. package/lib/core-azure/lib/version-manager/api-version-manager.js +1 -1
  72. package/lib/core-azure/lib/version-manager/interfaces/version-interfaces.js +7 -7
  73. package/lib/index.d.ts +4 -0
  74. package/lib/index.js +6 -2
  75. package/lib/testing/index.js +2 -2
  76. package/lib/testing/lib/cleanup.js +1 -1
  77. package/lib/testing/lib/metadata.js +1 -1
  78. package/package.json +1 -1
@@ -0,0 +1,333 @@
1
+ /**
2
+ * Azure Virtual Network Gateway Connection implementation using AzapiResource framework
3
+ *
4
+ * This class provides a unified implementation for Azure Virtual Network Gateway Connections that
5
+ * automatically handles version management, schema validation, and property
6
+ * transformation across all supported API versions.
7
+ *
8
+ * Supported API Versions:
9
+ * - 2024-01-01 (Active)
10
+ * - 2024-05-01 (Active, Latest)
11
+ *
12
+ * Features:
13
+ * - Automatic latest version resolution when no version is specified
14
+ * - Explicit version pinning for stability requirements
15
+ * - Schema-driven validation and transformation
16
+ * - Type-safe connection type handling using discriminated unions
17
+ * - Full backward compatibility
18
+ * - JSII compliance for multi-language support
19
+ */
20
+ import * as cdktf from "cdktf";
21
+ import { Construct } from "constructs";
22
+ import { AzapiResource, AzapiResourceProps } from "../../core-azure/lib/azapi/azapi-resource";
23
+ import { ApiSchema } from "../../core-azure/lib/version-manager/interfaces/version-interfaces";
24
+ /**
25
+ * Reference to a Virtual Network Gateway
26
+ */
27
+ export interface GatewayReference {
28
+ /**
29
+ * Resource ID of the virtual network gateway
30
+ */
31
+ readonly id: string;
32
+ }
33
+ /**
34
+ * Reference to an ExpressRoute circuit peer
35
+ */
36
+ export interface PeerReference {
37
+ /**
38
+ * Resource ID of the ExpressRoute circuit
39
+ */
40
+ readonly id: string;
41
+ }
42
+ /**
43
+ * IPsec policy configuration
44
+ */
45
+ export interface IpsecPolicy {
46
+ /**
47
+ * DH Group for IKE Phase 1
48
+ * @example "DHGroup14", "DHGroup2048", "ECP256", "ECP384"
49
+ */
50
+ readonly dhGroup: string;
51
+ /**
52
+ * IKE encryption algorithm
53
+ * @example "AES128", "AES192", "AES256", "GCMAES128", "GCMAES256"
54
+ */
55
+ readonly ikeEncryption: string;
56
+ /**
57
+ * IKE integrity algorithm
58
+ * @example "SHA256", "SHA384", "GCMAES128", "GCMAES256"
59
+ */
60
+ readonly ikeIntegrity: string;
61
+ /**
62
+ * IPsec encryption algorithm
63
+ * @example "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", "GCMAES256"
64
+ */
65
+ readonly ipsecEncryption: string;
66
+ /**
67
+ * IPsec integrity algorithm
68
+ * @example "SHA256", "GCMAES128", "GCMAES192", "GCMAES256"
69
+ */
70
+ readonly ipsecIntegrity: string;
71
+ /**
72
+ * PFS Group for IKE Phase 2
73
+ * @example "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24", "PFS14", "PFSMM"
74
+ */
75
+ readonly pfsGroup: string;
76
+ /**
77
+ * SA lifetime in seconds
78
+ * @example 3600
79
+ */
80
+ readonly saLifeTimeSeconds: number;
81
+ /**
82
+ * SA data size in kilobytes
83
+ * @example 102400000
84
+ */
85
+ readonly saDataSizeKilobytes: number;
86
+ }
87
+ /**
88
+ * NAT rule reference
89
+ */
90
+ export interface NatRuleReference {
91
+ /**
92
+ * Resource ID of the NAT rule
93
+ */
94
+ readonly id: string;
95
+ }
96
+ /**
97
+ * Properties for the Azure Virtual Network Gateway Connection
98
+ *
99
+ * Supports three connection types: IPsec (Site-to-Site), VNet-to-VNet, and ExpressRoute
100
+ */
101
+ export interface VirtualNetworkGatewayConnectionProps extends AzapiResourceProps {
102
+ /**
103
+ * Connection type
104
+ * Must be "IPsec", "Vnet2Vnet", or "ExpressRoute"
105
+ */
106
+ readonly connectionType: "IPsec" | "Vnet2Vnet" | "ExpressRoute";
107
+ /**
108
+ * Resource group ID where the connection will be created
109
+ */
110
+ readonly resourceGroupId: string;
111
+ /**
112
+ * Reference to the first virtual network gateway
113
+ * Required for all connection types
114
+ */
115
+ readonly virtualNetworkGateway1: GatewayReference;
116
+ /**
117
+ * Reference to the local network gateway
118
+ * Required for IPsec connections only
119
+ */
120
+ readonly localNetworkGateway2?: GatewayReference;
121
+ /**
122
+ * Reference to the second virtual network gateway
123
+ * Required for Vnet2Vnet connections only
124
+ */
125
+ readonly virtualNetworkGateway2?: GatewayReference;
126
+ /**
127
+ * Reference to the ExpressRoute circuit
128
+ * Required for ExpressRoute connections only
129
+ */
130
+ readonly peer?: PeerReference;
131
+ /**
132
+ * Shared key for the connection
133
+ * Required for IPsec and Vnet2Vnet connections
134
+ */
135
+ readonly sharedKey?: string;
136
+ /**
137
+ * Authorization key for the ExpressRoute circuit
138
+ * Optional - for cross-subscription ExpressRoute connections
139
+ */
140
+ readonly authorizationKey?: string;
141
+ /**
142
+ * Connection protocol to use
143
+ * @defaultValue "IKEv2"
144
+ */
145
+ readonly connectionProtocol?: "IKEv2" | "IKEv1";
146
+ /**
147
+ * Enable BGP for the connection
148
+ * @defaultValue false
149
+ */
150
+ readonly enableBgp?: boolean;
151
+ /**
152
+ * Routing weight for the connection
153
+ */
154
+ readonly routingWeight?: number;
155
+ /**
156
+ * DPD timeout in seconds
157
+ */
158
+ readonly dpdTimeoutSeconds?: number;
159
+ /**
160
+ * Custom IPsec policies
161
+ */
162
+ readonly ipsecPolicies?: IpsecPolicy[];
163
+ /**
164
+ * Enable policy-based traffic selectors
165
+ * @defaultValue false
166
+ */
167
+ readonly usePolicyBasedTrafficSelectors?: boolean;
168
+ /**
169
+ * Connection mode
170
+ * @defaultValue "Default"
171
+ */
172
+ readonly connectionMode?: "Default" | "ResponderOnly" | "InitiatorOnly";
173
+ /**
174
+ * Egress NAT rules
175
+ */
176
+ readonly egressNatRules?: NatRuleReference[];
177
+ /**
178
+ * Ingress NAT rules
179
+ */
180
+ readonly ingressNatRules?: NatRuleReference[];
181
+ /**
182
+ * The lifecycle rules to ignore changes
183
+ * @example ["tags"]
184
+ */
185
+ readonly ignoreChanges?: string[];
186
+ }
187
+ /**
188
+ * Azure Virtual Network Gateway Connection implementation
189
+ *
190
+ * This class provides a single, version-aware implementation that replaces
191
+ * version-specific Virtual Network Gateway Connection classes. It automatically handles version
192
+ * resolution, schema validation, and property transformation while maintaining
193
+ * full backward compatibility.
194
+ *
195
+ * Virtual Network Gateway Connections establish connectivity between Virtual Network Gateways
196
+ * and other networking endpoints:
197
+ * - IPsec: Site-to-Site VPN connections to on-premises networks
198
+ * - Vnet2Vnet: VNet-to-VNet connections between Azure virtual networks
199
+ * - ExpressRoute: Private connections to Azure via ExpressRoute circuits
200
+ *
201
+ * @example
202
+ * // IPsec (Site-to-Site VPN) Connection:
203
+ * const s2sConnection = new VirtualNetworkGatewayConnection(this, "s2sConnection", {
204
+ * name: "my-s2s-connection",
205
+ * location: "eastus",
206
+ * resourceGroupId: resourceGroup.id,
207
+ * connectionType: "IPsec",
208
+ * virtualNetworkGateway1: { id: vpnGateway.id },
209
+ * localNetworkGateway2: { id: localGateway.id },
210
+ * sharedKey: "mySecureSharedKey123!"
211
+ * });
212
+ *
213
+ * @example
214
+ * // VNet-to-VNet Connection:
215
+ * const vnetConnection = new VirtualNetworkGatewayConnection(this, "vnetConnection", {
216
+ * name: "my-vnet-connection",
217
+ * location: "eastus",
218
+ * resourceGroupId: resourceGroup.id,
219
+ * connectionType: "Vnet2Vnet",
220
+ * virtualNetworkGateway1: { id: vpnGateway1.id },
221
+ * virtualNetworkGateway2: { id: vpnGateway2.id },
222
+ * sharedKey: "mySecureSharedKey123!",
223
+ * enableBgp: true
224
+ * });
225
+ *
226
+ * @example
227
+ * // ExpressRoute Connection:
228
+ * const erConnection = new VirtualNetworkGatewayConnection(this, "erConnection", {
229
+ * name: "my-er-connection",
230
+ * location: "eastus",
231
+ * resourceGroupId: resourceGroup.id,
232
+ * connectionType: "ExpressRoute",
233
+ * virtualNetworkGateway1: { id: erGateway.id },
234
+ * peer: { id: expressRouteCircuit.id },
235
+ * authorizationKey: "optional-auth-key-if-cross-subscription"
236
+ * });
237
+ *
238
+ * @example
239
+ * // IPsec Connection with Custom IPsec Policies:
240
+ * const customConnection = new VirtualNetworkGatewayConnection(this, "customConnection", {
241
+ * name: "my-custom-connection",
242
+ * location: "eastus",
243
+ * resourceGroupId: resourceGroup.id,
244
+ * connectionType: "IPsec",
245
+ * virtualNetworkGateway1: { id: vpnGateway.id },
246
+ * localNetworkGateway2: { id: localGateway.id },
247
+ * sharedKey: "mySecureSharedKey123!",
248
+ * connectionProtocol: "IKEv2",
249
+ * ipsecPolicies: [{
250
+ * dhGroup: "DHGroup14",
251
+ * ikeEncryption: "AES256",
252
+ * ikeIntegrity: "SHA256",
253
+ * ipsecEncryption: "AES256",
254
+ * ipsecIntegrity: "SHA256",
255
+ * pfsGroup: "PFS2048",
256
+ * saLifeTimeSeconds: 3600,
257
+ * saDataSizeKilobytes: 102400000
258
+ * }],
259
+ * usePolicyBasedTrafficSelectors: true
260
+ * });
261
+ *
262
+ * @stability stable
263
+ */
264
+ export declare class VirtualNetworkGatewayConnection extends AzapiResource {
265
+ /**
266
+ * The input properties for this Virtual Network Gateway Connection instance
267
+ */
268
+ readonly props: VirtualNetworkGatewayConnectionProps;
269
+ readonly idOutput: cdktf.TerraformOutput;
270
+ readonly nameOutput: cdktf.TerraformOutput;
271
+ readonly locationOutput: cdktf.TerraformOutput;
272
+ readonly tagsOutput: cdktf.TerraformOutput;
273
+ /**
274
+ * Creates a new Azure Virtual Network Gateway Connection using the AzapiResource framework
275
+ *
276
+ * The constructor automatically handles version resolution, schema registration,
277
+ * validation, and resource creation. It maintains full backward compatibility
278
+ * with existing Virtual Network Gateway Connection implementations.
279
+ *
280
+ * @param scope - The scope in which to define this construct
281
+ * @param id - The unique identifier for this instance
282
+ * @param props - Configuration properties for the Virtual Network Gateway Connection
283
+ */
284
+ constructor(scope: Construct, id: string, props: VirtualNetworkGatewayConnectionProps);
285
+ /**
286
+ * Gets the default API version to use when no explicit version is specified
287
+ * Returns the most recent stable version as the default
288
+ */
289
+ protected defaultVersion(): string;
290
+ /**
291
+ * Gets the Azure resource type for Virtual Network Gateway Connections
292
+ */
293
+ protected resourceType(): string;
294
+ /**
295
+ * Gets the API schema for the resolved version
296
+ * Uses the framework's schema resolution to get the appropriate schema
297
+ */
298
+ protected apiSchema(): ApiSchema;
299
+ /**
300
+ * Indicates that location is required for Virtual Network Gateway Connections
301
+ */
302
+ protected requiresLocation(): boolean;
303
+ /**
304
+ * Creates the resource body for the Azure API call
305
+ * Transforms the input properties into the JSON format expected by Azure REST API
306
+ * Handles type-specific properties based on connectionType
307
+ */
308
+ protected createResourceBody(props: any): any;
309
+ /**
310
+ * Get the subscription ID from the Virtual Network Gateway Connection ID
311
+ * Extracts the subscription ID from the Azure resource ID format
312
+ */
313
+ get subscriptionId(): string;
314
+ /**
315
+ * Get the full resource identifier for use in other Azure resources
316
+ * Alias for the id property to match original interface
317
+ */
318
+ get resourceId(): string;
319
+ /**
320
+ * Add a tag to the Virtual Network Gateway Connection
321
+ * Note: This modifies the construct props but requires a new deployment to take effect
322
+ */
323
+ addTag(key: string, value: string): void;
324
+ /**
325
+ * Remove a tag from the Virtual Network Gateway Connection
326
+ * Note: This modifies the construct props but requires a new deployment to take effect
327
+ */
328
+ removeTag(key: string): void;
329
+ /**
330
+ * Applies ignore changes lifecycle rules if specified in props
331
+ */
332
+ private _applyIgnoreChanges;
333
+ }