0

我需要使用RDS Module提供的 fact 关键字来查找我的 Db 实例的 ARN 。以下是基本玩法:

- name: Get The RDS Facts from AWS
  rds:
    command: facts
    region: '{{ aws_region }}'
    instance_name: '{{ source_rds_instance_name  }}'
  register: db_facts

该剧的输出:

TASK: [read_replica_rds | Get The RDS Facts from AWS] ************************* 
ok: [127.0.0.1] => {
   "changed":false,
   "instance": {
      "availability_zone":"ap-southeast-2a",
      "backup_retention":7,
      "create_time":1473670897.052,
      "endpoint":"test-for-cross-region.oe451o1vbl45.ap-southeast-2.rds.amazonaws.com",
      "id":"test-for-cross-region",
      "instance_type":"db.m3.medium",
      "iops":null,
      "maintenance_window":"wed:14:00-wed:14:30",
      "multi_zone":false,
      "port":3306,
      "replication_source":null,
      "status":"available",
      "username":"root",
      "vpc_security_groups":"sg-d3b9e7b7"
   }
}

由于输出中没有提供 ARN,如何检索它?

4

1 回答 1

1

我猜 boto 中没有DBInstance对象的 ARN 属性。

为什么不直接构建知道实例名称的 ARN?

arn:aws:rds:<region>:<account-id>:db:<db-instance-name>
于 2016-09-16T06:13:04.517 回答