"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.CodeSigningConfig=exports.UntrustedArtifactOnDeployment=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),core_1=require("../../core"),lambda_generated_1=require("./lambda.generated");var UntrustedArtifactOnDeployment;(function(UntrustedArtifactOnDeployment2){UntrustedArtifactOnDeployment2.ENFORCE="Enforce",UntrustedArtifactOnDeployment2.WARN="Warn"})(UntrustedArtifactOnDeployment=exports.UntrustedArtifactOnDeployment||(exports.UntrustedArtifactOnDeployment={}));class CodeSigningConfig extends core_1.Resource{constructor(scope,id,props){var _b;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,this.constructor),error}const signingProfileVersionArns=props.signingProfiles.map(signingProfile=>signingProfile.signingProfileVersionArn),resource=new lambda_generated_1.CfnCodeSigningConfig(this,"Resource",{allowedPublishers:{signingProfileVersionArns},codeSigningPolicies:{untrustedArtifactOnDeployment:(_b=props.untrustedArtifactOnDeployment)!==null&&_b!==void 0?_b:UntrustedArtifactOnDeployment.WARN},description:props.description});this.codeSigningConfigArn=resource.attrCodeSigningConfigArn,this.codeSigningConfigId=resource.attrCodeSigningConfigId}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:aws: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}}exports.CodeSigningConfig=CodeSigningConfig,_a=JSII_RTTI_SYMBOL_1,CodeSigningConfig[_a]={fqn:"aws-cdk-lib.aws_lambda.CodeSigningConfig",version:"2.21.0"};
//# sourceMappingURL=code-signing-config.js.map
