【问题标题】:Assign RDS to a VPC using AWS CLI使用 AWS CLI 将 RDS 分配给 VPC
【发布时间】:2018-03-19 10:20:25
【问题描述】:

我正在使用

创建一个 RDS

创建数据库实例

如何将其分配给 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 \

【问题讨论】:

    标签: amazon-web-services amazon-rds aws-cli


    【解决方案1】:

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

    子网属于 VPC。

    因此,顺序为:

    • 创建一个 DBSubnetGroup 指向您的 VPC 中的子网
    • 在 DBSubnetGroup 中启动 RDS 实例

    【讨论】:

    • 知道了,谢谢。有什么建议我可以只列出所有 DBSubnetGroups 名称吗?
    • 这是有效的..> aws rds describe-db-subnet-groups --query DBSubnetGroups[*].DBSubnetGroupName --output table
    猜你喜欢
    • 2013-11-01
    • 2020-11-15
    • 1970-01-01
    • 2021-01-14
    • 1970-01-01
    • 2015-09-08
    • 2021-03-14
    • 2019-09-18
    • 2016-08-30
    相关资源
    最近更新 更多