Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elastic Beanstalk: Migrate DB Security Group to VPC Security Group

When trying to deploy my application, I recently got the following error:

ERROR: Service:AmazonCloudFormation, Message:Stack named
'awseb-e-123-stack' aborted operation. Current state: 'UPDATE_ROLLBACK_IN_PROGRESS'
Reason: The following resource(s) failed to update: [AWSEBRDSDatabase]. 
ERROR: Updating RDS database named: abcdefg12345 failed
Reason: DB Security Groups can no longer be associated
with this DB Instance.  Use VPC Security Groups instead.
ERROR: Failed to deploy application.                                

How do you switch over a DB Security Group to a VPC Security Group? Steps for using the Elastic Beanstalk Console would be greatly appreciated.

like image 434
Will Avatar asked Nov 16 '25 11:11

Will


1 Answers

For anyone arriving via Google, here's how you do it via CloudFormation: The official docs contains an example, at the very bottom https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.html#Overview.RDSSecurityGroups.DeleteDBVPCGroups

SecurityGroup:
Type: "AWS::EC2::SecurityGroup"
Properties:
  VpcId: <vpc_id>
  GroupDescription: Explain your SG
  SecurityGroupIngress:
    - Description: Ingress description
      CidrIp: 10.214.0.0/16
      IpProtocol: tcp
      FromPort: 3306
      ToPort: 3306
RDSDb:
Type: 'AWS::RDS::DBInstance'
Properties:
  VPCSecurityGroups:
    - Fn::GetAtt:
        - SecurityGroup
        - GroupId
like image 78
Dylan Munyard Avatar answered Nov 18 '25 02:11

Dylan Munyard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!