localstack icon indicating copy to clipboard operation
localstack copied to clipboard

feature request: support MySQL instance for AWS RDS

Open RobertLucian opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Feature description

Currently, only MariaDB instances are supported (for these engines mysql, mariadb, aurora-mysql). Add support for MySQL instances as well.

In addition to supporting a different RDS instance type, at the same time, also preferably add support for setting the instance version at deploy time (i.e. mysql:8.0.28-debian).

🧑‍💻 Implementation

No response

Anything else?

Looking to be able to run the following with CDK on Localstack:

instance = rds.DatabaseInstance(
    self,
    "MagnusDBInstance",
    engine=rds.DatabaseInstanceEngine.mysql(
        version=rds.MysqlEngineVersion.VER_8_0_21
    ),
    instance_type=ec2.InstanceType("t2.medium"),
    vpc_subnets=ec2.SubnetSelection(subnet_type=ec2.SubnetType.PUBLIC),
    vpc=vpc.instance,
    multi_az=False,
    allocated_storage=10,
    database_name="magnusdb",
    instance_identifier=instance_identifier,
    credentials=rds.Credentials.from_secret(secret),
    security_groups=[vpc.mysql_sg],
)

RobertLucian avatar Aug 30 '22 13:08 RobertLucian

This would be really good, currently running into an error with our db migration script as it is not compatible with MariaDB and only MySQL

lukonjun avatar Sep 07 '22 10:09 lukonjun

Very useful

arita37 avatar Jan 02 '23 05:01 arita37

Hey, I'm happy to take this up I have the local Dev setup as per the docs and have gone through the codebase. I suspect that it requires changes in moto/rds/models.py please enlighten me more on this. I'm new here

uzaxirr avatar Jan 02 '23 08:01 uzaxirr

Hi @uzaxirr,

thanks for showing initiative on this issue. Unfortunately, the RDS support is a pro feature, meaning the implementation is not open-source. LocalStack Pro spins up real databases, whereas moto only provides CRUD operations for the RDS API.

steffyP avatar Jan 02 '23 09:01 steffyP

@steffyP Thanks for letting me know!

uzaxirr avatar Jan 02 '23 14:01 uzaxirr

Hi @RobertLucian, hi @lukonjun,

we have added support for MySQL images in the latest LocalStack image. It will run a MySQL instance in a new docker container, using the official images.

In order to enable this new feature, please set the environment variable RDS_MYSQL_DOCKER=1.

The engine-version will be used as the tag for the image - so you are free to use any version that is offered by MySQL. Please also consider the related docs for RDS.

Please let us know, if it works for you. We would appreciate your feedback! 🙏

steffyP avatar Jan 10 '23 13:01 steffyP