"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"),util_1=require("./private/util"),secretsmanager=require("../../aws-secretsmanager"),core_1=require("../../core"),helpers_internal_1=require("../../core/lib/helpers-internal");class DatabaseSecret extends secretsmanager.Secret{constructor(scope,id,props){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_DatabaseSecretProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,DatabaseSecret),error}const excludeCharacters=props.excludeCharacters??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,dbname:props.dbname,masterarn:props.masterSecret?.secretArn}),generateStringKey:"password",excludeCharacters},replicaRegions:props.replicaRegions}),props.replaceOnPasswordCriteriaChanges){const hash=(0,helpers_internal_1.md5hash)(JSON.stringify({excludeCharacters})),logicalId=`${core_1.Names.uniqueId(this)}${hash}`;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.96.1"};
