aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 3.07 kB
JavaScript
"use strict";var _a;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ParameterGroup=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var rds_generated_1=()=>{var tmp=require("./rds.generated");return rds_generated_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp};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.name=props.name,this.parameters=props.parameters??{},this.removalPolicy=props.removalPolicy}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,dbClusterParameterGroupName:this.name,parameters:core_1().Lazy.any({produce:()=>this.parameters})})}return this.removalPolicy&&this.clusterCfnGroup.applyRemovalPolicy(this.removalPolicy??core_1().RemovalPolicy.DESTROY),{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,dbParameterGroupName:this.name,parameters:core_1().Lazy.any({produce:()=>this.parameters})})}return this.removalPolicy&&this.instanceCfnGroup.applyRemovalPolicy(this.removalPolicy??core_1().RemovalPolicy.DESTROY),{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.160.0"};