"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.DatabaseSecret=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),crypto=require("crypto"),secretsmanager=require("../../aws-secretsmanager"),core_1=require("../../core"),util_1=require("./private/util");class DatabaseSecret extends secretsmanager.Secret{constructor(scope,id,props){var _b,_c;try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_DatabaseSecretProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.constructor),error}const excludeCharacters=(_b=props.excludeCharacters)!==null&&_b!==void 0?_b:util_1.DEFAULT_PASSWORD_EXCLUDE_CHARS;if(super(scope,id,{encryptionKey:props.encryptionKey,description:`Generated by the CDK for stack: ${core_1.Aws.STACK_NAME}`,secretName:props.secretName,generateSecretString:{passwordLength:30,secretStringTemplate:JSON.stringify({username:props.username,masterarn:(_c=props.masterSecret)===null||_c===void 0?void 0:_c.secretArn}),generateStringKey:"password",excludeCharacters},replicaRegions:props.replicaRegions}),props.replaceOnPasswordCriteriaChanges){const hash=crypto.createHash("md5");hash.update(JSON.stringify({excludeCharacters}));const logicalId=`${core_1.Names.uniqueId(this)}${hash.digest("hex")}`;this.node.defaultChild.overrideLogicalId(logicalId.slice(-255))}}}exports.DatabaseSecret=DatabaseSecret,_a=JSII_RTTI_SYMBOL_1,DatabaseSecret[_a]={fqn:"aws-cdk-lib.aws_rds.DatabaseSecret",version:"2.24.1"};
//# sourceMappingURL=database-secret.js.map
