"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ParameterGroup=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti"),rds_generated_1=require("./rds.generated"),core_1=require("../../core");class ParameterGroup extends core_1.Resource{static fromParameterGroupName(scope,id,parameterGroupName){class Import extends core_1.Resource{bindToCluster(_options){return{parameterGroupName}}bindToInstance(_options){return{parameterGroupName}}addParameter(_key,_value){return!1}}return new Import(scope,id)}constructor(scope,id,props){super(scope,id);try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_ParameterGroupProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ParameterGroup),error}const family=props.engine.parameterGroupFamily;if(!family)throw new Error("ParameterGroup cannot be used with an engine that doesn't specify a version");this.family=family,this.description=props.description,this.parameters=props.parameters??{}}bindToCluster(_options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_ParameterGroupClusterBindOptions(_options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bindToCluster),error}if(!this.clusterCfnGroup){const id=this.instanceCfnGroup?"ClusterParameterGroup":"Resource";this.clusterCfnGroup=new rds_generated_1.CfnDBClusterParameterGroup(this,id,{description:this.description||`Cluster parameter group for ${this.family}`,family:this.family,parameters:core_1.Lazy.any({produce:()=>this.parameters})})}return{parameterGroupName:this.clusterCfnGroup.ref}}bindToInstance(_options){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_ParameterGroupInstanceBindOptions(_options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bindToInstance),error}if(!this.instanceCfnGroup){const id=this.clusterCfnGroup?"InstanceParameterGroup":"Resource";this.instanceCfnGroup=new rds_generated_1.CfnDBParameterGroup(this,id,{description:this.description||`Parameter group for ${this.family}`,family:this.family,parameters:core_1.Lazy.any({produce:()=>this.parameters})})}return{parameterGroupName:this.instanceCfnGroup.ref}}addParameter(key,value){return this.parameters[key]=value,!0}}exports.ParameterGroup=ParameterGroup,_a=JSII_RTTI_SYMBOL_1,ParameterGroup[_a]={fqn:"aws-cdk-lib.aws_rds.ParameterGroup",version:"2.96.1"};
