AmericanRedCross / osm-stats

Track and analyze contributions to Missing Maps
http://missingmaps.org
BSD 3-Clause "New" or "Revised" License
26 stars 9 forks source link

Error creating RDS database VPC vs non-VPC #30

Closed kriscarle closed 7 years ago

kriscarle commented 8 years ago

I get the following error:

14:31:15: Creating RDS database osmstats Traceback (most recent call last): File "./osmstats.py", line 110, in db = create_database(args.name, args.password, dbclass=args.dbclass) File "/Users/kris/dev/loggingroads/osm-stats/deploy/boto3utils.py", line 125, in create_database AllocatedStorage=storage File "/Library/Python/2.7/site-packages/botocore/client.py", line 252, in _api_call return self._make_api_call(operation_name, kwargs) File "/Library/Python/2.7/site-packages/botocore/client.py", line 542, in _make_api_call raise ClientError(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (InvalidParameterCombination) when calling the CreateDBInstance operation: VPC Security Groups cannot be associated with non-VPC DB Instances.

According to Amazon's documentation http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html

If there is no DB subnet group, then it is a non-VPC DB instance.

I got around this by

  1. Adding the VpcId to the create_security_group() call
  2. Adding a DBSubnetGroupName to the create_db_instance() call

I'm pretty new to AWS especially the security group stuff, so I'm not sure if I'm not sure if this is because something is different about my account and what it does by default? Are you using a VPC or EC2-classic?

I'm happy to help put together a PR, if this turns out to be a bug.

kriscarle commented 8 years ago

In case it helps, I think part of my problem here is that I don't have a default VPC. My account is older than 2013, so maybe I never had one, or maybe a deleted the default at some point.

https://aws.amazon.com/premiumsupport/knowledge-center/deleted-default-vpc/