使用 AWS CLI 设置的 RDS 中 --db-security-groups 和 --vpc-security-group-ids 之间的区别

Difference between --db-security-groups and --vpc-security-group-ids in RDS set up using AWS CLI

我正在尝试使用 CLI 创建 AWS RDS,通常我使用 AWS 控制台创建它。当我尝试创建 RDS 实例时,我看到了这两个参数:

  1. --db-安全组
  2. --vpc-security-group-ids

这两个值有什么区别?我无法通过控制台找到与 --db-security-groups 相关的值。这些是 AWS 在文档中提供的定义:

--db-security-groups (list)

A list of DB security groups to associate with this DB instance.

Default: The default DB security group for the database engine.

--vpc-security-group-ids (list)

A list of Amazon EC2 VPC security groups to associate with this DB instance.

Amazon Aurora Not applicable. The associated list of EC2 VPC security groups is managed by the DB cluster.

Default: The default EC2 VPC security group for the DB subnet group's VPC.

我还是没看懂,有什么区别。或者是否有任何特定于数据库的安全组?

这在AWS docs中有解释:

DB security groups are used with DB instances that are not in a VPC and on the EC2-Classic platform.

这些天你只会使用 vpc-security-group-ids,除非你有旧的 aws 帐户。

详细比较也在[文档]中(DB security groups vs. VPC security groups):