"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeSigningConfig=exports.UntrustedArtifactOnDeployment=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var lambda_generated_1=()=>{var tmp=require("./lambda.generated");return lambda_generated_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},UntrustedArtifactOnDeployment;(function(UntrustedArtifactOnDeployment2){UntrustedArtifactOnDeployment2.ENFORCE="Enforce",UntrustedArtifactOnDeployment2.WARN="Warn"})(UntrustedArtifactOnDeployment||(exports.UntrustedArtifactOnDeployment=UntrustedArtifactOnDeployment={}));class CodeSigningConfig extends core_1().Resource{static fromCodeSigningConfigArn(scope,id,codeSigningConfigArn){const codeSigningProfileId=core_1().Stack.of(scope).splitArn(codeSigningConfigArn,core_1().ArnFormat.SLASH_RESOURCE_NAME).resourceName;if(!codeSigningProfileId)throw new Error(`Code signing config ARN must be in the format 'arn:<partition>:lambda:<region>:<account>:code-signing-config:<codeSigningConfigArn>', got: '${codeSigningConfigArn}'`);const assertedCodeSigningProfileId=codeSigningProfileId;class Import extends core_1().Resource{constructor(){super(scope,id),this.codeSigningConfigArn=codeSigningConfigArn,this.codeSigningConfigId=assertedCodeSigningProfileId}}return new Import}constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_lambda_CodeSigningConfigProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CodeSigningConfig),error}const signingProfileVersionArns=props.signingProfiles.map(signingProfile=>signingProfile.signingProfileVersionArn),resource=new(lambda_generated_1()).CfnCodeSigningConfig(this,"Resource",{allowedPublishers:{signingProfileVersionArns},codeSigningPolicies:{untrustedArtifactOnDeployment:props.untrustedArtifactOnDeployment??UntrustedArtifactOnDeployment.WARN},description:props.description});this.codeSigningConfigArn=resource.attrCodeSigningConfigArn,this.codeSigningConfigId=resource.attrCodeSigningConfigId}}exports.CodeSigningConfig=CodeSigningConfig,_a=JSII_RTTI_SYMBOL_1,CodeSigningConfig[_a]={fqn:"aws-cdk-lib.aws_lambda.CodeSigningConfig",version:"2.159.0"};
