如何使用 Ansible 停止 AWS RDS 实例?

How do I stop an AWS RDS instance with Ansible?

如何停止 带有 Ansible rds_instances 模块的 RDS 实例?

ansible --version

ansible 2.9.10

我正在尝试以下操作:

- name: Stopping RDS instances for
  rds_instance:
    id: "instance_id" # I have tried also db_instance_identifier, and tried using multiple values from rds_info...
    state: stopped

我会得到以下错误:

To create DB instance requires the parameters: ['DBInstanceIdentifier', 'DBInstanceClass', 'Engine']

如果我指定缺少的参数(尽管文档中没有标记为必需),我会得到一个不同的错误:

The error was: botocore.exceptions.ClientError: An error occurred
(InvalidParameterValue) when calling the CreateDBInstance operation:
Invalid master password

调试不再产生任何新答案。

多哈

我缺少 profile/region 参数,因此无法找到 RDS 实例。它正在寻找一个完全不同的 AWS 账户,因为使用的是默认配置文件。 Ansible 未找到数据库,因此因创建错误而失败。

- name: Stopping RDS instances for
  rds_instance:
    id: "instance_id"
    state: stopped
    profile: "{{ profile }}"
    region: "{{ region }}"