UNPKG

cdk-nextjs

Version:

Deploy Next.js apps on AWS with CDK

146 lines (145 loc) 5.37 kB
import type { aws_ecr_assets, IgnoreMode, SymlinkFollowMode } from 'aws-cdk-lib'; /** * OptionalDockerImageAssetProps */ export interface OptionalDockerImageAssetProps { /** * 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 * @stability stable */ readonly directory?: string; /** * Docker target to build to. * @default - no target * @stability stable */ readonly target?: string; /** * Platform to build for. * _Requires Docker Buildx_. * @default - no platform specified (the current machine architecture will be used) * @stability stable */ readonly platform?: aws_ecr_assets.Platform; /** * Outputs to pass to the `docker build` command. * @default - no outputs are passed to the build command (default outputs are used) * @stability stable */ readonly outputs?: Array<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) * @stability stable */ readonly networkMode?: aws_ecr_assets.NetworkMode; /** * Options to control which parameters are used to invalidate the asset hash. * @default - hash all parameters * @stability stable */ readonly invalidation?: aws_ecr_assets.DockerImageAssetInvalidationOptions; /** * Path to the Dockerfile (relative to the directory). * @default 'Dockerfile' * @stability stable */ readonly file?: 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. * * 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 * @stability stable */ readonly displayName?: string; /** * Cache to options to pass to the `docker build` command. * @default - no cache to options are passed to the build command * @stability stable */ readonly cacheTo?: aws_ecr_assets.DockerCacheOption; /** * Cache from options to pass to the `docker build` command. * @default - no cache from options are passed to the build command * @stability stable */ readonly cacheFrom?: Array<aws_ecr_assets.DockerCacheOption>; /** * Disable the cache and pass `--no-cache` to the `docker build` command. * @default - cache is used * @stability stable */ readonly cacheDisabled?: boolean; /** * SSH agent socket or keys to pass to the `docker build` command. * Docker BuildKit must be enabled to use the ssh flag * @default - no --ssh flag * @stability stable */ readonly buildSsh?: string; /** * Build secrets. * Docker BuildKit must be enabled to use build secrets. * @default - no build secrets * @stability stable */ readonly buildSecrets?: Record<string, string>; /** * 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 * @stability stable */ readonly buildArgs?: Record<string, string>; /** * Unique identifier of the docker image asset and its potential revisions. * Required if using AppScopedStagingSynthesizer. * @default - no asset name * @stability stable */ readonly assetName?: string; /** * Extra information to encode into the fingerprint (e.g. build instructions and other inputs). * @default - hash is only based on source content * @stability stable */ readonly extraHash?: string; /** * The ignore behavior to use for `exclude` patterns. * @default IgnoreMode.GLOB * @stability stable */ readonly ignoreMode?: IgnoreMode; /** * A strategy for how to handle symlinks. * @default SymlinkFollowMode.NEVER * @stability stable */ readonly followSymlinks?: SymlinkFollowMode; /** * File paths matching the patterns will be excluded. * See `ignoreMode` to set the matching behavior. * Has no effect on Assets bundled using the `bundling` property. * @default - nothing is excluded * @stability stable */ readonly exclude?: Array<string>; }