@cdklabs/deploy-time-build 0.0.1 → 0.0.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/.jsii +9563 -0
- package/.jsii.tabl.json +1 -0
- package/API.md +1673 -0
- package/AmazonQ.md +65 -0
- package/LICENSE +202 -0
- package/README.md +212 -45
- package/lambda/trigger-codebuild/dist/index.js +279 -0
- package/lambda/trigger-codebuild/index.ts +269 -0
- package/lambda/trigger-codebuild/package.json +17 -0
- package/lib/container-image-build.d.ts +84 -0
- package/lib/container-image-build.js +221 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +21 -0
- package/lib/nodejs-build.d.ts +84 -0
- package/lib/nodejs-build.js +221 -0
- package/lib/singleton-project.d.ts +28 -0
- package/lib/singleton-project.js +43 -0
- package/lib/soci-index-build.d.ts +30 -0
- package/lib/soci-index-build.js +118 -0
- package/lib/soci-index-v2-build.d.ts +41 -0
- package/lib/soci-index-v2-build.js +131 -0
- package/lib/types.d.ts +44 -0
- package/lib/types.js +3 -0
- package/package.json +156 -6
- package/rosetta/default.ts-fixture +24 -0
- package/rosetta/imported.ts-fixture +25 -0
package/API.md
ADDED
|
@@ -0,0 +1,1673 @@
|
|
|
1
|
+
# API Reference <a name="API Reference" id="api-reference"></a>
|
|
2
|
+
|
|
3
|
+
## Constructs <a name="Constructs" id="Constructs"></a>
|
|
4
|
+
|
|
5
|
+
### ContainerImageBuild <a name="ContainerImageBuild" id="@cdklabs/deploy-time-build.ContainerImageBuild"></a>
|
|
6
|
+
|
|
7
|
+
- *Implements:* aws-cdk-lib.aws_iam.IGrantable
|
|
8
|
+
|
|
9
|
+
Build a container image and push it to an ECR repository on deploy-time.
|
|
10
|
+
|
|
11
|
+
#### Initializers <a name="Initializers" id="@cdklabs/deploy-time-build.ContainerImageBuild.Initializer"></a>
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { ContainerImageBuild } from '@cdklabs/deploy-time-build'
|
|
15
|
+
|
|
16
|
+
new ContainerImageBuild(scope: Construct, id: string, props: ContainerImageBuildProps)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
| **Name** | **Type** | **Description** |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
22
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
23
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.Initializer.parameter.props">props</a></code> | <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps">ContainerImageBuildProps</a></code> | *No description.* |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="@cdklabs/deploy-time-build.ContainerImageBuild.Initializer.parameter.scope"></a>
|
|
28
|
+
|
|
29
|
+
- *Type:* constructs.Construct
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
##### `id`<sup>Required</sup> <a name="id" id="@cdklabs/deploy-time-build.ContainerImageBuild.Initializer.parameter.id"></a>
|
|
34
|
+
|
|
35
|
+
- *Type:* string
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
##### `props`<sup>Required</sup> <a name="props" id="@cdklabs/deploy-time-build.ContainerImageBuild.Initializer.parameter.props"></a>
|
|
40
|
+
|
|
41
|
+
- *Type:* <a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps">ContainerImageBuildProps</a>
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
46
|
+
|
|
47
|
+
| **Name** | **Description** |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
50
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.toEcsDockerImageCode">toEcsDockerImageCode</a></code> | Get the instance of {@link ContainerImage} for an ECS task definition. |
|
|
51
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.toLambdaDockerImageCode">toLambdaDockerImageCode</a></code> | Get the instance of {@link DockerImageCode} for a Lambda function image. |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
##### `toString` <a name="toString" id="@cdklabs/deploy-time-build.ContainerImageBuild.toString"></a>
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
public toString(): string
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Returns a string representation of this construct.
|
|
62
|
+
|
|
63
|
+
##### `toEcsDockerImageCode` <a name="toEcsDockerImageCode" id="@cdklabs/deploy-time-build.ContainerImageBuild.toEcsDockerImageCode"></a>
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
public toEcsDockerImageCode(): EcrImage
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Get the instance of {@link ContainerImage} for an ECS task definition.
|
|
70
|
+
|
|
71
|
+
##### `toLambdaDockerImageCode` <a name="toLambdaDockerImageCode" id="@cdklabs/deploy-time-build.ContainerImageBuild.toLambdaDockerImageCode"></a>
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
public toLambdaDockerImageCode(options?: LambdaDockerImageOptions): DockerImageCode
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Get the instance of {@link DockerImageCode} for a Lambda function image.
|
|
78
|
+
|
|
79
|
+
###### `options`<sup>Optional</sup> <a name="options" id="@cdklabs/deploy-time-build.ContainerImageBuild.toLambdaDockerImageCode.parameter.options"></a>
|
|
80
|
+
|
|
81
|
+
- *Type:* <a href="#@cdklabs/deploy-time-build.LambdaDockerImageOptions">LambdaDockerImageOptions</a>
|
|
82
|
+
|
|
83
|
+
Optional configuration for Docker image code.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
88
|
+
|
|
89
|
+
| **Name** | **Description** |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
##### `isConstruct` <a name="isConstruct" id="@cdklabs/deploy-time-build.ContainerImageBuild.isConstruct"></a>
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { ContainerImageBuild } from '@cdklabs/deploy-time-build'
|
|
99
|
+
|
|
100
|
+
ContainerImageBuild.isConstruct(x: any)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Checks if `x` is a construct.
|
|
104
|
+
|
|
105
|
+
Use this method instead of `instanceof` to properly detect `Construct`
|
|
106
|
+
instances, even when the construct library is symlinked.
|
|
107
|
+
|
|
108
|
+
Explanation: in JavaScript, multiple copies of the `constructs` library on
|
|
109
|
+
disk are seen as independent, completely different libraries. As a
|
|
110
|
+
consequence, the class `Construct` in each copy of the `constructs` library
|
|
111
|
+
is seen as a different class, and an instance of one class will not test as
|
|
112
|
+
`instanceof` the other class. `npm install` will not create installations
|
|
113
|
+
like this, but users may manually symlink construct libraries together or
|
|
114
|
+
use a monorepo tool: in those cases, multiple copies of the `constructs`
|
|
115
|
+
library can be accidentally installed, and `instanceof` will behave
|
|
116
|
+
unpredictably. It is safest to avoid using `instanceof`, and using
|
|
117
|
+
this type-testing method instead.
|
|
118
|
+
|
|
119
|
+
###### `x`<sup>Required</sup> <a name="x" id="@cdklabs/deploy-time-build.ContainerImageBuild.isConstruct.parameter.x"></a>
|
|
120
|
+
|
|
121
|
+
- *Type:* any
|
|
122
|
+
|
|
123
|
+
Any object.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
128
|
+
|
|
129
|
+
| **Name** | **Type** | **Description** |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
132
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | The principal to grant permissions to. |
|
|
133
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.property.imageTag">imageTag</a></code> | <code>string</code> | *No description.* |
|
|
134
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.property.imageUri">imageUri</a></code> | <code>string</code> | *No description.* |
|
|
135
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.property.repository">repository</a></code> | <code>aws-cdk-lib.aws_ecr.IRepository</code> | *No description.* |
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
##### `node`<sup>Required</sup> <a name="node" id="@cdklabs/deploy-time-build.ContainerImageBuild.property.node"></a>
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
public readonly node: Node;
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
- *Type:* constructs.Node
|
|
146
|
+
|
|
147
|
+
The tree node.
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
##### `grantPrincipal`<sup>Required</sup> <a name="grantPrincipal" id="@cdklabs/deploy-time-build.ContainerImageBuild.property.grantPrincipal"></a>
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
public readonly grantPrincipal: IPrincipal;
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
- *Type:* aws-cdk-lib.aws_iam.IPrincipal
|
|
158
|
+
|
|
159
|
+
The principal to grant permissions to.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
##### `imageTag`<sup>Required</sup> <a name="imageTag" id="@cdklabs/deploy-time-build.ContainerImageBuild.property.imageTag"></a>
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
public readonly imageTag: string;
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
- *Type:* string
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
##### `imageUri`<sup>Required</sup> <a name="imageUri" id="@cdklabs/deploy-time-build.ContainerImageBuild.property.imageUri"></a>
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
public readonly imageUri: string;
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
- *Type:* string
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
##### `repository`<sup>Required</sup> <a name="repository" id="@cdklabs/deploy-time-build.ContainerImageBuild.property.repository"></a>
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
public readonly repository: IRepository;
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
- *Type:* aws-cdk-lib.aws_ecr.IRepository
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### NodejsBuild <a name="NodejsBuild" id="@cdklabs/deploy-time-build.NodejsBuild"></a>
|
|
195
|
+
|
|
196
|
+
- *Implements:* aws-cdk-lib.aws_iam.IGrantable
|
|
197
|
+
|
|
198
|
+
Build Node.js app and optionally publish the artifact to an S3 bucket.
|
|
199
|
+
|
|
200
|
+
#### Initializers <a name="Initializers" id="@cdklabs/deploy-time-build.NodejsBuild.Initializer"></a>
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
import { NodejsBuild } from '@cdklabs/deploy-time-build'
|
|
204
|
+
|
|
205
|
+
new NodejsBuild(scope: Construct, id: string, props: NodejsBuildProps)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
| **Name** | **Type** | **Description** |
|
|
209
|
+
| --- | --- | --- |
|
|
210
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuild.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
211
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuild.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
212
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuild.Initializer.parameter.props">props</a></code> | <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps">NodejsBuildProps</a></code> | *No description.* |
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="@cdklabs/deploy-time-build.NodejsBuild.Initializer.parameter.scope"></a>
|
|
217
|
+
|
|
218
|
+
- *Type:* constructs.Construct
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
##### `id`<sup>Required</sup> <a name="id" id="@cdklabs/deploy-time-build.NodejsBuild.Initializer.parameter.id"></a>
|
|
223
|
+
|
|
224
|
+
- *Type:* string
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
##### `props`<sup>Required</sup> <a name="props" id="@cdklabs/deploy-time-build.NodejsBuild.Initializer.parameter.props"></a>
|
|
229
|
+
|
|
230
|
+
- *Type:* <a href="#@cdklabs/deploy-time-build.NodejsBuildProps">NodejsBuildProps</a>
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
235
|
+
|
|
236
|
+
| **Name** | **Description** |
|
|
237
|
+
| --- | --- |
|
|
238
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuild.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
##### `toString` <a name="toString" id="@cdklabs/deploy-time-build.NodejsBuild.toString"></a>
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
public toString(): string
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Returns a string representation of this construct.
|
|
249
|
+
|
|
250
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
251
|
+
|
|
252
|
+
| **Name** | **Description** |
|
|
253
|
+
| --- | --- |
|
|
254
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuild.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
##### `isConstruct` <a name="isConstruct" id="@cdklabs/deploy-time-build.NodejsBuild.isConstruct"></a>
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
import { NodejsBuild } from '@cdklabs/deploy-time-build'
|
|
262
|
+
|
|
263
|
+
NodejsBuild.isConstruct(x: any)
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Checks if `x` is a construct.
|
|
267
|
+
|
|
268
|
+
Use this method instead of `instanceof` to properly detect `Construct`
|
|
269
|
+
instances, even when the construct library is symlinked.
|
|
270
|
+
|
|
271
|
+
Explanation: in JavaScript, multiple copies of the `constructs` library on
|
|
272
|
+
disk are seen as independent, completely different libraries. As a
|
|
273
|
+
consequence, the class `Construct` in each copy of the `constructs` library
|
|
274
|
+
is seen as a different class, and an instance of one class will not test as
|
|
275
|
+
`instanceof` the other class. `npm install` will not create installations
|
|
276
|
+
like this, but users may manually symlink construct libraries together or
|
|
277
|
+
use a monorepo tool: in those cases, multiple copies of the `constructs`
|
|
278
|
+
library can be accidentally installed, and `instanceof` will behave
|
|
279
|
+
unpredictably. It is safest to avoid using `instanceof`, and using
|
|
280
|
+
this type-testing method instead.
|
|
281
|
+
|
|
282
|
+
###### `x`<sup>Required</sup> <a name="x" id="@cdklabs/deploy-time-build.NodejsBuild.isConstruct.parameter.x"></a>
|
|
283
|
+
|
|
284
|
+
- *Type:* any
|
|
285
|
+
|
|
286
|
+
Any object.
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
291
|
+
|
|
292
|
+
| **Name** | **Type** | **Description** |
|
|
293
|
+
| --- | --- | --- |
|
|
294
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuild.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
295
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuild.property.grantPrincipal">grantPrincipal</a></code> | <code>aws-cdk-lib.aws_iam.IPrincipal</code> | The principal to grant permissions to. |
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
##### `node`<sup>Required</sup> <a name="node" id="@cdklabs/deploy-time-build.NodejsBuild.property.node"></a>
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
public readonly node: Node;
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
- *Type:* constructs.Node
|
|
306
|
+
|
|
307
|
+
The tree node.
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
##### `grantPrincipal`<sup>Required</sup> <a name="grantPrincipal" id="@cdklabs/deploy-time-build.NodejsBuild.property.grantPrincipal"></a>
|
|
312
|
+
|
|
313
|
+
```typescript
|
|
314
|
+
public readonly grantPrincipal: IPrincipal;
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
- *Type:* aws-cdk-lib.aws_iam.IPrincipal
|
|
318
|
+
|
|
319
|
+
The principal to grant permissions to.
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
### SociIndexBuild <a name="SociIndexBuild" id="@cdklabs/deploy-time-build.SociIndexBuild"></a>
|
|
325
|
+
|
|
326
|
+
Build and publish a SOCI index for a container image.
|
|
327
|
+
|
|
328
|
+
A SOCI index helps start Fargate tasks faster in some cases.
|
|
329
|
+
Please read the following document for more details: https://docs.aws.amazon.com/AmazonECS/latest/userguide/container-considerations.html
|
|
330
|
+
|
|
331
|
+
#### Initializers <a name="Initializers" id="@cdklabs/deploy-time-build.SociIndexBuild.Initializer"></a>
|
|
332
|
+
|
|
333
|
+
```typescript
|
|
334
|
+
import { SociIndexBuild } from '@cdklabs/deploy-time-build'
|
|
335
|
+
|
|
336
|
+
new SociIndexBuild(scope: Construct, id: string, props: SociIndexBuildProps)
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
| **Name** | **Type** | **Description** |
|
|
340
|
+
| --- | --- | --- |
|
|
341
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuild.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
342
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuild.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
343
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuild.Initializer.parameter.props">props</a></code> | <code><a href="#@cdklabs/deploy-time-build.SociIndexBuildProps">SociIndexBuildProps</a></code> | *No description.* |
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="@cdklabs/deploy-time-build.SociIndexBuild.Initializer.parameter.scope"></a>
|
|
348
|
+
|
|
349
|
+
- *Type:* constructs.Construct
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
##### `id`<sup>Required</sup> <a name="id" id="@cdklabs/deploy-time-build.SociIndexBuild.Initializer.parameter.id"></a>
|
|
354
|
+
|
|
355
|
+
- *Type:* string
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
##### `props`<sup>Required</sup> <a name="props" id="@cdklabs/deploy-time-build.SociIndexBuild.Initializer.parameter.props"></a>
|
|
360
|
+
|
|
361
|
+
- *Type:* <a href="#@cdklabs/deploy-time-build.SociIndexBuildProps">SociIndexBuildProps</a>
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
366
|
+
|
|
367
|
+
| **Name** | **Description** |
|
|
368
|
+
| --- | --- |
|
|
369
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuild.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
##### ~~`toString`~~ <a name="toString" id="@cdklabs/deploy-time-build.SociIndexBuild.toString"></a>
|
|
374
|
+
|
|
375
|
+
```typescript
|
|
376
|
+
public toString(): string
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Returns a string representation of this construct.
|
|
380
|
+
|
|
381
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
382
|
+
|
|
383
|
+
| **Name** | **Description** |
|
|
384
|
+
| --- | --- |
|
|
385
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuild.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
386
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuild.fromDockerImageAsset">fromDockerImageAsset</a></code> | A utility method to create a SociIndexBuild construct from a DockerImageAsset instance. |
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
##### ~~`isConstruct`~~ <a name="isConstruct" id="@cdklabs/deploy-time-build.SociIndexBuild.isConstruct"></a>
|
|
391
|
+
|
|
392
|
+
```typescript
|
|
393
|
+
import { SociIndexBuild } from '@cdklabs/deploy-time-build'
|
|
394
|
+
|
|
395
|
+
SociIndexBuild.isConstruct(x: any)
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
Checks if `x` is a construct.
|
|
399
|
+
|
|
400
|
+
Use this method instead of `instanceof` to properly detect `Construct`
|
|
401
|
+
instances, even when the construct library is symlinked.
|
|
402
|
+
|
|
403
|
+
Explanation: in JavaScript, multiple copies of the `constructs` library on
|
|
404
|
+
disk are seen as independent, completely different libraries. As a
|
|
405
|
+
consequence, the class `Construct` in each copy of the `constructs` library
|
|
406
|
+
is seen as a different class, and an instance of one class will not test as
|
|
407
|
+
`instanceof` the other class. `npm install` will not create installations
|
|
408
|
+
like this, but users may manually symlink construct libraries together or
|
|
409
|
+
use a monorepo tool: in those cases, multiple copies of the `constructs`
|
|
410
|
+
library can be accidentally installed, and `instanceof` will behave
|
|
411
|
+
unpredictably. It is safest to avoid using `instanceof`, and using
|
|
412
|
+
this type-testing method instead.
|
|
413
|
+
|
|
414
|
+
###### `x`<sup>Required</sup> <a name="x" id="@cdklabs/deploy-time-build.SociIndexBuild.isConstruct.parameter.x"></a>
|
|
415
|
+
|
|
416
|
+
- *Type:* any
|
|
417
|
+
|
|
418
|
+
Any object.
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
##### ~~`fromDockerImageAsset`~~ <a name="fromDockerImageAsset" id="@cdklabs/deploy-time-build.SociIndexBuild.fromDockerImageAsset"></a>
|
|
423
|
+
|
|
424
|
+
```typescript
|
|
425
|
+
import { SociIndexBuild } from '@cdklabs/deploy-time-build'
|
|
426
|
+
|
|
427
|
+
SociIndexBuild.fromDockerImageAsset(scope: Construct, id: string, imageAsset: DockerImageAsset)
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
A utility method to create a SociIndexBuild construct from a DockerImageAsset instance.
|
|
431
|
+
|
|
432
|
+
###### `scope`<sup>Required</sup> <a name="scope" id="@cdklabs/deploy-time-build.SociIndexBuild.fromDockerImageAsset.parameter.scope"></a>
|
|
433
|
+
|
|
434
|
+
- *Type:* constructs.Construct
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
###### `id`<sup>Required</sup> <a name="id" id="@cdklabs/deploy-time-build.SociIndexBuild.fromDockerImageAsset.parameter.id"></a>
|
|
439
|
+
|
|
440
|
+
- *Type:* string
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
###### `imageAsset`<sup>Required</sup> <a name="imageAsset" id="@cdklabs/deploy-time-build.SociIndexBuild.fromDockerImageAsset.parameter.imageAsset"></a>
|
|
445
|
+
|
|
446
|
+
- *Type:* aws-cdk-lib.aws_ecr_assets.DockerImageAsset
|
|
447
|
+
|
|
448
|
+
---
|
|
449
|
+
|
|
450
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
451
|
+
|
|
452
|
+
| **Name** | **Type** | **Description** |
|
|
453
|
+
| --- | --- | --- |
|
|
454
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuild.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
455
|
+
|
|
456
|
+
---
|
|
457
|
+
|
|
458
|
+
##### ~~`node`~~<sup>Required</sup> <a name="node" id="@cdklabs/deploy-time-build.SociIndexBuild.property.node"></a>
|
|
459
|
+
|
|
460
|
+
- *Deprecated:* Use {@link SociIndexV2Build } instead. Customers new to SOCI on AWS Fargate can only use SOCI index manifest v2.
|
|
461
|
+
See [this article](https://aws.amazon.com/blogs/containers/improving-amazon-ecs-deployment-consistency-with-soci-index-manifest-v2/) for more details.
|
|
462
|
+
|
|
463
|
+
```typescript
|
|
464
|
+
public readonly node: Node;
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
- *Type:* constructs.Node
|
|
468
|
+
|
|
469
|
+
The tree node.
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
### SociIndexV2Build <a name="SociIndexV2Build" id="@cdklabs/deploy-time-build.SociIndexV2Build"></a>
|
|
475
|
+
|
|
476
|
+
Build and publish a SOCI index for a container image.
|
|
477
|
+
|
|
478
|
+
A SOCI index helps start Fargate tasks faster in some cases.
|
|
479
|
+
Please read the following document for more details: https://docs.aws.amazon.com/AmazonECS/latest/userguide/container-considerations.html
|
|
480
|
+
|
|
481
|
+
#### Initializers <a name="Initializers" id="@cdklabs/deploy-time-build.SociIndexV2Build.Initializer"></a>
|
|
482
|
+
|
|
483
|
+
```typescript
|
|
484
|
+
import { SociIndexV2Build } from '@cdklabs/deploy-time-build'
|
|
485
|
+
|
|
486
|
+
new SociIndexV2Build(scope: Construct, id: string, props: SociIndexV2BuildProps)
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
| **Name** | **Type** | **Description** |
|
|
490
|
+
| --- | --- | --- |
|
|
491
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
|
|
492
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
|
|
493
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.Initializer.parameter.props">props</a></code> | <code><a href="#@cdklabs/deploy-time-build.SociIndexV2BuildProps">SociIndexV2BuildProps</a></code> | *No description.* |
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
##### `scope`<sup>Required</sup> <a name="scope" id="@cdklabs/deploy-time-build.SociIndexV2Build.Initializer.parameter.scope"></a>
|
|
498
|
+
|
|
499
|
+
- *Type:* constructs.Construct
|
|
500
|
+
|
|
501
|
+
---
|
|
502
|
+
|
|
503
|
+
##### `id`<sup>Required</sup> <a name="id" id="@cdklabs/deploy-time-build.SociIndexV2Build.Initializer.parameter.id"></a>
|
|
504
|
+
|
|
505
|
+
- *Type:* string
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
##### `props`<sup>Required</sup> <a name="props" id="@cdklabs/deploy-time-build.SociIndexV2Build.Initializer.parameter.props"></a>
|
|
510
|
+
|
|
511
|
+
- *Type:* <a href="#@cdklabs/deploy-time-build.SociIndexV2BuildProps">SociIndexV2BuildProps</a>
|
|
512
|
+
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
#### Methods <a name="Methods" id="Methods"></a>
|
|
516
|
+
|
|
517
|
+
| **Name** | **Description** |
|
|
518
|
+
| --- | --- |
|
|
519
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
520
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.toEcsDockerImageCode">toEcsDockerImageCode</a></code> | Get the instance of image embedded with SOCI v2 index for an ECS task definition. |
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
##### `toString` <a name="toString" id="@cdklabs/deploy-time-build.SociIndexV2Build.toString"></a>
|
|
525
|
+
|
|
526
|
+
```typescript
|
|
527
|
+
public toString(): string
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
Returns a string representation of this construct.
|
|
531
|
+
|
|
532
|
+
##### `toEcsDockerImageCode` <a name="toEcsDockerImageCode" id="@cdklabs/deploy-time-build.SociIndexV2Build.toEcsDockerImageCode"></a>
|
|
533
|
+
|
|
534
|
+
```typescript
|
|
535
|
+
public toEcsDockerImageCode(): EcrImage
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
Get the instance of image embedded with SOCI v2 index for an ECS task definition.
|
|
539
|
+
|
|
540
|
+
When using this image returned from this function, your deployment waits until
|
|
541
|
+
the index build complete and then start deploying after the image with index ready.
|
|
542
|
+
|
|
543
|
+
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
544
|
+
|
|
545
|
+
| **Name** | **Description** |
|
|
546
|
+
| --- | --- |
|
|
547
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
|
|
548
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.fromDockerImageAsset">fromDockerImageAsset</a></code> | A utility method to create a SociIndexBuild construct from a DockerImageAsset instance. |
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
##### `isConstruct` <a name="isConstruct" id="@cdklabs/deploy-time-build.SociIndexV2Build.isConstruct"></a>
|
|
553
|
+
|
|
554
|
+
```typescript
|
|
555
|
+
import { SociIndexV2Build } from '@cdklabs/deploy-time-build'
|
|
556
|
+
|
|
557
|
+
SociIndexV2Build.isConstruct(x: any)
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
Checks if `x` is a construct.
|
|
561
|
+
|
|
562
|
+
Use this method instead of `instanceof` to properly detect `Construct`
|
|
563
|
+
instances, even when the construct library is symlinked.
|
|
564
|
+
|
|
565
|
+
Explanation: in JavaScript, multiple copies of the `constructs` library on
|
|
566
|
+
disk are seen as independent, completely different libraries. As a
|
|
567
|
+
consequence, the class `Construct` in each copy of the `constructs` library
|
|
568
|
+
is seen as a different class, and an instance of one class will not test as
|
|
569
|
+
`instanceof` the other class. `npm install` will not create installations
|
|
570
|
+
like this, but users may manually symlink construct libraries together or
|
|
571
|
+
use a monorepo tool: in those cases, multiple copies of the `constructs`
|
|
572
|
+
library can be accidentally installed, and `instanceof` will behave
|
|
573
|
+
unpredictably. It is safest to avoid using `instanceof`, and using
|
|
574
|
+
this type-testing method instead.
|
|
575
|
+
|
|
576
|
+
###### `x`<sup>Required</sup> <a name="x" id="@cdklabs/deploy-time-build.SociIndexV2Build.isConstruct.parameter.x"></a>
|
|
577
|
+
|
|
578
|
+
- *Type:* any
|
|
579
|
+
|
|
580
|
+
Any object.
|
|
581
|
+
|
|
582
|
+
---
|
|
583
|
+
|
|
584
|
+
##### `fromDockerImageAsset` <a name="fromDockerImageAsset" id="@cdklabs/deploy-time-build.SociIndexV2Build.fromDockerImageAsset"></a>
|
|
585
|
+
|
|
586
|
+
```typescript
|
|
587
|
+
import { SociIndexV2Build } from '@cdklabs/deploy-time-build'
|
|
588
|
+
|
|
589
|
+
SociIndexV2Build.fromDockerImageAsset(scope: Construct, id: string, imageAsset: DockerImageAsset)
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
A utility method to create a SociIndexBuild construct from a DockerImageAsset instance.
|
|
593
|
+
|
|
594
|
+
###### `scope`<sup>Required</sup> <a name="scope" id="@cdklabs/deploy-time-build.SociIndexV2Build.fromDockerImageAsset.parameter.scope"></a>
|
|
595
|
+
|
|
596
|
+
- *Type:* constructs.Construct
|
|
597
|
+
|
|
598
|
+
---
|
|
599
|
+
|
|
600
|
+
###### `id`<sup>Required</sup> <a name="id" id="@cdklabs/deploy-time-build.SociIndexV2Build.fromDockerImageAsset.parameter.id"></a>
|
|
601
|
+
|
|
602
|
+
- *Type:* string
|
|
603
|
+
|
|
604
|
+
---
|
|
605
|
+
|
|
606
|
+
###### `imageAsset`<sup>Required</sup> <a name="imageAsset" id="@cdklabs/deploy-time-build.SociIndexV2Build.fromDockerImageAsset.parameter.imageAsset"></a>
|
|
607
|
+
|
|
608
|
+
- *Type:* aws-cdk-lib.aws_ecr_assets.DockerImageAsset
|
|
609
|
+
|
|
610
|
+
---
|
|
611
|
+
|
|
612
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
613
|
+
|
|
614
|
+
| **Name** | **Type** | **Description** |
|
|
615
|
+
| --- | --- | --- |
|
|
616
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
617
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.property.outputImageTag">outputImageTag</a></code> | <code>string</code> | *No description.* |
|
|
618
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.property.repository">repository</a></code> | <code>aws-cdk-lib.aws_ecr.IRepository</code> | *No description.* |
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
##### `node`<sup>Required</sup> <a name="node" id="@cdklabs/deploy-time-build.SociIndexV2Build.property.node"></a>
|
|
623
|
+
|
|
624
|
+
```typescript
|
|
625
|
+
public readonly node: Node;
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
- *Type:* constructs.Node
|
|
629
|
+
|
|
630
|
+
The tree node.
|
|
631
|
+
|
|
632
|
+
---
|
|
633
|
+
|
|
634
|
+
##### `outputImageTag`<sup>Required</sup> <a name="outputImageTag" id="@cdklabs/deploy-time-build.SociIndexV2Build.property.outputImageTag"></a>
|
|
635
|
+
|
|
636
|
+
```typescript
|
|
637
|
+
public readonly outputImageTag: string;
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
- *Type:* string
|
|
641
|
+
|
|
642
|
+
---
|
|
643
|
+
|
|
644
|
+
##### `repository`<sup>Required</sup> <a name="repository" id="@cdklabs/deploy-time-build.SociIndexV2Build.property.repository"></a>
|
|
645
|
+
|
|
646
|
+
```typescript
|
|
647
|
+
public readonly repository: IRepository;
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
- *Type:* aws-cdk-lib.aws_ecr.IRepository
|
|
651
|
+
|
|
652
|
+
---
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
## Structs <a name="Structs" id="Structs"></a>
|
|
656
|
+
|
|
657
|
+
### AssetConfig <a name="AssetConfig" id="@cdklabs/deploy-time-build.AssetConfig"></a>
|
|
658
|
+
|
|
659
|
+
#### Initializer <a name="Initializer" id="@cdklabs/deploy-time-build.AssetConfig.Initializer"></a>
|
|
660
|
+
|
|
661
|
+
```typescript
|
|
662
|
+
import { AssetConfig } from '@cdklabs/deploy-time-build'
|
|
663
|
+
|
|
664
|
+
const assetConfig: AssetConfig = { ... }
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
668
|
+
|
|
669
|
+
| **Name** | **Type** | **Description** |
|
|
670
|
+
| --- | --- | --- |
|
|
671
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.assetHash">assetHash</a></code> | <code>string</code> | Specify a custom hash for this asset. |
|
|
672
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.assetHashType">assetHashType</a></code> | <code>aws-cdk-lib.AssetHashType</code> | Specifies the type of hash to calculate for this asset. |
|
|
673
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.bundling">bundling</a></code> | <code>aws-cdk-lib.BundlingOptions</code> | Bundle the asset by executing a command in a Docker container or a custom bundling provider. |
|
|
674
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.exclude">exclude</a></code> | <code>string[]</code> | File paths matching the patterns will be excluded. |
|
|
675
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.followSymlinks">followSymlinks</a></code> | <code>aws-cdk-lib.SymlinkFollowMode</code> | A strategy for how to handle symlinks. |
|
|
676
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.ignoreMode">ignoreMode</a></code> | <code>aws-cdk-lib.IgnoreMode</code> | The ignore behavior to use for `exclude` patterns. |
|
|
677
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.deployTime">deployTime</a></code> | <code>boolean</code> | Whether or not the asset needs to exist beyond deployment time; |
|
|
678
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.displayName">displayName</a></code> | <code>string</code> | A display name for this asset. |
|
|
679
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.readers">readers</a></code> | <code>aws-cdk-lib.aws_iam.IGrantable[]</code> | A list of principals that should be able to read this asset from S3. |
|
|
680
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.sourceKMSKey">sourceKMSKey</a></code> | <code>aws-cdk-lib.interfaces.aws_kms.IKeyRef</code> | The ARN of the KMS key used to encrypt the handler code. |
|
|
681
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.path">path</a></code> | <code>string</code> | The disk location of the asset. |
|
|
682
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.commands">commands</a></code> | <code>string[]</code> | Shell commands executed right after the asset zip is extracted to the build environment. |
|
|
683
|
+
| <code><a href="#@cdklabs/deploy-time-build.AssetConfig.property.extractPath">extractPath</a></code> | <code>string</code> | Relative path from a build directory to the directory where the asset is extracted. |
|
|
684
|
+
|
|
685
|
+
---
|
|
686
|
+
|
|
687
|
+
##### `assetHash`<sup>Optional</sup> <a name="assetHash" id="@cdklabs/deploy-time-build.AssetConfig.property.assetHash"></a>
|
|
688
|
+
|
|
689
|
+
```typescript
|
|
690
|
+
public readonly assetHash: string;
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
- *Type:* string
|
|
694
|
+
- *Default:* based on `assetHashType`
|
|
695
|
+
|
|
696
|
+
Specify a custom hash for this asset.
|
|
697
|
+
|
|
698
|
+
If `assetHashType` is set it must
|
|
699
|
+
be set to `AssetHashType.CUSTOM`. For consistency, this custom hash will
|
|
700
|
+
be SHA256 hashed and encoded as hex. The resulting hash will be the asset
|
|
701
|
+
hash.
|
|
702
|
+
|
|
703
|
+
NOTE: the hash is used in order to identify a specific revision of the asset, and
|
|
704
|
+
used for optimizing and caching deployment activities related to this asset such as
|
|
705
|
+
packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will
|
|
706
|
+
need to make sure it is updated every time the asset changes, or otherwise it is
|
|
707
|
+
possible that some deployments will not be invalidated.
|
|
708
|
+
|
|
709
|
+
---
|
|
710
|
+
|
|
711
|
+
##### `assetHashType`<sup>Optional</sup> <a name="assetHashType" id="@cdklabs/deploy-time-build.AssetConfig.property.assetHashType"></a>
|
|
712
|
+
|
|
713
|
+
```typescript
|
|
714
|
+
public readonly assetHashType: AssetHashType;
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
- *Type:* aws-cdk-lib.AssetHashType
|
|
718
|
+
- *Default:* the default is `AssetHashType.SOURCE`, but if `assetHash` is explicitly specified this value defaults to `AssetHashType.CUSTOM`.
|
|
719
|
+
|
|
720
|
+
Specifies the type of hash to calculate for this asset.
|
|
721
|
+
|
|
722
|
+
If `assetHash` is configured, this option must be `undefined` or
|
|
723
|
+
`AssetHashType.CUSTOM`.
|
|
724
|
+
|
|
725
|
+
---
|
|
726
|
+
|
|
727
|
+
##### `bundling`<sup>Optional</sup> <a name="bundling" id="@cdklabs/deploy-time-build.AssetConfig.property.bundling"></a>
|
|
728
|
+
|
|
729
|
+
```typescript
|
|
730
|
+
public readonly bundling: BundlingOptions;
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
- *Type:* aws-cdk-lib.BundlingOptions
|
|
734
|
+
- *Default:* uploaded as-is to S3 if the asset is a regular file or a .zip file, archived into a .zip file and uploaded to S3 otherwise
|
|
735
|
+
|
|
736
|
+
Bundle the asset by executing a command in a Docker container or a custom bundling provider.
|
|
737
|
+
|
|
738
|
+
The asset path will be mounted at `/asset-input`. The Docker
|
|
739
|
+
container is responsible for putting content at `/asset-output`.
|
|
740
|
+
The content at `/asset-output` will be zipped and used as the
|
|
741
|
+
final asset.
|
|
742
|
+
|
|
743
|
+
---
|
|
744
|
+
|
|
745
|
+
##### `exclude`<sup>Optional</sup> <a name="exclude" id="@cdklabs/deploy-time-build.AssetConfig.property.exclude"></a>
|
|
746
|
+
|
|
747
|
+
```typescript
|
|
748
|
+
public readonly exclude: string[];
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
- *Type:* string[]
|
|
752
|
+
- *Default:* nothing is excluded
|
|
753
|
+
|
|
754
|
+
File paths matching the patterns will be excluded.
|
|
755
|
+
|
|
756
|
+
See `ignoreMode` to set the matching behavior.
|
|
757
|
+
Has no effect on Assets bundled using the `bundling` property.
|
|
758
|
+
|
|
759
|
+
---
|
|
760
|
+
|
|
761
|
+
##### `followSymlinks`<sup>Optional</sup> <a name="followSymlinks" id="@cdklabs/deploy-time-build.AssetConfig.property.followSymlinks"></a>
|
|
762
|
+
|
|
763
|
+
```typescript
|
|
764
|
+
public readonly followSymlinks: SymlinkFollowMode;
|
|
765
|
+
```
|
|
766
|
+
|
|
767
|
+
- *Type:* aws-cdk-lib.SymlinkFollowMode
|
|
768
|
+
- *Default:* SymlinkFollowMode.NEVER
|
|
769
|
+
|
|
770
|
+
A strategy for how to handle symlinks.
|
|
771
|
+
|
|
772
|
+
---
|
|
773
|
+
|
|
774
|
+
##### `ignoreMode`<sup>Optional</sup> <a name="ignoreMode" id="@cdklabs/deploy-time-build.AssetConfig.property.ignoreMode"></a>
|
|
775
|
+
|
|
776
|
+
```typescript
|
|
777
|
+
public readonly ignoreMode: IgnoreMode;
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
- *Type:* aws-cdk-lib.IgnoreMode
|
|
781
|
+
- *Default:* IgnoreMode.GLOB
|
|
782
|
+
|
|
783
|
+
The ignore behavior to use for `exclude` patterns.
|
|
784
|
+
|
|
785
|
+
---
|
|
786
|
+
|
|
787
|
+
##### `deployTime`<sup>Optional</sup> <a name="deployTime" id="@cdklabs/deploy-time-build.AssetConfig.property.deployTime"></a>
|
|
788
|
+
|
|
789
|
+
```typescript
|
|
790
|
+
public readonly deployTime: boolean;
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
- *Type:* boolean
|
|
794
|
+
- *Default:* false
|
|
795
|
+
|
|
796
|
+
Whether or not the asset needs to exist beyond deployment time;
|
|
797
|
+
|
|
798
|
+
i.e.
|
|
799
|
+
are copied over to a different location and not needed afterwards.
|
|
800
|
+
Setting this property to true has an impact on the lifecycle of the asset,
|
|
801
|
+
because we will assume that it is safe to delete after the CloudFormation
|
|
802
|
+
deployment succeeds.
|
|
803
|
+
|
|
804
|
+
For example, Lambda Function assets are copied over to Lambda during
|
|
805
|
+
deployment. Therefore, it is not necessary to store the asset in S3, so
|
|
806
|
+
we consider those deployTime assets.
|
|
807
|
+
|
|
808
|
+
---
|
|
809
|
+
|
|
810
|
+
##### `displayName`<sup>Optional</sup> <a name="displayName" id="@cdklabs/deploy-time-build.AssetConfig.property.displayName"></a>
|
|
811
|
+
|
|
812
|
+
```typescript
|
|
813
|
+
public readonly displayName: string;
|
|
814
|
+
```
|
|
815
|
+
|
|
816
|
+
- *Type:* string
|
|
817
|
+
- *Default:* Stack-relative construct path
|
|
818
|
+
|
|
819
|
+
A display name for this asset.
|
|
820
|
+
|
|
821
|
+
If supplied, the display name will be used in locations where the asset
|
|
822
|
+
identifier is printed, like in the CLI progress information. If the same
|
|
823
|
+
asset is added multiple times, the display name of the first occurrence is
|
|
824
|
+
used.
|
|
825
|
+
|
|
826
|
+
The default is the construct path of the Asset construct, with respect to
|
|
827
|
+
the enclosing stack. If the asset is produced by a construct helper
|
|
828
|
+
function (such as `lambda.Code.fromAsset()`), this will look like
|
|
829
|
+
`MyFunction/Code`.
|
|
830
|
+
|
|
831
|
+
We use the stack-relative construct path so that in the common case where
|
|
832
|
+
you have multiple stacks with the same asset, we won't show something like
|
|
833
|
+
`/MyBetaStack/MyFunction/Code` when you are actually deploying to
|
|
834
|
+
production.
|
|
835
|
+
|
|
836
|
+
---
|
|
837
|
+
|
|
838
|
+
##### `readers`<sup>Optional</sup> <a name="readers" id="@cdklabs/deploy-time-build.AssetConfig.property.readers"></a>
|
|
839
|
+
|
|
840
|
+
```typescript
|
|
841
|
+
public readonly readers: IGrantable[];
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
- *Type:* aws-cdk-lib.aws_iam.IGrantable[]
|
|
845
|
+
- *Default:* No principals that can read file asset.
|
|
846
|
+
|
|
847
|
+
A list of principals that should be able to read this asset from S3.
|
|
848
|
+
|
|
849
|
+
You can use `asset.grantRead(principal)` to grant read permissions later.
|
|
850
|
+
|
|
851
|
+
---
|
|
852
|
+
|
|
853
|
+
##### `sourceKMSKey`<sup>Optional</sup> <a name="sourceKMSKey" id="@cdklabs/deploy-time-build.AssetConfig.property.sourceKMSKey"></a>
|
|
854
|
+
|
|
855
|
+
```typescript
|
|
856
|
+
public readonly sourceKMSKey: IKeyRef;
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
- *Type:* aws-cdk-lib.interfaces.aws_kms.IKeyRef
|
|
860
|
+
- *Default:* the default server-side encryption with Amazon S3 managed keys(SSE-S3) key will be used.
|
|
861
|
+
|
|
862
|
+
The ARN of the KMS key used to encrypt the handler code.
|
|
863
|
+
|
|
864
|
+
---
|
|
865
|
+
|
|
866
|
+
##### `path`<sup>Required</sup> <a name="path" id="@cdklabs/deploy-time-build.AssetConfig.property.path"></a>
|
|
867
|
+
|
|
868
|
+
```typescript
|
|
869
|
+
public readonly path: string;
|
|
870
|
+
```
|
|
871
|
+
|
|
872
|
+
- *Type:* string
|
|
873
|
+
|
|
874
|
+
The disk location of the asset.
|
|
875
|
+
|
|
876
|
+
The path should refer to one of the following:
|
|
877
|
+
- A regular file or a .zip file, in which case the file will be uploaded as-is to S3.
|
|
878
|
+
- A directory, in which case it will be archived into a .zip file and uploaded to S3.
|
|
879
|
+
|
|
880
|
+
---
|
|
881
|
+
|
|
882
|
+
##### `commands`<sup>Optional</sup> <a name="commands" id="@cdklabs/deploy-time-build.AssetConfig.property.commands"></a>
|
|
883
|
+
|
|
884
|
+
```typescript
|
|
885
|
+
public readonly commands: string[];
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
- *Type:* string[]
|
|
889
|
+
- *Default:* No command is executed.
|
|
890
|
+
|
|
891
|
+
Shell commands executed right after the asset zip is extracted to the build environment.
|
|
892
|
+
|
|
893
|
+
---
|
|
894
|
+
|
|
895
|
+
##### `extractPath`<sup>Optional</sup> <a name="extractPath" id="@cdklabs/deploy-time-build.AssetConfig.property.extractPath"></a>
|
|
896
|
+
|
|
897
|
+
```typescript
|
|
898
|
+
public readonly extractPath: string;
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
- *Type:* string
|
|
902
|
+
- *Default:* basename of the asset path.
|
|
903
|
+
|
|
904
|
+
Relative path from a build directory to the directory where the asset is extracted.
|
|
905
|
+
|
|
906
|
+
---
|
|
907
|
+
|
|
908
|
+
### ContainerImageBuildProps <a name="ContainerImageBuildProps" id="@cdklabs/deploy-time-build.ContainerImageBuildProps"></a>
|
|
909
|
+
|
|
910
|
+
#### Initializer <a name="Initializer" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.Initializer"></a>
|
|
911
|
+
|
|
912
|
+
```typescript
|
|
913
|
+
import { ContainerImageBuildProps } from '@cdklabs/deploy-time-build'
|
|
914
|
+
|
|
915
|
+
const containerImageBuildProps: ContainerImageBuildProps = { ... }
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
919
|
+
|
|
920
|
+
| **Name** | **Type** | **Description** |
|
|
921
|
+
| --- | --- | --- |
|
|
922
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.exclude">exclude</a></code> | <code>string[]</code> | File paths matching the patterns will be excluded. |
|
|
923
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.followSymlinks">followSymlinks</a></code> | <code>aws-cdk-lib.SymlinkFollowMode</code> | A strategy for how to handle symlinks. |
|
|
924
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.ignoreMode">ignoreMode</a></code> | <code>aws-cdk-lib.IgnoreMode</code> | The ignore behavior to use for `exclude` patterns. |
|
|
925
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.extraHash">extraHash</a></code> | <code>string</code> | Extra information to encode into the fingerprint (e.g. build instructions and other inputs). |
|
|
926
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.assetName">assetName</a></code> | <code>string</code> | Unique identifier of the docker image asset and its potential revisions. |
|
|
927
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.buildArgs">buildArgs</a></code> | <code>{[ key: string ]: string}</code> | Build args to pass to the `docker build` command. |
|
|
928
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.buildSecrets">buildSecrets</a></code> | <code>{[ key: string ]: string}</code> | Build secrets. |
|
|
929
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.buildSsh">buildSsh</a></code> | <code>string</code> | SSH agent socket or keys to pass to the `docker build` command. |
|
|
930
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.cacheDisabled">cacheDisabled</a></code> | <code>boolean</code> | Disable the cache and pass `--no-cache` to the `docker build` command. |
|
|
931
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.cacheFrom">cacheFrom</a></code> | <code>aws-cdk-lib.aws_ecr_assets.DockerCacheOption[]</code> | Cache from options to pass to the `docker build` command. |
|
|
932
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.cacheTo">cacheTo</a></code> | <code>aws-cdk-lib.aws_ecr_assets.DockerCacheOption</code> | Cache to options to pass to the `docker build` command. |
|
|
933
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.displayName">displayName</a></code> | <code>string</code> | A display name for this asset. |
|
|
934
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.file">file</a></code> | <code>string</code> | Path to the Dockerfile (relative to the directory). |
|
|
935
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.invalidation">invalidation</a></code> | <code>aws-cdk-lib.aws_ecr_assets.DockerImageAssetInvalidationOptions</code> | Options to control which parameters are used to invalidate the asset hash. |
|
|
936
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.networkMode">networkMode</a></code> | <code>aws-cdk-lib.aws_ecr_assets.NetworkMode</code> | Networking mode for the RUN commands during build. |
|
|
937
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.outputs">outputs</a></code> | <code>string[]</code> | Outputs to pass to the `docker build` command. |
|
|
938
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.platform">platform</a></code> | <code>aws-cdk-lib.aws_ecr_assets.Platform</code> | Platform to build for. |
|
|
939
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.target">target</a></code> | <code>string</code> | Docker target to build to. |
|
|
940
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.directory">directory</a></code> | <code>string</code> | The directory where the Dockerfile is stored. |
|
|
941
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.repository">repository</a></code> | <code>aws-cdk-lib.aws_ecr.IRepository</code> | The ECR repository to push the image. |
|
|
942
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.tag">tag</a></code> | <code>string</code> | The tag when to push the image. |
|
|
943
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.tagPrefix">tagPrefix</a></code> | <code>string</code> | Prefix to add to the image tag. |
|
|
944
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.vpc">vpc</a></code> | <code>aws-cdk-lib.aws_ec2.IVpc</code> | The VPC where your build job will be deployed. This VPC must have private subnets with NAT Gateways. |
|
|
945
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuildProps.property.zstdCompression">zstdCompression</a></code> | <code>boolean</code> | Use zstd for compressing a container image. |
|
|
946
|
+
|
|
947
|
+
---
|
|
948
|
+
|
|
949
|
+
##### `exclude`<sup>Optional</sup> <a name="exclude" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.exclude"></a>
|
|
950
|
+
|
|
951
|
+
```typescript
|
|
952
|
+
public readonly exclude: string[];
|
|
953
|
+
```
|
|
954
|
+
|
|
955
|
+
- *Type:* string[]
|
|
956
|
+
- *Default:* nothing is excluded
|
|
957
|
+
|
|
958
|
+
File paths matching the patterns will be excluded.
|
|
959
|
+
|
|
960
|
+
See `ignoreMode` to set the matching behavior.
|
|
961
|
+
Has no effect on Assets bundled using the `bundling` property.
|
|
962
|
+
|
|
963
|
+
---
|
|
964
|
+
|
|
965
|
+
##### `followSymlinks`<sup>Optional</sup> <a name="followSymlinks" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.followSymlinks"></a>
|
|
966
|
+
|
|
967
|
+
```typescript
|
|
968
|
+
public readonly followSymlinks: SymlinkFollowMode;
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
- *Type:* aws-cdk-lib.SymlinkFollowMode
|
|
972
|
+
- *Default:* SymlinkFollowMode.NEVER
|
|
973
|
+
|
|
974
|
+
A strategy for how to handle symlinks.
|
|
975
|
+
|
|
976
|
+
---
|
|
977
|
+
|
|
978
|
+
##### `ignoreMode`<sup>Optional</sup> <a name="ignoreMode" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.ignoreMode"></a>
|
|
979
|
+
|
|
980
|
+
```typescript
|
|
981
|
+
public readonly ignoreMode: IgnoreMode;
|
|
982
|
+
```
|
|
983
|
+
|
|
984
|
+
- *Type:* aws-cdk-lib.IgnoreMode
|
|
985
|
+
- *Default:* IgnoreMode.GLOB
|
|
986
|
+
|
|
987
|
+
The ignore behavior to use for `exclude` patterns.
|
|
988
|
+
|
|
989
|
+
---
|
|
990
|
+
|
|
991
|
+
##### `extraHash`<sup>Optional</sup> <a name="extraHash" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.extraHash"></a>
|
|
992
|
+
|
|
993
|
+
```typescript
|
|
994
|
+
public readonly extraHash: string;
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
- *Type:* string
|
|
998
|
+
- *Default:* hash is only based on source content
|
|
999
|
+
|
|
1000
|
+
Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
|
|
1001
|
+
|
|
1002
|
+
---
|
|
1003
|
+
|
|
1004
|
+
##### `assetName`<sup>Optional</sup> <a name="assetName" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.assetName"></a>
|
|
1005
|
+
|
|
1006
|
+
```typescript
|
|
1007
|
+
public readonly assetName: string;
|
|
1008
|
+
```
|
|
1009
|
+
|
|
1010
|
+
- *Type:* string
|
|
1011
|
+
- *Default:* no asset name
|
|
1012
|
+
|
|
1013
|
+
Unique identifier of the docker image asset and its potential revisions.
|
|
1014
|
+
|
|
1015
|
+
Required if using AppScopedStagingSynthesizer.
|
|
1016
|
+
|
|
1017
|
+
---
|
|
1018
|
+
|
|
1019
|
+
##### `buildArgs`<sup>Optional</sup> <a name="buildArgs" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.buildArgs"></a>
|
|
1020
|
+
|
|
1021
|
+
```typescript
|
|
1022
|
+
public readonly buildArgs: {[ key: string ]: string};
|
|
1023
|
+
```
|
|
1024
|
+
|
|
1025
|
+
- *Type:* {[ key: string ]: string}
|
|
1026
|
+
- *Default:* no build args are passed
|
|
1027
|
+
|
|
1028
|
+
Build args to pass to the `docker build` command.
|
|
1029
|
+
|
|
1030
|
+
Since Docker build arguments are resolved before deployment, keys and
|
|
1031
|
+
values cannot refer to unresolved tokens (such as `lambda.functionArn` or
|
|
1032
|
+
`queue.queueUrl`).
|
|
1033
|
+
|
|
1034
|
+
---
|
|
1035
|
+
|
|
1036
|
+
##### `buildSecrets`<sup>Optional</sup> <a name="buildSecrets" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.buildSecrets"></a>
|
|
1037
|
+
|
|
1038
|
+
```typescript
|
|
1039
|
+
public readonly buildSecrets: {[ key: string ]: string};
|
|
1040
|
+
```
|
|
1041
|
+
|
|
1042
|
+
- *Type:* {[ key: string ]: string}
|
|
1043
|
+
- *Default:* no build secrets
|
|
1044
|
+
|
|
1045
|
+
Build secrets.
|
|
1046
|
+
|
|
1047
|
+
Docker BuildKit must be enabled to use build secrets.
|
|
1048
|
+
|
|
1049
|
+
> [https://docs.docker.com/build/buildkit/](https://docs.docker.com/build/buildkit/)
|
|
1050
|
+
|
|
1051
|
+
---
|
|
1052
|
+
|
|
1053
|
+
*Example*
|
|
1054
|
+
|
|
1055
|
+
```typescript
|
|
1056
|
+
import { DockerBuildSecret } from 'aws-cdk-lib';
|
|
1057
|
+
|
|
1058
|
+
const buildSecrets = {
|
|
1059
|
+
'MY_SECRET': DockerBuildSecret.fromSrc('file.txt')
|
|
1060
|
+
};
|
|
1061
|
+
```
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
##### `buildSsh`<sup>Optional</sup> <a name="buildSsh" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.buildSsh"></a>
|
|
1065
|
+
|
|
1066
|
+
```typescript
|
|
1067
|
+
public readonly buildSsh: string;
|
|
1068
|
+
```
|
|
1069
|
+
|
|
1070
|
+
- *Type:* string
|
|
1071
|
+
- *Default:* no --ssh flag
|
|
1072
|
+
|
|
1073
|
+
SSH agent socket or keys to pass to the `docker build` command.
|
|
1074
|
+
|
|
1075
|
+
Docker BuildKit must be enabled to use the ssh flag
|
|
1076
|
+
|
|
1077
|
+
> [https://docs.docker.com/build/buildkit/](https://docs.docker.com/build/buildkit/)
|
|
1078
|
+
|
|
1079
|
+
---
|
|
1080
|
+
|
|
1081
|
+
##### `cacheDisabled`<sup>Optional</sup> <a name="cacheDisabled" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.cacheDisabled"></a>
|
|
1082
|
+
|
|
1083
|
+
```typescript
|
|
1084
|
+
public readonly cacheDisabled: boolean;
|
|
1085
|
+
```
|
|
1086
|
+
|
|
1087
|
+
- *Type:* boolean
|
|
1088
|
+
- *Default:* cache is used
|
|
1089
|
+
|
|
1090
|
+
Disable the cache and pass `--no-cache` to the `docker build` command.
|
|
1091
|
+
|
|
1092
|
+
---
|
|
1093
|
+
|
|
1094
|
+
##### `cacheFrom`<sup>Optional</sup> <a name="cacheFrom" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.cacheFrom"></a>
|
|
1095
|
+
|
|
1096
|
+
```typescript
|
|
1097
|
+
public readonly cacheFrom: DockerCacheOption[];
|
|
1098
|
+
```
|
|
1099
|
+
|
|
1100
|
+
- *Type:* aws-cdk-lib.aws_ecr_assets.DockerCacheOption[]
|
|
1101
|
+
- *Default:* no cache from options are passed to the build command
|
|
1102
|
+
|
|
1103
|
+
Cache from options to pass to the `docker build` command.
|
|
1104
|
+
|
|
1105
|
+
> [https://docs.docker.com/build/cache/backends/](https://docs.docker.com/build/cache/backends/)
|
|
1106
|
+
|
|
1107
|
+
---
|
|
1108
|
+
|
|
1109
|
+
##### `cacheTo`<sup>Optional</sup> <a name="cacheTo" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.cacheTo"></a>
|
|
1110
|
+
|
|
1111
|
+
```typescript
|
|
1112
|
+
public readonly cacheTo: DockerCacheOption;
|
|
1113
|
+
```
|
|
1114
|
+
|
|
1115
|
+
- *Type:* aws-cdk-lib.aws_ecr_assets.DockerCacheOption
|
|
1116
|
+
- *Default:* no cache to options are passed to the build command
|
|
1117
|
+
|
|
1118
|
+
Cache to options to pass to the `docker build` command.
|
|
1119
|
+
|
|
1120
|
+
> [https://docs.docker.com/build/cache/backends/](https://docs.docker.com/build/cache/backends/)
|
|
1121
|
+
|
|
1122
|
+
---
|
|
1123
|
+
|
|
1124
|
+
##### `displayName`<sup>Optional</sup> <a name="displayName" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.displayName"></a>
|
|
1125
|
+
|
|
1126
|
+
```typescript
|
|
1127
|
+
public readonly displayName: string;
|
|
1128
|
+
```
|
|
1129
|
+
|
|
1130
|
+
- *Type:* string
|
|
1131
|
+
- *Default:* Stack-relative construct path
|
|
1132
|
+
|
|
1133
|
+
A display name for this asset.
|
|
1134
|
+
|
|
1135
|
+
If supplied, the display name will be used in locations where the asset
|
|
1136
|
+
identifier is printed, like in the CLI progress information. If the same
|
|
1137
|
+
asset is added multiple times, the display name of the first occurrence is
|
|
1138
|
+
used.
|
|
1139
|
+
|
|
1140
|
+
If `assetName` is given, it will also be used as the default `displayName`.
|
|
1141
|
+
Otherwise, the default is the construct path of the ImageAsset construct,
|
|
1142
|
+
with respect to the enclosing stack. If the asset is produced by a
|
|
1143
|
+
construct helper function (such as `lambda.Code.fromAssetImage()`), this
|
|
1144
|
+
will look like `MyFunction/AssetImage`.
|
|
1145
|
+
|
|
1146
|
+
We use the stack-relative construct path so that in the common case where
|
|
1147
|
+
you have multiple stacks with the same asset, we won't show something like
|
|
1148
|
+
`/MyBetaStack/MyFunction/Code` when you are actually deploying to
|
|
1149
|
+
production.
|
|
1150
|
+
|
|
1151
|
+
---
|
|
1152
|
+
|
|
1153
|
+
##### `file`<sup>Optional</sup> <a name="file" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.file"></a>
|
|
1154
|
+
|
|
1155
|
+
```typescript
|
|
1156
|
+
public readonly file: string;
|
|
1157
|
+
```
|
|
1158
|
+
|
|
1159
|
+
- *Type:* string
|
|
1160
|
+
- *Default:* 'Dockerfile'
|
|
1161
|
+
|
|
1162
|
+
Path to the Dockerfile (relative to the directory).
|
|
1163
|
+
|
|
1164
|
+
---
|
|
1165
|
+
|
|
1166
|
+
##### `invalidation`<sup>Optional</sup> <a name="invalidation" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.invalidation"></a>
|
|
1167
|
+
|
|
1168
|
+
```typescript
|
|
1169
|
+
public readonly invalidation: DockerImageAssetInvalidationOptions;
|
|
1170
|
+
```
|
|
1171
|
+
|
|
1172
|
+
- *Type:* aws-cdk-lib.aws_ecr_assets.DockerImageAssetInvalidationOptions
|
|
1173
|
+
- *Default:* hash all parameters
|
|
1174
|
+
|
|
1175
|
+
Options to control which parameters are used to invalidate the asset hash.
|
|
1176
|
+
|
|
1177
|
+
---
|
|
1178
|
+
|
|
1179
|
+
##### `networkMode`<sup>Optional</sup> <a name="networkMode" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.networkMode"></a>
|
|
1180
|
+
|
|
1181
|
+
```typescript
|
|
1182
|
+
public readonly networkMode: NetworkMode;
|
|
1183
|
+
```
|
|
1184
|
+
|
|
1185
|
+
- *Type:* aws-cdk-lib.aws_ecr_assets.NetworkMode
|
|
1186
|
+
- *Default:* no networking mode specified (the default networking mode `NetworkMode.DEFAULT` will be used)
|
|
1187
|
+
|
|
1188
|
+
Networking mode for the RUN commands during build.
|
|
1189
|
+
|
|
1190
|
+
Support docker API 1.25+.
|
|
1191
|
+
|
|
1192
|
+
---
|
|
1193
|
+
|
|
1194
|
+
##### `outputs`<sup>Optional</sup> <a name="outputs" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.outputs"></a>
|
|
1195
|
+
|
|
1196
|
+
```typescript
|
|
1197
|
+
public readonly outputs: string[];
|
|
1198
|
+
```
|
|
1199
|
+
|
|
1200
|
+
- *Type:* string[]
|
|
1201
|
+
- *Default:* no outputs are passed to the build command (default outputs are used)
|
|
1202
|
+
|
|
1203
|
+
Outputs to pass to the `docker build` command.
|
|
1204
|
+
|
|
1205
|
+
> [https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs](https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs)
|
|
1206
|
+
|
|
1207
|
+
---
|
|
1208
|
+
|
|
1209
|
+
##### `platform`<sup>Optional</sup> <a name="platform" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.platform"></a>
|
|
1210
|
+
|
|
1211
|
+
```typescript
|
|
1212
|
+
public readonly platform: Platform;
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
- *Type:* aws-cdk-lib.aws_ecr_assets.Platform
|
|
1216
|
+
- *Default:* no platform specified (the current machine architecture will be used)
|
|
1217
|
+
|
|
1218
|
+
Platform to build for.
|
|
1219
|
+
|
|
1220
|
+
_Requires Docker Buildx_.
|
|
1221
|
+
|
|
1222
|
+
---
|
|
1223
|
+
|
|
1224
|
+
##### `target`<sup>Optional</sup> <a name="target" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.target"></a>
|
|
1225
|
+
|
|
1226
|
+
```typescript
|
|
1227
|
+
public readonly target: string;
|
|
1228
|
+
```
|
|
1229
|
+
|
|
1230
|
+
- *Type:* string
|
|
1231
|
+
- *Default:* no target
|
|
1232
|
+
|
|
1233
|
+
Docker target to build to.
|
|
1234
|
+
|
|
1235
|
+
---
|
|
1236
|
+
|
|
1237
|
+
##### `directory`<sup>Required</sup> <a name="directory" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.directory"></a>
|
|
1238
|
+
|
|
1239
|
+
```typescript
|
|
1240
|
+
public readonly directory: string;
|
|
1241
|
+
```
|
|
1242
|
+
|
|
1243
|
+
- *Type:* string
|
|
1244
|
+
|
|
1245
|
+
The directory where the Dockerfile is stored.
|
|
1246
|
+
|
|
1247
|
+
Any directory inside with a name that matches the CDK output folder (cdk.out by default) will be excluded from the asset
|
|
1248
|
+
|
|
1249
|
+
---
|
|
1250
|
+
|
|
1251
|
+
##### `repository`<sup>Optional</sup> <a name="repository" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.repository"></a>
|
|
1252
|
+
|
|
1253
|
+
```typescript
|
|
1254
|
+
public readonly repository: IRepository;
|
|
1255
|
+
```
|
|
1256
|
+
|
|
1257
|
+
- *Type:* aws-cdk-lib.aws_ecr.IRepository
|
|
1258
|
+
- *Default:* create a new ECR repository
|
|
1259
|
+
|
|
1260
|
+
The ECR repository to push the image.
|
|
1261
|
+
|
|
1262
|
+
---
|
|
1263
|
+
|
|
1264
|
+
##### `tag`<sup>Optional</sup> <a name="tag" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.tag"></a>
|
|
1265
|
+
|
|
1266
|
+
```typescript
|
|
1267
|
+
public readonly tag: string;
|
|
1268
|
+
```
|
|
1269
|
+
|
|
1270
|
+
- *Type:* string
|
|
1271
|
+
- *Default:* use assetHash as tag
|
|
1272
|
+
|
|
1273
|
+
The tag when to push the image.
|
|
1274
|
+
|
|
1275
|
+
---
|
|
1276
|
+
|
|
1277
|
+
##### `tagPrefix`<sup>Optional</sup> <a name="tagPrefix" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.tagPrefix"></a>
|
|
1278
|
+
|
|
1279
|
+
```typescript
|
|
1280
|
+
public readonly tagPrefix: string;
|
|
1281
|
+
```
|
|
1282
|
+
|
|
1283
|
+
- *Type:* string
|
|
1284
|
+
- *Default:* no prefix
|
|
1285
|
+
|
|
1286
|
+
Prefix to add to the image tag.
|
|
1287
|
+
|
|
1288
|
+
---
|
|
1289
|
+
|
|
1290
|
+
##### `vpc`<sup>Optional</sup> <a name="vpc" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.vpc"></a>
|
|
1291
|
+
|
|
1292
|
+
```typescript
|
|
1293
|
+
public readonly vpc: IVpc;
|
|
1294
|
+
```
|
|
1295
|
+
|
|
1296
|
+
- *Type:* aws-cdk-lib.aws_ec2.IVpc
|
|
1297
|
+
- *Default:* No VPC used.
|
|
1298
|
+
|
|
1299
|
+
The VPC where your build job will be deployed. This VPC must have private subnets with NAT Gateways.
|
|
1300
|
+
|
|
1301
|
+
Use this property when you want to control the outbound IP addresses that base images are pulled from.
|
|
1302
|
+
|
|
1303
|
+
---
|
|
1304
|
+
|
|
1305
|
+
##### `zstdCompression`<sup>Optional</sup> <a name="zstdCompression" id="@cdklabs/deploy-time-build.ContainerImageBuildProps.property.zstdCompression"></a>
|
|
1306
|
+
|
|
1307
|
+
```typescript
|
|
1308
|
+
public readonly zstdCompression: boolean;
|
|
1309
|
+
```
|
|
1310
|
+
|
|
1311
|
+
- *Type:* boolean
|
|
1312
|
+
- *Default:* false
|
|
1313
|
+
|
|
1314
|
+
Use zstd for compressing a container image.
|
|
1315
|
+
|
|
1316
|
+
---
|
|
1317
|
+
|
|
1318
|
+
### LambdaDockerImageOptions <a name="LambdaDockerImageOptions" id="@cdklabs/deploy-time-build.LambdaDockerImageOptions"></a>
|
|
1319
|
+
|
|
1320
|
+
Options for configuring Lambda Docker image code.
|
|
1321
|
+
|
|
1322
|
+
#### Initializer <a name="Initializer" id="@cdklabs/deploy-time-build.LambdaDockerImageOptions.Initializer"></a>
|
|
1323
|
+
|
|
1324
|
+
```typescript
|
|
1325
|
+
import { LambdaDockerImageOptions } from '@cdklabs/deploy-time-build'
|
|
1326
|
+
|
|
1327
|
+
const lambdaDockerImageOptions: LambdaDockerImageOptions = { ... }
|
|
1328
|
+
```
|
|
1329
|
+
|
|
1330
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
1331
|
+
|
|
1332
|
+
| **Name** | **Type** | **Description** |
|
|
1333
|
+
| --- | --- | --- |
|
|
1334
|
+
| <code><a href="#@cdklabs/deploy-time-build.LambdaDockerImageOptions.property.cmd">cmd</a></code> | <code>string[]</code> | Specify or override the CMD on the specified Docker image or Dockerfile. |
|
|
1335
|
+
| <code><a href="#@cdklabs/deploy-time-build.LambdaDockerImageOptions.property.entrypoint">entrypoint</a></code> | <code>string[]</code> | Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile. |
|
|
1336
|
+
| <code><a href="#@cdklabs/deploy-time-build.LambdaDockerImageOptions.property.workingDirectory">workingDirectory</a></code> | <code>string</code> | Specify or override the WORKDIR on the specified Docker image or Dockerfile. |
|
|
1337
|
+
|
|
1338
|
+
---
|
|
1339
|
+
|
|
1340
|
+
##### `cmd`<sup>Optional</sup> <a name="cmd" id="@cdklabs/deploy-time-build.LambdaDockerImageOptions.property.cmd"></a>
|
|
1341
|
+
|
|
1342
|
+
```typescript
|
|
1343
|
+
public readonly cmd: string[];
|
|
1344
|
+
```
|
|
1345
|
+
|
|
1346
|
+
- *Type:* string[]
|
|
1347
|
+
- *Default:* use the CMD specified in the docker image or Dockerfile.
|
|
1348
|
+
|
|
1349
|
+
Specify or override the CMD on the specified Docker image or Dockerfile.
|
|
1350
|
+
|
|
1351
|
+
This needs to be in the 'exec form', viz., `[ 'executable', 'param1', 'param2' ]`.
|
|
1352
|
+
|
|
1353
|
+
> [ <https://docs.docker.com/engine/reference/builder/#cmd>]( <https://docs.docker.com/engine/reference/builder/#cmd>)
|
|
1354
|
+
|
|
1355
|
+
---
|
|
1356
|
+
|
|
1357
|
+
##### `entrypoint`<sup>Optional</sup> <a name="entrypoint" id="@cdklabs/deploy-time-build.LambdaDockerImageOptions.property.entrypoint"></a>
|
|
1358
|
+
|
|
1359
|
+
```typescript
|
|
1360
|
+
public readonly entrypoint: string[];
|
|
1361
|
+
```
|
|
1362
|
+
|
|
1363
|
+
- *Type:* string[]
|
|
1364
|
+
- *Default:* use the ENTRYPOINT in the docker image or Dockerfile.
|
|
1365
|
+
|
|
1366
|
+
Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile.
|
|
1367
|
+
|
|
1368
|
+
An ENTRYPOINT allows you to configure a container that will run as an executable.
|
|
1369
|
+
This needs to be in the 'exec form', viz., `[ 'executable', 'param1', 'param2' ]`.
|
|
1370
|
+
|
|
1371
|
+
> [ <https://docs.docker.com/engine/reference/builder/#entrypoint>]( <https://docs.docker.com/engine/reference/builder/#entrypoint>)
|
|
1372
|
+
|
|
1373
|
+
---
|
|
1374
|
+
|
|
1375
|
+
##### `workingDirectory`<sup>Optional</sup> <a name="workingDirectory" id="@cdklabs/deploy-time-build.LambdaDockerImageOptions.property.workingDirectory"></a>
|
|
1376
|
+
|
|
1377
|
+
```typescript
|
|
1378
|
+
public readonly workingDirectory: string;
|
|
1379
|
+
```
|
|
1380
|
+
|
|
1381
|
+
- *Type:* string
|
|
1382
|
+
- *Default:* use the WORKDIR in the docker image or Dockerfile.
|
|
1383
|
+
|
|
1384
|
+
Specify or override the WORKDIR on the specified Docker image or Dockerfile.
|
|
1385
|
+
|
|
1386
|
+
A WORKDIR allows you to configure the working directory the container will use.
|
|
1387
|
+
|
|
1388
|
+
> [ <https://docs.docker.com/engine/reference/builder/#workdir>]( <https://docs.docker.com/engine/reference/builder/#workdir>)
|
|
1389
|
+
|
|
1390
|
+
---
|
|
1391
|
+
|
|
1392
|
+
### NodejsBuildProps <a name="NodejsBuildProps" id="@cdklabs/deploy-time-build.NodejsBuildProps"></a>
|
|
1393
|
+
|
|
1394
|
+
#### Initializer <a name="Initializer" id="@cdklabs/deploy-time-build.NodejsBuildProps.Initializer"></a>
|
|
1395
|
+
|
|
1396
|
+
```typescript
|
|
1397
|
+
import { NodejsBuildProps } from '@cdklabs/deploy-time-build'
|
|
1398
|
+
|
|
1399
|
+
const nodejsBuildProps: NodejsBuildProps = { ... }
|
|
1400
|
+
```
|
|
1401
|
+
|
|
1402
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
1403
|
+
|
|
1404
|
+
| **Name** | **Type** | **Description** |
|
|
1405
|
+
| --- | --- | --- |
|
|
1406
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.assets">assets</a></code> | <code><a href="#@cdklabs/deploy-time-build.AssetConfig">AssetConfig</a>[]</code> | The AssetProps from which s3-assets are created and copied to the build environment. |
|
|
1407
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.destinationBucket">destinationBucket</a></code> | <code>aws-cdk-lib.aws_s3.IBucket</code> | S3 Bucket to which your build artifacts are finally deployed. |
|
|
1408
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.outputSourceDirectory">outputSourceDirectory</a></code> | <code>string</code> | Relative path from the working directory to the directory where the build artifacts are output. |
|
|
1409
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.buildCommands">buildCommands</a></code> | <code>string[]</code> | Shell commands to build your project. |
|
|
1410
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.buildEnvironment">buildEnvironment</a></code> | <code>{[ key: string ]: string}</code> | Environment variables injected to the build environment. |
|
|
1411
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.destinationKeyPrefix">destinationKeyPrefix</a></code> | <code>string</code> | Key prefix to deploy your build artifact. |
|
|
1412
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.IDistribution</code> | The distribution you are using to publish you build artifact. |
|
|
1413
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.excludeCommonFiles">excludeCommonFiles</a></code> | <code>boolean</code> | If true, common unnecessary files/directories such as .DS_Store, .git, node_modules, etc are excluded from the assets by default. |
|
|
1414
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.nodejsVersion">nodejsVersion</a></code> | <code>number</code> | The version of Node.js to use in a build environment. Available versions: 12, 14, 16, 18, 20, and 22. |
|
|
1415
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.outputEnvFile">outputEnvFile</a></code> | <code>boolean</code> | If true, a .env file is uploaded to an S3 bucket with values of `buildEnvironment` property. You can copy it to your local machine by running the command in the stack output. |
|
|
1416
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.workingDirectory">workingDirectory</a></code> | <code>string</code> | Relative path from the build directory to the directory where build commands run. |
|
|
1417
|
+
|
|
1418
|
+
---
|
|
1419
|
+
|
|
1420
|
+
##### `assets`<sup>Required</sup> <a name="assets" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.assets"></a>
|
|
1421
|
+
|
|
1422
|
+
```typescript
|
|
1423
|
+
public readonly assets: AssetConfig[];
|
|
1424
|
+
```
|
|
1425
|
+
|
|
1426
|
+
- *Type:* <a href="#@cdklabs/deploy-time-build.AssetConfig">AssetConfig</a>[]
|
|
1427
|
+
|
|
1428
|
+
The AssetProps from which s3-assets are created and copied to the build environment.
|
|
1429
|
+
|
|
1430
|
+
---
|
|
1431
|
+
|
|
1432
|
+
##### `destinationBucket`<sup>Required</sup> <a name="destinationBucket" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.destinationBucket"></a>
|
|
1433
|
+
|
|
1434
|
+
```typescript
|
|
1435
|
+
public readonly destinationBucket: IBucket;
|
|
1436
|
+
```
|
|
1437
|
+
|
|
1438
|
+
- *Type:* aws-cdk-lib.aws_s3.IBucket
|
|
1439
|
+
|
|
1440
|
+
S3 Bucket to which your build artifacts are finally deployed.
|
|
1441
|
+
|
|
1442
|
+
---
|
|
1443
|
+
|
|
1444
|
+
##### `outputSourceDirectory`<sup>Required</sup> <a name="outputSourceDirectory" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.outputSourceDirectory"></a>
|
|
1445
|
+
|
|
1446
|
+
```typescript
|
|
1447
|
+
public readonly outputSourceDirectory: string;
|
|
1448
|
+
```
|
|
1449
|
+
|
|
1450
|
+
- *Type:* string
|
|
1451
|
+
|
|
1452
|
+
Relative path from the working directory to the directory where the build artifacts are output.
|
|
1453
|
+
|
|
1454
|
+
---
|
|
1455
|
+
|
|
1456
|
+
##### `buildCommands`<sup>Optional</sup> <a name="buildCommands" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.buildCommands"></a>
|
|
1457
|
+
|
|
1458
|
+
```typescript
|
|
1459
|
+
public readonly buildCommands: string[];
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
- *Type:* string[]
|
|
1463
|
+
- *Default:* ['npm run build']
|
|
1464
|
+
|
|
1465
|
+
Shell commands to build your project.
|
|
1466
|
+
|
|
1467
|
+
They are executed on the working directory you specified.
|
|
1468
|
+
|
|
1469
|
+
---
|
|
1470
|
+
|
|
1471
|
+
##### `buildEnvironment`<sup>Optional</sup> <a name="buildEnvironment" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.buildEnvironment"></a>
|
|
1472
|
+
|
|
1473
|
+
```typescript
|
|
1474
|
+
public readonly buildEnvironment: {[ key: string ]: string};
|
|
1475
|
+
```
|
|
1476
|
+
|
|
1477
|
+
- *Type:* {[ key: string ]: string}
|
|
1478
|
+
- *Default:* {}
|
|
1479
|
+
|
|
1480
|
+
Environment variables injected to the build environment.
|
|
1481
|
+
|
|
1482
|
+
You can use CDK deploy-time values as well as literals.
|
|
1483
|
+
|
|
1484
|
+
---
|
|
1485
|
+
|
|
1486
|
+
##### `destinationKeyPrefix`<sup>Optional</sup> <a name="destinationKeyPrefix" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.destinationKeyPrefix"></a>
|
|
1487
|
+
|
|
1488
|
+
```typescript
|
|
1489
|
+
public readonly destinationKeyPrefix: string;
|
|
1490
|
+
```
|
|
1491
|
+
|
|
1492
|
+
- *Type:* string
|
|
1493
|
+
- *Default:* '/'
|
|
1494
|
+
|
|
1495
|
+
Key prefix to deploy your build artifact.
|
|
1496
|
+
|
|
1497
|
+
---
|
|
1498
|
+
|
|
1499
|
+
##### `distribution`<sup>Optional</sup> <a name="distribution" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.distribution"></a>
|
|
1500
|
+
|
|
1501
|
+
```typescript
|
|
1502
|
+
public readonly distribution: IDistribution;
|
|
1503
|
+
```
|
|
1504
|
+
|
|
1505
|
+
- *Type:* aws-cdk-lib.aws_cloudfront.IDistribution
|
|
1506
|
+
- *Default:* No distribution
|
|
1507
|
+
|
|
1508
|
+
The distribution you are using to publish you build artifact.
|
|
1509
|
+
|
|
1510
|
+
If any specified, the caches are invalidated on new artifact deployments.
|
|
1511
|
+
|
|
1512
|
+
---
|
|
1513
|
+
|
|
1514
|
+
##### `excludeCommonFiles`<sup>Optional</sup> <a name="excludeCommonFiles" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.excludeCommonFiles"></a>
|
|
1515
|
+
|
|
1516
|
+
```typescript
|
|
1517
|
+
public readonly excludeCommonFiles: boolean;
|
|
1518
|
+
```
|
|
1519
|
+
|
|
1520
|
+
- *Type:* boolean
|
|
1521
|
+
- *Default:* true
|
|
1522
|
+
|
|
1523
|
+
If true, common unnecessary files/directories such as .DS_Store, .git, node_modules, etc are excluded from the assets by default.
|
|
1524
|
+
|
|
1525
|
+
---
|
|
1526
|
+
|
|
1527
|
+
##### `nodejsVersion`<sup>Optional</sup> <a name="nodejsVersion" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.nodejsVersion"></a>
|
|
1528
|
+
|
|
1529
|
+
```typescript
|
|
1530
|
+
public readonly nodejsVersion: number;
|
|
1531
|
+
```
|
|
1532
|
+
|
|
1533
|
+
- *Type:* number
|
|
1534
|
+
- *Default:* 18
|
|
1535
|
+
|
|
1536
|
+
The version of Node.js to use in a build environment. Available versions: 12, 14, 16, 18, 20, and 22.
|
|
1537
|
+
|
|
1538
|
+
---
|
|
1539
|
+
|
|
1540
|
+
##### `outputEnvFile`<sup>Optional</sup> <a name="outputEnvFile" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.outputEnvFile"></a>
|
|
1541
|
+
|
|
1542
|
+
```typescript
|
|
1543
|
+
public readonly outputEnvFile: boolean;
|
|
1544
|
+
```
|
|
1545
|
+
|
|
1546
|
+
- *Type:* boolean
|
|
1547
|
+
- *Default:* false
|
|
1548
|
+
|
|
1549
|
+
If true, a .env file is uploaded to an S3 bucket with values of `buildEnvironment` property. You can copy it to your local machine by running the command in the stack output.
|
|
1550
|
+
|
|
1551
|
+
---
|
|
1552
|
+
|
|
1553
|
+
##### `workingDirectory`<sup>Optional</sup> <a name="workingDirectory" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.workingDirectory"></a>
|
|
1554
|
+
|
|
1555
|
+
```typescript
|
|
1556
|
+
public readonly workingDirectory: string;
|
|
1557
|
+
```
|
|
1558
|
+
|
|
1559
|
+
- *Type:* string
|
|
1560
|
+
- *Default:* assetProps[0].extractPath
|
|
1561
|
+
|
|
1562
|
+
Relative path from the build directory to the directory where build commands run.
|
|
1563
|
+
|
|
1564
|
+
---
|
|
1565
|
+
|
|
1566
|
+
### SociIndexBuildProps <a name="SociIndexBuildProps" id="@cdklabs/deploy-time-build.SociIndexBuildProps"></a>
|
|
1567
|
+
|
|
1568
|
+
#### Initializer <a name="Initializer" id="@cdklabs/deploy-time-build.SociIndexBuildProps.Initializer"></a>
|
|
1569
|
+
|
|
1570
|
+
```typescript
|
|
1571
|
+
import { SociIndexBuildProps } from '@cdklabs/deploy-time-build'
|
|
1572
|
+
|
|
1573
|
+
const sociIndexBuildProps: SociIndexBuildProps = { ... }
|
|
1574
|
+
```
|
|
1575
|
+
|
|
1576
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
1577
|
+
|
|
1578
|
+
| **Name** | **Type** | **Description** |
|
|
1579
|
+
| --- | --- | --- |
|
|
1580
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuildProps.property.imageTag">imageTag</a></code> | <code>string</code> | The tag of the container image you want to build index for. |
|
|
1581
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuildProps.property.repository">repository</a></code> | <code>aws-cdk-lib.aws_ecr.IRepository</code> | The ECR repository your container image is stored. |
|
|
1582
|
+
|
|
1583
|
+
---
|
|
1584
|
+
|
|
1585
|
+
##### `imageTag`<sup>Required</sup> <a name="imageTag" id="@cdklabs/deploy-time-build.SociIndexBuildProps.property.imageTag"></a>
|
|
1586
|
+
|
|
1587
|
+
```typescript
|
|
1588
|
+
public readonly imageTag: string;
|
|
1589
|
+
```
|
|
1590
|
+
|
|
1591
|
+
- *Type:* string
|
|
1592
|
+
|
|
1593
|
+
The tag of the container image you want to build index for.
|
|
1594
|
+
|
|
1595
|
+
---
|
|
1596
|
+
|
|
1597
|
+
##### `repository`<sup>Required</sup> <a name="repository" id="@cdklabs/deploy-time-build.SociIndexBuildProps.property.repository"></a>
|
|
1598
|
+
|
|
1599
|
+
```typescript
|
|
1600
|
+
public readonly repository: IRepository;
|
|
1601
|
+
```
|
|
1602
|
+
|
|
1603
|
+
- *Type:* aws-cdk-lib.aws_ecr.IRepository
|
|
1604
|
+
|
|
1605
|
+
The ECR repository your container image is stored.
|
|
1606
|
+
|
|
1607
|
+
You can only specify a repository in the same environment (account/region).
|
|
1608
|
+
The index artifact will be uploaded to this repository.
|
|
1609
|
+
|
|
1610
|
+
---
|
|
1611
|
+
|
|
1612
|
+
### SociIndexV2BuildProps <a name="SociIndexV2BuildProps" id="@cdklabs/deploy-time-build.SociIndexV2BuildProps"></a>
|
|
1613
|
+
|
|
1614
|
+
#### Initializer <a name="Initializer" id="@cdklabs/deploy-time-build.SociIndexV2BuildProps.Initializer"></a>
|
|
1615
|
+
|
|
1616
|
+
```typescript
|
|
1617
|
+
import { SociIndexV2BuildProps } from '@cdklabs/deploy-time-build'
|
|
1618
|
+
|
|
1619
|
+
const sociIndexV2BuildProps: SociIndexV2BuildProps = { ... }
|
|
1620
|
+
```
|
|
1621
|
+
|
|
1622
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
1623
|
+
|
|
1624
|
+
| **Name** | **Type** | **Description** |
|
|
1625
|
+
| --- | --- | --- |
|
|
1626
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2BuildProps.property.inputImageTag">inputImageTag</a></code> | <code>string</code> | The tag of the container image you want to build index for. |
|
|
1627
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2BuildProps.property.repository">repository</a></code> | <code>aws-cdk-lib.aws_ecr.IRepository</code> | The ECR repository your container image is stored. |
|
|
1628
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2BuildProps.property.outputImageTag">outputImageTag</a></code> | <code>string</code> | The tag of the output container image embedded with SOCI index. |
|
|
1629
|
+
|
|
1630
|
+
---
|
|
1631
|
+
|
|
1632
|
+
##### `inputImageTag`<sup>Required</sup> <a name="inputImageTag" id="@cdklabs/deploy-time-build.SociIndexV2BuildProps.property.inputImageTag"></a>
|
|
1633
|
+
|
|
1634
|
+
```typescript
|
|
1635
|
+
public readonly inputImageTag: string;
|
|
1636
|
+
```
|
|
1637
|
+
|
|
1638
|
+
- *Type:* string
|
|
1639
|
+
|
|
1640
|
+
The tag of the container image you want to build index for.
|
|
1641
|
+
|
|
1642
|
+
---
|
|
1643
|
+
|
|
1644
|
+
##### `repository`<sup>Required</sup> <a name="repository" id="@cdklabs/deploy-time-build.SociIndexV2BuildProps.property.repository"></a>
|
|
1645
|
+
|
|
1646
|
+
```typescript
|
|
1647
|
+
public readonly repository: IRepository;
|
|
1648
|
+
```
|
|
1649
|
+
|
|
1650
|
+
- *Type:* aws-cdk-lib.aws_ecr.IRepository
|
|
1651
|
+
|
|
1652
|
+
The ECR repository your container image is stored.
|
|
1653
|
+
|
|
1654
|
+
You can only specify a repository in the same environment (account/region).
|
|
1655
|
+
The index artifact will be uploaded to this repository.
|
|
1656
|
+
|
|
1657
|
+
---
|
|
1658
|
+
|
|
1659
|
+
##### `outputImageTag`<sup>Optional</sup> <a name="outputImageTag" id="@cdklabs/deploy-time-build.SociIndexV2BuildProps.property.outputImageTag"></a>
|
|
1660
|
+
|
|
1661
|
+
```typescript
|
|
1662
|
+
public readonly outputImageTag: string;
|
|
1663
|
+
```
|
|
1664
|
+
|
|
1665
|
+
- *Type:* string
|
|
1666
|
+
- *Default:* `${inputImageTag}-soci`
|
|
1667
|
+
|
|
1668
|
+
The tag of the output container image embedded with SOCI index.
|
|
1669
|
+
|
|
1670
|
+
---
|
|
1671
|
+
|
|
1672
|
+
|
|
1673
|
+
|