Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DB Security Groups can only be associated with VPC DB Instances using API versions

I have this code below to create a RDS instance in aws:

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

But I am having always this error related to security groups:

DB Security Groups can only be associated with VPC DB Instances using API versions 2012-01-15 through 2012-09-17.

Can anyone please help solve this issue?

If I use vpc_security_groups instead of security_groups Im having:

 <Message>Invalid security group , groupId= f, u, d, t, e, a, l, groupName=.</Message>
like image 438
UserX Avatar asked Apr 03 '15 14:04

UserX


1 Answers

RDS instances in VPCs can not be members of RDS security groups. Instead, a RDS within a VPC should be in a VPC security group. In boto, use the vpc_security_groups parameter (with the VPC security group ID as its value) rather the security_groups parameter. See also the boto RDS docs for create_dbinstance().

like image 83
Ben Whaley Avatar answered Oct 01 '22 05:10

Ben Whaley