DockerImageDeployment pushes an image from a local or external source to a specified external destination.
import { DockerImageDeployment } from 'cdk-docker-image-deployment'
new DockerImageDeployment(scope: Construct, id: string, props: DockerImageDeploymentProps)| Name | Type | Description |
|---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
DockerImageDeploymentProps |
No description. |
- Type: constructs.Construct
- Type: string
| Name | Description |
|---|---|
toString |
Returns a string representation of this construct. |
public toString(): stringReturns a string representation of this construct.
| Name | Description |
|---|---|
isConstruct |
Checks if x is a construct. |
import { DockerImageDeployment } from 'cdk-docker-image-deployment'
DockerImageDeployment.isConstruct(x: any)Checks if x is a construct.
- Type: any
Any object.
| Name | Type | Description |
|---|---|---|
node |
constructs.Node |
The tree node. |
public readonly node: Node;- Type: constructs.Node
The tree node.
Destination information.
import { DestinationConfig } from 'cdk-docker-image-deployment'
const destinationConfig: DestinationConfig = { ... }| Name | Type | Description |
|---|---|---|
destinationUri |
string |
The URI of the destination repository to deploy to. |
loginConfig |
LoginConfig |
The login command and region. |
destinationTag |
string |
The tag of the deployed image. |
public readonly destinationUri: string;- Type: string
The URI of the destination repository to deploy to.
public readonly loginConfig: LoginConfig;- Type: LoginConfig
The login command and region.
public readonly destinationTag: string;- Type: string
- Default: the tag of the source
The tag of the deployed image.
import { DockerImageDeploymentProps } from 'cdk-docker-image-deployment'
const dockerImageDeploymentProps: DockerImageDeploymentProps = { ... }| Name | Type | Description |
|---|---|---|
destination |
Destination |
Destination repository to deploy the image to. |
source |
Source |
Source of the image to deploy. |
public readonly destination: Destination;- Type: Destination
Destination repository to deploy the image to.
public readonly source: Source;- Type: Source
Source of the image to deploy.
Properties needed for Source.ecr.
import { EcrSourceOptions } from 'cdk-docker-image-deployment'
const ecrSourceOptions: EcrSourceOptions = { ... }| Name | Type | Description |
|---|---|---|
tag |
string |
Tag of deployed image. |
public readonly tag: string;- Type: string
- Default: tag of source
Tag of deployed image.
Login commands for specified registry.
import { LoginConfig } from 'cdk-docker-image-deployment'
const loginConfig: LoginConfig = { ... }| Name | Type | Description |
|---|---|---|
loginCommand |
string |
Command to run in codebuild to login. |
region |
string |
Region of ECR repository. |
public readonly loginCommand: string;- Type: string
Command to run in codebuild to login.
Formatted docker login ....
public readonly region: string;- Type: string
- Default: undefined if not an ECR repository
Region of ECR repository.
Source information.
import { SourceConfig } from 'cdk-docker-image-deployment'
const sourceConfig: SourceConfig = { ... }| Name | Type | Description |
|---|---|---|
imageTag |
string |
The source tag. |
imageUri |
string |
The source image URI. |
loginConfig |
LoginConfig |
The login command and region. |
public readonly imageTag: string;- Type: string
The source tag.
public readonly imageUri: string;- Type: string
The source image URI.
public readonly loginConfig: LoginConfig;- Type: LoginConfig
The login command and region.
Bind context for Source.
import { SourceContext } from 'cdk-docker-image-deployment'
const sourceContext: SourceContext = { ... }| Name | Type | Description |
|---|---|---|
handlerRole |
aws-cdk-lib.aws_iam.IRole |
The role for the handler. |
public readonly handlerRole: IRole;- Type: aws-cdk-lib.aws_iam.IRole
The role for the handler.
Specifies docker image deployment destination.
Usage:
declare const repo: ecr.IRepository;
const destinationEcr = dockerDeploy.Destination.ecr(repository, {
tag: 'tag',
});import { Destination } from 'cdk-docker-image-deployment'
new Destination()| Name | Type | Description |
|---|
| Name | Description |
|---|---|
bind |
Bind grants the CodeBuild role permissions to pull and push to a repository if necessary. |
public bind(role: IGrantable): DestinationConfigBind grants the CodeBuild role permissions to pull and push to a repository if necessary.
Bind should be invoked by the caller to get the DestinationConfig.
- Type: aws-cdk-lib.aws_iam.IGrantable
| Name | Description |
|---|---|
ecr |
Uses an ECR repository in the same account as the stack as the destination for the image. |
import { Destination } from 'cdk-docker-image-deployment'
Destination.ecr(repository: IRepository, options?: EcrSourceOptions)Uses an ECR repository in the same account as the stack as the destination for the image.
- Type: aws-cdk-lib.aws_ecr.IRepository
- Type: EcrSourceOptions
Specifies docker image deployment source.
Usage:
import * as path from 'path';
const path = path.join(__dirname, 'path/to/directory');
const sourceDirectory = Source.directory(path);import { Source } from 'cdk-docker-image-deployment'
new Source()| Name | Type | Description |
|---|
| Name | Description |
|---|---|
bind |
Bind grants the CodeBuild role permissions to pull from a repository if necessary. |
public bind(scope: Construct, context: SourceContext): SourceConfigBind grants the CodeBuild role permissions to pull from a repository if necessary.
Bind should be invoked by the caller to get the SourceConfig.
- Type: constructs.Construct
- Type: SourceContext
| Name | Description |
|---|---|
directory |
Uses a local image built from a Dockerfile in a local directory as the source. |
import { Source } from 'cdk-docker-image-deployment'
Source.directory(path: string)Uses a local image built from a Dockerfile in a local directory as the source.
- Type: string
path to the directory containing your Dockerfile (not a path to a file).