Skip to content

Commit

Permalink
feat: rds servrless resources ok
Browse files Browse the repository at this point in the history
Signed-off-by: seven <zilisheng1996@gmail.com>
  • Loading branch information
Blankll committed Jan 1, 2025
1 parent fa9d737 commit 0a311f5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 12 deletions.
28 changes: 25 additions & 3 deletions src/stack/rosStack/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,39 @@ export const resolveDatabases = (
replaceReference(db.key, context),
{
engine: rdsEngineMap.get(db.type) as string,
/**
* Serverless 实例
* MySQL:5.7、8.0
* SQL Server:2016_std_sl、2017_std_sl、2019_std_sl
* PostgreSQL:14.0、15.0、16.0
*/
engineVersion: replaceReference(db.version, context),
category: 'Basic',
dbInstanceClass: 'pg.n1e.1c.1m',
dbInstanceStorage: replaceReference(db.storage.min, context),
securityIpList: '0.0.0.0/0',
/** Serverless 实例
* serverless_basic:Serverless 基础系列。(仅适用 MySQL 和 PostgreSQL)
* serverless_standard:Serverless 高可用系列。(仅适用 MySQL 和 PostgreSQL)
* serverless_ha:SQL Server Serverless 高可用系列。
*/
category: 'serverless_basic',
dbInstanceClass: 'pg.n2.serverless.1c',
dbInstanceStorageType: 'cloud_essd',
payType: 'Postpaid',
payType: 'Serverless',
/**
* MaxCapacity:
* MySQL:1~32
* SQL Server:2~8
* PostgreSQL:1~14
* MinCapacity:
* MySQL:0.5~32
* SQL Server:2~8(仅支持整数)
* PostgreSQL:0.5~14
*/
serverlessConfig: {
minCapacity: replaceReference(db.cu.min, context),
maxCapacity: replaceReference(db.cu.max, context),
autoPause: true,
switchForce: false,
},
},
true,
Expand Down
24 changes: 15 additions & 9 deletions tests/fixtures/serverless-insight-es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@ provider:
region: cn-chengdu


service: insight-es-poc
service: insight-db-poc

tags:
owner: geek-fun

databases:
insight_es_db:
name: insight-poc-es
type: ELASTICSEARCH_SERVERLESS
version: '7.10'
engine_mode: SEARCH
cu: 1
storage_size: 20
# insight_es_db:
# name: insight-poc-es
# type: ELASTICSEARCH_SERVERLESS
# version: '7.10'
# engine_mode: SEARCH
# cu: 1
# storage_size: 20
# security:
# basic_auth:
# password: 'U34I6InQ8elseTgqTWT2t2oFXpoqFg'
insight_poc_db:
name: insight-poc-rds
type: RDS_POSTGRESQL_SERVERLESS
version: '16.0'
security:
basic_auth:
password: 'U34I6InQ8elseTgqTWT2t2oFXpoqFg'

0 comments on commit 0a311f5

Please sign in to comment.