Discussion:
[ansible-project] Error provisioning RDS instance
Guy Knights
2015-07-14 22:23:45 UTC
Permalink
I'm getting the following error when I use the rds module:

failed: [localhost] => {"failed": true, "parsed": false}
Traceback (most recent call last):
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 2822, in <module>
main()
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 1012, in main
invocations[module.params.get('command')](module, conn)
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 645, in create_db_instance
result = conn.get_db_instance(instance_name)
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 415, in get_db_instance
raise e
boto.exception.JSONResponseError: JSONResponseError: 400 Bad Request
{'RequestId': '673d1f59-2a74-11e5-af29-2dbda5511805', 'Error': {'Message':
'The parameter Filter: db-instance-id is not a valid identifier.
Identifiers must begin with a letter; must contain only ASCII letters,
digits, and hyphens; and must not end with a hyphen or contain two
consecutive hyphens.', 'Code': 'InvalidParameterValue', 'Type': 'Sender'}}


FATAL: all hosts have already failed -- aborting

The task config is as follows:

- name: provision rds master
rds:
command: create
instance_name: "{{ wl_name }}_db_master"
db_engine: MySQL
db_name: "{{ db_name }}"
instance_type: db.m3.large
username: "{{ db_username }}"
password: "{{ wl_name}}_db_password"
size: 50
wait: yes
wait_timeout: 600
multi_zone: no
subnet: "{{ wl_name }}-rds-sg"
tags:
Application: "{{ wl_name }}"
Environment: prod
region: us-west-1

I guess it's a problem with the lookup to check if the instance already
exists, but I'm not sure what it's supposed to be using as the lookup
parameter. Does anyone know why it's wrong, and how to fix it?

Thanks,
Guy
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e53b3903-c082-4fd2-8336-cd2a7a89e09d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Baraa Basata
2015-07-15 17:15:24 UTC
Permalink
The error message here is the RDS API, and it suggests to me that the
instance_name contains invalid characters. The API response says that RDS
instance identifiers must have "only ASCII letters, digits, and hyphens;
and must not end with a hyphen or contain two consecutive hyphens".

The underscore character that you have in the instance_name is not in that
list of valid characters.

-Baraa
Post by Guy Knights
failed: [localhost] => {"failed": true, "parsed": false}
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 2822, in <module>
main()
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 1012, in main
invocations[module.params.get('command')](module, conn)
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 645, in create_db_instance
result = conn.get_db_instance(instance_name)
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 415, in get_db_instance
raise e
boto.exception.JSONResponseError: JSONResponseError: 400 Bad Request
'The parameter Filter: db-instance-id is not a valid identifier.
Identifiers must begin with a letter; must contain only ASCII letters,
digits, and hyphens; and must not end with a hyphen or contain two
consecutive hyphens.', 'Code': 'InvalidParameterValue', 'Type': 'Sender'}}
FATAL: all hosts have already failed -- aborting
- name: provision rds master
command: create
instance_name: "{{ wl_name }}_db_master"
db_engine: MySQL
db_name: "{{ db_name }}"
instance_type: db.m3.large
username: "{{ db_username }}"
password: "{{ wl_name}}_db_password"
size: 50
wait: yes
wait_timeout: 600
multi_zone: no
subnet: "{{ wl_name }}-rds-sg"
Application: "{{ wl_name }}"
Environment: prod
region: us-west-1
I guess it's a problem with the lookup to check if the instance already
exists, but I'm not sure what it's supposed to be using as the lookup
parameter. Does anyone know why it's wrong, and how to fix it?
Thanks,
Guy
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3386be62-9541-4003-889b-02fee49e8826%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Guy Knights
2015-07-15 23:26:29 UTC
Permalink
Ahhh.....thank you! That was the issue after all. I changed the instance
name and it fixed the problem. I was confused because it was talking about
parameter filters.

Thanks again,
Guy
Post by Baraa Basata
The error message here is the RDS API, and it suggests to me that the
instance_name contains invalid characters. The API response says that RDS
instance identifiers must have "only ASCII letters, digits, and hyphens;
and must not end with a hyphen or contain two consecutive hyphens".
The underscore character that you have in the instance_name is not in that
list of valid characters.
-Baraa
Post by Guy Knights
failed: [localhost] => {"failed": true, "parsed": false}
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 2822, in <module>
main()
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 1012, in main
invocations[module.params.get('command')](module, conn)
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 645, in create_db_instance
result = conn.get_db_instance(instance_name)
File
"/Users/guy/.ansible/tmp/ansible-tmp-1436911513.8-147068920945542/rds",
line 415, in get_db_instance
raise e
boto.exception.JSONResponseError: JSONResponseError: 400 Bad Request
{'Message': 'The parameter Filter: db-instance-id is not a valid
identifier. Identifiers must begin with a letter; must contain only ASCII
letters, digits, and hyphens; and must not end with a hyphen or contain two
consecutive hyphens.', 'Code': 'InvalidParameterValue', 'Type': 'Sender'}}
FATAL: all hosts have already failed -- aborting
- name: provision rds master
command: create
instance_name: "{{ wl_name }}_db_master"
db_engine: MySQL
db_name: "{{ db_name }}"
instance_type: db.m3.large
username: "{{ db_username }}"
password: "{{ wl_name}}_db_password"
size: 50
wait: yes
wait_timeout: 600
multi_zone: no
subnet: "{{ wl_name }}-rds-sg"
Application: "{{ wl_name }}"
Environment: prod
region: us-west-1
I guess it's a problem with the lookup to check if the instance already
exists, but I'm not sure what it's supposed to be using as the lookup
parameter. Does anyone know why it's wrong, and how to fix it?
Thanks,
Guy
--
You received this message because you are subscribed to a topic in the
Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/ansible-project/xT1lOWalxYs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/3386be62-9541-4003-889b-02fee49e8826%40googlegroups.com
<https://groups.google.com/d/msgid/ansible-project/3386be62-9541-4003-889b-02fee49e8826%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CANNH9mtWmUpgyjS%2B%2B3PzYekLdz110SZAWL0zK9mig6Fak-czSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...