ansible / community

This repository is being archived. See https://github.com/ansible-community/presentations and https://github.com/ansible-community/meetings for the new locations
Apache License 2.0
487 stars 144 forks source link

GP3 not supported in amazon.aws.rds_instance module #688

Closed Ravikapadne closed 1 year ago

Ravikapadne commented 1 year ago

Hi Team,

I am trying to create RDS using ansible with amazon.aws.rds_instance module, when selecting storage_type as gp3 it's showing the below error and the task getting failed.

"fatal: [localhost]: FAILED! => {"changed": false, "msg": "value of storage_type must be one of: standard, gp2, io1, got: gp3"}"

As per the following link, gp3 is supported but getting the above error. https://docs.ansible.com/ansible/latest/collections/amazon/aws/rds_instance_module.html#ansible-collections-amazon-aws-rds-instance-module

storage_type string: The storage type to be associated with the DB instance. storage_type does not apply to Aurora DB 
instances.Choices:"standard""gp2""gp3""io1"


PFB ansible code which I am using:

name: Create Primary DB instance
community.aws.rds_instance:
id: "{{ rds_instance_id }}"
region: "{{ rds_region }}"
engine: "{{ engine }}"
master_username: XXXXXXX
master_user_password: XXXXXXX
db_instance_class: "{{ rds_instance_class }}"
allocated_storage: "{{ rds_allocated_storage }}"
max_allocated_storage: "{{ rds_max_allocated_storage }}"
storage_encrypted: True
vpc_security_group_ids: "{{ rds_sg_group }}"
db_subnet_group_name: "{{ rds_subnets_group_name }}"
auto_minor_version_upgrade: false
storage_type: gp3
storage_throughput: 400

Ansible Version:

xyz@mu-ec2:~/user$ ansible --version
ansible [core 2.12.4]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/xyz/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/ansible/lib/python3.8/site-packages/ansible
  ansible collection location = /home/xyz/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/ansible/bin/ansible
  python version = 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0]
  jinja version = 3.0.3
  libyaml = True
markuman commented 1 year ago

"value of storage_type must be one of: standard, gp2, io1, got: gp3"

That's an indicator that your local amazon.aws collection is to old. gp3 support for rds_instance was added in 5.2.0.

ansible-galaxy collection list |grep amazon.aws will show your installed versions.

sivel commented 1 year ago

This issue should be filed at https://github.com/ansible-collections/amazon.aws