"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RepositoryImage=void 0;const jsiiDeprecationWarnings=require("../../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),core_1=require("../../../core"),container_image_1=require("../container-image"),ECR_IMAGE_REGEX=/(^[a-zA-Z0-9][a-zA-Z0-9-_]*).dkr.ecr.([a-zA-Z0-9][a-zA-Z0-9-_]*).amazonaws.com(.cn)?\/.*/;class RepositoryImage extends container_image_1.ContainerImage{constructor(imageName,props={}){super(),this.imageName=imageName,this.props=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.constructor),error}}bind(scope,containerDefinition){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_ecs_ContainerDefinition(containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return!core_1.Token.isUnresolved(this.imageName)&&ECR_IMAGE_REGEX.test(this.imageName)&&core_1.Annotations.of(scope).addWarning("Proper policies need to be attached before pulling from ECR repository, or use 'fromEcrRepository'."),this.props.credentials&&this.props.credentials.grantRead(containerDefinition.taskDefinition.obtainExecutionRole()),{imageName:this.imageName,repositoryCredentials:this.props.credentials&&{credentialsParameter:this.props.credentials.secretArn}}}}exports.RepositoryImage=RepositoryImage,_a=JSII_RTTI_SYMBOL_1,RepositoryImage[_a]={fqn:"aws-cdk-lib.aws_ecs.RepositoryImage",version:"2.21.0"};
//# sourceMappingURL=repository.js.map
