Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rds_instance: map Tags parameters from dict to list on restore_db_instance_from_db_snapshot method #414

Merged
merged 2 commits into from
Apr 13, 2021

Conversation

vorotech
Copy link
Contributor

@vorotech vorotech commented Feb 15, 2021

SUMMARY

Map the parameters['Tags'] from dict to list with ansible_dict_to_boto3_tag_list on restore_db_instance_from_db_snapshot method, additionally to existing create_db_instance and create_db_instance_read_replica methods.

This change will fix the case when db is created from the snaphot and the tags parameter is specified on rds_instance module.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

rds_instance.py

ADDITIONAL INFORMATION

Before the fix, the error is thrown by module:

fatal: [rds -> 127.0.0.1]: FAILED! => changed=false 
  boto3_version: 1.11.6
  botocore_version: 1.14.6
  msg: |-
    Unexpected failure for method restore_db_instance_from_db_snapshot with parameters {'Engine': 'MySQL', 'AutoMinorVersionUpgrade': False, 'VpcSecurityGroupIds': ['sg-12345'], 'StorageType': 'gp2', 'DBInstanceIdentifier': 'examplemysql', 'DBInstanceClass': 'db.t3.small', 'DBName': 'examplemysql', 'DBSubnetGroupName': 'subnetgroup', 'MultiAZ': False, 'DBParameterGroupName': 'examplemysql-pg', 'DBSnapshotIdentifier': 'examplemysql-snapshot', 'Tags': {'foo': 'bar', 'env': 'dev'}}: Parameter validation failed:
    Invalid type for parameter Tags, value: {'foo': 'bar', 'env': 'dev'}, type: <class 'dict'>, valid types: <class 'list'>, <class 'tuple'>

Also, map Tags parameters from the dict to list during `restore_db_instance_from_db_snapshot` method
additionally to existing `create_db_instance` and `create_db_instance_read_replica`
@ansibullbot
Copy link

@ansibullbot ansibullbot added community_review feature This issue/PR relates to a feature request module module needs_triage plugins plugin (any type) small_patch Hopefully easy to review labels Feb 15, 2021
@alinabuzachis
Copy link
Contributor

Hi @vorotech, thank you for contributing. May you kindly control if you pushed all your changes?

@vorotech
Copy link
Contributor Author

vorotech commented Mar 11, 2021

hi @alinabuzachis
I'm not too sure what are you referring to...

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vorotech I believe @alinabuzachis was trying to politely ask if you've pushed all of your commits. (the way its phrased looks very much like the way you might politely ask in German)

The rds_instance module isn't the easiest to follow but I believe this is the right change.

Please add a changelog fragment: https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to

Given that the tests currently don't exercise the "creation_source: snapshot" functionality I'd not block on the lack of integration test for this change, but it would be fantastic if you could update our integration tests to exercise this functionality and test setting tags during restoration from a snapshot. tests/integration/targets/rds_instance/tasks/test_snapshot.yml

@ansibullbot ansibullbot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed community_review labels Apr 8, 2021
@tremble tremble linked an issue Apr 10, 2021 that may be closed by this pull request
@tremble
Copy link
Contributor

tremble commented Apr 13, 2021

@aardbol has confirmed that this fixes the issue (#530):

Yes, that fixes it. Thanks!

I think we're good to merge this PR

@tremble tremble added the gate label Apr 13, 2021
@ansible-zuul ansible-zuul bot merged commit 36f8a05 into ansible-collections:main Apr 13, 2021
@tremble
Copy link
Contributor

tremble commented Apr 13, 2021

@vorotech Sorry it's taken a while to get this merged. Many thanks for your submission. This fix should be available once version 1.5.0 of this collection is released (or 2.0.0 if we skip 1.5.0)

alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 15, 2021
…tch-1

rds_instance: map Tags parameters from dict to list on restore_db_instance_from_db_snapshot method

Reviewed-by: https://github.com/apps/ansible-zuul

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@36f8a05
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 16, 2021
…tch-1

rds_instance: map Tags parameters from dict to list on restore_db_instance_from_db_snapshot method

Reviewed-by: https://github.com/apps/ansible-zuul

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@36f8a05
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 17, 2021
…tch-1

rds_instance: map Tags parameters from dict to list on restore_db_instance_from_db_snapshot method

Reviewed-by: https://github.com/apps/ansible-zuul

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@9827a2b
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
rds_instance: map Tags parameters from dict to list on restore_db_instance_from_db_snapshot method

Reviewed-by: https://github.com/apps/ansible-zuul
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
rds_instance: map Tags parameters from dict to list on restore_db_instance_from_db_snapshot method

Reviewed-by: https://github.com/apps/ansible-zuul
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
rds_instance: map Tags parameters from dict to list on restore_db_instance_from_db_snapshot method

Reviewed-by: https://github.com/apps/ansible-zuul
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
…ollections#414)

EC2_instance: add support for controlling metadata options

SUMMARY

Adding support for controlling the metadata options, 'Metadata Accessible' and 'Metadata Version' in amazon.aws.ec2_instance.

Fixes ansible-collections#399
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

amazon.aws.ec2_instance

Reviewed-by: Jill R <None>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: None <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request has_issue module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR plugins plugin (any type) small_patch Hopefully easy to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rds tags not possible to configure on instance creation
4 participants