"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Addon=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var eks_generated_1=()=>{var tmp=require("./eks.generated");return eks_generated_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp};class Addon extends core_1().Resource{static fromAddonAttributes(scope,id,attrs){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_eks_AddonAttributes(attrs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromAddonAttributes),error}class Import extends core_1().Resource{constructor(){super(...arguments),this.addonName=attrs.addonName,this.addonArn=core_1().Stack.of(scope).formatArn({service:"eks",resource:"addon",resourceName:`${attrs.clusterName}/${attrs.addonName}`})}}return new Import(scope,id)}static fromAddonArn(scope,id,addonArn){const parsedArn=core_1().Stack.of(scope).splitArn(addonArn,core_1().ArnFormat.COLON_RESOURCE_NAME),splitResourceName=core_1().Fn.split("/",parsedArn.resourceName);class Import extends core_1().Resource{constructor(){super(...arguments),this.addonName=core_1().Fn.select(1,splitResourceName),this.addonArn=addonArn}}return new Import(scope,id)}constructor(scope,id,props){super(scope,id,{physicalName:props.addonName});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_eks_AddonProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Addon),error}this.clusterName=props.cluster.clusterName,this.addonName=props.addonName;const resource=new(eks_generated_1()).CfnAddon(this,"Resource",{addonName:props.addonName,clusterName:this.clusterName,addonVersion:props.addonVersion,preserveOnDelete:props.preserveOnDelete});this.addonName=this.getResourceNameAttribute(resource.ref),this.addonArn=this.getResourceArnAttribute(resource.attrArn,{service:"eks",resource:"addon",resourceName:`${this.clusterName}/${this.addonName}/`})}}exports.Addon=Addon,_a=JSII_RTTI_SYMBOL_1,Addon[_a]={fqn:"aws-cdk-lib.aws_eks.Addon",version:"2.159.0"};
