AWS弹性魔豆变化RDS端点 [英] AWS Elastic Beanstalk change RDS Endpoint

查看:235
本文介绍了AWS弹性魔豆变化RDS端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何修改我的AWS弹性魔豆环境的配置RDS终点? 例如。所述RDS数据库已被删除或应更换新的RDS数据库后

解决方案

更新

主题依然复杂和 AWS弹性魔豆(EB)文档仍然可以做得更好澄清可用的选项。这个问题一直是有关如何的更改RDS端点的,这似乎读出两种不同的方式:

  1. 在一个可以跨preT是如何的连接的现有外部管理的RDS端点,以现有的(不是新!)EB环境 - 这确实是不可能的,而人会需要采取处理这种情况下从应用程序本身,例如内在节中概述的中的的=nofollow的>使用Amazon RDS与Python
  2. 相反,OP问如何做到这一点的的RDS数据库已被删除或应更换新的RDS数据库的,即在的RDS端点的变化是隐含在过程中创造一个现有的EB环境,已经有一个一个新的RDS数据库 - 这确实是可以通过的 DBSnapshotIdentifier <一种手段href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html#command-options-general"相对=nofollow>选项值,它表示的的标识符数据库快照从。再一次EB文档是不完全定论这是什么意思,但是,EB是使用 AWS CloudFormation 下引擎盖,和RESP。条目<一个href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsnapshotidentifier"相对=nofollow> AWS :: RDS :: dbinstance具备 - DBSnapshotIdentifier 提供了更多的细节:

      

    通过指定这个属性,你可以创建从一个数据库实例   指定的数据库快照。如果DBSnapshotIdentifier属性是一个   空字符串或AWS :: RDS :: dbinstance具备声明没有   DBSnapshotIdentifier属性,该数据库作为新创建   数据库。如果属性包含一个值(不是空字符串等),   AWS CloudFormation从指定的快照数据库。如果   具有指定名称的快照不存在,数据库   创建失败,堆栈回滚。

  3.   
  换句话说,更新任何的典型结果<一href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html#command-options-general"相对=nofollow>常规选项值从命名空间 AWS:RDS:dbinstance具备在现有的EB环境是由EB管理创建分别调整RDS实例,因此,一个新的RDS端点。

  • 一个具体的子场景是使用 DBSnapshotIdentifier 的,这将产生在EB管理的新的RDS例如基于所引用的快照,因此可用于迁移的(而非的的)现有的外部管理的RDS实例,尽管基于快照大小相当的停机时间。

初始答案

虽然很遗憾没有在配置数据库的具体阐述与AWS弹性魔豆,在 AWS弹性魔豆设置可选的亚马逊RDS 数据库通过的选项值,请参阅命名空间 AWS:RDS:dbinstance具备在<一个href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html#command-options-general"相对=nofollow>常规选项。

虽然 AWS管理控制台隐藏了很多的用户界面背后的那些选项值,你可以指定它们通过其他方式明确使用时的API,无论是创造一个环境时,以及更新一个作为时(这是你将如何改变RDS数据库实例的任何设置) - 如见参数 - 选项 - 设置的的更新环境从该 AWS命令行界面

  

如果指定,AWS弹性魔豆更新与运行环境相关的配置设置,并设置为请求值指定的配置选项。

How do I change the configured RDS endpoint of an AWS Elastic Beanstalk environment? E.g. after the RDS database was deleted or should be replaced with a new RDS database.

解决方案

Update

The topic remains complex and the AWS Elastic Beanstalk (EB) documentation could still do a better job to clarify available options. The question has been about how to change an RDS endpoint, which seems to be read in two different ways:

  1. One could interpret it about how to attach an existing externally managed RDS endpoint to an existing (not new!) EB environment - this is indeed not possible, rather one would need to resort to handling this scenario from within the app itself as e.g. outlined in section Using an Existing Amazon RDS DB Instance with Python within Using Amazon RDS with Python.
  2. Rather, the OP asked about how to do that after the RDS database was deleted or should be replaced with a new RDS database, i.e. the RDS endpoint change is implied in the process of creating a new RDS database for an existing EB environment that already had one - this is indeed possible by means of the DBSnapshotIdentifier Option Value, which denotes The identifier for the DB snapshot to restore from. Once again the EB docs aren't exactly conclusive what this means, however, EB is using AWS CloudFormation under the hood, and the resp. entry for AWS::RDS::DBInstance - DBSnapshotIdentifier provides more details:

    By specifying this property, you can create a DB instance from the specified DB snapshot. If the DBSnapshotIdentifier property is an empty string or the AWS::RDS::DBInstance declaration has no DBSnapshotIdentifier property, the database is created as a new database. If the property contains a value (other than empty string), AWS CloudFormation creates a database from the specified snapshot. If a snapshot with the specified name does not exist, the database creation fails and the stack rolls back.

In other words, the typical result of updating any of the General Option Values from namespace aws:rds:dbinstance for an existing EB environment is the creation of a respectively adjusted RDS instance managed by EB, and thus a new RDS endpoint.

  • A specific sub scenario is the use of DBSnapshotIdentifier, which yields a new RDS instance managed by EB based on the referenced snapshot and can therefore be used to migrate (rather than attach) an existing externally managed RDS instance, albeit with considerable downtime based on the snapshot size.

Initial Answer

While unfortunately not specifically addressed within Configuring Databases with AWS Elastic Beanstalk, the AWS Elastic Beanstalk settings for an optional Amazon RDS database are handled via Option Values, see namespace aws:rds:dbinstance within General Options.

While the AWS Management Console hides many of those option values behind its UI, you can specify them explicitly when using the API via other means, both when creating an environment as well as when updating one (which is how you would change any settings of an RDS database instance) - see e.g. parameter --option-settings for update-environment from the the AWS Command Line Interface:

If specified, AWS Elastic Beanstalk updates the configuration set associated with the running environment and sets the specified configuration options to the requested value.

这篇关于AWS弹性魔豆变化RDS端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆