@cdklabs/deploy-time-build 0.0.5 → 0.0.7
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 +223 -29
- package/.jsii.tabl.json +1 -1
- package/API.md +236 -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 +4 -12
- package/rosetta/imported.ts-fixture +1 -1
- package/scripts/verify-min-cdk.sh +28 -0
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.32","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"}}}
|
package/API.md
CHANGED
|
@@ -47,6 +47,7 @@ new ContainerImageBuild(scope: Construct, id: string, props: ContainerImageBuild
|
|
|
47
47
|
| **Name** | **Description** |
|
|
48
48
|
| --- | --- |
|
|
49
49
|
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
50
|
+
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.with">with</a></code> | Applies one or more mixins to this construct. |
|
|
50
51
|
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.toEcsDockerImageCode">toEcsDockerImageCode</a></code> | Get the instance of {@link ContainerImage} for an ECS task definition. |
|
|
51
52
|
| <code><a href="#@cdklabs/deploy-time-build.ContainerImageBuild.toLambdaDockerImageCode">toLambdaDockerImageCode</a></code> | Get the instance of {@link DockerImageCode} for a Lambda function image. |
|
|
52
53
|
|
|
@@ -60,6 +61,27 @@ public toString(): string
|
|
|
60
61
|
|
|
61
62
|
Returns a string representation of this construct.
|
|
62
63
|
|
|
64
|
+
##### `with` <a name="with" id="@cdklabs/deploy-time-build.ContainerImageBuild.with"></a>
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
public with(mixins: ...IMixin[]): IConstruct
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Applies one or more mixins to this construct.
|
|
71
|
+
|
|
72
|
+
Mixins are applied in order. The list of constructs is captured at the
|
|
73
|
+
start of the call, so constructs added by a mixin will not be visited.
|
|
74
|
+
Use multiple `with()` calls if subsequent mixins should apply to added
|
|
75
|
+
constructs.
|
|
76
|
+
|
|
77
|
+
###### `mixins`<sup>Required</sup> <a name="mixins" id="@cdklabs/deploy-time-build.ContainerImageBuild.with.parameter.mixins"></a>
|
|
78
|
+
|
|
79
|
+
- *Type:* ...constructs.IMixin[]
|
|
80
|
+
|
|
81
|
+
The mixins to apply.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
63
85
|
##### `toEcsDockerImageCode` <a name="toEcsDockerImageCode" id="@cdklabs/deploy-time-build.ContainerImageBuild.toEcsDockerImageCode"></a>
|
|
64
86
|
|
|
65
87
|
```typescript
|
|
@@ -236,6 +258,7 @@ new NodejsBuild(scope: Construct, id: string, props: NodejsBuildProps)
|
|
|
236
258
|
| **Name** | **Description** |
|
|
237
259
|
| --- | --- |
|
|
238
260
|
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuild.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
261
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuild.with">with</a></code> | Applies one or more mixins to this construct. |
|
|
239
262
|
|
|
240
263
|
---
|
|
241
264
|
|
|
@@ -247,6 +270,27 @@ public toString(): string
|
|
|
247
270
|
|
|
248
271
|
Returns a string representation of this construct.
|
|
249
272
|
|
|
273
|
+
##### `with` <a name="with" id="@cdklabs/deploy-time-build.NodejsBuild.with"></a>
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
public with(mixins: ...IMixin[]): IConstruct
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Applies one or more mixins to this construct.
|
|
280
|
+
|
|
281
|
+
Mixins are applied in order. The list of constructs is captured at the
|
|
282
|
+
start of the call, so constructs added by a mixin will not be visited.
|
|
283
|
+
Use multiple `with()` calls if subsequent mixins should apply to added
|
|
284
|
+
constructs.
|
|
285
|
+
|
|
286
|
+
###### `mixins`<sup>Required</sup> <a name="mixins" id="@cdklabs/deploy-time-build.NodejsBuild.with.parameter.mixins"></a>
|
|
287
|
+
|
|
288
|
+
- *Type:* ...constructs.IMixin[]
|
|
289
|
+
|
|
290
|
+
The mixins to apply.
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
250
294
|
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
251
295
|
|
|
252
296
|
| **Name** | **Description** |
|
|
@@ -367,6 +411,7 @@ new SociIndexBuild(scope: Construct, id: string, props: SociIndexBuildProps)
|
|
|
367
411
|
| **Name** | **Description** |
|
|
368
412
|
| --- | --- |
|
|
369
413
|
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuild.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
414
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexBuild.with">with</a></code> | Applies one or more mixins to this construct. |
|
|
370
415
|
|
|
371
416
|
---
|
|
372
417
|
|
|
@@ -378,6 +423,27 @@ public toString(): string
|
|
|
378
423
|
|
|
379
424
|
Returns a string representation of this construct.
|
|
380
425
|
|
|
426
|
+
##### ~~`with`~~ <a name="with" id="@cdklabs/deploy-time-build.SociIndexBuild.with"></a>
|
|
427
|
+
|
|
428
|
+
```typescript
|
|
429
|
+
public with(mixins: ...IMixin[]): IConstruct
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
Applies one or more mixins to this construct.
|
|
433
|
+
|
|
434
|
+
Mixins are applied in order. The list of constructs is captured at the
|
|
435
|
+
start of the call, so constructs added by a mixin will not be visited.
|
|
436
|
+
Use multiple `with()` calls if subsequent mixins should apply to added
|
|
437
|
+
constructs.
|
|
438
|
+
|
|
439
|
+
###### `mixins`<sup>Required</sup> <a name="mixins" id="@cdklabs/deploy-time-build.SociIndexBuild.with.parameter.mixins"></a>
|
|
440
|
+
|
|
441
|
+
- *Type:* ...constructs.IMixin[]
|
|
442
|
+
|
|
443
|
+
The mixins to apply.
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
381
447
|
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
382
448
|
|
|
383
449
|
| **Name** | **Description** |
|
|
@@ -517,6 +583,7 @@ new SociIndexV2Build(scope: Construct, id: string, props: SociIndexV2BuildProps)
|
|
|
517
583
|
| **Name** | **Description** |
|
|
518
584
|
| --- | --- |
|
|
519
585
|
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.toString">toString</a></code> | Returns a string representation of this construct. |
|
|
586
|
+
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.with">with</a></code> | Applies one or more mixins to this construct. |
|
|
520
587
|
| <code><a href="#@cdklabs/deploy-time-build.SociIndexV2Build.toEcsDockerImageCode">toEcsDockerImageCode</a></code> | Get the instance of image embedded with SOCI v2 index for an ECS task definition. |
|
|
521
588
|
|
|
522
589
|
---
|
|
@@ -529,6 +596,27 @@ public toString(): string
|
|
|
529
596
|
|
|
530
597
|
Returns a string representation of this construct.
|
|
531
598
|
|
|
599
|
+
##### `with` <a name="with" id="@cdklabs/deploy-time-build.SociIndexV2Build.with"></a>
|
|
600
|
+
|
|
601
|
+
```typescript
|
|
602
|
+
public with(mixins: ...IMixin[]): IConstruct
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
Applies one or more mixins to this construct.
|
|
606
|
+
|
|
607
|
+
Mixins are applied in order. The list of constructs is captured at the
|
|
608
|
+
start of the call, so constructs added by a mixin will not be visited.
|
|
609
|
+
Use multiple `with()` calls if subsequent mixins should apply to added
|
|
610
|
+
constructs.
|
|
611
|
+
|
|
612
|
+
###### `mixins`<sup>Required</sup> <a name="mixins" id="@cdklabs/deploy-time-build.SociIndexV2Build.with.parameter.mixins"></a>
|
|
613
|
+
|
|
614
|
+
- *Type:* ...constructs.IMixin[]
|
|
615
|
+
|
|
616
|
+
The mixins to apply.
|
|
617
|
+
|
|
618
|
+
---
|
|
619
|
+
|
|
532
620
|
##### `toEcsDockerImageCode` <a name="toEcsDockerImageCode" id="@cdklabs/deploy-time-build.SociIndexV2Build.toEcsDockerImageCode"></a>
|
|
533
621
|
|
|
534
622
|
```typescript
|
|
@@ -1408,6 +1496,8 @@ const nodejsBuildProps: NodejsBuildProps = { ... }
|
|
|
1408
1496
|
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.outputSourceDirectory">outputSourceDirectory</a></code> | <code>string</code> | Relative path from the working directory to the directory where the build artifacts are output. |
|
|
1409
1497
|
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.buildCommands">buildCommands</a></code> | <code>string[]</code> | Shell commands to build your project. |
|
|
1410
1498
|
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.buildEnvironment">buildEnvironment</a></code> | <code>{[ key: string ]: string}</code> | Environment variables injected to the build environment. |
|
|
1499
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.cache">cache</a></code> | <code><a href="#@cdklabs/deploy-time-build.CacheType">CacheType</a></code> | Cache type for the npm cache directory. |
|
|
1500
|
+
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.computeType">computeType</a></code> | <code>aws-cdk-lib.aws_codebuild.ComputeType</code> | The type of compute to use for this build. |
|
|
1411
1501
|
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.destinationKeyPrefix">destinationKeyPrefix</a></code> | <code>string</code> | Key prefix to deploy your build artifact. |
|
|
1412
1502
|
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.distribution">distribution</a></code> | <code>aws-cdk-lib.aws_cloudfront.IDistribution</code> | The distribution you are using to publish you build artifact. |
|
|
1413
1503
|
| <code><a href="#@cdklabs/deploy-time-build.NodejsBuildProps.property.excludeCommonFiles">excludeCommonFiles</a></code> | <code>boolean</code> | If true, common unnecessary files/directories such as .DS_Store, .git, node_modules, etc are excluded from the assets by default. |
|
|
@@ -1483,6 +1573,32 @@ You can use CDK deploy-time values as well as literals.
|
|
|
1483
1573
|
|
|
1484
1574
|
---
|
|
1485
1575
|
|
|
1576
|
+
##### `cache`<sup>Optional</sup> <a name="cache" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.cache"></a>
|
|
1577
|
+
|
|
1578
|
+
```typescript
|
|
1579
|
+
public readonly cache: CacheType;
|
|
1580
|
+
```
|
|
1581
|
+
|
|
1582
|
+
- *Type:* <a href="#@cdklabs/deploy-time-build.CacheType">CacheType</a>
|
|
1583
|
+
- *Default:* No caching
|
|
1584
|
+
|
|
1585
|
+
Cache type for the npm cache directory.
|
|
1586
|
+
|
|
1587
|
+
---
|
|
1588
|
+
|
|
1589
|
+
##### `computeType`<sup>Optional</sup> <a name="computeType" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.computeType"></a>
|
|
1590
|
+
|
|
1591
|
+
```typescript
|
|
1592
|
+
public readonly computeType: ComputeType;
|
|
1593
|
+
```
|
|
1594
|
+
|
|
1595
|
+
- *Type:* aws-cdk-lib.aws_codebuild.ComputeType
|
|
1596
|
+
- *Default:* ComputeType.SMALL
|
|
1597
|
+
|
|
1598
|
+
The type of compute to use for this build.
|
|
1599
|
+
|
|
1600
|
+
---
|
|
1601
|
+
|
|
1486
1602
|
##### `destinationKeyPrefix`<sup>Optional</sup> <a name="destinationKeyPrefix" id="@cdklabs/deploy-time-build.NodejsBuildProps.property.destinationKeyPrefix"></a>
|
|
1487
1603
|
|
|
1488
1604
|
```typescript
|
|
@@ -1671,3 +1787,123 @@ The tag of the output container image embedded with SOCI index.
|
|
|
1671
1787
|
|
|
1672
1788
|
|
|
1673
1789
|
|
|
1790
|
+
## Enums <a name="Enums" id="Enums"></a>
|
|
1791
|
+
|
|
1792
|
+
### CacheType <a name="CacheType" id="@cdklabs/deploy-time-build.CacheType"></a>
|
|
1793
|
+
|
|
1794
|
+
Cache type for NodejsBuild.
|
|
1795
|
+
|
|
1796
|
+
#### Members <a name="Members" id="Members"></a>
|
|
1797
|
+
|
|
1798
|
+
| **Name** | **Description** |
|
|
1799
|
+
| --- | --- |
|
|
1800
|
+
| <code><a href="#@cdklabs/deploy-time-build.CacheType.S3">S3</a></code> | S3 caching. |
|
|
1801
|
+
| <code><a href="#@cdklabs/deploy-time-build.CacheType.LOCAL">LOCAL</a></code> | Local caching. |
|
|
1802
|
+
|
|
1803
|
+
---
|
|
1804
|
+
|
|
1805
|
+
##### `S3` <a name="S3" id="@cdklabs/deploy-time-build.CacheType.S3"></a>
|
|
1806
|
+
|
|
1807
|
+
S3 caching.
|
|
1808
|
+
|
|
1809
|
+
Stores the npm cache directory in an S3 bucket.
|
|
1810
|
+
Good for builds that run on different hosts.
|
|
1811
|
+
|
|
1812
|
+
---
|
|
1813
|
+
|
|
1814
|
+
|
|
1815
|
+
##### `LOCAL` <a name="LOCAL" id="@cdklabs/deploy-time-build.CacheType.LOCAL"></a>
|
|
1816
|
+
|
|
1817
|
+
Local caching.
|
|
1818
|
+
|
|
1819
|
+
Stores the npm cache directory on the build host.
|
|
1820
|
+
Faster than S3 but only effective if builds run on the same host.
|
|
1821
|
+
Not supported with VPC or certain compute types.
|
|
1822
|
+
|
|
1823
|
+
---
|
|
1824
|
+
|
|
1825
|
+
|
|
1826
|
+
### ComputeType <a name="ComputeType" id="@cdklabs/deploy-time-build.ComputeType"></a>
|
|
1827
|
+
|
|
1828
|
+
Build machine compute type.
|
|
1829
|
+
|
|
1830
|
+
> [https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types)
|
|
1831
|
+
|
|
1832
|
+
#### Members <a name="Members" id="Members"></a>
|
|
1833
|
+
|
|
1834
|
+
| **Name** | **Description** |
|
|
1835
|
+
| --- | --- |
|
|
1836
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.SMALL">SMALL</a></code> | *No description.* |
|
|
1837
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.MEDIUM">MEDIUM</a></code> | *No description.* |
|
|
1838
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.LARGE">LARGE</a></code> | *No description.* |
|
|
1839
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.X_LARGE">X_LARGE</a></code> | *No description.* |
|
|
1840
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.X2_LARGE">X2_LARGE</a></code> | *No description.* |
|
|
1841
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.LAMBDA_1GB">LAMBDA_1GB</a></code> | *No description.* |
|
|
1842
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.LAMBDA_2GB">LAMBDA_2GB</a></code> | *No description.* |
|
|
1843
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.LAMBDA_4GB">LAMBDA_4GB</a></code> | *No description.* |
|
|
1844
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.LAMBDA_8GB">LAMBDA_8GB</a></code> | *No description.* |
|
|
1845
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.LAMBDA_10GB">LAMBDA_10GB</a></code> | *No description.* |
|
|
1846
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.ATTRIBUTE_BASED">ATTRIBUTE_BASED</a></code> | *No description.* |
|
|
1847
|
+
| <code><a href="#@cdklabs/deploy-time-build.ComputeType.CUSTOM_INSTANCE_TYPE">CUSTOM_INSTANCE_TYPE</a></code> | *No description.* |
|
|
1848
|
+
|
|
1849
|
+
---
|
|
1850
|
+
|
|
1851
|
+
##### `SMALL` <a name="SMALL" id="@cdklabs/deploy-time-build.ComputeType.SMALL"></a>
|
|
1852
|
+
|
|
1853
|
+
---
|
|
1854
|
+
|
|
1855
|
+
|
|
1856
|
+
##### `MEDIUM` <a name="MEDIUM" id="@cdklabs/deploy-time-build.ComputeType.MEDIUM"></a>
|
|
1857
|
+
|
|
1858
|
+
---
|
|
1859
|
+
|
|
1860
|
+
|
|
1861
|
+
##### `LARGE` <a name="LARGE" id="@cdklabs/deploy-time-build.ComputeType.LARGE"></a>
|
|
1862
|
+
|
|
1863
|
+
---
|
|
1864
|
+
|
|
1865
|
+
|
|
1866
|
+
##### `X_LARGE` <a name="X_LARGE" id="@cdklabs/deploy-time-build.ComputeType.X_LARGE"></a>
|
|
1867
|
+
|
|
1868
|
+
---
|
|
1869
|
+
|
|
1870
|
+
|
|
1871
|
+
##### `X2_LARGE` <a name="X2_LARGE" id="@cdklabs/deploy-time-build.ComputeType.X2_LARGE"></a>
|
|
1872
|
+
|
|
1873
|
+
---
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
##### `LAMBDA_1GB` <a name="LAMBDA_1GB" id="@cdklabs/deploy-time-build.ComputeType.LAMBDA_1GB"></a>
|
|
1877
|
+
|
|
1878
|
+
---
|
|
1879
|
+
|
|
1880
|
+
|
|
1881
|
+
##### `LAMBDA_2GB` <a name="LAMBDA_2GB" id="@cdklabs/deploy-time-build.ComputeType.LAMBDA_2GB"></a>
|
|
1882
|
+
|
|
1883
|
+
---
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
##### `LAMBDA_4GB` <a name="LAMBDA_4GB" id="@cdklabs/deploy-time-build.ComputeType.LAMBDA_4GB"></a>
|
|
1887
|
+
|
|
1888
|
+
---
|
|
1889
|
+
|
|
1890
|
+
|
|
1891
|
+
##### `LAMBDA_8GB` <a name="LAMBDA_8GB" id="@cdklabs/deploy-time-build.ComputeType.LAMBDA_8GB"></a>
|
|
1892
|
+
|
|
1893
|
+
---
|
|
1894
|
+
|
|
1895
|
+
|
|
1896
|
+
##### `LAMBDA_10GB` <a name="LAMBDA_10GB" id="@cdklabs/deploy-time-build.ComputeType.LAMBDA_10GB"></a>
|
|
1897
|
+
|
|
1898
|
+
---
|
|
1899
|
+
|
|
1900
|
+
|
|
1901
|
+
##### `ATTRIBUTE_BASED` <a name="ATTRIBUTE_BASED" id="@cdklabs/deploy-time-build.ComputeType.ATTRIBUTE_BASED"></a>
|
|
1902
|
+
|
|
1903
|
+
---
|
|
1904
|
+
|
|
1905
|
+
|
|
1906
|
+
##### `CUSTOM_INSTANCE_TYPE` <a name="CUSTOM_INSTANCE_TYPE" id="@cdklabs/deploy-time-build.ComputeType.CUSTOM_INSTANCE_TYPE"></a>
|
|
1907
|
+
|
|
1908
|
+
---
|
|
1909
|
+
|
package/README.md
CHANGED
|
@@ -107,6 +107,46 @@ I talked about why this construct can be useful in some situations at CDK Day 20
|
|
|
107
107
|
|
|
108
108
|
[Recording](https://www.youtube.com/live/b-nSH18gFQk?si=ogEZ2x1NixOj6J6j&t=373) | [Slides](https://speakerdeck.com/tmokmss/deploy-web-frontend-apps-with-aws-cdk)
|
|
109
109
|
|
|
110
|
+
#### Caching
|
|
111
|
+
|
|
112
|
+
You can enable npm caching to speed up builds using the `cache` property:
|
|
113
|
+
|
|
114
|
+
```ts fixture=imported
|
|
115
|
+
new NodejsBuild(this, 'ExampleBuild', {
|
|
116
|
+
assets: [
|
|
117
|
+
{
|
|
118
|
+
path: 'example-app',
|
|
119
|
+
exclude: ['dist', 'node_modules'],
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
destinationBucket,
|
|
123
|
+
outputSourceDirectory: 'dist',
|
|
124
|
+
cache: CacheType.S3, // or CacheType.LOCAL
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Two cache types are available:
|
|
129
|
+
- `CacheType.S3`: Stores the npm cache directory in an S3 bucket. Good for builds that run infrequently on different hosts.
|
|
130
|
+
- `CacheType.LOCAL`: Stores the npm cache directory on the build host. Faster than S3 but only effective if builds run on the same host.
|
|
131
|
+
|
|
132
|
+
#### Compute Type
|
|
133
|
+
|
|
134
|
+
You can specify the compute type for the CodeBuild project using the `computeType` property:
|
|
135
|
+
|
|
136
|
+
```ts fixture=imported
|
|
137
|
+
new NodejsBuild(this, 'ExampleBuild', {
|
|
138
|
+
assets: [
|
|
139
|
+
{
|
|
140
|
+
path: 'example-app',
|
|
141
|
+
exclude: ['dist', 'node_modules'],
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
destinationBucket,
|
|
145
|
+
outputSourceDirectory: 'dist',
|
|
146
|
+
computeType: ComputeType.MEDIUM,
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
|
110
150
|
#### Considerations
|
|
111
151
|
Since 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).
|
|
112
152
|
|