UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 2.15 kB
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ContainerImage=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),aws_ecr_assets_1=require("../../aws-ecr-assets");class ContainerImage{static fromRegistry(name,props={}){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_RepositoryImageProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromRegistry),error}return new repository_1.RepositoryImage(name,props)}static fromEcrRepository(repository,tag="latest"){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecr_IRepository(repository)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromEcrRepository),error}return new ecr_1.EcrImage(repository,tag)}static fromAsset(directory,props={}){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_AssetImageProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromAsset),error}return new asset_image_1.AssetImage(directory,props)}static fromDockerImageAsset(asset){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecr_assets_DockerImageAsset(asset)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromDockerImageAsset),error}return{bind(_scope,containerDefinition){return asset.repository.grantPull(containerDefinition.taskDefinition.obtainExecutionRole()),{imageName:asset.imageUri}}}}static fromTarball(tarballFile){return{bind(scope,containerDefinition){const asset=new aws_ecr_assets_1.TarballImageAsset(scope,"Tarball",{tarballFile});return asset.repository.grantPull(containerDefinition.taskDefinition.obtainExecutionRole()),{imageName:asset.imageUri}}}}}exports.ContainerImage=ContainerImage,_a=JSII_RTTI_SYMBOL_1,ContainerImage[_a]={fqn:"aws-cdk-lib.aws_ecs.ContainerImage",version:"2.70.0"};const asset_image_1=require("./images/asset-image"),ecr_1=require("./images/ecr"),repository_1=require("./images/repository");