"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.KeyGroup=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),cloudfront_generated_1=require("./cloudfront.generated"),core_1=require("../../core");class KeyGroup extends core_1.Resource{static fromKeyGroupId(scope,id,keyGroupId){return new class extends core_1.Resource{constructor(){super(...arguments),this.keyGroupId=keyGroupId}}(scope,id)}constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudfront_KeyGroupProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,KeyGroup),error}const resource=new cloudfront_generated_1.CfnKeyGroup(this,"Resource",{keyGroupConfig:{name:props.keyGroupName??this.generateName(),comment:props.comment,items:props.items.map(key=>key.publicKeyId)}});this.keyGroupId=resource.ref}generateName(){const name=core_1.Names.uniqueId(this);return name.length>80?name.substring(0,40)+name.substring(name.length-40):name}}exports.KeyGroup=KeyGroup,_a=JSII_RTTI_SYMBOL_1,KeyGroup[_a]={fqn:"aws-cdk-lib.aws_cloudfront.KeyGroup",version:"2.96.1"};
