[英]Is there a way to create a cross-region read only replica of an RDS instance?
I need to create a read only replica in a different region via Ansible. 我需要通过Ansible在其他区域中创建一个只读副本。
The docs don't seem to mention if this is possible. 文档似乎没有提到这是否可行。 They only mention normal read only replicas:
他们只提到普通的只读副本:
# Create a read-only replica and wait for it to become available
- rds:
command: replicate
instance_name: new-database-replica
source_instance: new_database
wait: yes
wait_timeout: 600
When creating cross region replicas it works pretty much exactly the same as creating normal read replicas except that instead of specifying the instance identifier you must specify the full ARN. 创建跨区域副本时,其工作原理与创建普通只读副本几乎完全相同,除了必须指定完整的ARN而不是指定实例标识符。 This then means that if you have a source instance called
my-mysql-instance
in US East 1 in the account 123456789012
then your ARN (and so instance_name
parameter to the RDS module) will look like this: 这意味着如果您在帐户
123456789012
中的US East 1中有一个名为my-mysql-instance
的源实例,则您的ARN(以及RDS模块的instance_name
参数)将如下所示:
arn:aws:rds:us-east-1:123456789012:db:my-mysql-instance
So you just need to adapt the replicate task from the docs to be something like this: 因此,您只需要将文档中的复制任务修改为如下所示:
- rds:
command: replicate
region: eu-west-1
instance_name: new-database-replica
source_instance: arn:aws:rds:us-east-1:123456789012:db:my-mysql-instance
wait: yes
wait_timeout: 600
This will create a new read replica in EU West 1 (Ireland) called new-database-replica
from a source database instance called my-mysql-instance
in US West 1. 这将在US West 1(爱尔兰)中的源数据库实例
my-mysql-instance
中,在EU West 1(爱尔兰)中创建一个名为new-database-replica
的新只读副本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.