@aws-cdk/aws-imagebuilder-alpha 2.226.0-alpha.0 → 2.228.0-alpha.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 +5536 -521
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +223 -1
- package/README.md +387 -0
- package/lib/component.d.ts +833 -0
- package/lib/component.js +970 -0
- package/lib/distribution-configuration.d.ts +410 -0
- package/lib/distribution-configuration.js +413 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -1
- package/lib/infrastructure-configuration.js +1 -1
- package/lib/os-version.d.ts +126 -0
- package/lib/os-version.js +158 -0
- package/package.json +6 -6
- package/rosetta/default.ts-fixture +1 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import * as cdk from 'aws-cdk-lib';
|
|
2
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
3
|
+
import * as ecr from 'aws-cdk-lib/aws-ecr';
|
|
4
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
5
|
+
import * as kms from 'aws-cdk-lib/aws-kms';
|
|
6
|
+
import * as ssm from 'aws-cdk-lib/aws-ssm';
|
|
7
|
+
import { Construct } from 'constructs';
|
|
8
|
+
/**
|
|
9
|
+
* An EC2 Image Builder Distribution Configuration.
|
|
10
|
+
*/
|
|
11
|
+
export interface IDistributionConfiguration extends cdk.IResource {
|
|
12
|
+
/**
|
|
13
|
+
* The ARN of the distribution configuration
|
|
14
|
+
*
|
|
15
|
+
* @attribute
|
|
16
|
+
*/
|
|
17
|
+
readonly distributionConfigurationArn: string;
|
|
18
|
+
/**
|
|
19
|
+
* The name of the distribution configuration
|
|
20
|
+
*
|
|
21
|
+
* @attribute
|
|
22
|
+
*/
|
|
23
|
+
readonly distributionConfigurationName: string;
|
|
24
|
+
/**
|
|
25
|
+
* Grant custom actions to the given grantee for the distribution configuration
|
|
26
|
+
*
|
|
27
|
+
* @param grantee The principal
|
|
28
|
+
* @param actions The list of actions
|
|
29
|
+
*/
|
|
30
|
+
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
|
|
31
|
+
/**
|
|
32
|
+
* Grant read permissions to the given grantee for the distribution configuration
|
|
33
|
+
*
|
|
34
|
+
* @param grantee The principal
|
|
35
|
+
*/
|
|
36
|
+
grantRead(grantee: iam.IGrantable): iam.Grant;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The launch permissions for the AMI, defining which principals are allowed to access the AMI
|
|
40
|
+
*/
|
|
41
|
+
export interface AmiLaunchPermission {
|
|
42
|
+
/**
|
|
43
|
+
* The ARNs for the AWS Organizations organizational units to share the AMI with
|
|
44
|
+
*
|
|
45
|
+
* @default None
|
|
46
|
+
*/
|
|
47
|
+
readonly organizationalUnitArns?: string[];
|
|
48
|
+
/**
|
|
49
|
+
* The ARNs for the AWS Organization that you want to share the AMI with
|
|
50
|
+
*
|
|
51
|
+
* @default None
|
|
52
|
+
*/
|
|
53
|
+
readonly organizationArns?: string[];
|
|
54
|
+
/**
|
|
55
|
+
* Whether to make the AMI public. Block public access for AMIs must be disabled to make the AMI public.
|
|
56
|
+
*
|
|
57
|
+
* WARNING: Making an AMI public exposes it to any AWS account globally.
|
|
58
|
+
* Ensure the AMI does not contain:
|
|
59
|
+
* - Sensitive data or credentials
|
|
60
|
+
* - Proprietary software or configurations
|
|
61
|
+
* - Internal network information or security settings
|
|
62
|
+
*
|
|
63
|
+
* For more information on blocking public access for AMIs, see: [Understand block public access for AMIs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-public-access-to-amis.html)
|
|
64
|
+
*
|
|
65
|
+
*
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
readonly isPublicUserGroup?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The AWS account IDs to share the AMI with
|
|
71
|
+
*
|
|
72
|
+
* @default None
|
|
73
|
+
*/
|
|
74
|
+
readonly accountIds?: string[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The SSM parameters to create or update for the distributed AMIs
|
|
78
|
+
*/
|
|
79
|
+
export interface SSMParameterConfigurations {
|
|
80
|
+
/**
|
|
81
|
+
* The AWS account ID that will own the SSM parameter in the given region. This must be one of the target accounts
|
|
82
|
+
* that was included in the list of AMI distribution target accounts
|
|
83
|
+
*
|
|
84
|
+
* @default The current account is used
|
|
85
|
+
*/
|
|
86
|
+
readonly amiAccount?: string;
|
|
87
|
+
/**
|
|
88
|
+
* The data type of the SSM parameter
|
|
89
|
+
*
|
|
90
|
+
* @default ssm.ParameterDataType.AWS_EC2_IMAGE
|
|
91
|
+
*/
|
|
92
|
+
readonly dataType?: ssm.ParameterDataType;
|
|
93
|
+
/**
|
|
94
|
+
* The SSM parameter to create or update
|
|
95
|
+
*/
|
|
96
|
+
readonly parameter: ssm.IStringParameter;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The launch template to apply the distributed AMI to
|
|
100
|
+
*/
|
|
101
|
+
export interface LaunchTemplateConfiguration {
|
|
102
|
+
/**
|
|
103
|
+
* The launch template to apply the distributed AMI to. A new launch template version will be created for the
|
|
104
|
+
* provided launch template with the distributed AMI applied.
|
|
105
|
+
*
|
|
106
|
+
* *Note:* The launch template should expose a `launchTemplateId`. Templates
|
|
107
|
+
* imported by name only are not supported.
|
|
108
|
+
*
|
|
109
|
+
*/
|
|
110
|
+
readonly launchTemplate: ec2.ILaunchTemplate;
|
|
111
|
+
/**
|
|
112
|
+
* The AWS account ID that owns the launch template
|
|
113
|
+
*
|
|
114
|
+
* @default The current account is used
|
|
115
|
+
*/
|
|
116
|
+
readonly accountId?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Whether to set the new launch template version that is created as the default launch template version. After
|
|
119
|
+
* creation of the launch template version containing the distributed AMI, it will be automatically set as the
|
|
120
|
+
* default version for the launch template.
|
|
121
|
+
*
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
124
|
+
readonly setDefaultVersion?: boolean;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The EC2 Fast Launch configuration to use for the Windows AMI
|
|
128
|
+
*/
|
|
129
|
+
export interface FastLaunchConfiguration {
|
|
130
|
+
/**
|
|
131
|
+
* Whether to enable fast launch for the AMI
|
|
132
|
+
*
|
|
133
|
+
* @default false
|
|
134
|
+
*/
|
|
135
|
+
readonly enabled?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* The launch template that the fast-launch enabled Windows AMI uses when it launches Windows instances to create
|
|
138
|
+
* pre-provisioned snapshots
|
|
139
|
+
*
|
|
140
|
+
* @default None
|
|
141
|
+
*/
|
|
142
|
+
readonly launchTemplate?: ec2.ILaunchTemplate;
|
|
143
|
+
/**
|
|
144
|
+
* The maximum number of parallel instances that are launched for creating resources
|
|
145
|
+
*
|
|
146
|
+
* @default A maximum of 6 instances are launched in parallel
|
|
147
|
+
* @see https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableFastLaunch.html
|
|
148
|
+
*/
|
|
149
|
+
readonly maxParallelLaunches?: number;
|
|
150
|
+
/**
|
|
151
|
+
* The number of pre-provisioned snapshots to keep on hand for a fast-launch enabled Windows AMI
|
|
152
|
+
*
|
|
153
|
+
* @default 10 snapshots are kept pre-provisioned
|
|
154
|
+
* @see https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableFastLaunch.html
|
|
155
|
+
*/
|
|
156
|
+
readonly targetSnapshotCount?: number;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The regional distribution settings to use for an AMI build
|
|
160
|
+
*/
|
|
161
|
+
export interface AmiDistribution {
|
|
162
|
+
/**
|
|
163
|
+
* The target region to distribute AMIs to
|
|
164
|
+
*
|
|
165
|
+
* @default The current region is used
|
|
166
|
+
*/
|
|
167
|
+
readonly region?: string;
|
|
168
|
+
/**
|
|
169
|
+
* The tags to apply to the distributed AMIs
|
|
170
|
+
*
|
|
171
|
+
* @default None
|
|
172
|
+
*/
|
|
173
|
+
readonly amiTags?: {
|
|
174
|
+
[key: string]: string;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* The description of the AMI
|
|
178
|
+
*
|
|
179
|
+
* @default None
|
|
180
|
+
*/
|
|
181
|
+
readonly amiDescription?: string;
|
|
182
|
+
/**
|
|
183
|
+
* The KMS key to encrypt the distributed AMI with
|
|
184
|
+
*
|
|
185
|
+
* @default None
|
|
186
|
+
*/
|
|
187
|
+
readonly amiKmsKey?: kms.IKey;
|
|
188
|
+
/**
|
|
189
|
+
* The launch permissions for the AMI, defining which principals are allowed to access the AMI
|
|
190
|
+
*
|
|
191
|
+
* @default None
|
|
192
|
+
*/
|
|
193
|
+
readonly amiLaunchPermission?: AmiLaunchPermission;
|
|
194
|
+
/**
|
|
195
|
+
* The name to use for the distributed AMIs
|
|
196
|
+
*
|
|
197
|
+
* @default A name is generated from the image recipe name
|
|
198
|
+
*/
|
|
199
|
+
readonly amiName?: string;
|
|
200
|
+
/**
|
|
201
|
+
* The account IDs to copy the output AMI to
|
|
202
|
+
*
|
|
203
|
+
* @default None
|
|
204
|
+
*/
|
|
205
|
+
readonly amiTargetAccountIds?: string[];
|
|
206
|
+
/**
|
|
207
|
+
* The SSM parameters to create or update for the distributed AMIs
|
|
208
|
+
*
|
|
209
|
+
* @default None
|
|
210
|
+
*/
|
|
211
|
+
readonly ssmParameters?: SSMParameterConfigurations[];
|
|
212
|
+
/**
|
|
213
|
+
* The launch templates to apply the distributed AMI to
|
|
214
|
+
*
|
|
215
|
+
* @default None
|
|
216
|
+
*/
|
|
217
|
+
readonly launchTemplates?: LaunchTemplateConfiguration[];
|
|
218
|
+
/**
|
|
219
|
+
* The fast launch configurations to use for enabling EC2 Fast Launch on the distributed Windows AMI
|
|
220
|
+
*
|
|
221
|
+
* @default None
|
|
222
|
+
* @see https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EnableFastLaunch.html
|
|
223
|
+
*/
|
|
224
|
+
readonly fastLaunchConfigurations?: FastLaunchConfiguration[];
|
|
225
|
+
/**
|
|
226
|
+
* The License Manager license configuration ARNs to apply to the distributed AMIs
|
|
227
|
+
*
|
|
228
|
+
* @default None
|
|
229
|
+
*/
|
|
230
|
+
readonly licenseConfigurationArns?: string[];
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* The regional distribution settings to use for a container build
|
|
234
|
+
*/
|
|
235
|
+
export interface ContainerDistribution {
|
|
236
|
+
/**
|
|
237
|
+
* The target region to distribute containers to
|
|
238
|
+
*
|
|
239
|
+
* @default The current region is used
|
|
240
|
+
*/
|
|
241
|
+
readonly region?: string;
|
|
242
|
+
/**
|
|
243
|
+
* The destination repository to distribute the output container to
|
|
244
|
+
*
|
|
245
|
+
* @default The target repository in the container recipe is used
|
|
246
|
+
*/
|
|
247
|
+
readonly containerRepository: Repository;
|
|
248
|
+
/**
|
|
249
|
+
* The description of the container image
|
|
250
|
+
*
|
|
251
|
+
* @default None
|
|
252
|
+
*/
|
|
253
|
+
readonly containerDescription?: string;
|
|
254
|
+
/**
|
|
255
|
+
* The additional tags to apply to the distributed container images
|
|
256
|
+
*
|
|
257
|
+
* @default None
|
|
258
|
+
*/
|
|
259
|
+
readonly containerTags?: string[];
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Properties for creating a Distribution Configuration resource
|
|
263
|
+
*/
|
|
264
|
+
export interface DistributionConfigurationProps {
|
|
265
|
+
/**
|
|
266
|
+
* The list of target regions and associated AMI distribution settings where the built AMI will be distributed. AMI
|
|
267
|
+
* distributions may also be added with the `addAmiDistributions` method.
|
|
268
|
+
*
|
|
269
|
+
* @default None if container distributions are provided. Otherwise, at least one AMI or container distribution must
|
|
270
|
+
* be provided
|
|
271
|
+
*/
|
|
272
|
+
readonly amiDistributions?: AmiDistribution[];
|
|
273
|
+
/**
|
|
274
|
+
* The list of target regions and associated container distribution settings where the built container will be
|
|
275
|
+
* distributed. Container distributions may also be added with the `addContainerDistributions` method.
|
|
276
|
+
*
|
|
277
|
+
* @default None if AMI distributions are provided. Otherwise, at least one AMI or container distribution must be
|
|
278
|
+
* provided
|
|
279
|
+
*/
|
|
280
|
+
readonly containerDistributions?: ContainerDistribution[];
|
|
281
|
+
/**
|
|
282
|
+
* The name of the distribution configuration.
|
|
283
|
+
*
|
|
284
|
+
* @default A name is generated
|
|
285
|
+
*/
|
|
286
|
+
readonly distributionConfigurationName?: string;
|
|
287
|
+
/**
|
|
288
|
+
* The description of the distribution configuration.
|
|
289
|
+
*
|
|
290
|
+
* @default None
|
|
291
|
+
*/
|
|
292
|
+
readonly description?: string;
|
|
293
|
+
/**
|
|
294
|
+
* The tags to apply to the distribution configuration
|
|
295
|
+
*
|
|
296
|
+
* @default None
|
|
297
|
+
*/
|
|
298
|
+
readonly tags?: {
|
|
299
|
+
[key: string]: string;
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* A new or imported Distribution Configuration
|
|
304
|
+
*/
|
|
305
|
+
declare abstract class DistributionConfigurationBase extends cdk.Resource implements IDistributionConfiguration {
|
|
306
|
+
/**
|
|
307
|
+
* The ARN of the distribution configuration
|
|
308
|
+
*/
|
|
309
|
+
abstract readonly distributionConfigurationArn: string;
|
|
310
|
+
/**
|
|
311
|
+
* The name of the distribution configuration
|
|
312
|
+
*/
|
|
313
|
+
abstract readonly distributionConfigurationName: string;
|
|
314
|
+
/**
|
|
315
|
+
* Grant custom actions to the given grantee for the distribution configuration
|
|
316
|
+
*
|
|
317
|
+
* @param grantee The principal
|
|
318
|
+
* @param actions The list of actions
|
|
319
|
+
*/
|
|
320
|
+
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
|
|
321
|
+
/**
|
|
322
|
+
* Grant read permissions to the given grantee for the distribution configuration
|
|
323
|
+
*
|
|
324
|
+
* @param grantee The principal
|
|
325
|
+
*/
|
|
326
|
+
grantRead(grantee: iam.IGrantable): iam.Grant;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* The service in which a container should be registered
|
|
330
|
+
*/
|
|
331
|
+
export declare enum RepositoryService {
|
|
332
|
+
/**
|
|
333
|
+
* Indicates the container should be registered in ECR
|
|
334
|
+
*/
|
|
335
|
+
ECR = "ECR"
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* A container repository used to distribute container images in EC2 Image Builder
|
|
339
|
+
*/
|
|
340
|
+
export declare abstract class Repository {
|
|
341
|
+
/**
|
|
342
|
+
* The ECR repository to use as the target container repository
|
|
343
|
+
*
|
|
344
|
+
* @param repository The ECR repository to use
|
|
345
|
+
*/
|
|
346
|
+
static fromEcr(repository: ecr.IRepository): Repository;
|
|
347
|
+
/**
|
|
348
|
+
* The name of the container repository where the output container image is stored
|
|
349
|
+
*/
|
|
350
|
+
abstract readonly repositoryName: string;
|
|
351
|
+
/**
|
|
352
|
+
* The service in which the container repository is hosted
|
|
353
|
+
*/
|
|
354
|
+
abstract readonly service: RepositoryService;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Represents an EC2 Image Builder Distribution Configuration.
|
|
358
|
+
*
|
|
359
|
+
* @see https://docs.aws.amazon.com/imagebuilder/latest/userguide/manage-distribution-settings.html
|
|
360
|
+
*/
|
|
361
|
+
export declare class DistributionConfiguration extends DistributionConfigurationBase {
|
|
362
|
+
/** Uniquely identifies this class. */
|
|
363
|
+
static readonly PROPERTY_INJECTION_ID: string;
|
|
364
|
+
/**
|
|
365
|
+
* Import an existing distribution configuration given its ARN.
|
|
366
|
+
*/
|
|
367
|
+
static fromDistributionConfigurationArn(scope: Construct, id: string, distributionConfigurationArn: string): IDistributionConfiguration;
|
|
368
|
+
/**
|
|
369
|
+
* Import an existing distribution configuration given its name. The provided name must be normalized by converting
|
|
370
|
+
* all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens.
|
|
371
|
+
*/
|
|
372
|
+
static fromDistributionConfigurationName(scope: Construct, id: string, distributionConfigurationName: string): IDistributionConfiguration;
|
|
373
|
+
/**
|
|
374
|
+
* Return whether the given object is a DistributionConfiguration.
|
|
375
|
+
*/
|
|
376
|
+
static isDistributionConfiguration(x: any): x is DistributionConfiguration;
|
|
377
|
+
/**
|
|
378
|
+
* The ARN of the distribution configuration
|
|
379
|
+
*/
|
|
380
|
+
readonly distributionConfigurationArn: string;
|
|
381
|
+
/**
|
|
382
|
+
* The name of the distribution configuration
|
|
383
|
+
*/
|
|
384
|
+
readonly distributionConfigurationName: string;
|
|
385
|
+
private readonly amiDistributionsByRegion;
|
|
386
|
+
private readonly containerDistributionsByRegion;
|
|
387
|
+
constructor(scope: Construct, id: string, props?: DistributionConfigurationProps);
|
|
388
|
+
/**
|
|
389
|
+
* Adds AMI distribution settings to the distribution configuration
|
|
390
|
+
*
|
|
391
|
+
* @param amiDistributions The list of AMI distribution settings to apply
|
|
392
|
+
*/
|
|
393
|
+
addAmiDistributions(...amiDistributions: AmiDistribution[]): void;
|
|
394
|
+
/**
|
|
395
|
+
* Adds container distribution settings to the distribution configuration
|
|
396
|
+
*
|
|
397
|
+
* @param containerDistributions The list of container distribution settings to apply
|
|
398
|
+
*/
|
|
399
|
+
addContainerDistributions(...containerDistributions: ContainerDistribution[]): void;
|
|
400
|
+
private validateDistributionConfigurationName;
|
|
401
|
+
private renderDistributions;
|
|
402
|
+
private buildAmiDistribution;
|
|
403
|
+
private buildContainerDistribution;
|
|
404
|
+
private buildAmiLaunchPermissions;
|
|
405
|
+
private buildFastLaunchConfigurations;
|
|
406
|
+
private buildLaunchTemplateConfigurations;
|
|
407
|
+
private buildLicenseConfigurationArns;
|
|
408
|
+
private buildSsmParameterConfigurations;
|
|
409
|
+
}
|
|
410
|
+
export {};
|