使用 AWS CLI 将 RDS 分配给 VPC
Assign RDS to a VPC using AWS CLI
我正在使用
创建 RDS
create-db-instance
如何分配给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 \
使用 --db-subnet-group-name
指向 DBSubnetGroup,其中包含允许启动数据库的子网列表。
子网属于一个 VPC。
因此,顺序是:
- 创建一个指向您的 VPC 中的子网的 DBSubnetGroup
- 将 RDS 实例启动到 DBSubnetGroup
我正在使用
创建 RDScreate-db-instance
如何分配给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 \
使用 --db-subnet-group-name
指向 DBSubnetGroup,其中包含允许启动数据库的子网列表。
子网属于一个 VPC。
因此,顺序是:
- 创建一个指向您的 VPC 中的子网的 DBSubnetGroup
- 将 RDS 实例启动到 DBSubnetGroup