How to use @aws-cdk/aws-ecr-assets - 2 common examples

To help you get started, we’ve selected a few @aws-cdk/aws-ecr-assets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / @aws-cdk / aws-ecs / lib / images / asset-image.ts View on Github external
public bind(scope: cdk.Construct, containerDefinition: ContainerDefinition): ContainerImageConfig {
    const asset = new DockerImageAsset(scope, 'AssetImage', {
      directory: this.directory,
      buildArgs: this.props.buildArgs,
      target: this.props.target,
    });
    asset.repository.grantPull(containerDefinition.taskDefinition.obtainExecutionRole());

    return {
      imageName: asset.imageUri,
    };
  }
}
github aws / aws-cdk / packages / @aws-cdk / aws-codebuild / lib / project.ts View on Github external
public static fromAsset(scope: Construct, id: string, props: DockerImageAssetProps): IBuildImage {
    const asset = new DockerImageAsset(scope, id, props);
    return new WindowsBuildImage({
      imageId: asset.imageUri,
      imagePullPrincipalType: ImagePullPrincipalType.SERVICE_ROLE,
      repository: asset.repository,
    });
  }

@aws-cdk/aws-ecr-assets

Docker image assets deployed to ECR

Apache-2.0
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis

Popular @aws-cdk/aws-ecr-assets functions