@microsoft/terraform-cdk-constructs 1.8.0 → 1.9.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/.jsii +21007 -16056
- package/API.md +37023 -29701
- package/lib/azure-actiongroup/lib/action-group.js +1 -1
- package/lib/azure-activitylogalert/lib/activity-log-alert.js +1 -1
- package/lib/azure-aks/lib/aks-cluster.js +1 -1
- package/lib/azure-diagnosticsettings/lib/diagnostic-settings.js +1 -1
- package/lib/azure-dnsforwardingruleset/lib/dns-forwarding-ruleset.js +1 -1
- package/lib/azure-dnsforwardingruleset/lib/forwarding-rule.js +1 -1
- package/lib/azure-dnsforwardingruleset/lib/virtual-network-link.js +1 -1
- package/lib/azure-dnsresolver/lib/dns-resolver.js +1 -1
- package/lib/azure-dnsresolver/lib/inbound-endpoint.js +1 -1
- package/lib/azure-dnsresolver/lib/outbound-endpoint.js +1 -1
- package/lib/azure-dnszone/lib/dns-zone.js +1 -1
- package/lib/azure-dnszone/lib/records/dns-records.js +10 -10
- package/lib/azure-loganalyticsworkspace/index.d.ts +6 -0
- package/lib/azure-loganalyticsworkspace/index.js +23 -0
- package/lib/azure-loganalyticsworkspace/lib/index.d.ts +5 -0
- package/lib/azure-loganalyticsworkspace/lib/index.js +22 -0
- package/lib/azure-loganalyticsworkspace/lib/log-analytics-workspace-schemas.d.ts +51 -0
- package/lib/azure-loganalyticsworkspace/lib/log-analytics-workspace-schemas.js +255 -0
- package/lib/azure-loganalyticsworkspace/lib/log-analytics-workspace.d.ts +301 -0
- package/lib/azure-loganalyticsworkspace/lib/log-analytics-workspace.js +213 -0
- package/lib/azure-loganalyticsworkspace/test/log-analytics-workspace.integ.d.ts +9 -0
- package/lib/azure-loganalyticsworkspace/test/log-analytics-workspace.integ.js +71 -0
- package/lib/azure-loganalyticsworkspace/test/log-analytics-workspace.spec.d.ts +8 -0
- package/lib/azure-loganalyticsworkspace/test/log-analytics-workspace.spec.js +504 -0
- package/lib/azure-metricalert/lib/metric-alert.js +1 -1
- package/lib/azure-networkinterface/lib/network-interface.js +1 -1
- package/lib/azure-networksecuritygroup/lib/network-security-group.js +1 -1
- package/lib/azure-networkwatcher/index.d.ts +14 -0
- package/lib/azure-networkwatcher/index.js +31 -0
- package/lib/azure-networkwatcher/lib/index.d.ts +5 -0
- package/lib/azure-networkwatcher/lib/index.js +22 -0
- package/lib/azure-networkwatcher/lib/network-watcher-schemas.d.ts +47 -0
- package/lib/azure-networkwatcher/lib/network-watcher-schemas.js +167 -0
- package/lib/azure-networkwatcher/lib/network-watcher.d.ts +181 -0
- package/lib/azure-networkwatcher/lib/network-watcher.js +187 -0
- package/lib/azure-networkwatcher/test/network-watcher.integ.d.ts +12 -0
- package/lib/azure-networkwatcher/test/network-watcher.integ.js +84 -0
- package/lib/azure-networkwatcher/test/network-watcher.spec.d.ts +8 -0
- package/lib/azure-networkwatcher/test/network-watcher.spec.js +312 -0
- package/lib/azure-policyassignment/lib/policy-assignment.js +1 -1
- package/lib/azure-policydefinition/lib/policy-definition.js +1 -1
- package/lib/azure-policysetdefinition/index.d.ts +10 -0
- package/lib/azure-policysetdefinition/index.js +27 -0
- package/lib/azure-policysetdefinition/lib/index.d.ts +5 -0
- package/lib/azure-policysetdefinition/lib/index.js +22 -0
- package/lib/azure-policysetdefinition/lib/policy-set-definition-schemas.d.ts +50 -0
- package/lib/azure-policysetdefinition/lib/policy-set-definition-schemas.js +255 -0
- package/lib/azure-policysetdefinition/lib/policy-set-definition.d.ts +426 -0
- package/lib/azure-policysetdefinition/lib/policy-set-definition.js +255 -0
- package/lib/azure-policysetdefinition/test/policy-set-definition.integ.d.ts +9 -0
- package/lib/azure-policysetdefinition/test/policy-set-definition.integ.js +56 -0
- package/lib/azure-policysetdefinition/test/policy-set-definition.spec.d.ts +8 -0
- package/lib/azure-policysetdefinition/test/policy-set-definition.spec.js +745 -0
- package/lib/azure-privatednszone/lib/private-dns-zone.js +1 -1
- package/lib/azure-privatednszone/lib/records/private-dns-records.js +8 -8
- package/lib/azure-privatednszonelink/lib/private-dns-zone-link.js +1 -1
- package/lib/azure-publicipaddress/lib/public-ip-address.js +1 -1
- package/lib/azure-resourcegroup/lib/resource-group.js +1 -1
- package/lib/azure-roleassignment/lib/role-assignment.js +1 -1
- package/lib/azure-roledefinition/lib/role-definition.js +1 -1
- package/lib/azure-storageaccount/lib/storage-account.js +1 -1
- package/lib/azure-subnet/lib/subnet.js +1 -1
- package/lib/azure-virtualmachine/lib/virtual-machine.js +1 -1
- package/lib/azure-virtualnetwork/lib/virtual-network.js +1 -1
- package/lib/azure-virtualnetworkgateway/lib/virtual-network-gateway-schemas.js +2 -2
- package/lib/azure-virtualnetworkgateway/lib/virtual-network-gateway.d.ts +4 -2
- package/lib/azure-virtualnetworkgateway/lib/virtual-network-gateway.js +8 -5
- package/lib/azure-virtualnetworkgateway/test/virtual-network-gateway.spec.js +109 -1
- package/lib/azure-virtualnetworkgatewayconnection/lib/virtual-network-gateway-connection.js +1 -1
- package/lib/azure-virtualnetworkmanager/lib/connectivity-configuration.js +1 -1
- package/lib/azure-virtualnetworkmanager/lib/ipam-pool-static-cidr.js +1 -1
- package/lib/azure-virtualnetworkmanager/lib/ipam-pool.js +1 -1
- package/lib/azure-virtualnetworkmanager/lib/network-group-static-member.js +1 -1
- package/lib/azure-virtualnetworkmanager/lib/network-group.js +1 -1
- package/lib/azure-virtualnetworkmanager/lib/security-admin-configuration.js +1 -1
- package/lib/azure-virtualnetworkmanager/lib/security-admin-rule-collection.js +1 -1
- package/lib/azure-virtualnetworkmanager/lib/security-admin-rule.js +1 -1
- package/lib/azure-virtualnetworkmanager/lib/virtual-network-manager.js +1 -1
- package/lib/azure-vmss/lib/virtual-machine-scale-set.js +1 -1
- package/lib/core-azure/lib/azapi/azapi-resource.js +2 -2
- package/lib/core-azure/lib/azapi/providers-azapi/data-azapi-client-config/index.js +2 -2
- package/lib/core-azure/lib/azapi/providers-azapi/data-azapi-resource/index.js +5 -5
- package/lib/core-azure/lib/azapi/providers-azapi/provider/index.js +1 -1
- package/lib/core-azure/lib/azapi/providers-azapi/resource/index.js +5 -5
- package/lib/core-azure/lib/azapi/providers-azapi/resource-action/index.js +3 -3
- package/lib/core-azure/lib/azapi/providers-azapi/update-resource/index.js +3 -3
- package/lib/core-azure/lib/azapi/schema-mapper/schema-mapper.js +1 -1
- package/lib/core-azure/lib/version-manager/api-version-manager.js +1 -1
- package/lib/core-azure/lib/version-manager/interfaces/version-interfaces.js +7 -7
- package/lib/index.d.ts +9 -0
- package/lib/index.js +11 -2
- package/lib/testing/index.js +2 -2
- package/lib/testing/lib/cleanup.js +1 -1
- package/lib/testing/lib/metadata.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Azure Policy Set Definition (Initiative) implementation using AzapiResource framework
|
|
3
|
+
*
|
|
4
|
+
* This class provides a version-aware implementation for Azure Policy Set Definitions
|
|
5
|
+
* that automatically handles version management, schema validation, and property
|
|
6
|
+
* transformation across all supported API versions.
|
|
7
|
+
*
|
|
8
|
+
* Policy Set Definitions (also known as Initiatives in Azure Portal) allow you to
|
|
9
|
+
* group multiple policy definitions together and assign them as a single unit.
|
|
10
|
+
*
|
|
11
|
+
* Supported API Versions:
|
|
12
|
+
* - 2023-04-01 (Active, Latest)
|
|
13
|
+
* - 2021-06-01 (Active, Backward Compatibility)
|
|
14
|
+
*
|
|
15
|
+
* Features:
|
|
16
|
+
* - Automatic latest version resolution when no version is specified
|
|
17
|
+
* - Explicit version pinning for stability requirements
|
|
18
|
+
* - Schema-driven validation and transformation
|
|
19
|
+
* - Full JSII compliance for multi-language support
|
|
20
|
+
* - Support for policy definition references with parameters
|
|
21
|
+
* - Policy definition groups for organization
|
|
22
|
+
* - Initiative-level parameter definitions
|
|
23
|
+
*/
|
|
24
|
+
import * as cdktf from "cdktf";
|
|
25
|
+
import { Construct } from "constructs";
|
|
26
|
+
import { AzapiResource, AzapiResourceProps } from "../../core-azure/lib/azapi/azapi-resource";
|
|
27
|
+
import { ApiSchema } from "../../core-azure/lib/version-manager/interfaces/version-interfaces";
|
|
28
|
+
/**
|
|
29
|
+
* A reference to a policy definition within a policy set
|
|
30
|
+
*
|
|
31
|
+
* This defines which policy definitions are included in the initiative
|
|
32
|
+
* and how they are configured with parameters.
|
|
33
|
+
*/
|
|
34
|
+
export interface PolicyDefinitionReference {
|
|
35
|
+
/**
|
|
36
|
+
* The ID of the policy definition to include in the set
|
|
37
|
+
*
|
|
38
|
+
* This can be:
|
|
39
|
+
* - A built-in policy: /providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionId}
|
|
40
|
+
* - A custom policy at subscription level: /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionId}
|
|
41
|
+
* - A custom policy at management group level: /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionId}
|
|
42
|
+
*
|
|
43
|
+
* @example "/providers/Microsoft.Authorization/policyDefinitions/06a78e20-9358-41c9-923c-fb736d382a4d"
|
|
44
|
+
*/
|
|
45
|
+
readonly policyDefinitionId: string;
|
|
46
|
+
/**
|
|
47
|
+
* A unique identifier for this policy definition reference within the set
|
|
48
|
+
*
|
|
49
|
+
* This ID is used to reference this specific policy in the initiative
|
|
50
|
+
* and must be unique within the policy set definition.
|
|
51
|
+
*
|
|
52
|
+
* @example "auditVMsWithoutTags"
|
|
53
|
+
*/
|
|
54
|
+
readonly policyDefinitionReferenceId?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Parameter values for this policy definition
|
|
57
|
+
*
|
|
58
|
+
* These values override the default parameter values in the policy definition.
|
|
59
|
+
* Parameters can reference initiative-level parameters using the format:
|
|
60
|
+
* { "value": "[parameters('initiativeParameterName')]" }
|
|
61
|
+
*
|
|
62
|
+
* @example { "tagName": { "value": "environment" }, "tagValue": { "value": "[parameters('requiredTagValue')]" } }
|
|
63
|
+
*/
|
|
64
|
+
readonly parameters?: {
|
|
65
|
+
[key: string]: PolicyParameterValue;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Group names that this policy definition belongs to
|
|
69
|
+
*
|
|
70
|
+
* Groups help organize policies within an initiative and can be used
|
|
71
|
+
* for compliance reporting and management.
|
|
72
|
+
*
|
|
73
|
+
* @example ["Security", "Compliance"]
|
|
74
|
+
*/
|
|
75
|
+
readonly groupNames?: string[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A group for organizing policy definitions within a policy set
|
|
79
|
+
*
|
|
80
|
+
* Groups provide a way to categorize and organize policies within an initiative
|
|
81
|
+
* for better management and compliance reporting.
|
|
82
|
+
*/
|
|
83
|
+
export interface PolicyDefinitionGroup {
|
|
84
|
+
/**
|
|
85
|
+
* The name of the group (must be unique within the policy set)
|
|
86
|
+
*
|
|
87
|
+
* This name is referenced by policy definitions to indicate membership.
|
|
88
|
+
*
|
|
89
|
+
* @example "Security"
|
|
90
|
+
*/
|
|
91
|
+
readonly name: string;
|
|
92
|
+
/**
|
|
93
|
+
* The display name of the group shown in Azure Portal
|
|
94
|
+
*
|
|
95
|
+
* @example "Security Policies"
|
|
96
|
+
*/
|
|
97
|
+
readonly displayName?: string;
|
|
98
|
+
/**
|
|
99
|
+
* The category this group belongs to
|
|
100
|
+
*
|
|
101
|
+
* Categories help organize groups and are displayed in the Azure Portal.
|
|
102
|
+
*
|
|
103
|
+
* @example "Security Center"
|
|
104
|
+
*/
|
|
105
|
+
readonly category?: string;
|
|
106
|
+
/**
|
|
107
|
+
* A description of the group's purpose
|
|
108
|
+
*
|
|
109
|
+
* @example "Policies related to security configuration and compliance"
|
|
110
|
+
*/
|
|
111
|
+
readonly description?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Additional metadata for the group
|
|
114
|
+
*/
|
|
115
|
+
readonly additionalMetadataId?: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Metadata for the policy set definition
|
|
119
|
+
*
|
|
120
|
+
* Metadata provides additional information about the policy set
|
|
121
|
+
* without affecting its evaluation logic.
|
|
122
|
+
*/
|
|
123
|
+
export interface PolicySetMetadata {
|
|
124
|
+
/**
|
|
125
|
+
* The category of the policy set for Azure Portal organization
|
|
126
|
+
*
|
|
127
|
+
* @example "Security Center"
|
|
128
|
+
*/
|
|
129
|
+
readonly category?: string;
|
|
130
|
+
/**
|
|
131
|
+
* The version of the policy set definition
|
|
132
|
+
*
|
|
133
|
+
* @example "1.0.0"
|
|
134
|
+
*/
|
|
135
|
+
readonly version?: string;
|
|
136
|
+
/**
|
|
137
|
+
* Whether this policy set is in preview
|
|
138
|
+
*
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
141
|
+
readonly preview?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Whether this policy set is deprecated
|
|
144
|
+
*
|
|
145
|
+
* @default false
|
|
146
|
+
*/
|
|
147
|
+
readonly deprecated?: boolean;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Metadata for a policy set parameter
|
|
151
|
+
*
|
|
152
|
+
* Provides additional information for Azure Portal integration.
|
|
153
|
+
*/
|
|
154
|
+
export interface PolicySetParameterMetadata {
|
|
155
|
+
/**
|
|
156
|
+
* Strong type for Azure Portal resource picker integration
|
|
157
|
+
*/
|
|
158
|
+
readonly strongType?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Display name in Azure Portal
|
|
161
|
+
*/
|
|
162
|
+
readonly displayName?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Description in Azure Portal
|
|
165
|
+
*/
|
|
166
|
+
readonly description?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Parameter definition for the policy set
|
|
170
|
+
*
|
|
171
|
+
* These parameters can be referenced by policy definitions within the set.
|
|
172
|
+
*/
|
|
173
|
+
export interface PolicySetParameterDefinition {
|
|
174
|
+
/**
|
|
175
|
+
* The data type of the parameter
|
|
176
|
+
*/
|
|
177
|
+
readonly type: "String" | "Array" | "Object" | "Boolean" | "Integer" | "Float" | "DateTime";
|
|
178
|
+
/**
|
|
179
|
+
* Display name for the parameter in Azure Portal
|
|
180
|
+
*/
|
|
181
|
+
readonly displayName?: string;
|
|
182
|
+
/**
|
|
183
|
+
* Description of the parameter
|
|
184
|
+
*/
|
|
185
|
+
readonly description?: string;
|
|
186
|
+
/**
|
|
187
|
+
* Default value for the parameter
|
|
188
|
+
*/
|
|
189
|
+
readonly defaultValue?: any;
|
|
190
|
+
/**
|
|
191
|
+
* Allowed values for the parameter
|
|
192
|
+
*/
|
|
193
|
+
readonly allowedValues?: any[];
|
|
194
|
+
/**
|
|
195
|
+
* Metadata for the parameter (e.g., strongType for Azure Portal integration)
|
|
196
|
+
*/
|
|
197
|
+
readonly metadata?: PolicySetParameterMetadata;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* A parameter value, either a direct value or a reference
|
|
201
|
+
*/
|
|
202
|
+
export interface PolicyParameterValue {
|
|
203
|
+
/**
|
|
204
|
+
* The value of the parameter
|
|
205
|
+
*
|
|
206
|
+
* Can be a direct value or a reference to an initiative parameter
|
|
207
|
+
* using the format: "[parameters('parameterName')]"
|
|
208
|
+
*/
|
|
209
|
+
readonly value: any;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Properties for the unified Azure Policy Set Definition
|
|
213
|
+
*
|
|
214
|
+
* Extends AzapiResourceProps with Policy Set Definition specific properties
|
|
215
|
+
*/
|
|
216
|
+
export interface PolicySetDefinitionProps extends AzapiResourceProps {
|
|
217
|
+
/**
|
|
218
|
+
* The scope at which to create the policy set definition
|
|
219
|
+
*
|
|
220
|
+
* This can be:
|
|
221
|
+
* - A subscription: /subscriptions/{subscriptionId}
|
|
222
|
+
* - A management group: /providers/Microsoft.Management/managementGroups/{managementGroupId}
|
|
223
|
+
*
|
|
224
|
+
* @example "/subscriptions/00000000-0000-0000-0000-000000000000"
|
|
225
|
+
* @example "/providers/Microsoft.Management/managementGroups/my-management-group"
|
|
226
|
+
*/
|
|
227
|
+
readonly scope: string;
|
|
228
|
+
/**
|
|
229
|
+
* The display name of the policy set definition
|
|
230
|
+
*
|
|
231
|
+
* This is the name shown in the Azure Portal.
|
|
232
|
+
* Required property.
|
|
233
|
+
*
|
|
234
|
+
* @example "Security Baseline Initiative"
|
|
235
|
+
*/
|
|
236
|
+
readonly displayName: string;
|
|
237
|
+
/**
|
|
238
|
+
* Description of the policy set definition
|
|
239
|
+
*
|
|
240
|
+
* @example "This initiative applies a set of security policies to ensure baseline compliance."
|
|
241
|
+
*/
|
|
242
|
+
readonly description?: string;
|
|
243
|
+
/**
|
|
244
|
+
* The type of policy set definition
|
|
245
|
+
*
|
|
246
|
+
* @default "Custom"
|
|
247
|
+
*/
|
|
248
|
+
readonly policyType?: "BuiltIn" | "Custom" | "Static";
|
|
249
|
+
/**
|
|
250
|
+
* Metadata for the policy set definition
|
|
251
|
+
*
|
|
252
|
+
* Includes category, version, preview, and deprecated flags.
|
|
253
|
+
*/
|
|
254
|
+
readonly metadata?: PolicySetMetadata;
|
|
255
|
+
/**
|
|
256
|
+
* Parameter definitions for the policy set
|
|
257
|
+
*
|
|
258
|
+
* These parameters can be referenced by policy definitions in the set
|
|
259
|
+
* using the format: "[parameters('parameterName')]"
|
|
260
|
+
*/
|
|
261
|
+
readonly parameters?: {
|
|
262
|
+
[key: string]: PolicySetParameterDefinition;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Array of policy definition references
|
|
266
|
+
*
|
|
267
|
+
* Each reference specifies a policy definition to include in the set
|
|
268
|
+
* along with its parameter values and group memberships.
|
|
269
|
+
* Required property.
|
|
270
|
+
*/
|
|
271
|
+
readonly policyDefinitions: PolicyDefinitionReference[];
|
|
272
|
+
/**
|
|
273
|
+
* Groups for organizing policy definitions in the set
|
|
274
|
+
*
|
|
275
|
+
* Groups help categorize policies for management and compliance reporting.
|
|
276
|
+
*/
|
|
277
|
+
readonly policyDefinitionGroups?: PolicyDefinitionGroup[];
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Properties interface for Azure Policy Set Definition
|
|
281
|
+
* This is required for JSII compliance to support multi-language code generation
|
|
282
|
+
*/
|
|
283
|
+
export interface PolicySetDefinitionProperties {
|
|
284
|
+
/**
|
|
285
|
+
* The display name of the policy set definition
|
|
286
|
+
*/
|
|
287
|
+
readonly displayName: string;
|
|
288
|
+
/**
|
|
289
|
+
* Description of the policy set definition
|
|
290
|
+
*/
|
|
291
|
+
readonly description?: string;
|
|
292
|
+
/**
|
|
293
|
+
* The type of policy set definition
|
|
294
|
+
*/
|
|
295
|
+
readonly policyType?: string;
|
|
296
|
+
/**
|
|
297
|
+
* Metadata for the policy set definition
|
|
298
|
+
*/
|
|
299
|
+
readonly metadata?: PolicySetMetadata;
|
|
300
|
+
/**
|
|
301
|
+
* Parameter definitions for the policy set
|
|
302
|
+
*/
|
|
303
|
+
readonly parameters?: {
|
|
304
|
+
[key: string]: PolicySetParameterDefinition;
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* Array of policy definition references
|
|
308
|
+
*/
|
|
309
|
+
readonly policyDefinitions: PolicyDefinitionReference[];
|
|
310
|
+
/**
|
|
311
|
+
* Groups for organizing policy definitions
|
|
312
|
+
*/
|
|
313
|
+
readonly policyDefinitionGroups?: PolicyDefinitionGroup[];
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* The resource body interface for Azure Policy Set Definition API calls
|
|
317
|
+
* This matches the Azure REST API schema for policy set definitions
|
|
318
|
+
*/
|
|
319
|
+
export interface PolicySetDefinitionBody {
|
|
320
|
+
/**
|
|
321
|
+
* The properties of the policy set definition
|
|
322
|
+
*/
|
|
323
|
+
readonly properties: PolicySetDefinitionProperties;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Unified Azure Policy Set Definition (Initiative) implementation
|
|
327
|
+
*
|
|
328
|
+
* This class provides a single, version-aware implementation for managing Azure
|
|
329
|
+
* Policy Set Definitions. It automatically handles version resolution, schema validation,
|
|
330
|
+
* and property transformation.
|
|
331
|
+
*
|
|
332
|
+
* Policy Set Definitions allow you to group multiple policy definitions together
|
|
333
|
+
* and assign them as a single unit (also known as "Initiatives" in Azure Portal).
|
|
334
|
+
*
|
|
335
|
+
* Note: Policy set definitions are created at subscription or management group scope.
|
|
336
|
+
* They do not have a location property as they are not region-specific.
|
|
337
|
+
*
|
|
338
|
+
* @example
|
|
339
|
+
* const initiative = new PolicySetDefinition(this, "security-initiative", {
|
|
340
|
+
* displayName: "Security Baseline",
|
|
341
|
+
* scope: "/subscriptions/00000000-0000-0000-0000-000000000000",
|
|
342
|
+
* policyDefinitions: [
|
|
343
|
+
* {
|
|
344
|
+
* policyDefinitionId: "/providers/Microsoft.Authorization/policyDefinitions/abc123",
|
|
345
|
+
* policyDefinitionReferenceId: "auditVMsWithoutExtensions",
|
|
346
|
+
* },
|
|
347
|
+
* ],
|
|
348
|
+
* });
|
|
349
|
+
*
|
|
350
|
+
* @stability stable
|
|
351
|
+
*/
|
|
352
|
+
export declare class PolicySetDefinition extends AzapiResource {
|
|
353
|
+
/**
|
|
354
|
+
* The input properties for this Policy Set Definition instance
|
|
355
|
+
*/
|
|
356
|
+
readonly props: PolicySetDefinitionProps;
|
|
357
|
+
readonly idOutput: cdktf.TerraformOutput;
|
|
358
|
+
readonly nameOutput: cdktf.TerraformOutput;
|
|
359
|
+
readonly policySetDefinitionIdOutput: cdktf.TerraformOutput;
|
|
360
|
+
/**
|
|
361
|
+
* Creates a new Azure Policy Set Definition using the AzapiResource framework
|
|
362
|
+
*
|
|
363
|
+
* The constructor automatically handles version resolution, schema registration,
|
|
364
|
+
* validation, and resource creation.
|
|
365
|
+
*
|
|
366
|
+
* @param scope - The scope in which to define this construct
|
|
367
|
+
* @param id - The unique identifier for this instance
|
|
368
|
+
* @param props - Configuration properties for the Policy Set Definition
|
|
369
|
+
*/
|
|
370
|
+
constructor(scope: Construct, id: string, props: PolicySetDefinitionProps);
|
|
371
|
+
/**
|
|
372
|
+
* Gets the default API version to use when no explicit version is specified
|
|
373
|
+
* Returns the most recent stable version as the default
|
|
374
|
+
*/
|
|
375
|
+
protected defaultVersion(): string;
|
|
376
|
+
/**
|
|
377
|
+
* Gets the Azure resource type for Policy Set Definitions
|
|
378
|
+
*/
|
|
379
|
+
protected resourceType(): string;
|
|
380
|
+
/**
|
|
381
|
+
* Gets the API schema for the resolved version
|
|
382
|
+
* Uses the framework's schema resolution to get the appropriate schema
|
|
383
|
+
*/
|
|
384
|
+
protected apiSchema(): ApiSchema;
|
|
385
|
+
/**
|
|
386
|
+
* Overrides the name resolution to generate deterministic GUIDs for policy set definitions
|
|
387
|
+
*
|
|
388
|
+
* Policy set definitions can use custom names or auto-generated GUIDs.
|
|
389
|
+
* This implementation generates a deterministic UUID based on the policy set definition's
|
|
390
|
+
* key properties if no name is provided.
|
|
391
|
+
*/
|
|
392
|
+
protected resolveName(props: AzapiResourceProps): string;
|
|
393
|
+
/**
|
|
394
|
+
* Creates the resource body for the Azure API call
|
|
395
|
+
* Transforms the input properties into the JSON format expected by Azure REST API
|
|
396
|
+
*
|
|
397
|
+
* Note: Policy set definitions do not have a location property as they are
|
|
398
|
+
* scope-specific resources deployed at subscription or management group level.
|
|
399
|
+
*/
|
|
400
|
+
protected createResourceBody(props: any): any;
|
|
401
|
+
/**
|
|
402
|
+
* Resolves the parent resource ID for Policy Set Definition
|
|
403
|
+
* Policy Set Definitions are created at subscription or management group scope
|
|
404
|
+
*
|
|
405
|
+
* @param props - The resource properties
|
|
406
|
+
* @returns The parent resource ID (the scope)
|
|
407
|
+
*/
|
|
408
|
+
protected resolveParentId(props: any): string;
|
|
409
|
+
/**
|
|
410
|
+
* Get the full resource identifier for use in policy assignments
|
|
411
|
+
* Alias for the id property
|
|
412
|
+
*/
|
|
413
|
+
get policySetDefinitionId(): string;
|
|
414
|
+
/**
|
|
415
|
+
* Get the display name of the policy set definition
|
|
416
|
+
*/
|
|
417
|
+
get displayName(): string;
|
|
418
|
+
/**
|
|
419
|
+
* Get the policy type
|
|
420
|
+
*/
|
|
421
|
+
get policyType(): string;
|
|
422
|
+
/**
|
|
423
|
+
* Get the number of policy definitions in this set
|
|
424
|
+
*/
|
|
425
|
+
get policyDefinitionCount(): number;
|
|
426
|
+
}
|