"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.TagParameterContainerImage=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var cdk=()=>{var tmp=require("../../../core");return cdk=()=>tmp,tmp},container_image_1=()=>{var tmp=require("../container-image");return container_image_1=()=>tmp,tmp};class TagParameterContainerImage extends container_image_1().ContainerImage{constructor(repository){super();try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecr_IRepository(repository)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,TagParameterContainerImage),error}this.repository=repository}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}this.repository.grantPull(containerDefinition.taskDefinition.obtainExecutionRole());const imageTagParameter=new(cdk()).CfnParameter(scope,"ImageTagParam");return this.imageTagParameter=imageTagParameter,{imageName:this.repository.repositoryUriForTag(imageTagParameter.valueAsString)}}get tagParameterName(){return cdk().Lazy.string({produce:()=>{if(this.imageTagParameter)return this.imageTagParameter.logicalId;throw new Error("TagParameterContainerImage must be used in a container definition when using tagParameterName")}})}get tagParameterValue(){return cdk().Lazy.string({produce:()=>{if(this.imageTagParameter)return this.imageTagParameter.valueAsString;throw new Error("TagParameterContainerImage must be used in a container definition when using tagParameterValue")}})}}exports.TagParameterContainerImage=TagParameterContainerImage,_a=JSII_RTTI_SYMBOL_1,TagParameterContainerImage[_a]={fqn:"aws-cdk-lib.aws_ecs.TagParameterContainerImage",version:"2.148.1"};
