lundi 30 mars 2015

Invalid instance_type while creating Amazon RDS db.r3 instance from Ansible playbook

I'm trying to create an Amazon RDS instance using Ansible RDS module and getting the following error when instance_type is db.r3.large.



msg: value of instance_type must be one of: db.t1.micro,db.m1.small,db.m1.medium,db.m1.large,db.m1.xlarge,db.m2.xlarge,db.m2.2xlarge,db.m2.4xlarge,db.m3.medium,db.m3.large,db.m3.xlarge,db.m3.2xlarge,db.cr1.8xlarge, got: db.r3.large



However, db.r3.large is a valid type as described here and I can create one manually from AWS console (i.e. without Ansible playbook).


Here is my vars file:



instance_name: my-instance-name
region: us-east-1
zone: us-east-1b
size: 100
instance_type: db.r3.large
db_engine: MySQL
engine_version: 5.6.21
subnet: my-subnet
parameter_group: default.mysql5.6
security_groups: my-security-group
db_name: my-db-name
db_username: root
db_password: my-password


And here is my playbook:



---
- name: Playbook to provision RDS instance
hosts: localhost
connection: local
gather_facts: no

vars_files:
- vars/rds.yml

tasks:
- name: Create MySQL RDS Instance
local_action:
module: rds
command: create
instance_name: "{{ instance_name }}"
region: "{{ region }}"
zone: "{{ zone }}"
size: "{{ size }}"
instance_type: "{{ instance_type }}"
db_engine: "{{ db_engine }}"
engine_version: "{{ engine_version }}"
subnet: "{{ subnet }}"
parameter_group: "{{ parameter_group }}"
multi_zone: no
db_name: "{{ db_name }}"
username: "{{ db_username }}"
password: "{{ db_password }}"
vpc_security_groups: "{{ security_groups }}"
maint_window: Sun:04:00-Sun:08:00
backup_retention: 30
backup_window: 01:00-3:00


subnet, vpc_security_groups, region, zone etc. are fine as I'm able to create db.r3.large instance with same settings from the AWS console.


It seems that something is wrong with Ansible module or boto, but I could not find out anything helpful. My ansible version is 1.6.1, boto version is 2.36.0 and botocore version is 0.94.0.


How can I create db.r3.large instance form Ansible?





Aucun commentaire:

Enregistrer un commentaire