UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 3.58 kB
"use strict";var _a,_b;Object.defineProperty(exports,"__esModule",{value:!0}),exports.PerformanceInsightRetention=exports.SnapshotCredentials=exports.Credentials=void 0;const jsiiDeprecationWarnings=require("../../.warnings.jsii.js"),JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class Credentials{static fromGeneratedSecret(username,options={}){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_CredentialsBaseOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromGeneratedSecret),error}return{...options,username,usernameAsString:!0}}static fromPassword(username,password){try{jsiiDeprecationWarnings.aws_cdk_lib_SecretValue(password)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromPassword),error}return{username,password,usernameAsString:!0}}static fromUsername(username,options={}){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_CredentialsFromUsernameOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromUsername),error}return{...options,username}}static fromSecret(secret,username){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_secretsmanager_ISecret(secret)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromSecret),error}return{username:username??secret.secretValueFromJson("username").unsafeUnwrap(),password:secret.secretValueFromJson("password"),encryptionKey:secret.encryptionKey,secret}}}exports.Credentials=Credentials,_a=JSII_RTTI_SYMBOL_1,Credentials[_a]={fqn:"aws-cdk-lib.aws_rds.Credentials",version:"2.70.0"};class SnapshotCredentials{static fromGeneratedSecret(username,options={}){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_SnapshotCredentialsFromGeneratedPasswordOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromGeneratedSecret),error}return{...options,generatePassword:!0,replaceOnPasswordCriteriaChanges:!0,username}}static fromGeneratedPassword(username,options={}){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_rds_SnapshotCredentialsFromGeneratedPasswordOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromGeneratedPassword),error}return{...options,generatePassword:!0,username}}static fromPassword(password){try{jsiiDeprecationWarnings.aws_cdk_lib_SecretValue(password)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromPassword),error}return{generatePassword:!1,password}}static fromSecret(secret){try{jsiiDeprecationWarnings.aws_cdk_lib_aws_secretsmanager_ISecret(secret)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromSecret),error}return{generatePassword:!1,password:secret.secretValueFromJson("password"),secret}}}exports.SnapshotCredentials=SnapshotCredentials,_b=JSII_RTTI_SYMBOL_1,SnapshotCredentials[_b]={fqn:"aws-cdk-lib.aws_rds.SnapshotCredentials",version:"2.70.0"};var PerformanceInsightRetention;(function(PerformanceInsightRetention2){PerformanceInsightRetention2[PerformanceInsightRetention2.DEFAULT=7]="DEFAULT",PerformanceInsightRetention2[PerformanceInsightRetention2.LONG_TERM=731]="LONG_TERM"})(PerformanceInsightRetention=exports.PerformanceInsightRetention||(exports.PerformanceInsightRetention={}));