"use strict";var _a,_b,_c;Object.defineProperty(exports,"__esModule",{value:!0}),exports.AccessEntry=exports.AccessEntryType=exports.AccessPolicy=exports.AccessPolicyArn=exports.AccessScopeType=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},AccessScopeType;(function(AccessScopeType2){AccessScopeType2.NAMESPACE="namespace",AccessScopeType2.CLUSTER="cluster"})(AccessScopeType||(exports.AccessScopeType=AccessScopeType={}));class AccessPolicyArn{static of(policyName){return new AccessPolicyArn(policyName)}constructor(policyName){this.policyName=policyName,this.policyArn=`arn:${core_1().Aws.PARTITION}:eks::aws:cluster-access-policy/${policyName}`}}exports.AccessPolicyArn=AccessPolicyArn,_a=JSII_RTTI_SYMBOL_1,AccessPolicyArn[_a]={fqn:"aws-cdk-lib.aws_eks.AccessPolicyArn",version:"2.159.0"},AccessPolicyArn.AMAZON_EKS_ADMIN_POLICY=AccessPolicyArn.of("AmazonEKSAdminPolicy"),AccessPolicyArn.AMAZON_EKS_CLUSTER_ADMIN_POLICY=AccessPolicyArn.of("AmazonEKSClusterAdminPolicy"),AccessPolicyArn.AMAZON_EKS_ADMIN_VIEW_POLICY=AccessPolicyArn.of("AmazonEKSAdminViewPolicy"),AccessPolicyArn.AMAZON_EKS_EDIT_POLICY=AccessPolicyArn.of("AmazonEKSEditPolicy"),AccessPolicyArn.AMAZON_EKS_VIEW_POLICY=AccessPolicyArn.of("AmazonEKSViewPolicy");class AccessPolicy{static fromAccessPolicyName(policyName,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_eks_AccessPolicyNameOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromAccessPolicyName),error}class Import{constructor(){this.policy=`arn:${core_1().Aws.PARTITION}:eks::aws:cluster-access-policy/${policyName}`,this.accessScope={type:options.accessScopeType,namespaces:options.namespaces}}}return new Import}constructor(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_eks_AccessPolicyProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,AccessPolicy),error}this.accessScope=props.accessScope,this.policy=props.policy.policyArn}}exports.AccessPolicy=AccessPolicy,_b=JSII_RTTI_SYMBOL_1,AccessPolicy[_b]={fqn:"aws-cdk-lib.aws_eks.AccessPolicy",version:"2.159.0"};var AccessEntryType;(function(AccessEntryType2){AccessEntryType2.STANDARD="Standard",AccessEntryType2.FARGATE_LINUX="FARGATE_LINUX",AccessEntryType2.EC2_LINUX="EC2_LINUX",AccessEntryType2.EC2_WINDOWS="EC2_WINDOWS"})(AccessEntryType||(exports.AccessEntryType=AccessEntryType={}));class AccessEntry extends core_1().Resource{static fromAccessEntryAttributes(scope,id,attrs){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_eks_AccessEntryAttributes(attrs)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromAccessEntryAttributes),error}class Import extends core_1().Resource{constructor(){super(...arguments),this.accessEntryName=attrs.accessEntryName,this.accessEntryArn=attrs.accessEntryArn}}return new Import(scope,id)}constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_eks_AccessEntryProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,AccessEntry),error}this.cluster=props.cluster,this.principal=props.principal,this.accessPolicies=props.accessPolicies;const resource=new(eks_generated_1()).CfnAccessEntry(this,"Resource",{clusterName:this.cluster.clusterName,principalArn:this.principal,type:props.accessEntryType,accessPolicies:core_1().Lazy.any({produce:()=>this.accessPolicies.map(p=>({accessScope:{type:p.accessScope.type,namespaces:p.accessScope.namespaces},policyArn:p.policy}))})});this.accessEntryName=this.getResourceNameAttribute(resource.ref),this.accessEntryArn=this.getResourceArnAttribute(resource.attrAccessEntryArn,{service:"eks",resource:"accessentry",resourceName:this.physicalName})}addAccessPolicies(newAccessPolicies){this.accessPolicies.push(...newAccessPolicies)}}exports.AccessEntry=AccessEntry,_c=JSII_RTTI_SYMBOL_1,AccessEntry[_c]={fqn:"aws-cdk-lib.aws_eks.AccessEntry",version:"2.159.0"};
