2017-10-07 153 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 –