UNPKG

cdk-kaniko

Version:

CDK construct library that allows you to build docker images with kaniko in AWS Fargate

76 lines (75 loc) 1.81 kB
import { aws_ec2 as ec2, aws_ecr as ecr, aws_ecs as ecs, aws_events as events } from 'aws-cdk-lib'; import { Construct } from 'constructs'; /** * @stability stable */ export interface KanikoProps { /** * Kaniko build context. * * @see https://github.com/GoogleContainerTools/kaniko#kaniko-build-contexts * @stability stable */ readonly context: string; /** * The target ECR repository. * * @default - create a new ECR private repository * @stability stable */ readonly destinationRepository?: ecr.IRepository; /** * The context sub path. * * @stability stable * @defautl - current directory */ readonly contextSubPath?: string; /** * The Dockerfile for the image building. * * @default Dockerfile * @stability stable */ readonly dockerfile?: string; /** * Use FARGATE_SPOT capacity provider. * * @stability stable */ readonly fargateSpot?: boolean; } /** * @stability stable */ export declare class Kaniko extends Construct { /** * @stability stable */ readonly destinationRepository: ecr.IRepository; /** * @stability stable */ readonly cluster: ecs.ICluster; /** * @stability stable */ readonly task: ecs.FargateTaskDefinition; /** * @stability stable */ readonly vpc: ec2.IVpc; private fargateSpot; /** * @stability stable */ constructor(scope: Construct, id: string, props: KanikoProps); private _createDestinationRepository; /** * Build the image with kaniko. * * @param schedule The schedule to repeatedly build the image. * @stability stable */ buildImage(id: string, schedule?: events.Schedule): void; }