2017-10-07 87 views
2

VPC的我创建一个RDS使用分配RDS使用AWS CLI

创建-DB实例

我怎么把它分配给VPC组?我没有看到任何标签来实现这一点。它正在挑选默认VPC组并分配给RDS。

这里是我用来创建RDS脚本(我传递变量这是在bash脚本中定义的变量)。>>

aws rds create-db-instance \ 
--db-name WIND \ 
--vpc-security-group-ids $sgGroup_id \ 
--db-instance-identifier $Instance_Identifier \ 
--allocated-storage 100 \ 
--copy-tags-to-snapshot \ 
--db-instance-class ${arrDbClass[$iDbClass]} \ 
--engine oracle-ee \ 
--engine-version ${arrEngVer[$iEngVer]} \ 
--license-model bring-your-own-license \ 
--master-username oraadmin \ 
--master-user-password $oraadminPassword \ 
--no-auto-minor-version-upgrade \ 
--no-publicly-accessible \ 
--backup-retention-period $backup_Retention_Period \ 
--no-storage-encrypted \ 
--storage-type gp2 \ 
--no-enable-iam-database-authentication \ 
    $multi_Az \ 

回答

4

使用--db-subnet-group-name指向一个DBSubnetGroup,这包含数据库允许启动的子网列表。

子网属于VPC。

因此,顺序是:

  • 在VPC创建指向子网DBSubnetGroup
  • 启动的RDS实例到DBSubnetGroup
+0

明白了,谢谢。任何建议如何列出所有DBSubnetGroups名称? –

+1

This is working ..> aws rds describe-db-subnet-groups --query DBSubnetGroups [*]。DBSubnetGroupName --output table –