agent-claw: automated task changes
This commit is contained in:
13
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/.jsiirc.json
generated
vendored
Normal file
13
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/.jsiirc.json
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"targets": {
|
||||
"java": {
|
||||
"package": "software.amazon.awscdk.services.ecr.assets"
|
||||
},
|
||||
"dotnet": {
|
||||
"namespace": "Amazon.CDK.AWS.Ecr.Assets"
|
||||
},
|
||||
"python": {
|
||||
"module": "aws_cdk.aws_ecr_assets"
|
||||
}
|
||||
}
|
||||
}
|
||||
286
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/README.md
generated
vendored
Normal file
286
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/README.md
generated
vendored
Normal file
@@ -0,0 +1,286 @@
|
||||
# AWS CDK Docker Image Assets
|
||||
|
||||
|
||||
This module allows bundling Docker images as assets.
|
||||
|
||||
## Images from Dockerfile
|
||||
|
||||
Images are built from a local Docker context directory (with a `Dockerfile`),
|
||||
uploaded to Amazon Elastic Container Registry (ECR) by the CDK toolkit
|
||||
and/or your app's CI/CD pipeline, and can be naturally referenced in your CDK app.
|
||||
|
||||
```ts
|
||||
import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
|
||||
const asset = new DockerImageAsset(this, 'MyBuildImage', {
|
||||
directory: path.join(__dirname, 'my-image'),
|
||||
|
||||
// Optional: describe the purpose of the asset with a human-readable string
|
||||
displayName: 'Source for my function',
|
||||
});
|
||||
```
|
||||
|
||||
The directory `my-image` must include a `Dockerfile`.
|
||||
|
||||
This will instruct the toolkit to build a Docker image from `my-image`, push it
|
||||
to an Amazon ECR repository and wire the name of the repository as CloudFormation
|
||||
parameters to your stack.
|
||||
|
||||
By default, all files in the given directory will be copied into the docker
|
||||
*build context*. If there is a large directory that you know you definitely
|
||||
don't need in the build context you can improve the performance by adding the
|
||||
names of files and directories to ignore to a file called `.dockerignore`, or
|
||||
pass them via the `exclude` property. If both are available, the patterns
|
||||
found in `exclude` are appended to the patterns found in `.dockerignore`.
|
||||
|
||||
The `ignoreMode` property controls how the set of ignore patterns is
|
||||
interpreted. The recommended setting for Docker image assets is
|
||||
`IgnoreMode.DOCKER`. If the context flag
|
||||
`@aws-cdk/aws-ecr-assets:dockerIgnoreSupport` is set to `true` in your
|
||||
`cdk.json` (this is by default for new projects, but must be set manually for
|
||||
old projects) then `IgnoreMode.DOCKER` is the default and you don't need to
|
||||
configure it on the asset itself.
|
||||
|
||||
Use `asset.imageUri` to reference the image. It includes both the ECR image URL
|
||||
and tag.
|
||||
|
||||
Use `asset.imageTag` to reference only the image tag.
|
||||
|
||||
You can optionally pass build args to the `docker build` command by specifying
|
||||
the `buildArgs` property. It is recommended to skip hashing of `buildArgs` for
|
||||
values that can change between different machines to maintain a consistent
|
||||
asset hash.
|
||||
|
||||
Additionally, you can supply `buildSecrets`. Your system must have Buildkit
|
||||
enabled, see https://docs.docker.com/build/buildkit/.
|
||||
|
||||
Also, similarly to `@aws-cdk/aws-s3-assets`, you can set the CDK_DOCKER environment
|
||||
variable in order to provide a custom Docker executable command or path. This may sometimes
|
||||
be needed when building in environments where the standard docker cannot be executed
|
||||
(see https://github.com/aws/aws-cdk/issues/8460 for details).
|
||||
|
||||
### Docker Alternatives
|
||||
|
||||
The CDK supports several Docker alternatives through the `CDK_DOCKER` environment variable:
|
||||
|
||||
#### Finch (AWS-supported)
|
||||
|
||||
```bash
|
||||
export CDK_DOCKER=finch
|
||||
```
|
||||
|
||||
**Note**: For Finch, you may also need to set the `DOCKER_HOST` environment variable. The socket path is OS-specific (e.g., on macOS: `unix:///Applications/Finch/lima/data/finch/sock/finch.sock`).
|
||||
|
||||
#### Podman (Community-tested)
|
||||
|
||||
```bash
|
||||
export CDK_DOCKER=podman
|
||||
export DOCKER_HOST=$(podman machine inspect --format 'unix://{{.ConnectionInfo.PodmanSocket.Path}}')
|
||||
```
|
||||
|
||||
**Note**: While Finch receives official AWS support, Podman is community-tested and may work for many use cases. The CDK doesn't check which Docker replacement you are using to determine if it's supported. If the tool has equivalent Docker commands and behaves similarly, it should work.
|
||||
|
||||
For some container runtimes, you may need to set the `DOCKER_HOST` environment variable to specify the correct socket path for the CDK to communicate with the container daemon.
|
||||
|
||||
SSH agent sockets or keys may be passed to docker build via `buildSsh`.
|
||||
|
||||
```ts
|
||||
import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
|
||||
const asset = new DockerImageAsset(this, 'MyBuildImage', {
|
||||
directory: path.join(__dirname, 'my-image'),
|
||||
buildArgs: {
|
||||
HTTP_PROXY: 'http://10.20.30.2:1234',
|
||||
},
|
||||
invalidation: {
|
||||
buildArgs: false,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
You can optionally pass additional build contexts to the `docker build` command by specifying
|
||||
the `buildContexts` property. Each entry specifies a named build context and its source, which
|
||||
can be a directory path, a URL, or a docker image. This is equivalent to the `--build-context`
|
||||
flag in the `docker build` command.
|
||||
|
||||
```ts
|
||||
import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
|
||||
const asset = new DockerImageAsset(this, 'MyBuildImage', {
|
||||
directory: path.join(__dirname, 'my-image'),
|
||||
buildContexts: {
|
||||
mycontext: path.join(__dirname, 'path/to/context'),
|
||||
alpine: 'docker-image://alpine:latest',
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Note that while changes to the `buildContexts` values (e.g. changing which directory a context
|
||||
points to) will invalidate the asset hash and trigger a rebuild, changes to the *contents* of
|
||||
directories referenced by build contexts are not automatically tracked. Only the contents of
|
||||
the primary `directory` are fingerprinted. If files in a build context directory change, you can
|
||||
use `extraHash` to trigger a rebuild:
|
||||
|
||||
```ts
|
||||
import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
import { FileSystem } from 'aws-cdk-lib';
|
||||
|
||||
const contextDir = path.join(__dirname, 'path/to/context');
|
||||
|
||||
const asset = new DockerImageAsset(this, 'MyBuildImage', {
|
||||
directory: path.join(__dirname, 'my-image'),
|
||||
buildContexts: {
|
||||
mycontext: contextDir,
|
||||
},
|
||||
extraHash: FileSystem.fingerprint(contextDir),
|
||||
});
|
||||
```
|
||||
|
||||
You can optionally pass a target to the `docker build` command by specifying
|
||||
the `target` property:
|
||||
|
||||
```ts
|
||||
import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
|
||||
const asset = new DockerImageAsset(this, 'MyBuildImage', {
|
||||
directory: path.join(__dirname, 'my-image'),
|
||||
target: 'a-target',
|
||||
});
|
||||
```
|
||||
|
||||
You can optionally pass networking mode to the `docker build` command by specifying
|
||||
the `networkMode` property:
|
||||
|
||||
```ts
|
||||
import { DockerImageAsset, NetworkMode } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
|
||||
const asset = new DockerImageAsset(this, 'MyBuildImage', {
|
||||
directory: path.join(__dirname, 'my-image'),
|
||||
networkMode: NetworkMode.HOST,
|
||||
})
|
||||
```
|
||||
|
||||
You can optionally pass an alternate platform to the `docker build` command by specifying
|
||||
the `platform` property:
|
||||
|
||||
```ts
|
||||
import { DockerImageAsset, Platform } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
|
||||
const asset = new DockerImageAsset(this, 'MyBuildImage', {
|
||||
directory: path.join(__dirname, 'my-image'),
|
||||
platform: Platform.LINUX_ARM64,
|
||||
})
|
||||
```
|
||||
|
||||
You can optionally pass an array of outputs to the `docker build` command by specifying
|
||||
the `outputs` property:
|
||||
|
||||
```ts
|
||||
import { DockerImageAsset, Platform } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
|
||||
const asset = new DockerImageAsset(this, 'MyBuildImage', {
|
||||
directory: path.join(__dirname, 'my-image'),
|
||||
outputs: ['type=local,dest=out'],
|
||||
})
|
||||
```
|
||||
|
||||
You can optionally pass cache from and cache to options to cache images:
|
||||
|
||||
```ts
|
||||
import { DockerImageAsset, Platform } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
|
||||
const asset = new DockerImageAsset(this, 'MyBuildImage', {
|
||||
directory: path.join(__dirname, 'my-image'),
|
||||
cacheFrom: [{ type: 'registry', params: { ref: 'ghcr.io/myorg/myimage:cache' }}],
|
||||
cacheTo: { type: 'registry', params: { ref: 'ghcr.io/myorg/myimage:cache', mode: 'max', compression: 'zstd' }}
|
||||
})
|
||||
```
|
||||
|
||||
You can optionally disable the cache:
|
||||
|
||||
```ts
|
||||
import { DockerImageAsset, Platform } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
|
||||
const asset = new DockerImageAsset(this, 'MyBuildImage', {
|
||||
directory: path.join(__dirname, 'my-image'),
|
||||
cacheDisabled: true,
|
||||
})
|
||||
```
|
||||
|
||||
## Images from Tarball
|
||||
|
||||
Images are loaded from a local tarball, uploaded to ECR by the CDK toolkit and/or your app's CI-CD pipeline, and can be
|
||||
naturally referenced in your CDK app.
|
||||
|
||||
```ts
|
||||
import { TarballImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
|
||||
const asset = new TarballImageAsset(this, 'MyBuildImage', {
|
||||
tarballFile: 'local-image.tar',
|
||||
});
|
||||
```
|
||||
|
||||
This will instruct the toolkit to add the tarball as a file asset. During deployment it will load the container image
|
||||
from `local-image.tar`, push it to an Amazon ECR repository and wire the name of the repository as CloudFormation parameters
|
||||
to your stack.
|
||||
|
||||
Similar to `DockerImageAsset`, you can set the `CDK_DOCKER` environment variable to provide a custom Docker executable
|
||||
command or path. This may be needed when building in environments where the standard docker cannot be executed or when
|
||||
using alternative container runtimes like Finch.
|
||||
|
||||
## Publishing images to ECR repositories
|
||||
|
||||
`DockerImageAsset` is designed for seamless build & consumption of image assets by CDK code deployed to multiple environments
|
||||
through the CDK CLI or through CI/CD workflows. To that end, the ECR repository behind this construct is controlled by the AWS CDK.
|
||||
The mechanics of where these images are published and how are intentionally kept as an implementation detail, and the construct
|
||||
does not support customizations such as specifying the ECR repository name or tags.
|
||||
|
||||
We are testing a new experimental synthesizer, the
|
||||
[App Staging Synthesizer](https://docs.aws.amazon.com/cdk/api/v2/docs/app-staging-synthesizer-alpha-readme.html) that
|
||||
creates separate support stacks for each CDK application. Unlike the default stack synthesizer, the App Staging
|
||||
Synthesizer creates unique ECR repositories for each `DockerImageAsset`, allowing lifecycle policies to only retain the
|
||||
last `n` images. This is a great way to keep your ECR repositories clean and reduce cost. You can learn more about
|
||||
this feature in [this blog post](https://aws.amazon.com/blogs/devops/enhancing-resource-isolation-in-aws-cdk-with-the-app-staging-synthesizer/).
|
||||
|
||||
Alternatively, If you are looking for a way to _publish_ image assets to an ECR repository in your control, you should consider using
|
||||
[cdklabs/cdk-ecr-deployment], which is able to replicate an image asset from the CDK-controlled ECR repository to a repository of
|
||||
your choice.
|
||||
|
||||
Here an example from the [cdklabs/cdk-ecr-deployment] project:
|
||||
|
||||
```text
|
||||
// This example available in TypeScript only
|
||||
|
||||
import { DockerImageAsset } from 'aws-cdk-lib/aws-ecr-assets';
|
||||
import * as ecrdeploy from 'cdk-ecr-deployment';
|
||||
|
||||
const image = new DockerImageAsset(this, 'CDKDockerImage', {
|
||||
directory: path.join(__dirname, 'docker'),
|
||||
});
|
||||
|
||||
new ecrdeploy.ECRDeployment(this, 'DeployDockerImage', {
|
||||
src: new ecrdeploy.DockerImageName(image.imageUri),
|
||||
dest: new ecrdeploy.DockerImageName(`${cdk.Aws.ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/test:nginx`),
|
||||
});
|
||||
```
|
||||
|
||||
⚠️ Please note that this is a 3rd-party construct library and is not officially supported by AWS.
|
||||
You are welcome to +1 [this GitHub issue](https://github.com/aws/aws-cdk/issues/12597) if you would like to see
|
||||
native support for this use-case in the AWS CDK.
|
||||
|
||||
[cdklabs/cdk-ecr-deployment]: https://github.com/cdklabs/cdk-ecr-deployment
|
||||
|
||||
## Pull Permissions
|
||||
|
||||
Depending on the consumer of your image asset, you will need to make sure
|
||||
the principal has permissions to pull the image.
|
||||
|
||||
In most cases, you should use the `asset.repository.grantPull(principal)`
|
||||
method. This will modify the IAM policy of the principal to allow it to
|
||||
pull images from this repository.
|
||||
|
||||
If the pulling principal is not in the same account or is an AWS service that
|
||||
doesn't assume a role in your account (e.g. AWS CodeBuild), you must either copy the image to a new repository, or
|
||||
grant pull permissions on the resource policy of the repository. Since the repository is managed by the CDK bootstrap stack,
|
||||
the following permissions must be granted there, or granted manually on the repository: "ecr:GetDownloadUrlForLayer",
|
||||
"ecr:BatchGetImage" and "ecr:BatchCheckLayerAvailability".
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/index.d.ts
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './lib';
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/index.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.NetworkMode=void 0,Object.defineProperty(exports,_noFold="NetworkMode",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").NetworkMode;return Object.defineProperty(exports,_noFold="NetworkMode",{enumerable:!0,configurable:!0,value}),value}}),exports.Platform=void 0,Object.defineProperty(exports,_noFold="Platform",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").Platform;return Object.defineProperty(exports,_noFold="Platform",{enumerable:!0,configurable:!0,value}),value}}),exports.DockerImageAsset=void 0,Object.defineProperty(exports,_noFold="DockerImageAsset",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").DockerImageAsset;return Object.defineProperty(exports,_noFold="DockerImageAsset",{enumerable:!0,configurable:!0,value}),value}}),exports.DOCKER_LOAD_OUTPUT_REGEX=void 0,Object.defineProperty(exports,_noFold="DOCKER_LOAD_OUTPUT_REGEX",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").DOCKER_LOAD_OUTPUT_REGEX;return Object.defineProperty(exports,_noFold="DOCKER_LOAD_OUTPUT_REGEX",{enumerable:!0,configurable:!0,value}),value}}),exports.TarballImageAsset=void 0,Object.defineProperty(exports,_noFold="TarballImageAsset",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").TarballImageAsset;return Object.defineProperty(exports,_noFold="TarballImageAsset",{enumerable:!0,configurable:!0,value}),value}});
|
||||
428
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/image-asset.d.ts
generated
vendored
Normal file
428
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/image-asset.d.ts
generated
vendored
Normal file
@@ -0,0 +1,428 @@
|
||||
import { Construct } from 'constructs';
|
||||
import '../../assets';
|
||||
import * as ecr from '../../aws-ecr';
|
||||
import type { FileFingerprintOptions, CfnResource } from '../../core';
|
||||
/**
|
||||
* networking mode on build time supported by docker
|
||||
*/
|
||||
export declare class NetworkMode {
|
||||
readonly mode: string;
|
||||
/**
|
||||
* The default networking mode if omitted, create a network stack on the default Docker bridge
|
||||
*/
|
||||
static readonly DEFAULT: NetworkMode;
|
||||
/**
|
||||
* Use the Docker host network stack
|
||||
*/
|
||||
static readonly HOST: NetworkMode;
|
||||
/**
|
||||
* Disable the network stack, only the loopback device will be created
|
||||
*/
|
||||
static readonly NONE: NetworkMode;
|
||||
/**
|
||||
* Reuse another container's network stack
|
||||
*
|
||||
* @param containerId The target container's id or name
|
||||
*/
|
||||
static fromContainer(containerId: string): NetworkMode;
|
||||
/**
|
||||
* Used to specify a custom networking mode
|
||||
* Use this if the networking mode name is not yet supported by the CDK.
|
||||
*
|
||||
* @param mode The networking mode to use for docker build
|
||||
*/
|
||||
static custom(mode: string): NetworkMode;
|
||||
/**
|
||||
* @param mode The networking mode to use for docker build
|
||||
*/
|
||||
private constructor();
|
||||
}
|
||||
/**
|
||||
* platform supported by docker
|
||||
*/
|
||||
export declare class Platform {
|
||||
/** @jsii suppress JSII5019 For historic reasons */
|
||||
readonly platform: string;
|
||||
/**
|
||||
* Build for linux/amd64
|
||||
*/
|
||||
static readonly LINUX_AMD64: Platform;
|
||||
/**
|
||||
* Build for linux/arm64
|
||||
*/
|
||||
static readonly LINUX_ARM64: Platform;
|
||||
/**
|
||||
* Used to specify a custom platform
|
||||
* Use this if the platform name is not yet supported by the CDK.
|
||||
*
|
||||
* @param platform The platform to use for docker build
|
||||
*/
|
||||
static custom(platform: string): Platform;
|
||||
/**
|
||||
* @param platform The platform to use for docker build
|
||||
*/
|
||||
private constructor();
|
||||
}
|
||||
/**
|
||||
* Options to control invalidation of `DockerImageAsset` asset hashes
|
||||
*/
|
||||
export interface DockerImageAssetInvalidationOptions {
|
||||
/**
|
||||
* Use `extraHash` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly extraHash?: boolean;
|
||||
/**
|
||||
* Use `buildArgs` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly buildArgs?: boolean;
|
||||
/**
|
||||
* Use `buildContexts` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly buildContexts?: boolean;
|
||||
/**
|
||||
* Use `buildSecrets` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly buildSecrets?: boolean;
|
||||
/**
|
||||
* Use `buildSsh` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly buildSsh?: boolean;
|
||||
/**
|
||||
* Use `target` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly target?: boolean;
|
||||
/**
|
||||
* Use `file` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly file?: boolean;
|
||||
/**
|
||||
* Use `repositoryName` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly repositoryName?: boolean;
|
||||
/**
|
||||
* Use `networkMode` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly networkMode?: boolean;
|
||||
/**
|
||||
* Use `platform` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly platform?: boolean;
|
||||
/**
|
||||
* Use `outputs` while calculating the asset hash
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly outputs?: boolean;
|
||||
}
|
||||
/**
|
||||
* Options for configuring the Docker cache backend
|
||||
*/
|
||||
export interface DockerCacheOption {
|
||||
/**
|
||||
* The type of cache to use.
|
||||
* Refer to https://docs.docker.com/build/cache/backends/ for full list of backends.
|
||||
* @default - unspecified
|
||||
*
|
||||
* @example 'registry'
|
||||
*/
|
||||
readonly type: string;
|
||||
/**
|
||||
* Any parameters to pass into the docker cache backend configuration.
|
||||
* Refer to https://docs.docker.com/build/cache/backends/ for cache backend configuration.
|
||||
* @default {} No options provided
|
||||
*
|
||||
* @example
|
||||
* declare const branch: string;
|
||||
*
|
||||
* const params = {
|
||||
* ref: `12345678.dkr.ecr.us-west-2.amazonaws.com/cache:${branch}`,
|
||||
* mode: "max",
|
||||
* };
|
||||
*/
|
||||
readonly params?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Options for DockerImageAsset
|
||||
*/
|
||||
export interface DockerImageAssetOptions extends FileFingerprintOptions {
|
||||
/**
|
||||
* Build args to pass to the `docker build` command.
|
||||
*
|
||||
* Since Docker build arguments are resolved before deployment, keys and
|
||||
* values cannot refer to unresolved tokens (such as `lambda.functionArn` or
|
||||
* `queue.queueUrl`).
|
||||
*
|
||||
* @default - no build args are passed
|
||||
*/
|
||||
readonly buildArgs?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* Build contexts to pass to the `docker build` command.
|
||||
*
|
||||
* Build contexts can be used to specify additional directories or images
|
||||
* to use during the build. Each entry specifies a named build context
|
||||
* and its source (a directory path, a URL, or a docker image).
|
||||
*
|
||||
* Since Docker build contexts are resolved before deployment, keys and
|
||||
* values cannot refer to unresolved tokens (such as `lambda.functionArn` or
|
||||
* `queue.queueUrl`).
|
||||
*
|
||||
* @see https://docs.docker.com/build/building/context/#additional-build-contexts
|
||||
*
|
||||
* @default - no additional build contexts
|
||||
*/
|
||||
readonly buildContexts?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* Build secrets.
|
||||
*
|
||||
* Docker BuildKit must be enabled to use build secrets.
|
||||
*
|
||||
* @see https://docs.docker.com/build/buildkit/
|
||||
*
|
||||
* @default - no build secrets
|
||||
*
|
||||
* @example
|
||||
* import { DockerBuildSecret } from 'aws-cdk-lib';
|
||||
*
|
||||
* const buildSecrets = {
|
||||
* 'MY_SECRET': DockerBuildSecret.fromSrc('file.txt')
|
||||
* };
|
||||
*/
|
||||
readonly buildSecrets?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* SSH agent socket or keys to pass to the `docker build` command.
|
||||
*
|
||||
* Docker BuildKit must be enabled to use the ssh flag
|
||||
*
|
||||
* @see https://docs.docker.com/build/buildkit/
|
||||
*
|
||||
* @default - no --ssh flag
|
||||
*/
|
||||
readonly buildSsh?: string;
|
||||
/**
|
||||
* Docker target to build to
|
||||
*
|
||||
* @default - no target
|
||||
*/
|
||||
readonly target?: string;
|
||||
/**
|
||||
* Path to the Dockerfile (relative to the directory).
|
||||
*
|
||||
* @default 'Dockerfile'
|
||||
*/
|
||||
readonly file?: string;
|
||||
/**
|
||||
* Networking mode for the RUN commands during build. Support docker API 1.25+.
|
||||
*
|
||||
* @default - no networking mode specified (the default networking mode `NetworkMode.DEFAULT` will be used)
|
||||
*/
|
||||
readonly networkMode?: NetworkMode;
|
||||
/**
|
||||
* Platform to build for. _Requires Docker Buildx_.
|
||||
*
|
||||
* @default - no platform specified (the current machine architecture will be used)
|
||||
*/
|
||||
readonly platform?: Platform;
|
||||
/**
|
||||
* Options to control which parameters are used to invalidate the asset hash.
|
||||
*
|
||||
* @default - hash all parameters
|
||||
*/
|
||||
readonly invalidation?: DockerImageAssetInvalidationOptions;
|
||||
/**
|
||||
* Outputs to pass to the `docker build` command.
|
||||
*
|
||||
* @default - no outputs are passed to the build command (default outputs are used)
|
||||
* @see https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs
|
||||
*/
|
||||
readonly outputs?: string[];
|
||||
/**
|
||||
* Unique identifier of the docker image asset and its potential revisions.
|
||||
* Required if using AppScopedStagingSynthesizer.
|
||||
*
|
||||
* @default - no asset name
|
||||
*/
|
||||
readonly assetName?: string;
|
||||
/**
|
||||
* Cache from options to pass to the `docker build` command.
|
||||
*
|
||||
* @default - no cache from options are passed to the build command
|
||||
* @see https://docs.docker.com/build/cache/backends/
|
||||
*/
|
||||
readonly cacheFrom?: DockerCacheOption[];
|
||||
/**
|
||||
* Cache to options to pass to the `docker build` command.
|
||||
*
|
||||
* @default - no cache to options are passed to the build command
|
||||
* @see https://docs.docker.com/build/cache/backends/
|
||||
*/
|
||||
readonly cacheTo?: DockerCacheOption;
|
||||
/**
|
||||
* Disable the cache and pass `--no-cache` to the `docker build` command.
|
||||
*
|
||||
* @default - cache is used
|
||||
*/
|
||||
readonly cacheDisabled?: boolean;
|
||||
/**
|
||||
* A display name for this asset
|
||||
*
|
||||
* If supplied, the display name will be used in locations where the asset
|
||||
* identifier is printed, like in the CLI progress information. If the same
|
||||
* asset is added multiple times, the display name of the first occurrence is
|
||||
* used.
|
||||
*
|
||||
* If `assetName` is given, it will also be used as the default `displayName`.
|
||||
* Otherwise, the default is the construct path of the ImageAsset construct,
|
||||
* with respect to the enclosing stack. If the asset is produced by a
|
||||
* construct helper function (such as `lambda.Code.fromAssetImage()`), this
|
||||
* will look like `MyFunction/AssetImage`.
|
||||
*
|
||||
* We use the stack-relative construct path so that in the common case where
|
||||
* you have multiple stacks with the same asset, we won't show something like
|
||||
* `/MyBetaStack/MyFunction/Code` when you are actually deploying to
|
||||
* production.
|
||||
*
|
||||
* @default - Stack-relative construct path
|
||||
*/
|
||||
readonly displayName?: string;
|
||||
}
|
||||
/**
|
||||
* Props for DockerImageAssets
|
||||
*/
|
||||
export interface DockerImageAssetProps extends DockerImageAssetOptions {
|
||||
/**
|
||||
* The directory where the Dockerfile is stored
|
||||
*
|
||||
* Any directory inside with a name that matches the CDK output folder (cdk.out by default) will be excluded from the asset
|
||||
*/
|
||||
readonly directory: string;
|
||||
}
|
||||
/**
|
||||
* An asset that represents a Docker image.
|
||||
*
|
||||
* The image will be created in build time and uploaded to an ECR repository.
|
||||
*/
|
||||
export declare class DockerImageAsset extends Construct {
|
||||
/**
|
||||
* Uniquely identifies this class.
|
||||
*/
|
||||
static readonly PROPERTY_INJECTION_ID: string;
|
||||
/**
|
||||
* The full URI of the image (including a tag). Use this reference to pull
|
||||
* the asset.
|
||||
*/
|
||||
imageUri: string;
|
||||
/**
|
||||
* Repository where the image is stored
|
||||
*/
|
||||
repository: ecr.IRepository;
|
||||
/**
|
||||
* A hash of this asset, which is available at construction time. As this is a plain string, it
|
||||
* can be used in construct IDs in order to enforce creation of a new resource when the content
|
||||
* hash has changed.
|
||||
*/
|
||||
readonly assetHash: string;
|
||||
/**
|
||||
* The tag of this asset when it is uploaded to ECR. The tag may differ from the assetHash if a stack synthesizer adds a dockerTagPrefix.
|
||||
*/
|
||||
readonly imageTag: string;
|
||||
/**
|
||||
* The path to the asset, relative to the current Cloud Assembly
|
||||
*
|
||||
* If asset staging is disabled, this will just be the original path.
|
||||
*
|
||||
* If asset staging is enabled it will be the staged path.
|
||||
*/
|
||||
private readonly assetPath;
|
||||
/**
|
||||
* The path to the Dockerfile, relative to the assetPath
|
||||
*/
|
||||
private readonly dockerfilePath?;
|
||||
/**
|
||||
* Build args to pass to the `docker build` command.
|
||||
*/
|
||||
private readonly dockerBuildArgs?;
|
||||
/**
|
||||
* Build contexts to pass to the `docker build` command.
|
||||
*/
|
||||
private readonly dockerBuildContexts?;
|
||||
/**
|
||||
* Build secrets to pass to the `docker build` command.
|
||||
*/
|
||||
private readonly dockerBuildSecrets?;
|
||||
/**
|
||||
* SSH agent socket or keys to pass to the `docker build` command.
|
||||
*/
|
||||
private readonly dockerBuildSsh?;
|
||||
/**
|
||||
* Outputs to pass to the `docker build` command.
|
||||
*/
|
||||
private readonly dockerOutputs?;
|
||||
/**
|
||||
* Unique identifier of the docker image asset and its potential revisions.
|
||||
* Required if using AppScopedStagingSynthesizer.
|
||||
*
|
||||
* @default - no asset name
|
||||
*/
|
||||
private readonly assetName?;
|
||||
/**
|
||||
* Cache from options to pass to the `docker build` command.
|
||||
*/
|
||||
private readonly dockerCacheFrom?;
|
||||
/**
|
||||
* Cache to options to pass to the `docker build` command.
|
||||
*/
|
||||
private readonly dockerCacheTo?;
|
||||
/**
|
||||
* Disable the cache and pass `--no-cache` to the `docker build` command.
|
||||
*/
|
||||
private readonly dockerCacheDisabled?;
|
||||
/**
|
||||
* Docker target to build to
|
||||
*/
|
||||
private readonly dockerBuildTarget?;
|
||||
constructor(scope: Construct, id: string, props: DockerImageAssetProps);
|
||||
/**
|
||||
* Adds CloudFormation template metadata to the specified resource with
|
||||
* information that indicates which resource property is mapped to this local
|
||||
* asset. This can be used by tools such as SAM CLI to provide local
|
||||
* experience such as local invocation and debugging of Lambda functions.
|
||||
*
|
||||
* Asset metadata will only be included if the stack is synthesized with the
|
||||
* "aws:cdk:enable-asset-metadata" context key defined, which is the default
|
||||
* behavior when synthesizing via the CDK Toolkit.
|
||||
*
|
||||
* @see https://github.com/aws/aws-cdk/issues/1432
|
||||
*
|
||||
* @param resource The CloudFormation resource which is using this asset [disable-awslint:ref-via-interface]
|
||||
* @param resourceProperty The property name where this asset is referenced
|
||||
*/
|
||||
addResourceMetadata(resource: CfnResource, resourceProperty: string): void;
|
||||
}
|
||||
2
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/image-asset.js
generated
vendored
Normal file
2
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/image-asset.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/index.d.ts
generated
vendored
Normal file
2
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './image-asset';
|
||||
export * from './tarball-asset';
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/index.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.NetworkMode=void 0,Object.defineProperty(exports,_noFold="NetworkMode",{enumerable:!0,configurable:!0,get:()=>{var value=require("./image-asset").NetworkMode;return Object.defineProperty(exports,_noFold="NetworkMode",{enumerable:!0,configurable:!0,value}),value}}),exports.Platform=void 0,Object.defineProperty(exports,_noFold="Platform",{enumerable:!0,configurable:!0,get:()=>{var value=require("./image-asset").Platform;return Object.defineProperty(exports,_noFold="Platform",{enumerable:!0,configurable:!0,value}),value}}),exports.DockerImageAsset=void 0,Object.defineProperty(exports,_noFold="DockerImageAsset",{enumerable:!0,configurable:!0,get:()=>{var value=require("./image-asset").DockerImageAsset;return Object.defineProperty(exports,_noFold="DockerImageAsset",{enumerable:!0,configurable:!0,value}),value}}),exports.DOCKER_LOAD_OUTPUT_REGEX=void 0,Object.defineProperty(exports,_noFold="DOCKER_LOAD_OUTPUT_REGEX",{enumerable:!0,configurable:!0,get:()=>{var value=require("./tarball-asset").DOCKER_LOAD_OUTPUT_REGEX;return Object.defineProperty(exports,_noFold="DOCKER_LOAD_OUTPUT_REGEX",{enumerable:!0,configurable:!0,value}),value}}),exports.TarballImageAsset=void 0,Object.defineProperty(exports,_noFold="TarballImageAsset",{enumerable:!0,configurable:!0,get:()=>{var value=require("./tarball-asset").TarballImageAsset;return Object.defineProperty(exports,_noFold="TarballImageAsset",{enumerable:!0,configurable:!0,value}),value}});
|
||||
71
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/tarball-asset.d.ts
generated
vendored
Normal file
71
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/tarball-asset.d.ts
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
import { Construct } from 'constructs';
|
||||
import '../../assets';
|
||||
import * as ecr from '../../aws-ecr';
|
||||
/**
|
||||
* The sed pattern used to extract the image ID from docker load output
|
||||
* Works with both formats:
|
||||
* - "Loaded image: <digest>" (older Docker versions)
|
||||
* - "Loaded image ID: <digest>" (Docker 27.4+)
|
||||
*/
|
||||
export declare const DOCKER_LOAD_OUTPUT_REGEX = "s/Loaded image[^:]*: //g";
|
||||
/**
|
||||
* Options for TarballImageAsset
|
||||
*/
|
||||
export interface TarballImageAssetProps {
|
||||
/**
|
||||
* Absolute path to the tarball.
|
||||
*
|
||||
* It is recommended to use the script running directory (e.g. `__dirname`
|
||||
* in Node.js projects or dirname of `__file__` in Python) if your tarball
|
||||
* is located as a resource inside your project.
|
||||
*/
|
||||
readonly tarballFile: string;
|
||||
/**
|
||||
* A display name for this asset
|
||||
*
|
||||
* If supplied, the display name will be used in locations where the asset
|
||||
* identifier is printed, like in the CLI progress information. If the same
|
||||
* asset is added multiple times, the display name of the first occurrence is
|
||||
* used.
|
||||
*
|
||||
* The default is the construct path of the `TarballImageAsset` construct,
|
||||
* with respect to the enclosing stack. If the asset is produced by a
|
||||
* construct helper function (such as `lambda.Code.fromAssetImage()`), this
|
||||
* will look like `MyFunction/AssetImage`.
|
||||
*
|
||||
* We use the stack-relative construct path so that in the common case where
|
||||
* you have multiple stacks with the same asset, we won't show something like
|
||||
* `/MyBetaStack/MyFunction/Code` when you are actually deploying to
|
||||
* production.
|
||||
*
|
||||
* @default - Stack-relative construct path
|
||||
*/
|
||||
readonly displayName?: string;
|
||||
}
|
||||
/**
|
||||
* An asset that represents a Docker image.
|
||||
*
|
||||
* The image will loaded from an existing tarball and uploaded to an ECR repository.
|
||||
*/
|
||||
export declare class TarballImageAsset extends Construct {
|
||||
/**
|
||||
* The full URI of the image (including a tag). Use this reference to pull
|
||||
* the asset.
|
||||
*/
|
||||
imageUri: string;
|
||||
/**
|
||||
* Repository where the image is stored
|
||||
*/
|
||||
repository: ecr.IRepository;
|
||||
/**
|
||||
* A hash of this asset, which is available at construction time. As this is a plain string, it
|
||||
* can be used in construct IDs in order to enforce creation of a new resource when the content
|
||||
* hash has changed.
|
||||
*/
|
||||
readonly assetHash: string;
|
||||
/**
|
||||
* The tag of this asset when it is uploaded to ECR. The tag may differ from the assetHash if a stack synthesizer adds a dockerTagPrefix.
|
||||
*/
|
||||
readonly imageTag: string;
|
||||
constructor(scope: Construct, id: string, props: TarballImageAssetProps);
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/tarball-asset.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/aws-ecr-assets/lib/tarball-asset.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TarballImageAsset=exports.DOCKER_LOAD_OUTPUT_REGEX=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var fs=()=>{var tmp=require("fs");return fs=()=>tmp,tmp},path=()=>{var tmp=require("path");return path=()=>tmp,tmp},constructs_1=()=>{var tmp=require("constructs");return constructs_1=()=>tmp,tmp},ecr=()=>{var tmp=require("../../aws-ecr");return ecr=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};exports.DOCKER_LOAD_OUTPUT_REGEX="s/Loaded image[^:]*: //g";class TarballImageAsset extends constructs_1().Construct{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecr_assets.TarballImageAsset",version:"2.252.0"};imageUri;repository;sourceHash;assetHash;imageTag;constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecr_assets_TarballImageAssetProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,TarballImageAsset),error}if(!fs().existsSync(props.tarballFile))throw new(core_1()).ValidationError((0,literal_string_1().lit)`CannotFindFile`,`Cannot find file at ${props.tarballFile}`,this);const stagedTarball=new(core_1()).AssetStaging(this,"Staging",{sourcePath:props.tarballFile});this.sourceHash=stagedTarball.assetHash,this.assetHash=stagedTarball.assetHash;const stage=core_1().Stage.of(this),relativePathInOutDir=stage?path().relative(stage.assetOutdir,stagedTarball.absoluteStagedPath):stagedTarball.absoluteStagedPath,location=core_1().Stack.of(this).synthesizer.addDockerImageAsset({sourceHash:stagedTarball.assetHash,executable:["sh","-c",`${process.env.CDK_DOCKER??"docker"} load -i ${relativePathInOutDir} | tail -n 1 | sed "${exports.DOCKER_LOAD_OUTPUT_REGEX}"`],displayName:props.displayName??core_1().Names.stackRelativeConstructPath(this)});this.repository=ecr().Repository.fromRepositoryName(this,"Repository",location.repositoryName),this.imageUri=location.imageUri,this.imageTag=location.imageTag??this.assetHash}}exports.TarballImageAsset=TarballImageAsset;
|
||||
Reference in New Issue
Block a user