我有下面的代码在 aws 中创建 RDS 实例:
import boto.rds
REGION="us-east-1"
INSTANCE_TYPE="db.t1.micro"
ID = "MySQL-db-instance-database-test2"
USERNAME="root"
PASSWORD = "pass"
DB_PORT = 3306
DB_SIZE = 5
DB_ENGINE = "MySQL5.1"
DB_NAME = "databasetest2"
SECGROUP_HANDLE="default"
print "Connecting to RDS"
conn = boto.rds.connect_to_region(REGION)
print "Creating a RDS Instance"
instance = conn.create_dbinstance(ID, DB_SIZE, INSTANCE_TYPE, USERNAME, PASSWORD, port=DB_PORT, engine=DB_ENGINE,db_name=DB_NAME, security_groups = [SECGROUP_HANDLE],)
print instance
但我总是遇到与安全组相关的错误:
数据库安全组只能与使用 API 版本 2012-01-15 至 2012-09-17 的 VPC 数据库实例关联。
有人可以帮忙解决这个问题吗?
如果我使用 vpc_security_group_ids 而不是 security_groups 我将拥有:
<Message>Invalid security group , groupId= f, u, d, t, e, a, l, groupName=.</Message>