@cdklabs/deploy-time-build 0.0.4 → 0.0.6
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 +180 -28
- package/.jsii.tabl.json +1 -1
- package/API.md +148 -0
- package/README.md +40 -0
- package/lib/container-image-build.js +1 -1
- package/lib/nodejs-build.d.ts +28 -0
- package/lib/nodejs-build.js +51 -9
- package/lib/soci-index-build.js +1 -1
- package/lib/soci-index-v2-build.js +1 -1
- package/package.json +1 -9
- package/rosetta/imported.ts-fixture +1 -1
- package/scripts/verify-min-cdk.sh +28 -0
package/.jsii
CHANGED
|
@@ -8490,7 +8490,7 @@
|
|
|
8490
8490
|
},
|
|
8491
8491
|
"name": "@cdklabs/deploy-time-build",
|
|
8492
8492
|
"readme": {
|
|
8493
|
-
"markdown": "# Deploy-time Build\nAWS CDK L3 construct that allows you to run a build job for specific purposes. Currently this library supports the following use cases:\n\n* Build web frontend static files\n* Build a container image\n* Build Seekable OCI (SOCI) indices for container images\n\n[](https://constructs.dev/packages/@cdklabs/deploy-time-build)\n\n## Usage\nInstall from npm:\n\n```sh\nnpm i @cdklabs/deploy-time-build\n```\n\nThis library defines several L3 constructs for specific use cases. Here is the usage for each case.\n\n### Build Node.js apps\n\nYou can build a Node.js app such as a React frontend app on deploy time by the `NodejsBuild` construct.\n\n\n\nThe following code is an example to use the construct:\n\n```ts\nimport { NodejsBuild } from '@cdklabs/deploy-time-build';\n\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n buildCommands: ['npm ci', 'npm run build'],\n buildEnvironment: {\n VITE_API_ENDPOINT: api.url,\n },\n});\n```\n\nNote that it is possible to pass environment variable `VITE_API_ENDPOINT: api.url` to the construct, which is resolved on deploy time, and injected to the build environment (a vite process in this case.)\nThe resulting build artifacts will be deployed to `destinationBucket` from CodeBuild.\n\nYou can specify multiple input assets by `assets` property. These assets are extracted to respective sub directories. For example, assume you specified assets like the following:\n\n```ts fixture=imported\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n // directory containing source code and package.json\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n commands: ['npm install'],\n },\n {\n // directory that is also required for the build\n path: 'module1',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});\n```\n\nThen, the extracted directories will be located as the following:\n\n```sh\n. # a temporary directory (automatically created)\n├── example-app # extracted example-app assets\n│ ├── src/ # dist or node_modules directories are excluded even if they exist locally.\n│ ├── package.json # npm install will be executed since its specified in `commands` property.\n│ └── package-lock.json\n└── module1 # extracted module1 assets\n```\n\nYou can also override the path where assets are extracted by `extractPath` property for each asset.\n\nWith `outputEnvFile` property enabled, a `.env` file is automatically generated and uploaded to your S3 bucket. This file can be used running you frontend project locally. You can download the file to your local machine by running the command added in the stack output.\n\nPlease also check [the example directory](./example/) for a complete example.\n\n#### Allowing access from the build environment to other AWS resources\nSince `NodejsBuild` construct implements [`iam.IGrantable`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IGrantable.html) interface, you can use `grant*` method of other constructs to allow access from the build environment.\n\n```ts fixture=imported\ndeclare const someBucket: s3.IBucket;\ndeclare const build: NodejsBuild;\nsomeBucket.grantReadWrite(build);\n```\n\nYou can also use [`iam.Grant`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Grant.html) class to allow any actions and resources.\n\n```ts fixture=imported\ndeclare const build: NodejsBuild;\niam.Grant.addToPrincipal({ grantee: build, actions: ['s3:ListBucket'], resourceArns:['*'] })\n```\n\n#### Motivation - why do we need the `NodejsBuild` construct?\nI talked about why this construct can be useful in some situations at CDK Day 2023. See the recording or slides below:\n\n[Recording](https://www.youtube.com/live/b-nSH18gFQk?si=ogEZ2x1NixOj6J6j&t=373) | [Slides](https://speakerdeck.com/tmokmss/deploy-web-frontend-apps-with-aws-cdk)\n\n#### Considerations\nSince this construct builds your frontend apps every time you deploy the stack and there is any change in input assets (and currently there's even no build cache in the Lambda function!), the time a deployment takes tends to be longer (e.g. a few minutes even for the simple app in `example` directory.) This might results in worse developer experience if you want to deploy changes frequently (imagine `cdk watch` deployment always re-build your frontend app).\n\nTo mitigate this issue, you can separate the stack for frontend construct from other stacks especially for a dev environment. Another solution would be to set a fixed string as an asset hash, and avoid builds on every deployment.\n\n```ts fixture=imported\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: '../frontend',\n exclude: ['node_modules', 'dist'],\n commands: ['npm ci'],\n // Set a fixed string as a asset hash to prevent deploying changes.\n // This can be useful for an environment you use to develop locally.\n assetHash: 'frontend_asset',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});\n```\n\n### Build a container image\nYou can build a container image at deploy time by the following code:\n\n```ts\nimport { ContainerImageBuild } from '@cdklabs/deploy-time-build';\n\nconst image = new ContainerImageBuild(this, 'Build', {\n directory: 'example-image',\n buildArgs: { DUMMY_FILE_SIZE_MB: '15' },\n tag: 'my-image-tag',\n});\nnew DockerImageFunction(this, 'Function', {\n code: image.toLambdaDockerImageCode(),\n});\nconst armImage = new ContainerImageBuild(this, 'BuildArm', {\n directory: 'example-image',\n platform: Platform.LINUX_ARM64,\n repository: image.repository,\n zstdCompression: true,\n});\nnew FargateTaskDefinition(this, 'TaskDefinition', {\n runtimePlatform: { cpuArchitecture: CpuArchitecture.ARM64 }\n}).addContainer('main', {\n image: armImage.toEcsDockerImageCode(),\n});\n```\n\nThe third argument (props) are a superset of DockerImageAsset's properties. You can set a few additional properties such as `tag`, `repository`, and `zstdCompression`.\n\n### Build SOCI index for a container image\n[Seekable OCI (SOCI)](https://aws.amazon.com/about-aws/whats-new/2022/09/introducing-seekable-oci-lazy-loading-container-images/) is a way to help start tasks faster for Amazon ECS tasks on Fargate 1.4.0. You can build and push a SOCI index using the `SociIndexV2Build` construct.\n\n\n\nThe following code is an example to use the construct:\n\n```ts\nimport { SociIndexV2Build } from '@cdklabs/deploy-time-build';\n\nconst asset = new DockerImageAsset(this, 'Image', { directory: 'example-image' });\nconst sociIndex = new SociIndexV2Build(this, 'SociV2Index', {\n repository: asset.repository,\n inputImageTag: asset.assetHash,\n outputImageTag: `${asset.assetHash}-soci`,\n});\n\n// Use with ECS Fargate\nconst taskDefinition = new FargateTaskDefinition(this, 'TaskDefinition');\ntaskDefinition.addContainer('main', {\n image: sociIndex.toEcsDockerImageCode(),\n});\n\n// Or create from DockerImageAsset using utility method\nconst sociIndexFromAsset = SociIndexV2Build.fromDockerImageAsset(this, 'SociV2Index2', asset);\n```\n\nThe `SociIndexV2Build` construct:\n- Takes an input container image and builds a SOCI v2 index for it\n- Outputs a new image tag with the embedded SOCI index\n- Provides `toEcsDockerImageCode()` method to easily use with ECS tasks\n- Uses the same ECR repository for input and output images\n\nWe currently use [`soci-wrapper`](https://github.com/tmokmss/soci-wrapper) to build and push SOCI indices.\n\n> [!WARNING]\n> The previous `SocideIndexBuild` construct is now deprecated. Customers new to SOCI on AWS Fargate can only use SOCI index manifest v2. See [this article](https://aws.amazon.com/blogs/containers/improving-amazon-ecs-deployment-consistency-with-soci-index-manifest-v2/) for more details.\n\n#### Motivation - why do we need the `SociIndexBuild` construct?\n\nCurrently there are several other ways to build a SOCI index; 1. use `soci-snapshotter` CLI, or 2. use [cfn-ecr-aws-soci-index-builder](https://github.com/aws-ia/cfn-ecr-aws-soci-index-builder) solution, none of which can be directly used from AWS CDK. If you are familiar with CDK, you should often deploy container images as CDK assets, which is an ideal way to integrate with other L2 constructs such as ECS. To make the developer experience for SOCI as close as the ordinary container images, the `SociIndexBuild` allows you to deploying a SOCI index directly from CDK, without any dependencies outside of CDK context.\n\n## Development\nCommands for maintainers:\n\n```sh\n# run test locally\nnpx tsc -p tsconfig.dev.json\nnpx integ-runner\nnpx integ-runner --update-on-failed\n```\n"
|
|
8493
|
+
"markdown": "# Deploy-time Build\nAWS CDK L3 construct that allows you to run a build job for specific purposes. Currently this library supports the following use cases:\n\n* Build web frontend static files\n* Build a container image\n* Build Seekable OCI (SOCI) indices for container images\n\n[](https://constructs.dev/packages/@cdklabs/deploy-time-build)\n\n## Usage\nInstall from npm:\n\n```sh\nnpm i @cdklabs/deploy-time-build\n```\n\nThis library defines several L3 constructs for specific use cases. Here is the usage for each case.\n\n### Build Node.js apps\n\nYou can build a Node.js app such as a React frontend app on deploy time by the `NodejsBuild` construct.\n\n\n\nThe following code is an example to use the construct:\n\n```ts\nimport { NodejsBuild } from '@cdklabs/deploy-time-build';\n\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n buildCommands: ['npm ci', 'npm run build'],\n buildEnvironment: {\n VITE_API_ENDPOINT: api.url,\n },\n});\n```\n\nNote that it is possible to pass environment variable `VITE_API_ENDPOINT: api.url` to the construct, which is resolved on deploy time, and injected to the build environment (a vite process in this case.)\nThe resulting build artifacts will be deployed to `destinationBucket` from CodeBuild.\n\nYou can specify multiple input assets by `assets` property. These assets are extracted to respective sub directories. For example, assume you specified assets like the following:\n\n```ts fixture=imported\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n // directory containing source code and package.json\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n commands: ['npm install'],\n },\n {\n // directory that is also required for the build\n path: 'module1',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});\n```\n\nThen, the extracted directories will be located as the following:\n\n```sh\n. # a temporary directory (automatically created)\n├── example-app # extracted example-app assets\n│ ├── src/ # dist or node_modules directories are excluded even if they exist locally.\n│ ├── package.json # npm install will be executed since its specified in `commands` property.\n│ └── package-lock.json\n└── module1 # extracted module1 assets\n```\n\nYou can also override the path where assets are extracted by `extractPath` property for each asset.\n\nWith `outputEnvFile` property enabled, a `.env` file is automatically generated and uploaded to your S3 bucket. This file can be used running you frontend project locally. You can download the file to your local machine by running the command added in the stack output.\n\nPlease also check [the example directory](./example/) for a complete example.\n\n#### Allowing access from the build environment to other AWS resources\nSince `NodejsBuild` construct implements [`iam.IGrantable`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IGrantable.html) interface, you can use `grant*` method of other constructs to allow access from the build environment.\n\n```ts fixture=imported\ndeclare const someBucket: s3.IBucket;\ndeclare const build: NodejsBuild;\nsomeBucket.grantReadWrite(build);\n```\n\nYou can also use [`iam.Grant`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Grant.html) class to allow any actions and resources.\n\n```ts fixture=imported\ndeclare const build: NodejsBuild;\niam.Grant.addToPrincipal({ grantee: build, actions: ['s3:ListBucket'], resourceArns:['*'] })\n```\n\n#### Motivation - why do we need the `NodejsBuild` construct?\nI talked about why this construct can be useful in some situations at CDK Day 2023. See the recording or slides below:\n\n[Recording](https://www.youtube.com/live/b-nSH18gFQk?si=ogEZ2x1NixOj6J6j&t=373) | [Slides](https://speakerdeck.com/tmokmss/deploy-web-frontend-apps-with-aws-cdk)\n\n#### Caching\n\nYou can enable npm caching to speed up builds using the `cache` property:\n\n```ts fixture=imported\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n outputSourceDirectory: 'dist',\n cache: CacheType.S3, // or CacheType.LOCAL\n});\n```\n\nTwo cache types are available:\n- `CacheType.S3`: Stores the npm cache directory in an S3 bucket. Good for builds that run infrequently on different hosts.\n- `CacheType.LOCAL`: Stores the npm cache directory on the build host. Faster than S3 but only effective if builds run on the same host.\n\n#### Compute Type\n\nYou can specify the compute type for the CodeBuild project using the `computeType` property:\n\n```ts fixture=imported\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n outputSourceDirectory: 'dist',\n computeType: ComputeType.MEDIUM,\n});\n```\n\n#### Considerations\nSince this construct builds your frontend apps every time you deploy the stack and there is any change in input assets (and currently there's even no build cache in the Lambda function!), the time a deployment takes tends to be longer (e.g. a few minutes even for the simple app in `example` directory.) This might results in worse developer experience if you want to deploy changes frequently (imagine `cdk watch` deployment always re-build your frontend app).\n\nTo mitigate this issue, you can separate the stack for frontend construct from other stacks especially for a dev environment. Another solution would be to set a fixed string as an asset hash, and avoid builds on every deployment.\n\n```ts fixture=imported\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: '../frontend',\n exclude: ['node_modules', 'dist'],\n commands: ['npm ci'],\n // Set a fixed string as a asset hash to prevent deploying changes.\n // This can be useful for an environment you use to develop locally.\n assetHash: 'frontend_asset',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});\n```\n\n### Build a container image\nYou can build a container image at deploy time by the following code:\n\n```ts\nimport { ContainerImageBuild } from '@cdklabs/deploy-time-build';\n\nconst image = new ContainerImageBuild(this, 'Build', {\n directory: 'example-image',\n buildArgs: { DUMMY_FILE_SIZE_MB: '15' },\n tag: 'my-image-tag',\n});\nnew DockerImageFunction(this, 'Function', {\n code: image.toLambdaDockerImageCode(),\n});\nconst armImage = new ContainerImageBuild(this, 'BuildArm', {\n directory: 'example-image',\n platform: Platform.LINUX_ARM64,\n repository: image.repository,\n zstdCompression: true,\n});\nnew FargateTaskDefinition(this, 'TaskDefinition', {\n runtimePlatform: { cpuArchitecture: CpuArchitecture.ARM64 }\n}).addContainer('main', {\n image: armImage.toEcsDockerImageCode(),\n});\n```\n\nThe third argument (props) are a superset of DockerImageAsset's properties. You can set a few additional properties such as `tag`, `repository`, and `zstdCompression`.\n\n### Build SOCI index for a container image\n[Seekable OCI (SOCI)](https://aws.amazon.com/about-aws/whats-new/2022/09/introducing-seekable-oci-lazy-loading-container-images/) is a way to help start tasks faster for Amazon ECS tasks on Fargate 1.4.0. You can build and push a SOCI index using the `SociIndexV2Build` construct.\n\n\n\nThe following code is an example to use the construct:\n\n```ts\nimport { SociIndexV2Build } from '@cdklabs/deploy-time-build';\n\nconst asset = new DockerImageAsset(this, 'Image', { directory: 'example-image' });\nconst sociIndex = new SociIndexV2Build(this, 'SociV2Index', {\n repository: asset.repository,\n inputImageTag: asset.assetHash,\n outputImageTag: `${asset.assetHash}-soci`,\n});\n\n// Use with ECS Fargate\nconst taskDefinition = new FargateTaskDefinition(this, 'TaskDefinition');\ntaskDefinition.addContainer('main', {\n image: sociIndex.toEcsDockerImageCode(),\n});\n\n// Or create from DockerImageAsset using utility method\nconst sociIndexFromAsset = SociIndexV2Build.fromDockerImageAsset(this, 'SociV2Index2', asset);\n```\n\nThe `SociIndexV2Build` construct:\n- Takes an input container image and builds a SOCI v2 index for it\n- Outputs a new image tag with the embedded SOCI index\n- Provides `toEcsDockerImageCode()` method to easily use with ECS tasks\n- Uses the same ECR repository for input and output images\n\nWe currently use [`soci-wrapper`](https://github.com/tmokmss/soci-wrapper) to build and push SOCI indices.\n\n> [!WARNING]\n> The previous `SocideIndexBuild` construct is now deprecated. Customers new to SOCI on AWS Fargate can only use SOCI index manifest v2. See [this article](https://aws.amazon.com/blogs/containers/improving-amazon-ecs-deployment-consistency-with-soci-index-manifest-v2/) for more details.\n\n#### Motivation - why do we need the `SociIndexBuild` construct?\n\nCurrently there are several other ways to build a SOCI index; 1. use `soci-snapshotter` CLI, or 2. use [cfn-ecr-aws-soci-index-builder](https://github.com/aws-ia/cfn-ecr-aws-soci-index-builder) solution, none of which can be directly used from AWS CDK. If you are familiar with CDK, you should often deploy container images as CDK assets, which is an ideal way to integrate with other L2 constructs such as ECS. To make the developer experience for SOCI as close as the ordinary container images, the `SociIndexBuild` allows you to deploying a SOCI index directly from CDK, without any dependencies outside of CDK context.\n\n## Development\nCommands for maintainers:\n\n```sh\n# run test locally\nnpx tsc -p tsconfig.dev.json\nnpx integ-runner\nnpx integ-runner --update-on-failed\n```\n"
|
|
8494
8494
|
},
|
|
8495
8495
|
"repository": {
|
|
8496
8496
|
"type": "git",
|
|
@@ -8498,13 +8498,6 @@
|
|
|
8498
8498
|
},
|
|
8499
8499
|
"schema": "jsii/0.10.0",
|
|
8500
8500
|
"targets": {
|
|
8501
|
-
"java": {
|
|
8502
|
-
"maven": {
|
|
8503
|
-
"artifactId": "deploy-time-build",
|
|
8504
|
-
"groupId": "io.github.cdklabs"
|
|
8505
|
-
},
|
|
8506
|
-
"package": "io.github.cdklabs.deploy.time.build"
|
|
8507
|
-
},
|
|
8508
8501
|
"js": {
|
|
8509
8502
|
"npm": "@cdklabs/deploy-time-build"
|
|
8510
8503
|
},
|
|
@@ -8527,7 +8520,7 @@
|
|
|
8527
8520
|
"kind": "interface",
|
|
8528
8521
|
"locationInModule": {
|
|
8529
8522
|
"filename": "src/nodejs-build.ts",
|
|
8530
|
-
"line":
|
|
8523
|
+
"line": 31
|
|
8531
8524
|
},
|
|
8532
8525
|
"name": "AssetConfig",
|
|
8533
8526
|
"properties": [
|
|
@@ -8541,7 +8534,7 @@
|
|
|
8541
8534
|
"immutable": true,
|
|
8542
8535
|
"locationInModule": {
|
|
8543
8536
|
"filename": "src/nodejs-build.ts",
|
|
8544
|
-
"line":
|
|
8537
|
+
"line": 36
|
|
8545
8538
|
},
|
|
8546
8539
|
"name": "commands",
|
|
8547
8540
|
"optional": true,
|
|
@@ -8564,7 +8557,7 @@
|
|
|
8564
8557
|
"immutable": true,
|
|
8565
8558
|
"locationInModule": {
|
|
8566
8559
|
"filename": "src/nodejs-build.ts",
|
|
8567
|
-
"line":
|
|
8560
|
+
"line": 42
|
|
8568
8561
|
},
|
|
8569
8562
|
"name": "extractPath",
|
|
8570
8563
|
"optional": true,
|
|
@@ -8575,6 +8568,129 @@
|
|
|
8575
8568
|
],
|
|
8576
8569
|
"symbolId": "src/nodejs-build:AssetConfig"
|
|
8577
8570
|
},
|
|
8571
|
+
"@cdklabs/deploy-time-build.CacheType": {
|
|
8572
|
+
"assembly": "@cdklabs/deploy-time-build",
|
|
8573
|
+
"docs": {
|
|
8574
|
+
"stability": "experimental",
|
|
8575
|
+
"summary": "Cache type for NodejsBuild."
|
|
8576
|
+
},
|
|
8577
|
+
"fqn": "@cdklabs/deploy-time-build.CacheType",
|
|
8578
|
+
"kind": "enum",
|
|
8579
|
+
"locationInModule": {
|
|
8580
|
+
"filename": "src/nodejs-build.ts",
|
|
8581
|
+
"line": 17
|
|
8582
|
+
},
|
|
8583
|
+
"members": [
|
|
8584
|
+
{
|
|
8585
|
+
"docs": {
|
|
8586
|
+
"remarks": "Stores the npm cache directory in an S3 bucket.\nGood for builds that run on different hosts.",
|
|
8587
|
+
"stability": "experimental",
|
|
8588
|
+
"summary": "S3 caching."
|
|
8589
|
+
},
|
|
8590
|
+
"name": "S3"
|
|
8591
|
+
},
|
|
8592
|
+
{
|
|
8593
|
+
"docs": {
|
|
8594
|
+
"remarks": "Stores the npm cache directory on the build host.\nFaster than S3 but only effective if builds run on the same host.\nNot supported with VPC or certain compute types.",
|
|
8595
|
+
"stability": "experimental",
|
|
8596
|
+
"summary": "Local caching."
|
|
8597
|
+
},
|
|
8598
|
+
"name": "LOCAL"
|
|
8599
|
+
}
|
|
8600
|
+
],
|
|
8601
|
+
"name": "CacheType",
|
|
8602
|
+
"symbolId": "src/nodejs-build:CacheType"
|
|
8603
|
+
},
|
|
8604
|
+
"@cdklabs/deploy-time-build.ComputeType": {
|
|
8605
|
+
"assembly": "@cdklabs/deploy-time-build",
|
|
8606
|
+
"docs": {
|
|
8607
|
+
"see": "https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types",
|
|
8608
|
+
"stability": "experimental",
|
|
8609
|
+
"summary": "Build machine compute type."
|
|
8610
|
+
},
|
|
8611
|
+
"fqn": "@cdklabs/deploy-time-build.ComputeType",
|
|
8612
|
+
"kind": "enum",
|
|
8613
|
+
"locationInModule": {
|
|
8614
|
+
"filename": "node_modules/aws-cdk-lib/aws-codebuild/lib/compute-type.d.ts",
|
|
8615
|
+
"line": 6
|
|
8616
|
+
},
|
|
8617
|
+
"members": [
|
|
8618
|
+
{
|
|
8619
|
+
"docs": {
|
|
8620
|
+
"stability": "experimental"
|
|
8621
|
+
},
|
|
8622
|
+
"name": "SMALL"
|
|
8623
|
+
},
|
|
8624
|
+
{
|
|
8625
|
+
"docs": {
|
|
8626
|
+
"stability": "experimental"
|
|
8627
|
+
},
|
|
8628
|
+
"name": "MEDIUM"
|
|
8629
|
+
},
|
|
8630
|
+
{
|
|
8631
|
+
"docs": {
|
|
8632
|
+
"stability": "experimental"
|
|
8633
|
+
},
|
|
8634
|
+
"name": "LARGE"
|
|
8635
|
+
},
|
|
8636
|
+
{
|
|
8637
|
+
"docs": {
|
|
8638
|
+
"stability": "experimental"
|
|
8639
|
+
},
|
|
8640
|
+
"name": "X_LARGE"
|
|
8641
|
+
},
|
|
8642
|
+
{
|
|
8643
|
+
"docs": {
|
|
8644
|
+
"stability": "experimental"
|
|
8645
|
+
},
|
|
8646
|
+
"name": "X2_LARGE"
|
|
8647
|
+
},
|
|
8648
|
+
{
|
|
8649
|
+
"docs": {
|
|
8650
|
+
"stability": "experimental"
|
|
8651
|
+
},
|
|
8652
|
+
"name": "LAMBDA_1GB"
|
|
8653
|
+
},
|
|
8654
|
+
{
|
|
8655
|
+
"docs": {
|
|
8656
|
+
"stability": "experimental"
|
|
8657
|
+
},
|
|
8658
|
+
"name": "LAMBDA_2GB"
|
|
8659
|
+
},
|
|
8660
|
+
{
|
|
8661
|
+
"docs": {
|
|
8662
|
+
"stability": "experimental"
|
|
8663
|
+
},
|
|
8664
|
+
"name": "LAMBDA_4GB"
|
|
8665
|
+
},
|
|
8666
|
+
{
|
|
8667
|
+
"docs": {
|
|
8668
|
+
"stability": "experimental"
|
|
8669
|
+
},
|
|
8670
|
+
"name": "LAMBDA_8GB"
|
|
8671
|
+
},
|
|
8672
|
+
{
|
|
8673
|
+
"docs": {
|
|
8674
|
+
"stability": "experimental"
|
|
8675
|
+
},
|
|
8676
|
+
"name": "LAMBDA_10GB"
|
|
8677
|
+
},
|
|
8678
|
+
{
|
|
8679
|
+
"docs": {
|
|
8680
|
+
"stability": "experimental"
|
|
8681
|
+
},
|
|
8682
|
+
"name": "ATTRIBUTE_BASED"
|
|
8683
|
+
},
|
|
8684
|
+
{
|
|
8685
|
+
"docs": {
|
|
8686
|
+
"stability": "experimental"
|
|
8687
|
+
},
|
|
8688
|
+
"name": "CUSTOM_INSTANCE_TYPE"
|
|
8689
|
+
}
|
|
8690
|
+
],
|
|
8691
|
+
"name": "ComputeType",
|
|
8692
|
+
"symbolId": "aws-codebuild/lib/compute-type:ComputeType"
|
|
8693
|
+
},
|
|
8578
8694
|
"@cdklabs/deploy-time-build.ContainerImageBuild": {
|
|
8579
8695
|
"assembly": "@cdklabs/deploy-time-build",
|
|
8580
8696
|
"base": "constructs.Construct",
|
|
@@ -8942,7 +9058,7 @@
|
|
|
8942
9058
|
},
|
|
8943
9059
|
"locationInModule": {
|
|
8944
9060
|
"filename": "src/nodejs-build.ts",
|
|
8945
|
-
"line":
|
|
9061
|
+
"line": 120
|
|
8946
9062
|
},
|
|
8947
9063
|
"parameters": [
|
|
8948
9064
|
{
|
|
@@ -8971,7 +9087,7 @@
|
|
|
8971
9087
|
"kind": "class",
|
|
8972
9088
|
"locationInModule": {
|
|
8973
9089
|
"filename": "src/nodejs-build.ts",
|
|
8974
|
-
"line":
|
|
9090
|
+
"line": 117
|
|
8975
9091
|
},
|
|
8976
9092
|
"name": "NodejsBuild",
|
|
8977
9093
|
"properties": [
|
|
@@ -8983,7 +9099,7 @@
|
|
|
8983
9099
|
"immutable": true,
|
|
8984
9100
|
"locationInModule": {
|
|
8985
9101
|
"filename": "src/nodejs-build.ts",
|
|
8986
|
-
"line":
|
|
9102
|
+
"line": 118
|
|
8987
9103
|
},
|
|
8988
9104
|
"name": "grantPrincipal",
|
|
8989
9105
|
"overrides": "aws-cdk-lib.aws_iam.IGrantable",
|
|
@@ -9004,7 +9120,7 @@
|
|
|
9004
9120
|
"kind": "interface",
|
|
9005
9121
|
"locationInModule": {
|
|
9006
9122
|
"filename": "src/nodejs-build.ts",
|
|
9007
|
-
"line":
|
|
9123
|
+
"line": 45
|
|
9008
9124
|
},
|
|
9009
9125
|
"name": "NodejsBuildProps",
|
|
9010
9126
|
"properties": [
|
|
@@ -9017,7 +9133,7 @@
|
|
|
9017
9133
|
"immutable": true,
|
|
9018
9134
|
"locationInModule": {
|
|
9019
9135
|
"filename": "src/nodejs-build.ts",
|
|
9020
|
-
"line":
|
|
9136
|
+
"line": 49
|
|
9021
9137
|
},
|
|
9022
9138
|
"name": "assets",
|
|
9023
9139
|
"type": {
|
|
@@ -9038,7 +9154,7 @@
|
|
|
9038
9154
|
"immutable": true,
|
|
9039
9155
|
"locationInModule": {
|
|
9040
9156
|
"filename": "src/nodejs-build.ts",
|
|
9041
|
-
"line":
|
|
9157
|
+
"line": 59
|
|
9042
9158
|
},
|
|
9043
9159
|
"name": "destinationBucket",
|
|
9044
9160
|
"type": {
|
|
@@ -9054,7 +9170,7 @@
|
|
|
9054
9170
|
"immutable": true,
|
|
9055
9171
|
"locationInModule": {
|
|
9056
9172
|
"filename": "src/nodejs-build.ts",
|
|
9057
|
-
"line":
|
|
9173
|
+
"line": 84
|
|
9058
9174
|
},
|
|
9059
9175
|
"name": "outputSourceDirectory",
|
|
9060
9176
|
"type": {
|
|
@@ -9072,7 +9188,7 @@
|
|
|
9072
9188
|
"immutable": true,
|
|
9073
9189
|
"locationInModule": {
|
|
9074
9190
|
"filename": "src/nodejs-build.ts",
|
|
9075
|
-
"line":
|
|
9191
|
+
"line": 75
|
|
9076
9192
|
},
|
|
9077
9193
|
"name": "buildCommands",
|
|
9078
9194
|
"optional": true,
|
|
@@ -9096,7 +9212,7 @@
|
|
|
9096
9212
|
"immutable": true,
|
|
9097
9213
|
"locationInModule": {
|
|
9098
9214
|
"filename": "src/nodejs-build.ts",
|
|
9099
|
-
"line":
|
|
9215
|
+
"line": 55
|
|
9100
9216
|
},
|
|
9101
9217
|
"name": "buildEnvironment",
|
|
9102
9218
|
"optional": true,
|
|
@@ -9109,6 +9225,42 @@
|
|
|
9109
9225
|
}
|
|
9110
9226
|
}
|
|
9111
9227
|
},
|
|
9228
|
+
{
|
|
9229
|
+
"abstract": true,
|
|
9230
|
+
"docs": {
|
|
9231
|
+
"default": "- No caching",
|
|
9232
|
+
"stability": "experimental",
|
|
9233
|
+
"summary": "Cache type for the npm cache directory."
|
|
9234
|
+
},
|
|
9235
|
+
"immutable": true,
|
|
9236
|
+
"locationInModule": {
|
|
9237
|
+
"filename": "src/nodejs-build.ts",
|
|
9238
|
+
"line": 106
|
|
9239
|
+
},
|
|
9240
|
+
"name": "cache",
|
|
9241
|
+
"optional": true,
|
|
9242
|
+
"type": {
|
|
9243
|
+
"fqn": "@cdklabs/deploy-time-build.CacheType"
|
|
9244
|
+
}
|
|
9245
|
+
},
|
|
9246
|
+
{
|
|
9247
|
+
"abstract": true,
|
|
9248
|
+
"docs": {
|
|
9249
|
+
"default": "ComputeType.SMALL",
|
|
9250
|
+
"stability": "experimental",
|
|
9251
|
+
"summary": "The type of compute to use for this build."
|
|
9252
|
+
},
|
|
9253
|
+
"immutable": true,
|
|
9254
|
+
"locationInModule": {
|
|
9255
|
+
"filename": "src/nodejs-build.ts",
|
|
9256
|
+
"line": 111
|
|
9257
|
+
},
|
|
9258
|
+
"name": "computeType",
|
|
9259
|
+
"optional": true,
|
|
9260
|
+
"type": {
|
|
9261
|
+
"fqn": "aws-cdk-lib.aws_codebuild.ComputeType"
|
|
9262
|
+
}
|
|
9263
|
+
},
|
|
9112
9264
|
{
|
|
9113
9265
|
"abstract": true,
|
|
9114
9266
|
"docs": {
|
|
@@ -9119,7 +9271,7 @@
|
|
|
9119
9271
|
"immutable": true,
|
|
9120
9272
|
"locationInModule": {
|
|
9121
9273
|
"filename": "src/nodejs-build.ts",
|
|
9122
|
-
"line":
|
|
9274
|
+
"line": 64
|
|
9123
9275
|
},
|
|
9124
9276
|
"name": "destinationKeyPrefix",
|
|
9125
9277
|
"optional": true,
|
|
@@ -9138,7 +9290,7 @@
|
|
|
9138
9290
|
"immutable": true,
|
|
9139
9291
|
"locationInModule": {
|
|
9140
9292
|
"filename": "src/nodejs-build.ts",
|
|
9141
|
-
"line":
|
|
9293
|
+
"line": 70
|
|
9142
9294
|
},
|
|
9143
9295
|
"name": "distribution",
|
|
9144
9296
|
"optional": true,
|
|
@@ -9156,7 +9308,7 @@
|
|
|
9156
9308
|
"immutable": true,
|
|
9157
9309
|
"locationInModule": {
|
|
9158
9310
|
"filename": "src/nodejs-build.ts",
|
|
9159
|
-
"line":
|
|
9311
|
+
"line": 101
|
|
9160
9312
|
},
|
|
9161
9313
|
"name": "excludeCommonFiles",
|
|
9162
9314
|
"optional": true,
|
|
@@ -9174,7 +9326,7 @@
|
|
|
9174
9326
|
"immutable": true,
|
|
9175
9327
|
"locationInModule": {
|
|
9176
9328
|
"filename": "src/nodejs-build.ts",
|
|
9177
|
-
"line":
|
|
9329
|
+
"line": 89
|
|
9178
9330
|
},
|
|
9179
9331
|
"name": "nodejsVersion",
|
|
9180
9332
|
"optional": true,
|
|
@@ -9192,7 +9344,7 @@
|
|
|
9192
9344
|
"immutable": true,
|
|
9193
9345
|
"locationInModule": {
|
|
9194
9346
|
"filename": "src/nodejs-build.ts",
|
|
9195
|
-
"line":
|
|
9347
|
+
"line": 95
|
|
9196
9348
|
},
|
|
9197
9349
|
"name": "outputEnvFile",
|
|
9198
9350
|
"optional": true,
|
|
@@ -9210,7 +9362,7 @@
|
|
|
9210
9362
|
"immutable": true,
|
|
9211
9363
|
"locationInModule": {
|
|
9212
9364
|
"filename": "src/nodejs-build.ts",
|
|
9213
|
-
"line":
|
|
9365
|
+
"line": 80
|
|
9214
9366
|
},
|
|
9215
9367
|
"name": "workingDirectory",
|
|
9216
9368
|
"optional": true,
|
|
@@ -9558,6 +9710,6 @@
|
|
|
9558
9710
|
"symbolId": "src/soci-index-v2-build:SociIndexV2BuildProps"
|
|
9559
9711
|
}
|
|
9560
9712
|
},
|
|
9561
|
-
"version": "0.0.
|
|
9562
|
-
"fingerprint": "
|
|
9713
|
+
"version": "0.0.6",
|
|
9714
|
+
"fingerprint": "GL7JjwLlQY8RTr0QWOxaaG3O8tSy4xnfRRdFyprB4o0="
|
|
9563
9715
|
}
|
package/.jsii.tabl.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2","toolVersion":"5.9.26","snippets":{"800726ff84b625f3be59259a8353b2b087e9ea4a472846d215c86c8e4492bf66":{"translations":{"python":{"source":"from cdklabs.deploy_time_build import AssetConfig\nfrom cdklabs.deploy_time_build import NodejsBuild\n\n\nNodejsBuild(self, \"ExampleBuild\",\n assets=[AssetConfig(\n path=\"example-app\",\n exclude=[\"dist\", \"node_modules\"]\n )\n ],\n destination_bucket=destination_bucket,\n distribution=distribution,\n output_source_directory=\"dist\",\n build_commands=[\"npm ci\", \"npm run build\"],\n build_environment={\n \"VITE_API_ENDPOINT\": api.url\n }\n)","version":"2"},"csharp":{"source":"using Cdklabs.Deploy.Time.Build;\n\n\nnew NodejsBuild(this, \"ExampleBuild\", new NodejsBuildProps {\n Assets = new [] { new AssetConfig {\n Path = \"example-app\",\n Exclude = new [] { \"dist\", \"node_modules\" }\n } },\n DestinationBucket = destinationBucket,\n Distribution = distribution,\n OutputSourceDirectory = \"dist\",\n BuildCommands = new [] { \"npm ci\", \"npm run build\" },\n BuildEnvironment = new Dictionary<string, string> {\n { \"VITE_API_ENDPOINT\", api.Url }\n }\n});","version":"1"},"java":{"source":"import io.github.cdklabs.deploy.time.build.NodejsBuild;\n\n\nNodejsBuild.Builder.create(this, \"ExampleBuild\")\n .assets(List.of(AssetConfig.builder()\n .path(\"example-app\")\n .exclude(List.of(\"dist\", \"node_modules\"))\n .build()))\n .destinationBucket(destinationBucket)\n .distribution(distribution)\n .outputSourceDirectory(\"dist\")\n .buildCommands(List.of(\"npm ci\", \"npm run build\"))\n .buildEnvironment(Map.of(\n \"VITE_API_ENDPOINT\", api.getUrl()))\n .build();","version":"1"},"go":{"source":"import \"github.com/aws-samples/dummy/cdklabsdeploytimebuild\"\n\n\ncdklabsdeploytimebuild.NewNodejsBuild(this, jsii.String(\"ExampleBuild\"), &NodejsBuildProps{\n\tAssets: []AssetConfig{\n\t\t&AssetConfig{\n\t\t\tPath: jsii.String(\"example-app\"),\n\t\t\tExclude: []*string{\n\t\t\t\tjsii.String(\"dist\"),\n\t\t\t\tjsii.String(\"node_modules\"),\n\t\t\t},\n\t\t},\n\t},\n\tDestinationBucket: DestinationBucket,\n\tDistribution: Distribution,\n\tOutputSourceDirectory: jsii.String(\"dist\"),\n\tBuildCommands: []*string{\n\t\tjsii.String(\"npm ci\"),\n\t\tjsii.String(\"npm run build\"),\n\t},\n\tBuildEnvironment: map[string]*string{\n\t\t\"VITE_API_ENDPOINT\": api.url,\n\t},\n})","version":"1"},"$":{"source":"import { NodejsBuild } from '@cdklabs/deploy-time-build';\n\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n buildCommands: ['npm ci', 'npm run build'],\n buildEnvironment: {\n VITE_API_ENDPOINT: api.url,\n },\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":27}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.NodejsBuild","@cdklabs/deploy-time-build.NodejsBuildProps","aws-cdk-lib.aws_cloudfront.IDistribution","aws-cdk-lib.aws_s3.IBucket","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { NodejsBuild } from '@cdklabs/deploy-time-build';\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n buildCommands: ['npm ci', 'npm run build'],\n buildEnvironment: {\n VITE_API_ENDPOINT: api.url,\n },\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":8,"80":13,"110":1,"210":3,"211":3,"212":1,"215":1,"245":1,"273":1,"274":1,"276":1,"277":1,"304":7,"305":2,"308":1},"fqnsFingerprint":"cae6cd9aa29769183a8ebcfe4277eca2953bb8ec13c7da823974e33ed72745e4"},"3d9e4fa921daf5e80c0161b2fc5fd13680e32e4798e30ed8498c2de2490498c8":{"translations":{"python":{"source":"from cdklabs.deploy_time_build import AssetConfig, AssetConfig\nNodejsBuild(self, \"ExampleBuild\",\n assets=[AssetConfig(\n # directory containing source code and package.json\n path=\"example-app\",\n exclude=[\"dist\", \"node_modules\"],\n commands=[\"npm install\"]\n ), AssetConfig(\n # directory that is also required for the build\n path=\"module1\"\n )\n ],\n destination_bucket=destination_bucket,\n distribution=distribution,\n output_source_directory=\"dist\"\n)","version":"2"},"csharp":{"source":"new NodejsBuild(this, \"ExampleBuild\", new NodejsBuildProps {\n Assets = new [] { new AssetConfig {\n // directory containing source code and package.json\n Path = \"example-app\",\n Exclude = new [] { \"dist\", \"node_modules\" },\n Commands = new [] { \"npm install\" }\n }, new AssetConfig {\n // directory that is also required for the build\n Path = \"module1\"\n } },\n DestinationBucket = destinationBucket,\n Distribution = distribution,\n OutputSourceDirectory = \"dist\"\n});","version":"1"},"java":{"source":"NodejsBuild.Builder.create(this, \"ExampleBuild\")\n .assets(List.of(AssetConfig.builder()\n // directory containing source code and package.json\n .path(\"example-app\")\n .exclude(List.of(\"dist\", \"node_modules\"))\n .commands(List.of(\"npm install\"))\n .build(), AssetConfig.builder()\n // directory that is also required for the build\n .path(\"module1\")\n .build()))\n .destinationBucket(destinationBucket)\n .distribution(distribution)\n .outputSourceDirectory(\"dist\")\n .build();","version":"1"},"go":{"source":"cdklabsdeploytimebuild.NewNodejsBuild(this, jsii.String(\"ExampleBuild\"), &NodejsBuildProps{\n\tAssets: []AssetConfig{\n\t\t&AssetConfig{\n\t\t\t// directory containing source code and package.json\n\t\t\tPath: jsii.String(\"example-app\"),\n\t\t\tExclude: []*string{\n\t\t\t\tjsii.String(\"dist\"),\n\t\t\t\tjsii.String(\"node_modules\"),\n\t\t\t},\n\t\t\tCommands: []*string{\n\t\t\t\tjsii.String(\"npm install\"),\n\t\t\t},\n\t\t},\n\t\t&AssetConfig{\n\t\t\t// directory that is also required for the build\n\t\t\tPath: jsii.String(\"module1\"),\n\t\t},\n\t},\n\tDestinationBucket: DestinationBucket,\n\tDistribution: Distribution,\n\tOutputSourceDirectory: jsii.String(\"dist\"),\n})","version":"1"},"$":{"source":"new NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n // directory containing source code and package.json\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n commands: ['npm install'],\n },\n {\n // directory that is also required for the build\n path: 'module1',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":52}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.NodejsBuild","@cdklabs/deploy-time-build.NodejsBuildProps","aws-cdk-lib.aws_cloudfront.IDistribution","aws-cdk-lib.aws_s3.IBucket","constructs.Construct"],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { NodejsBuild } from '@cdklabs/deploy-time-build';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n // directory containing source code and package.json\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n commands: ['npm install'],\n },\n {\n // directory that is also required for the build\n path: 'module1',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":7,"80":9,"110":1,"210":3,"211":3,"215":1,"245":1,"304":6,"305":2},"fqnsFingerprint":"cae6cd9aa29769183a8ebcfe4277eca2953bb8ec13c7da823974e33ed72745e4"},"57c4f1e95406cffad4eca47374a253fcf144b129352834b84fe4ce6ce9e3da1d":{"translations":{"python":{"source":"# some_bucket: s3.IBucket\n# build: NodejsBuild\n\nsome_bucket.grant_read_write(build)","version":"2"},"csharp":{"source":"IBucket someBucket;\nNodejsBuild build;\n\nsomeBucket.GrantReadWrite(build);","version":"1"},"java":{"source":"IBucket someBucket;\nNodejsBuild build;\n\nsomeBucket.grantReadWrite(build);","version":"1"},"go":{"source":"var someBucket IBucket\nvar build NodejsBuild\n\nsomeBucket.GrantReadWrite(build)","version":"1"},"$":{"source":"declare const someBucket: s3.IBucket;\ndeclare const build: NodejsBuild;\nsomeBucket.grantReadWrite(build);","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":92}},"didCompile":true,"fqnsReferenced":["aws-cdk-lib.aws_iam.IGrantable","aws-cdk-lib.aws_s3.IBucket#grantReadWrite"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\ndeclare const someBucket: s3.IBucket;\ndeclare const build: NodejsBuild;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { NodejsBuild } from '@cdklabs/deploy-time-build';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\nsomeBucket.grantReadWrite(build);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"80":8,"138":2,"167":1,"184":2,"212":1,"214":1,"244":2,"245":1,"261":2,"262":2,"308":1},"fqnsFingerprint":"c04a359ccd17c4ce38c71752edeca6657c59c603cbac00a70dd89b708aeb3861"},"cd56982b16eadc2c93e7a07a2ce081e37678697c7e9ecfeccf336ffaa75877b0":{"translations":{"python":{"source":"# build: NodejsBuild\n\niam.Grant.add_to_principal(grantee=build, actions=[\"s3:ListBucket\"], resource_arns=[\"*\"])","version":"2"},"csharp":{"source":"NodejsBuild build;\n\nGrant.AddToPrincipal(new GrantOnPrincipalOptions { Grantee = build, Actions = new [] { \"s3:ListBucket\" }, ResourceArns = new [] { \"*\" } });","version":"1"},"java":{"source":"NodejsBuild build;\n\nGrant.addToPrincipal(GrantOnPrincipalOptions.builder().grantee(build).actions(List.of(\"s3:ListBucket\")).resourceArns(List.of(\"*\")).build());","version":"1"},"go":{"source":"var build NodejsBuild\n\niam.Grant_AddToPrincipal(&GrantOnPrincipalOptions{\n\tGrantee: build,\n\tActions: []*string{\n\t\tjsii.String(\"s3:ListBucket\"),\n\t},\n\tResourceArns: []*string{\n\t\tjsii.String(\"*\"),\n\t},\n})","version":"1"},"$":{"source":"declare const build: NodejsBuild;\niam.Grant.addToPrincipal({ grantee: build, actions: ['s3:ListBucket'], resourceArns:['*'] })","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":100}},"didCompile":true,"fqnsReferenced":["aws-cdk-lib.aws_iam.Grant","aws-cdk-lib.aws_iam.Grant#addToPrincipal","aws-cdk-lib.aws_iam.GrantOnPrincipalOptions","aws-cdk-lib.aws_iam.IGrantable"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\ndeclare const build: NodejsBuild;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { NodejsBuild } from '@cdklabs/deploy-time-build';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\niam.Grant.addToPrincipal({ grantee: build, actions: ['s3:ListBucket'], resourceArns:['*'] })\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":2,"80":9,"138":1,"184":1,"210":2,"211":1,"212":2,"214":1,"244":1,"245":1,"261":1,"262":1,"304":3,"308":1},"fqnsFingerprint":"f0f52e6409e416e29fafa429de473262080fac9c74b9ae991b8e740d74556893"},"d125b8c849264f486e19f9a39ee88a8bf15d6441b387d1c5ca8b34d9468b0b2e":{"translations":{"python":{"source":"from cdklabs.deploy_time_build import AssetConfig\nNodejsBuild(self, \"ExampleBuild\",\n assets=[AssetConfig(\n path=\"../frontend\",\n exclude=[\"node_modules\", \"dist\"],\n commands=[\"npm ci\"],\n # Set a fixed string as a asset hash to prevent deploying changes.\n # This can be useful for an environment you use to develop locally.\n asset_hash=\"frontend_asset\"\n )\n ],\n destination_bucket=destination_bucket,\n distribution=distribution,\n output_source_directory=\"dist\"\n)","version":"2"},"csharp":{"source":"new NodejsBuild(this, \"ExampleBuild\", new NodejsBuildProps {\n Assets = new [] { new AssetConfig {\n Path = \"../frontend\",\n Exclude = new [] { \"node_modules\", \"dist\" },\n Commands = new [] { \"npm ci\" },\n // Set a fixed string as a asset hash to prevent deploying changes.\n // This can be useful for an environment you use to develop locally.\n AssetHash = \"frontend_asset\"\n } },\n DestinationBucket = destinationBucket,\n Distribution = distribution,\n OutputSourceDirectory = \"dist\"\n});","version":"1"},"java":{"source":"NodejsBuild.Builder.create(this, \"ExampleBuild\")\n .assets(List.of(AssetConfig.builder()\n .path(\"../frontend\")\n .exclude(List.of(\"node_modules\", \"dist\"))\n .commands(List.of(\"npm ci\"))\n // Set a fixed string as a asset hash to prevent deploying changes.\n // This can be useful for an environment you use to develop locally.\n .assetHash(\"frontend_asset\")\n .build()))\n .destinationBucket(destinationBucket)\n .distribution(distribution)\n .outputSourceDirectory(\"dist\")\n .build();","version":"1"},"go":{"source":"cdklabsdeploytimebuild.NewNodejsBuild(this, jsii.String(\"ExampleBuild\"), &NodejsBuildProps{\n\tAssets: []AssetConfig{\n\t\t&AssetConfig{\n\t\t\tPath: jsii.String(\"../frontend\"),\n\t\t\tExclude: []*string{\n\t\t\t\tjsii.String(\"node_modules\"),\n\t\t\t\tjsii.String(\"dist\"),\n\t\t\t},\n\t\t\tCommands: []*string{\n\t\t\t\tjsii.String(\"npm ci\"),\n\t\t\t},\n\t\t\t// Set a fixed string as a asset hash to prevent deploying changes.\n\t\t\t// This can be useful for an environment you use to develop locally.\n\t\t\tAssetHash: jsii.String(\"frontend_asset\"),\n\t\t},\n\t},\n\tDestinationBucket: DestinationBucket,\n\tDistribution: Distribution,\n\tOutputSourceDirectory: jsii.String(\"dist\"),\n})","version":"1"},"$":{"source":"new NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: '../frontend',\n exclude: ['node_modules', 'dist'],\n commands: ['npm ci'],\n // Set a fixed string as a asset hash to prevent deploying changes.\n // This can be useful for an environment you use to develop locally.\n assetHash: 'frontend_asset',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":115}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.NodejsBuild","@cdklabs/deploy-time-build.NodejsBuildProps","aws-cdk-lib.aws_cloudfront.IDistribution","aws-cdk-lib.aws_s3.IBucket","constructs.Construct"],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { NodejsBuild } from '@cdklabs/deploy-time-build';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: '../frontend',\n exclude: ['node_modules', 'dist'],\n commands: ['npm ci'],\n // Set a fixed string as a asset hash to prevent deploying changes.\n // This can be useful for an environment you use to develop locally.\n assetHash: 'frontend_asset',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":7,"80":9,"110":1,"210":3,"211":2,"215":1,"245":1,"304":6,"305":2},"fqnsFingerprint":"cae6cd9aa29769183a8ebcfe4277eca2953bb8ec13c7da823974e33ed72745e4"},"d39d7604898e274a032131443e89b8fdb7699b96fd9d7c643a97a5bc5f94740e":{"translations":{"python":{"source":"from aws_cdk.aws_ecs import RuntimePlatform\nfrom cdklabs.deploy_time_build import ContainerImageBuild\n\n\nimage = ContainerImageBuild(self, \"Build\",\n directory=\"example-image\",\n build_args={\"DUMMY_FILE_SIZE_MB\": \"15\"},\n tag=\"my-image-tag\"\n)\nDockerImageFunction(self, \"Function\",\n code=image.to_lambda_docker_image_code()\n)\narm_image = ContainerImageBuild(self, \"BuildArm\",\n directory=\"example-image\",\n platform=Platform.LINUX_ARM64,\n repository=image.repository,\n zstd_compression=True\n)\nFargateTaskDefinition(self, \"TaskDefinition\",\n runtime_platform=RuntimePlatform(cpu_architecture=CpuArchitecture.ARM64)\n).add_container(\"main\",\n image=arm_image.to_ecs_docker_image_code()\n)","version":"2"},"csharp":{"source":"using Cdklabs.Deploy.Time.Build;\n\n\nvar image = new ContainerImageBuild(this, \"Build\", new ContainerImageBuildProps {\n Directory = \"example-image\",\n BuildArgs = new Dictionary<string, string> { { \"DUMMY_FILE_SIZE_MB\", \"15\" } },\n Tag = \"my-image-tag\"\n});\nnew DockerImageFunction(this, \"Function\", new DockerImageFunctionProps {\n Code = image.ToLambdaDockerImageCode()\n});\nvar armImage = new ContainerImageBuild(this, \"BuildArm\", new ContainerImageBuildProps {\n Directory = \"example-image\",\n Platform = Platform.LINUX_ARM64,\n Repository = image.Repository,\n ZstdCompression = true\n});\nnew FargateTaskDefinition(this, \"TaskDefinition\", new FargateTaskDefinitionProps {\n RuntimePlatform = new RuntimePlatform { CpuArchitecture = CpuArchitecture.ARM64 }\n}).AddContainer(\"main\", new ContainerDefinitionOptions {\n Image = armImage.ToEcsDockerImageCode()\n});","version":"1"},"java":{"source":"import io.github.cdklabs.deploy.time.build.ContainerImageBuild;\n\n\nContainerImageBuild image = ContainerImageBuild.Builder.create(this, \"Build\")\n .directory(\"example-image\")\n .buildArgs(Map.of(\"DUMMY_FILE_SIZE_MB\", \"15\"))\n .tag(\"my-image-tag\")\n .build();\nDockerImageFunction.Builder.create(this, \"Function\")\n .code(image.toLambdaDockerImageCode())\n .build();\nContainerImageBuild armImage = ContainerImageBuild.Builder.create(this, \"BuildArm\")\n .directory(\"example-image\")\n .platform(Platform.LINUX_ARM64)\n .repository(image.getRepository())\n .zstdCompression(true)\n .build();\nFargateTaskDefinition.Builder.create(this, \"TaskDefinition\")\n .runtimePlatform(RuntimePlatform.builder().cpuArchitecture(CpuArchitecture.ARM64).build())\n .build().addContainer(\"main\", ContainerDefinitionOptions.builder()\n .image(armImage.toEcsDockerImageCode())\n .build());","version":"1"},"go":{"source":"import \"github.com/aws-samples/dummy/cdklabsdeploytimebuild\"\n\n\nimage := cdklabsdeploytimebuild.NewContainerImageBuild(this, jsii.String(\"Build\"), &ContainerImageBuildProps{\n\tDirectory: jsii.String(\"example-image\"),\n\tBuildArgs: map[string]*string{\n\t\t\"DUMMY_FILE_SIZE_MB\": jsii.String(\"15\"),\n\t},\n\tTag: jsii.String(\"my-image-tag\"),\n})\nawscdk.NewDockerImageFunction(this, jsii.String(\"Function\"), &DockerImageFunctionProps{\n\tCode: image.ToLambdaDockerImageCode(),\n})\narmImage := cdklabsdeploytimebuild.NewContainerImageBuild(this, jsii.String(\"BuildArm\"), &ContainerImageBuildProps{\n\tDirectory: jsii.String(\"example-image\"),\n\tPlatform: awscdk.Platform_LINUX_ARM64(),\n\tRepository: image.Repository,\n\tZstdCompression: jsii.Boolean(true),\n})\nawscdk.NewFargateTaskDefinition(this, jsii.String(\"TaskDefinition\"), &FargateTaskDefinitionProps{\n\tRuntimePlatform: &RuntimePlatform{\n\t\tCpuArchitecture: awscdk.CpuArchitecture_ARM64(),\n\t},\n}).AddContainer(jsii.String(\"main\"), &ContainerDefinitionOptions{\n\tImage: armImage.ToEcsDockerImageCode(),\n})","version":"1"},"$":{"source":"import { ContainerImageBuild } from '@cdklabs/deploy-time-build';\n\nconst image = new ContainerImageBuild(this, 'Build', {\n directory: 'example-image',\n buildArgs: { DUMMY_FILE_SIZE_MB: '15' },\n tag: 'my-image-tag',\n});\nnew DockerImageFunction(this, 'Function', {\n code: image.toLambdaDockerImageCode(),\n});\nconst armImage = new ContainerImageBuild(this, 'BuildArm', {\n directory: 'example-image',\n platform: Platform.LINUX_ARM64,\n repository: image.repository,\n zstdCompression: true,\n});\nnew FargateTaskDefinition(this, 'TaskDefinition', {\n runtimePlatform: { cpuArchitecture: CpuArchitecture.ARM64 }\n}).addContainer('main', {\n image: armImage.toEcsDockerImageCode(),\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":136}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.ContainerImageBuild","@cdklabs/deploy-time-build.ContainerImageBuild#repository","@cdklabs/deploy-time-build.ContainerImageBuild#toEcsDockerImageCode","@cdklabs/deploy-time-build.ContainerImageBuild#toLambdaDockerImageCode","@cdklabs/deploy-time-build.ContainerImageBuildProps","aws-cdk-lib.aws_ecr.IRepository","aws-cdk-lib.aws_ecr_assets.Platform","aws-cdk-lib.aws_ecr_assets.Platform#LINUX_ARM64","aws-cdk-lib.aws_ecs.ContainerDefinitionOptions","aws-cdk-lib.aws_ecs.ContainerImage","aws-cdk-lib.aws_ecs.CpuArchitecture","aws-cdk-lib.aws_ecs.CpuArchitecture#ARM64","aws-cdk-lib.aws_ecs.FargateTaskDefinition","aws-cdk-lib.aws_ecs.FargateTaskDefinitionProps","aws-cdk-lib.aws_ecs.RuntimePlatform","aws-cdk-lib.aws_ecs.TaskDefinition#addContainer","aws-cdk-lib.aws_lambda.DockerImageCode","aws-cdk-lib.aws_lambda.DockerImageFunction","aws-cdk-lib.aws_lambda.DockerImageFunctionProps","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { ContainerImageBuild } from '@cdklabs/deploy-time-build';\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst image = new ContainerImageBuild(this, 'Build', {\n directory: 'example-image',\n buildArgs: { DUMMY_FILE_SIZE_MB: '15' },\n tag: 'my-image-tag',\n});\nnew DockerImageFunction(this, 'Function', {\n code: image.toLambdaDockerImageCode(),\n});\nconst armImage = new ContainerImageBuild(this, 'BuildArm', {\n directory: 'example-image',\n platform: Platform.LINUX_ARM64,\n repository: image.repository,\n zstdCompression: true,\n});\nnew FargateTaskDefinition(this, 'TaskDefinition', {\n runtimePlatform: { cpuArchitecture: CpuArchitecture.ARM64 }\n}).addContainer('main', {\n image: armImage.toEcsDockerImageCode(),\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":10,"80":30,"110":4,"112":1,"211":7,"212":6,"214":3,"215":4,"244":2,"245":2,"261":2,"262":2,"273":1,"274":1,"276":1,"277":1,"304":12,"308":1},"fqnsFingerprint":"907854e816a7aea78483a10d546d1d76969e608020786f9f7401f4d185b3b6cd"},"0edbf109619b58eea09faf5bb83f6c21aac7ae7cfb5cae9b7bf6f2d9aa25fe5e":{"translations":{"python":{"source":"from cdklabs.deploy_time_build import SociIndexV2Build\n\n\nasset = DockerImageAsset(self, \"Image\", directory=\"example-image\")\nsoci_index = SociIndexV2Build(self, \"SociV2Index\",\n repository=asset.repository,\n input_image_tag=asset.asset_hash,\n output_image_tag=f\"{asset.assetHash}-soci\"\n)\n\n# Use with ECS Fargate\ntask_definition = FargateTaskDefinition(self, \"TaskDefinition\")\ntask_definition.add_container(\"main\",\n image=soci_index.to_ecs_docker_image_code()\n)\n\n# Or create from DockerImageAsset using utility method\nsoci_index_from_asset = SociIndexV2Build.from_docker_image_asset(self, \"SociV2Index2\", asset)","version":"2"},"csharp":{"source":"using Cdklabs.Deploy.Time.Build;\n\n\nvar asset = new DockerImageAsset(this, \"Image\", new DockerImageAssetProps { Directory = \"example-image\" });\nvar sociIndex = new SociIndexV2Build(this, \"SociV2Index\", new SociIndexV2BuildProps {\n Repository = asset.Repository,\n InputImageTag = asset.AssetHash,\n OutputImageTag = $\"{asset.assetHash}-soci\"\n});\n\n// Use with ECS Fargate\nvar taskDefinition = new FargateTaskDefinition(this, \"TaskDefinition\");\ntaskDefinition.AddContainer(\"main\", new ContainerDefinitionOptions {\n Image = sociIndex.ToEcsDockerImageCode()\n});\n\n// Or create from DockerImageAsset using utility method\nvar sociIndexFromAsset = SociIndexV2Build.FromDockerImageAsset(this, \"SociV2Index2\", asset);","version":"1"},"java":{"source":"import io.github.cdklabs.deploy.time.build.SociIndexV2Build;\n\n\nDockerImageAsset asset = DockerImageAsset.Builder.create(this, \"Image\").directory(\"example-image\").build();\nSociIndexV2Build sociIndex = SociIndexV2Build.Builder.create(this, \"SociV2Index\")\n .repository(asset.getRepository())\n .inputImageTag(asset.getAssetHash())\n .outputImageTag(String.format(\"%s-soci\", asset.getAssetHash()))\n .build();\n\n// Use with ECS Fargate\nFargateTaskDefinition taskDefinition = new FargateTaskDefinition(this, \"TaskDefinition\");\ntaskDefinition.addContainer(\"main\", ContainerDefinitionOptions.builder()\n .image(sociIndex.toEcsDockerImageCode())\n .build());\n\n// Or create from DockerImageAsset using utility method\nSociIndexV2Build sociIndexFromAsset = SociIndexV2Build.fromDockerImageAsset(this, \"SociV2Index2\", asset);","version":"1"},"go":{"source":"import \"github.com/aws-samples/dummy/cdklabsdeploytimebuild\"\n\n\nasset := awscdk.NewDockerImageAsset(this, jsii.String(\"Image\"), &DockerImageAssetProps{\n\tDirectory: jsii.String(\"example-image\"),\n})\nsociIndex := cdklabsdeploytimebuild.NewSociIndexV2Build(this, jsii.String(\"SociV2Index\"), &SociIndexV2BuildProps{\n\tRepository: asset.Repository,\n\tInputImageTag: asset.AssetHash,\n\tOutputImageTag: fmt.Sprintf(\"%v-soci\", asset.*AssetHash),\n})\n\n// Use with ECS Fargate\ntaskDefinition := awscdk.NewFargateTaskDefinition(this, jsii.String(\"TaskDefinition\"))\ntaskDefinition.AddContainer(jsii.String(\"main\"), &ContainerDefinitionOptions{\n\tImage: sociIndex.ToEcsDockerImageCode(),\n})\n\n// Or create from DockerImageAsset using utility method\nsociIndexFromAsset := cdklabsdeploytimebuild.SociIndexV2Build_FromDockerImageAsset(this, jsii.String(\"SociV2Index2\"), asset)","version":"1"},"$":{"source":"import { SociIndexV2Build } from '@cdklabs/deploy-time-build';\n\nconst asset = new DockerImageAsset(this, 'Image', { directory: 'example-image' });\nconst sociIndex = new SociIndexV2Build(this, 'SociV2Index', {\n repository: asset.repository,\n inputImageTag: asset.assetHash,\n outputImageTag: `${asset.assetHash}-soci`,\n});\n\n// Use with ECS Fargate\nconst taskDefinition = new FargateTaskDefinition(this, 'TaskDefinition');\ntaskDefinition.addContainer('main', {\n image: sociIndex.toEcsDockerImageCode(),\n});\n\n// Or create from DockerImageAsset using utility method\nconst sociIndexFromAsset = SociIndexV2Build.fromDockerImageAsset(this, 'SociV2Index2', asset);","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":169}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.SociIndexV2Build","@cdklabs/deploy-time-build.SociIndexV2Build#fromDockerImageAsset","@cdklabs/deploy-time-build.SociIndexV2Build#toEcsDockerImageCode","@cdklabs/deploy-time-build.SociIndexV2BuildProps","aws-cdk-lib.aws_ecr.IRepository","aws-cdk-lib.aws_ecr_assets.DockerImageAsset","aws-cdk-lib.aws_ecr_assets.DockerImageAsset#assetHash","aws-cdk-lib.aws_ecr_assets.DockerImageAsset#repository","aws-cdk-lib.aws_ecr_assets.DockerImageAssetProps","aws-cdk-lib.aws_ecs.ContainerDefinitionOptions","aws-cdk-lib.aws_ecs.ContainerImage","aws-cdk-lib.aws_ecs.FargateTaskDefinition","aws-cdk-lib.aws_ecs.TaskDefinition#addContainer","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { SociIndexV2Build } from '@cdklabs/deploy-time-build';\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst asset = new DockerImageAsset(this, 'Image', { directory: 'example-image' });\nconst sociIndex = new SociIndexV2Build(this, 'SociV2Index', {\n repository: asset.repository,\n inputImageTag: asset.assetHash,\n outputImageTag: `${asset.assetHash}-soci`,\n});\n\n// Use with ECS Fargate\nconst taskDefinition = new FargateTaskDefinition(this, 'TaskDefinition');\ntaskDefinition.addContainer('main', {\n image: sociIndex.toEcsDockerImageCode(),\n});\n\n// Or create from DockerImageAsset using utility method\nconst sociIndexFromAsset = SociIndexV2Build.fromDockerImageAsset(this, 'SociV2Index2', asset);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":7,"16":1,"18":1,"80":26,"110":4,"211":3,"212":6,"214":3,"215":3,"229":1,"240":1,"244":4,"245":1,"261":4,"262":4,"273":1,"274":1,"276":1,"277":1,"304":5,"308":1},"fqnsFingerprint":"d2ee8a950386ff153f6d29ad18cbd22ac20e48787a134985f4943fa610f1a788"}}}
|
|
1
|
+
{"version":"2","toolVersion":"5.9.26","snippets":{"800726ff84b625f3be59259a8353b2b087e9ea4a472846d215c86c8e4492bf66":{"translations":{"python":{"source":"from cdklabs.deploy_time_build import AssetConfig\nfrom cdklabs.deploy_time_build import NodejsBuild\n\n\nNodejsBuild(self, \"ExampleBuild\",\n assets=[AssetConfig(\n path=\"example-app\",\n exclude=[\"dist\", \"node_modules\"]\n )\n ],\n destination_bucket=destination_bucket,\n distribution=distribution,\n output_source_directory=\"dist\",\n build_commands=[\"npm ci\", \"npm run build\"],\n build_environment={\n \"VITE_API_ENDPOINT\": api.url\n }\n)","version":"2"},"csharp":{"source":"using Cdklabs.Deploy.Time.Build;\n\n\nnew NodejsBuild(this, \"ExampleBuild\", new NodejsBuildProps {\n Assets = new [] { new AssetConfig {\n Path = \"example-app\",\n Exclude = new [] { \"dist\", \"node_modules\" }\n } },\n DestinationBucket = destinationBucket,\n Distribution = distribution,\n OutputSourceDirectory = \"dist\",\n BuildCommands = new [] { \"npm ci\", \"npm run build\" },\n BuildEnvironment = new Dictionary<string, string> {\n { \"VITE_API_ENDPOINT\", api.Url }\n }\n});","version":"1"},"java":{"source":"import cdklabs.deploy.time.build.NodejsBuild;\n\n\nNodejsBuild.Builder.create(this, \"ExampleBuild\")\n .assets(List.of(AssetConfig.builder()\n .path(\"example-app\")\n .exclude(List.of(\"dist\", \"node_modules\"))\n .build()))\n .destinationBucket(destinationBucket)\n .distribution(distribution)\n .outputSourceDirectory(\"dist\")\n .buildCommands(List.of(\"npm ci\", \"npm run build\"))\n .buildEnvironment(Map.of(\n \"VITE_API_ENDPOINT\", api.getUrl()))\n .build();","version":"1"},"go":{"source":"import \"github.com/aws-samples/dummy/cdklabsdeploytimebuild\"\n\n\ncdklabsdeploytimebuild.NewNodejsBuild(this, jsii.String(\"ExampleBuild\"), &NodejsBuildProps{\n\tAssets: []AssetConfig{\n\t\t&AssetConfig{\n\t\t\tPath: jsii.String(\"example-app\"),\n\t\t\tExclude: []*string{\n\t\t\t\tjsii.String(\"dist\"),\n\t\t\t\tjsii.String(\"node_modules\"),\n\t\t\t},\n\t\t},\n\t},\n\tDestinationBucket: DestinationBucket,\n\tDistribution: Distribution,\n\tOutputSourceDirectory: jsii.String(\"dist\"),\n\tBuildCommands: []*string{\n\t\tjsii.String(\"npm ci\"),\n\t\tjsii.String(\"npm run build\"),\n\t},\n\tBuildEnvironment: map[string]*string{\n\t\t\"VITE_API_ENDPOINT\": api.url,\n\t},\n})","version":"1"},"$":{"source":"import { NodejsBuild } from '@cdklabs/deploy-time-build';\n\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n buildCommands: ['npm ci', 'npm run build'],\n buildEnvironment: {\n VITE_API_ENDPOINT: api.url,\n },\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":27}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.NodejsBuild","@cdklabs/deploy-time-build.NodejsBuildProps","aws-cdk-lib.aws_cloudfront.IDistribution","aws-cdk-lib.aws_s3.IBucket","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { NodejsBuild } from '@cdklabs/deploy-time-build';\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n buildCommands: ['npm ci', 'npm run build'],\n buildEnvironment: {\n VITE_API_ENDPOINT: api.url,\n },\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":8,"80":13,"110":1,"210":3,"211":3,"212":1,"215":1,"245":1,"273":1,"274":1,"276":1,"277":1,"304":7,"305":2,"308":1},"fqnsFingerprint":"2aa87b2a825af421f03a94064dd65e89edda59cce4d1a9604199e108f0c050b6"},"3d9e4fa921daf5e80c0161b2fc5fd13680e32e4798e30ed8498c2de2490498c8":{"translations":{"python":{"source":"from cdklabs.deploy_time_build import AssetConfig, AssetConfig\nNodejsBuild(self, \"ExampleBuild\",\n assets=[AssetConfig(\n # directory containing source code and package.json\n path=\"example-app\",\n exclude=[\"dist\", \"node_modules\"],\n commands=[\"npm install\"]\n ), AssetConfig(\n # directory that is also required for the build\n path=\"module1\"\n )\n ],\n destination_bucket=destination_bucket,\n distribution=distribution,\n output_source_directory=\"dist\"\n)","version":"2"},"csharp":{"source":"new NodejsBuild(this, \"ExampleBuild\", new NodejsBuildProps {\n Assets = new [] { new AssetConfig {\n // directory containing source code and package.json\n Path = \"example-app\",\n Exclude = new [] { \"dist\", \"node_modules\" },\n Commands = new [] { \"npm install\" }\n }, new AssetConfig {\n // directory that is also required for the build\n Path = \"module1\"\n } },\n DestinationBucket = destinationBucket,\n Distribution = distribution,\n OutputSourceDirectory = \"dist\"\n});","version":"1"},"java":{"source":"NodejsBuild.Builder.create(this, \"ExampleBuild\")\n .assets(List.of(AssetConfig.builder()\n // directory containing source code and package.json\n .path(\"example-app\")\n .exclude(List.of(\"dist\", \"node_modules\"))\n .commands(List.of(\"npm install\"))\n .build(), AssetConfig.builder()\n // directory that is also required for the build\n .path(\"module1\")\n .build()))\n .destinationBucket(destinationBucket)\n .distribution(distribution)\n .outputSourceDirectory(\"dist\")\n .build();","version":"1"},"go":{"source":"cdklabsdeploytimebuild.NewNodejsBuild(this, jsii.String(\"ExampleBuild\"), &NodejsBuildProps{\n\tAssets: []AssetConfig{\n\t\t&AssetConfig{\n\t\t\t// directory containing source code and package.json\n\t\t\tPath: jsii.String(\"example-app\"),\n\t\t\tExclude: []*string{\n\t\t\t\tjsii.String(\"dist\"),\n\t\t\t\tjsii.String(\"node_modules\"),\n\t\t\t},\n\t\t\tCommands: []*string{\n\t\t\t\tjsii.String(\"npm install\"),\n\t\t\t},\n\t\t},\n\t\t&AssetConfig{\n\t\t\t// directory that is also required for the build\n\t\t\tPath: jsii.String(\"module1\"),\n\t\t},\n\t},\n\tDestinationBucket: DestinationBucket,\n\tDistribution: Distribution,\n\tOutputSourceDirectory: jsii.String(\"dist\"),\n})","version":"1"},"$":{"source":"new NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n // directory containing source code and package.json\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n commands: ['npm install'],\n },\n {\n // directory that is also required for the build\n path: 'module1',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":52}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.NodejsBuild","@cdklabs/deploy-time-build.NodejsBuildProps","aws-cdk-lib.aws_cloudfront.IDistribution","aws-cdk-lib.aws_s3.IBucket","constructs.Construct"],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { NodejsBuild, CacheType, ComputeType } from '@cdklabs/deploy-time-build';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n // directory containing source code and package.json\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n commands: ['npm install'],\n },\n {\n // directory that is also required for the build\n path: 'module1',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":7,"80":9,"110":1,"210":3,"211":3,"215":1,"245":1,"304":6,"305":2},"fqnsFingerprint":"2aa87b2a825af421f03a94064dd65e89edda59cce4d1a9604199e108f0c050b6"},"57c4f1e95406cffad4eca47374a253fcf144b129352834b84fe4ce6ce9e3da1d":{"translations":{"python":{"source":"# some_bucket: s3.IBucket\n# build: NodejsBuild\n\nsome_bucket.grant_read_write(build)","version":"2"},"csharp":{"source":"IBucket someBucket;\nNodejsBuild build;\n\nsomeBucket.GrantReadWrite(build);","version":"1"},"java":{"source":"IBucket someBucket;\nNodejsBuild build;\n\nsomeBucket.grantReadWrite(build);","version":"1"},"go":{"source":"var someBucket IBucket\nvar build NodejsBuild\n\nsomeBucket.GrantReadWrite(build)","version":"1"},"$":{"source":"declare const someBucket: s3.IBucket;\ndeclare const build: NodejsBuild;\nsomeBucket.grantReadWrite(build);","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":92}},"didCompile":true,"fqnsReferenced":["aws-cdk-lib.aws_iam.IGrantable","aws-cdk-lib.aws_s3.IBucket#grantReadWrite"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\ndeclare const someBucket: s3.IBucket;\ndeclare const build: NodejsBuild;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { NodejsBuild, CacheType, ComputeType } from '@cdklabs/deploy-time-build';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\nsomeBucket.grantReadWrite(build);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"80":8,"138":2,"167":1,"184":2,"212":1,"214":1,"244":2,"245":1,"261":2,"262":2,"308":1},"fqnsFingerprint":"c04a359ccd17c4ce38c71752edeca6657c59c603cbac00a70dd89b708aeb3861"},"cd56982b16eadc2c93e7a07a2ce081e37678697c7e9ecfeccf336ffaa75877b0":{"translations":{"python":{"source":"# build: NodejsBuild\n\niam.Grant.add_to_principal(grantee=build, actions=[\"s3:ListBucket\"], resource_arns=[\"*\"])","version":"2"},"csharp":{"source":"NodejsBuild build;\n\nGrant.AddToPrincipal(new GrantOnPrincipalOptions { Grantee = build, Actions = new [] { \"s3:ListBucket\" }, ResourceArns = new [] { \"*\" } });","version":"1"},"java":{"source":"NodejsBuild build;\n\nGrant.addToPrincipal(GrantOnPrincipalOptions.builder().grantee(build).actions(List.of(\"s3:ListBucket\")).resourceArns(List.of(\"*\")).build());","version":"1"},"go":{"source":"var build NodejsBuild\n\niam.Grant_AddToPrincipal(&GrantOnPrincipalOptions{\n\tGrantee: build,\n\tActions: []*string{\n\t\tjsii.String(\"s3:ListBucket\"),\n\t},\n\tResourceArns: []*string{\n\t\tjsii.String(\"*\"),\n\t},\n})","version":"1"},"$":{"source":"declare const build: NodejsBuild;\niam.Grant.addToPrincipal({ grantee: build, actions: ['s3:ListBucket'], resourceArns:['*'] })","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":100}},"didCompile":true,"fqnsReferenced":["aws-cdk-lib.aws_iam.Grant","aws-cdk-lib.aws_iam.Grant#addToPrincipal","aws-cdk-lib.aws_iam.GrantOnPrincipalOptions","aws-cdk-lib.aws_iam.IGrantable"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\ndeclare const build: NodejsBuild;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { NodejsBuild, CacheType, ComputeType } from '@cdklabs/deploy-time-build';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\niam.Grant.addToPrincipal({ grantee: build, actions: ['s3:ListBucket'], resourceArns:['*'] })\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":2,"80":9,"138":1,"184":1,"210":2,"211":1,"212":2,"214":1,"244":1,"245":1,"261":1,"262":1,"304":3,"308":1},"fqnsFingerprint":"f0f52e6409e416e29fafa429de473262080fac9c74b9ae991b8e740d74556893"},"c3b4ba4f88afe00be36e4c6feeb0a65adb359788c19cee076dd9f736f98018a2":{"translations":{"python":{"source":"from cdklabs.deploy_time_build import AssetConfig\nNodejsBuild(self, \"ExampleBuild\",\n assets=[AssetConfig(\n path=\"example-app\",\n exclude=[\"dist\", \"node_modules\"]\n )\n ],\n destination_bucket=destination_bucket,\n output_source_directory=\"dist\",\n cache=CacheType.S3\n)","version":"2"},"csharp":{"source":"new NodejsBuild(this, \"ExampleBuild\", new NodejsBuildProps {\n Assets = new [] { new AssetConfig {\n Path = \"example-app\",\n Exclude = new [] { \"dist\", \"node_modules\" }\n } },\n DestinationBucket = destinationBucket,\n OutputSourceDirectory = \"dist\",\n Cache = CacheType.S3\n});","version":"1"},"java":{"source":"NodejsBuild.Builder.create(this, \"ExampleBuild\")\n .assets(List.of(AssetConfig.builder()\n .path(\"example-app\")\n .exclude(List.of(\"dist\", \"node_modules\"))\n .build()))\n .destinationBucket(destinationBucket)\n .outputSourceDirectory(\"dist\")\n .cache(CacheType.S3)\n .build();","version":"1"},"go":{"source":"cdklabsdeploytimebuild.NewNodejsBuild(this, jsii.String(\"ExampleBuild\"), &NodejsBuildProps{\n\tAssets: []AssetConfig{\n\t\t&AssetConfig{\n\t\t\tPath: jsii.String(\"example-app\"),\n\t\t\tExclude: []*string{\n\t\t\t\tjsii.String(\"dist\"),\n\t\t\t\tjsii.String(\"node_modules\"),\n\t\t\t},\n\t\t},\n\t},\n\tDestinationBucket: DestinationBucket,\n\tOutputSourceDirectory: jsii.String(\"dist\"),\n\tCache: *cdklabsdeploytimebuild.CacheType_S3,\n})","version":"1"},"$":{"source":"new NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n outputSourceDirectory: 'dist',\n cache: CacheType.S3, // or CacheType.LOCAL\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":114}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.CacheType","@cdklabs/deploy-time-build.CacheType#S3","@cdklabs/deploy-time-build.NodejsBuild","@cdklabs/deploy-time-build.NodejsBuildProps","aws-cdk-lib.aws_s3.IBucket","constructs.Construct"],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { NodejsBuild, CacheType, ComputeType } from '@cdklabs/deploy-time-build';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n outputSourceDirectory: 'dist',\n cache: CacheType.S3, // or CacheType.LOCAL\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":5,"80":9,"110":1,"210":2,"211":2,"212":1,"215":1,"245":1,"304":5,"305":1},"fqnsFingerprint":"094a0d0f146600072ceb317ed656f5177129549ab5d1f8f1ac293b5b85502b22"},"b6f5ab3c4527977e95b37e6633f5b038c325679cbd41d197f5af2ddb7a8102e4":{"translations":{"python":{"source":"from cdklabs.deploy_time_build import AssetConfig\nNodejsBuild(self, \"ExampleBuild\",\n assets=[AssetConfig(\n path=\"example-app\",\n exclude=[\"dist\", \"node_modules\"]\n )\n ],\n destination_bucket=destination_bucket,\n output_source_directory=\"dist\",\n compute_type=ComputeType.MEDIUM\n)","version":"2"},"csharp":{"source":"new NodejsBuild(this, \"ExampleBuild\", new NodejsBuildProps {\n Assets = new [] { new AssetConfig {\n Path = \"example-app\",\n Exclude = new [] { \"dist\", \"node_modules\" }\n } },\n DestinationBucket = destinationBucket,\n OutputSourceDirectory = \"dist\",\n ComputeType = ComputeType.MEDIUM\n});","version":"1"},"java":{"source":"NodejsBuild.Builder.create(this, \"ExampleBuild\")\n .assets(List.of(AssetConfig.builder()\n .path(\"example-app\")\n .exclude(List.of(\"dist\", \"node_modules\"))\n .build()))\n .destinationBucket(destinationBucket)\n .outputSourceDirectory(\"dist\")\n .computeType(ComputeType.MEDIUM)\n .build();","version":"1"},"go":{"source":"cdklabsdeploytimebuild.NewNodejsBuild(this, jsii.String(\"ExampleBuild\"), &NodejsBuildProps{\n\tAssets: []AssetConfig{\n\t\t&AssetConfig{\n\t\t\tPath: jsii.String(\"example-app\"),\n\t\t\tExclude: []*string{\n\t\t\t\tjsii.String(\"dist\"),\n\t\t\t\tjsii.String(\"node_modules\"),\n\t\t\t},\n\t\t},\n\t},\n\tDestinationBucket: DestinationBucket,\n\tOutputSourceDirectory: jsii.String(\"dist\"),\n\tComputeType: *cdklabsdeploytimebuild.ComputeType_MEDIUM,\n})","version":"1"},"$":{"source":"new NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n outputSourceDirectory: 'dist',\n computeType: ComputeType.MEDIUM,\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":136}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.NodejsBuild","@cdklabs/deploy-time-build.NodejsBuildProps","aws-cdk-lib.aws_codebuild.ComputeType","aws-cdk-lib.aws_codebuild.ComputeType#MEDIUM","aws-cdk-lib.aws_s3.IBucket","constructs.Construct"],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { NodejsBuild, CacheType, ComputeType } from '@cdklabs/deploy-time-build';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: 'example-app',\n exclude: ['dist', 'node_modules'],\n },\n ],\n destinationBucket,\n outputSourceDirectory: 'dist',\n computeType: ComputeType.MEDIUM,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":5,"80":9,"110":1,"210":2,"211":2,"212":1,"215":1,"245":1,"304":5,"305":1},"fqnsFingerprint":"d7974a07d861b1e20b9202987260c9d5dfc69709a1c5f82a6a073e356388dac3"},"d125b8c849264f486e19f9a39ee88a8bf15d6441b387d1c5ca8b34d9468b0b2e":{"translations":{"python":{"source":"from cdklabs.deploy_time_build import AssetConfig\nNodejsBuild(self, \"ExampleBuild\",\n assets=[AssetConfig(\n path=\"../frontend\",\n exclude=[\"node_modules\", \"dist\"],\n commands=[\"npm ci\"],\n # Set a fixed string as a asset hash to prevent deploying changes.\n # This can be useful for an environment you use to develop locally.\n asset_hash=\"frontend_asset\"\n )\n ],\n destination_bucket=destination_bucket,\n distribution=distribution,\n output_source_directory=\"dist\"\n)","version":"2"},"csharp":{"source":"new NodejsBuild(this, \"ExampleBuild\", new NodejsBuildProps {\n Assets = new [] { new AssetConfig {\n Path = \"../frontend\",\n Exclude = new [] { \"node_modules\", \"dist\" },\n Commands = new [] { \"npm ci\" },\n // Set a fixed string as a asset hash to prevent deploying changes.\n // This can be useful for an environment you use to develop locally.\n AssetHash = \"frontend_asset\"\n } },\n DestinationBucket = destinationBucket,\n Distribution = distribution,\n OutputSourceDirectory = \"dist\"\n});","version":"1"},"java":{"source":"NodejsBuild.Builder.create(this, \"ExampleBuild\")\n .assets(List.of(AssetConfig.builder()\n .path(\"../frontend\")\n .exclude(List.of(\"node_modules\", \"dist\"))\n .commands(List.of(\"npm ci\"))\n // Set a fixed string as a asset hash to prevent deploying changes.\n // This can be useful for an environment you use to develop locally.\n .assetHash(\"frontend_asset\")\n .build()))\n .destinationBucket(destinationBucket)\n .distribution(distribution)\n .outputSourceDirectory(\"dist\")\n .build();","version":"1"},"go":{"source":"cdklabsdeploytimebuild.NewNodejsBuild(this, jsii.String(\"ExampleBuild\"), &NodejsBuildProps{\n\tAssets: []AssetConfig{\n\t\t&AssetConfig{\n\t\t\tPath: jsii.String(\"../frontend\"),\n\t\t\tExclude: []*string{\n\t\t\t\tjsii.String(\"node_modules\"),\n\t\t\t\tjsii.String(\"dist\"),\n\t\t\t},\n\t\t\tCommands: []*string{\n\t\t\t\tjsii.String(\"npm ci\"),\n\t\t\t},\n\t\t\t// Set a fixed string as a asset hash to prevent deploying changes.\n\t\t\t// This can be useful for an environment you use to develop locally.\n\t\t\tAssetHash: jsii.String(\"frontend_asset\"),\n\t\t},\n\t},\n\tDestinationBucket: DestinationBucket,\n\tDistribution: Distribution,\n\tOutputSourceDirectory: jsii.String(\"dist\"),\n})","version":"1"},"$":{"source":"new NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: '../frontend',\n exclude: ['node_modules', 'dist'],\n commands: ['npm ci'],\n // Set a fixed string as a asset hash to prevent deploying changes.\n // This can be useful for an environment you use to develop locally.\n assetHash: 'frontend_asset',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":155}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.NodejsBuild","@cdklabs/deploy-time-build.NodejsBuildProps","aws-cdk-lib.aws_cloudfront.IDistribution","aws-cdk-lib.aws_s3.IBucket","constructs.Construct"],"fullSource":"// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { NodejsBuild, CacheType, ComputeType } from '@cdklabs/deploy-time-build';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew NodejsBuild(this, 'ExampleBuild', {\n assets: [\n {\n path: '../frontend',\n exclude: ['node_modules', 'dist'],\n commands: ['npm ci'],\n // Set a fixed string as a asset hash to prevent deploying changes.\n // This can be useful for an environment you use to develop locally.\n assetHash: 'frontend_asset',\n },\n ],\n destinationBucket,\n distribution,\n outputSourceDirectory: 'dist',\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":7,"80":9,"110":1,"210":3,"211":2,"215":1,"245":1,"304":6,"305":2},"fqnsFingerprint":"2aa87b2a825af421f03a94064dd65e89edda59cce4d1a9604199e108f0c050b6"},"d39d7604898e274a032131443e89b8fdb7699b96fd9d7c643a97a5bc5f94740e":{"translations":{"python":{"source":"from aws_cdk.aws_ecs import RuntimePlatform\nfrom cdklabs.deploy_time_build import ContainerImageBuild\n\n\nimage = ContainerImageBuild(self, \"Build\",\n directory=\"example-image\",\n build_args={\"DUMMY_FILE_SIZE_MB\": \"15\"},\n tag=\"my-image-tag\"\n)\nDockerImageFunction(self, \"Function\",\n code=image.to_lambda_docker_image_code()\n)\narm_image = ContainerImageBuild(self, \"BuildArm\",\n directory=\"example-image\",\n platform=Platform.LINUX_ARM64,\n repository=image.repository,\n zstd_compression=True\n)\nFargateTaskDefinition(self, \"TaskDefinition\",\n runtime_platform=RuntimePlatform(cpu_architecture=CpuArchitecture.ARM64)\n).add_container(\"main\",\n image=arm_image.to_ecs_docker_image_code()\n)","version":"2"},"csharp":{"source":"using Cdklabs.Deploy.Time.Build;\n\n\nvar image = new ContainerImageBuild(this, \"Build\", new ContainerImageBuildProps {\n Directory = \"example-image\",\n BuildArgs = new Dictionary<string, string> { { \"DUMMY_FILE_SIZE_MB\", \"15\" } },\n Tag = \"my-image-tag\"\n});\nnew DockerImageFunction(this, \"Function\", new DockerImageFunctionProps {\n Code = image.ToLambdaDockerImageCode()\n});\nvar armImage = new ContainerImageBuild(this, \"BuildArm\", new ContainerImageBuildProps {\n Directory = \"example-image\",\n Platform = Platform.LINUX_ARM64,\n Repository = image.Repository,\n ZstdCompression = true\n});\nnew FargateTaskDefinition(this, \"TaskDefinition\", new FargateTaskDefinitionProps {\n RuntimePlatform = new RuntimePlatform { CpuArchitecture = CpuArchitecture.ARM64 }\n}).AddContainer(\"main\", new ContainerDefinitionOptions {\n Image = armImage.ToEcsDockerImageCode()\n});","version":"1"},"java":{"source":"import cdklabs.deploy.time.build.ContainerImageBuild;\n\n\nContainerImageBuild image = ContainerImageBuild.Builder.create(this, \"Build\")\n .directory(\"example-image\")\n .buildArgs(Map.of(\"DUMMY_FILE_SIZE_MB\", \"15\"))\n .tag(\"my-image-tag\")\n .build();\nDockerImageFunction.Builder.create(this, \"Function\")\n .code(image.toLambdaDockerImageCode())\n .build();\nContainerImageBuild armImage = ContainerImageBuild.Builder.create(this, \"BuildArm\")\n .directory(\"example-image\")\n .platform(Platform.LINUX_ARM64)\n .repository(image.getRepository())\n .zstdCompression(true)\n .build();\nFargateTaskDefinition.Builder.create(this, \"TaskDefinition\")\n .runtimePlatform(RuntimePlatform.builder().cpuArchitecture(CpuArchitecture.ARM64).build())\n .build().addContainer(\"main\", ContainerDefinitionOptions.builder()\n .image(armImage.toEcsDockerImageCode())\n .build());","version":"1"},"go":{"source":"import \"github.com/aws-samples/dummy/cdklabsdeploytimebuild\"\n\n\nimage := cdklabsdeploytimebuild.NewContainerImageBuild(this, jsii.String(\"Build\"), &ContainerImageBuildProps{\n\tDirectory: jsii.String(\"example-image\"),\n\tBuildArgs: map[string]*string{\n\t\t\"DUMMY_FILE_SIZE_MB\": jsii.String(\"15\"),\n\t},\n\tTag: jsii.String(\"my-image-tag\"),\n})\nawscdk.NewDockerImageFunction(this, jsii.String(\"Function\"), &DockerImageFunctionProps{\n\tCode: image.ToLambdaDockerImageCode(),\n})\narmImage := cdklabsdeploytimebuild.NewContainerImageBuild(this, jsii.String(\"BuildArm\"), &ContainerImageBuildProps{\n\tDirectory: jsii.String(\"example-image\"),\n\tPlatform: awscdk.Platform_LINUX_ARM64(),\n\tRepository: image.Repository,\n\tZstdCompression: jsii.Boolean(true),\n})\nawscdk.NewFargateTaskDefinition(this, jsii.String(\"TaskDefinition\"), &FargateTaskDefinitionProps{\n\tRuntimePlatform: &RuntimePlatform{\n\t\tCpuArchitecture: awscdk.CpuArchitecture_ARM64(),\n\t},\n}).AddContainer(jsii.String(\"main\"), &ContainerDefinitionOptions{\n\tImage: armImage.ToEcsDockerImageCode(),\n})","version":"1"},"$":{"source":"import { ContainerImageBuild } from '@cdklabs/deploy-time-build';\n\nconst image = new ContainerImageBuild(this, 'Build', {\n directory: 'example-image',\n buildArgs: { DUMMY_FILE_SIZE_MB: '15' },\n tag: 'my-image-tag',\n});\nnew DockerImageFunction(this, 'Function', {\n code: image.toLambdaDockerImageCode(),\n});\nconst armImage = new ContainerImageBuild(this, 'BuildArm', {\n directory: 'example-image',\n platform: Platform.LINUX_ARM64,\n repository: image.repository,\n zstdCompression: true,\n});\nnew FargateTaskDefinition(this, 'TaskDefinition', {\n runtimePlatform: { cpuArchitecture: CpuArchitecture.ARM64 }\n}).addContainer('main', {\n image: armImage.toEcsDockerImageCode(),\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":176}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.ContainerImageBuild","@cdklabs/deploy-time-build.ContainerImageBuild#repository","@cdklabs/deploy-time-build.ContainerImageBuild#toEcsDockerImageCode","@cdklabs/deploy-time-build.ContainerImageBuild#toLambdaDockerImageCode","@cdklabs/deploy-time-build.ContainerImageBuildProps","aws-cdk-lib.aws_ecr.IRepository","aws-cdk-lib.aws_ecr_assets.Platform","aws-cdk-lib.aws_ecr_assets.Platform#LINUX_ARM64","aws-cdk-lib.aws_ecs.ContainerDefinitionOptions","aws-cdk-lib.aws_ecs.ContainerImage","aws-cdk-lib.aws_ecs.CpuArchitecture","aws-cdk-lib.aws_ecs.CpuArchitecture#ARM64","aws-cdk-lib.aws_ecs.FargateTaskDefinition","aws-cdk-lib.aws_ecs.FargateTaskDefinitionProps","aws-cdk-lib.aws_ecs.RuntimePlatform","aws-cdk-lib.aws_ecs.TaskDefinition#addContainer","aws-cdk-lib.aws_lambda.DockerImageCode","aws-cdk-lib.aws_lambda.DockerImageFunction","aws-cdk-lib.aws_lambda.DockerImageFunctionProps","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { ContainerImageBuild } from '@cdklabs/deploy-time-build';\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst image = new ContainerImageBuild(this, 'Build', {\n directory: 'example-image',\n buildArgs: { DUMMY_FILE_SIZE_MB: '15' },\n tag: 'my-image-tag',\n});\nnew DockerImageFunction(this, 'Function', {\n code: image.toLambdaDockerImageCode(),\n});\nconst armImage = new ContainerImageBuild(this, 'BuildArm', {\n directory: 'example-image',\n platform: Platform.LINUX_ARM64,\n repository: image.repository,\n zstdCompression: true,\n});\nnew FargateTaskDefinition(this, 'TaskDefinition', {\n runtimePlatform: { cpuArchitecture: CpuArchitecture.ARM64 }\n}).addContainer('main', {\n image: armImage.toEcsDockerImageCode(),\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":10,"80":30,"110":4,"112":1,"211":7,"212":6,"214":3,"215":4,"244":2,"245":2,"261":2,"262":2,"273":1,"274":1,"276":1,"277":1,"304":12,"308":1},"fqnsFingerprint":"907854e816a7aea78483a10d546d1d76969e608020786f9f7401f4d185b3b6cd"},"0edbf109619b58eea09faf5bb83f6c21aac7ae7cfb5cae9b7bf6f2d9aa25fe5e":{"translations":{"python":{"source":"from cdklabs.deploy_time_build import SociIndexV2Build\n\n\nasset = DockerImageAsset(self, \"Image\", directory=\"example-image\")\nsoci_index = SociIndexV2Build(self, \"SociV2Index\",\n repository=asset.repository,\n input_image_tag=asset.asset_hash,\n output_image_tag=f\"{asset.assetHash}-soci\"\n)\n\n# Use with ECS Fargate\ntask_definition = FargateTaskDefinition(self, \"TaskDefinition\")\ntask_definition.add_container(\"main\",\n image=soci_index.to_ecs_docker_image_code()\n)\n\n# Or create from DockerImageAsset using utility method\nsoci_index_from_asset = SociIndexV2Build.from_docker_image_asset(self, \"SociV2Index2\", asset)","version":"2"},"csharp":{"source":"using Cdklabs.Deploy.Time.Build;\n\n\nvar asset = new DockerImageAsset(this, \"Image\", new DockerImageAssetProps { Directory = \"example-image\" });\nvar sociIndex = new SociIndexV2Build(this, \"SociV2Index\", new SociIndexV2BuildProps {\n Repository = asset.Repository,\n InputImageTag = asset.AssetHash,\n OutputImageTag = $\"{asset.assetHash}-soci\"\n});\n\n// Use with ECS Fargate\nvar taskDefinition = new FargateTaskDefinition(this, \"TaskDefinition\");\ntaskDefinition.AddContainer(\"main\", new ContainerDefinitionOptions {\n Image = sociIndex.ToEcsDockerImageCode()\n});\n\n// Or create from DockerImageAsset using utility method\nvar sociIndexFromAsset = SociIndexV2Build.FromDockerImageAsset(this, \"SociV2Index2\", asset);","version":"1"},"java":{"source":"import cdklabs.deploy.time.build.SociIndexV2Build;\n\n\nDockerImageAsset asset = DockerImageAsset.Builder.create(this, \"Image\").directory(\"example-image\").build();\nSociIndexV2Build sociIndex = SociIndexV2Build.Builder.create(this, \"SociV2Index\")\n .repository(asset.getRepository())\n .inputImageTag(asset.getAssetHash())\n .outputImageTag(String.format(\"%s-soci\", asset.getAssetHash()))\n .build();\n\n// Use with ECS Fargate\nFargateTaskDefinition taskDefinition = new FargateTaskDefinition(this, \"TaskDefinition\");\ntaskDefinition.addContainer(\"main\", ContainerDefinitionOptions.builder()\n .image(sociIndex.toEcsDockerImageCode())\n .build());\n\n// Or create from DockerImageAsset using utility method\nSociIndexV2Build sociIndexFromAsset = SociIndexV2Build.fromDockerImageAsset(this, \"SociV2Index2\", asset);","version":"1"},"go":{"source":"import \"github.com/aws-samples/dummy/cdklabsdeploytimebuild\"\n\n\nasset := awscdk.NewDockerImageAsset(this, jsii.String(\"Image\"), &DockerImageAssetProps{\n\tDirectory: jsii.String(\"example-image\"),\n})\nsociIndex := cdklabsdeploytimebuild.NewSociIndexV2Build(this, jsii.String(\"SociV2Index\"), &SociIndexV2BuildProps{\n\tRepository: asset.Repository,\n\tInputImageTag: asset.AssetHash,\n\tOutputImageTag: fmt.Sprintf(\"%v-soci\", asset.*AssetHash),\n})\n\n// Use with ECS Fargate\ntaskDefinition := awscdk.NewFargateTaskDefinition(this, jsii.String(\"TaskDefinition\"))\ntaskDefinition.AddContainer(jsii.String(\"main\"), &ContainerDefinitionOptions{\n\tImage: sociIndex.ToEcsDockerImageCode(),\n})\n\n// Or create from DockerImageAsset using utility method\nsociIndexFromAsset := cdklabsdeploytimebuild.SociIndexV2Build_FromDockerImageAsset(this, jsii.String(\"SociV2Index2\"), asset)","version":"1"},"$":{"source":"import { SociIndexV2Build } from '@cdklabs/deploy-time-build';\n\nconst asset = new DockerImageAsset(this, 'Image', { directory: 'example-image' });\nconst sociIndex = new SociIndexV2Build(this, 'SociV2Index', {\n repository: asset.repository,\n inputImageTag: asset.assetHash,\n outputImageTag: `${asset.assetHash}-soci`,\n});\n\n// Use with ECS Fargate\nconst taskDefinition = new FargateTaskDefinition(this, 'TaskDefinition');\ntaskDefinition.addContainer('main', {\n image: sociIndex.toEcsDockerImageCode(),\n});\n\n// Or create from DockerImageAsset using utility method\nconst sociIndexFromAsset = SociIndexV2Build.fromDockerImageAsset(this, 'SociV2Index2', asset);","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@cdklabs/deploy-time-build"},"field":{"field":"markdown","line":209}},"didCompile":true,"fqnsReferenced":["@cdklabs/deploy-time-build.SociIndexV2Build","@cdklabs/deploy-time-build.SociIndexV2Build#fromDockerImageAsset","@cdklabs/deploy-time-build.SociIndexV2Build#toEcsDockerImageCode","@cdklabs/deploy-time-build.SociIndexV2BuildProps","aws-cdk-lib.aws_ecr.IRepository","aws-cdk-lib.aws_ecr_assets.DockerImageAsset","aws-cdk-lib.aws_ecr_assets.DockerImageAsset#assetHash","aws-cdk-lib.aws_ecr_assets.DockerImageAsset#repository","aws-cdk-lib.aws_ecr_assets.DockerImageAssetProps","aws-cdk-lib.aws_ecs.ContainerDefinitionOptions","aws-cdk-lib.aws_ecs.ContainerImage","aws-cdk-lib.aws_ecs.FargateTaskDefinition","aws-cdk-lib.aws_ecs.TaskDefinition#addContainer","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport { SociIndexV2Build } from '@cdklabs/deploy-time-build';\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport {\n Stack,\n} from 'aws-cdk-lib';\nimport { Platform, DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';\nimport { Cluster, FargateTaskDefinition, CpuArchitecture, AwsLogDriver } from 'aws-cdk-lib/aws-ecs';\nimport { DockerImageFunction } from 'aws-cdk-lib/aws-lambda';\nimport * as apigateway from 'aws-cdk-lib/aws-apigateway';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as iam from 'aws-cdk-lib/aws-iam';\n\ndeclare const api: apigateway.RestApi;\ndeclare const destinationBucket: s3.IBucket;\ndeclare const distribution: cloudfront.IDistribution;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst asset = new DockerImageAsset(this, 'Image', { directory: 'example-image' });\nconst sociIndex = new SociIndexV2Build(this, 'SociV2Index', {\n repository: asset.repository,\n inputImageTag: asset.assetHash,\n outputImageTag: `${asset.assetHash}-soci`,\n});\n\n// Use with ECS Fargate\nconst taskDefinition = new FargateTaskDefinition(this, 'TaskDefinition');\ntaskDefinition.addContainer('main', {\n image: sociIndex.toEcsDockerImageCode(),\n});\n\n// Or create from DockerImageAsset using utility method\nconst sociIndexFromAsset = SociIndexV2Build.fromDockerImageAsset(this, 'SociV2Index2', asset);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":7,"16":1,"18":1,"80":26,"110":4,"211":3,"212":6,"214":3,"215":3,"229":1,"240":1,"244":4,"245":1,"261":4,"262":4,"273":1,"274":1,"276":1,"277":1,"304":5,"308":1},"fqnsFingerprint":"d2ee8a950386ff153f6d29ad18cbd22ac20e48787a134985f4943fa610f1a788"}}}
|