Restoring an Elastic Beanstalk RDS

邮差的信 提交于 2021-02-10 08:07:01

问题


When rebuilding an elastic beanstalk environment, EB automatically recreates a new and associated RDS instance.

Once associated, RDS instances cannot be dissociated from an EB environment.

I have a snapshot of the previous RDS prior to the rebuild.

You cannot restore RDS snapshots to an existing RDS instance.

How then, can I rebuild the environment with my desired snapshot attached? Or, how can I use my existing snapshot, or how can I migrate the existing snapshot data to the new database (I tried a data export with create schema's but lacked permissions on the import). Any appropriate but ideally simple option will do.


回答1:


If you have a snapshot of your RDS DB, you can create a new environment with it. For this, you need to specify the DBSnapshotIdentifier option setting.

  1. Create a file .ebextensions/rds_builder.config in the root of your project
  2. Add the following:

    option_settings:
      aws:rds:dbinstance:
        DBSnapshotIdentifier: <snapshot ID here>
    

EDIT:

You can also create a new environment using a saved configuration template of the present one. It is likely that this saved template will contain information in the aws:rds:dbinstance (since you have associated your present environment with an RDS), so you would need to basically modify this bit to point to your snapshot. This should work, and is probably the better approach.



来源:https://stackoverflow.com/questions/49224288/restoring-an-elastic-beanstalk-rds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!