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 tags not possible to configure on instance creation #530

Closed
aardbol opened this issue Apr 6, 2021 · 6 comments · Fixed by #414
Closed

rds tags not possible to configure on instance creation #530

aardbol opened this issue Apr 6, 2021 · 6 comments · Fixed by #414
Labels
bug This issue/PR relates to a bug module module performance plugins plugin (any type) python3 traceback

Comments

@aardbol
Copy link

aardbol commented Apr 6, 2021

SUMMARY

On RDS instance creation, it's not possible to set the tags. It will give a type error (received dict but only accepts list)

ISSUE TYPE
  • Bug Report
COMPONENT NAME

rds_instance

ANSIBLE VERSION
ansible 2.10.7
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/ik/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.9/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.9.2 (default, Feb 20 2021, 18:40:11) [GCC 10.2.0]
CONFIGURATION

OS / ENVIRONMENT

Manjaro

STEPS TO REPRODUCE
    - name: Create new RDS instance
      rds_instance:
        creation_source: snapshot
        backup_retention_period: 0
        copy_tags_to_snapshot: yes
        db_snapshot_identifier: "{{ rds_snapshot }}"
        snapshot_identifier: "{{ rds_snapshot }}"
        id: "{{ new_project_name }}"
        storage_encrypted: "{{ rdsdetails.storage_encrypted }}"
        kms_key_id: "{{ rdsdetails.kms_key_id }}"
        storage_type: "{{ rdsdetails.storage_type }}"
        engine: "{{ rdsdetails.engine }}"
        engine_version: "{{ rdsdetails.engine_version }}"
        db_subnet_group_name: "{{ rdsdetails.db_subnet_group.db_subnet_group_name }}"
        vpc_security_group_ids: "{{ rdsdetails.vpc_security_groups[0].vpc_security_group_id }}"
        zone: "{{ rdsdetails.availability_zone }}"
        wait: no
        tags:
          Environment: test
          Circle: Exquisite
EXPECTED RESULTS

Tags being set

ACTUAL RESULTS

Type error when setting tags when rds instance needs to be created. It is possible to modify the tags when the rds instance already exists

The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_rds_instance_payload_xm5j9uq1/ansible_rds_instance_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/rds.py", line 126, in call_method
result = AWSRetry.jittered_backoff()(method)(**parameters)
File "/tmp/ansible_rds_instance_payload_xm5j9uq1/ansible_rds_instance_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloud.py", line 156, in retry_func
raise e
File "/tmp/ansible_rds_instance_payload_xm5j9uq1/ansible_rds_instance_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloud.py", line 143, in retry_func
return f(*args, **kwargs)
File "/home/ik/.local/lib/python3.9/site-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/ik/.local/lib/python3.9/site-packages/botocore/client.py", line 648, in _make_api_call
request_dict = self._convert_to_request_dict(
File "/home/ik/.local/lib/python3.9/site-packages/botocore/client.py", line 696, in _convert_to_request_dict
request_dict = self._serializer.serialize_to_request(
File "/home/ik/.local/lib/python3.9/site-packages/botocore/validate.py", line 293, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter Tags, value: {'Environment': 'test', 'Circle': 'Exquisite'}, type: <class 'dict'>, valid types: <class 'list'>, <class 'tuple'>
fatal: [localhost]: FAILED! => {
"boto3_version": "1.17.43",
"botocore_version": "1.20.43",
"changed": false,
"invocation": {
"module_args": {
"allocated_storage": null,
"allow_major_version_upgrade": null,
"apply_immediately": false,
"auto_minor_version_upgrade": null,
"availability_zone": "eu-west-1b",
"aws_access_key": null,
"aws_ca_bundle": null,
"aws_config": null,
"aws_secret_key": null,
"backup_retention_period": 0,
"ca_certificate_identifier": null,
"character_set_name": null,
"copy_tags_to_snapshot": true,
"creation_source": "snapshot",
"db_cluster_identifier": null,
"db_instance_class": null,
"db_instance_identifier": "confluence-test-2",
"db_name": null,
"db_parameter_group_name": null,
"db_security_groups": null,
"db_snapshot_identifier": "arn:aws:rds:eu-west-1:xxx:snapshot:rds:confluence-2021-04-10-04-47",
"db_subnet_group_name": "database-test",
"debug_botocore_endpoint_logs": false,
"domain": null,
"domain_iam_role_name": null,
"ec2_url": null,
"enable_cloudwatch_logs_exports": null,
"enable_iam_database_authentication": null,
"enable_performance_insights": null,
"engine": "postgres",
"engine_version": "9.6.20",
"final_db_snapshot_identifier": null,
"force_failover": null,
"force_update_password": false,
"id": "confluence-test-2",
"iops": null,
"kms_key_id": "arn:aws:kms:eu-west-1:xxx:key/xxx-xxx",
"license_model": null,
"master_user_password": null,
"master_username": null,
"max_allocated_storage": null,
"monitoring_interval": null,
"monitoring_role_arn": null,
"multi_az": null,
"new_db_instance_identifier": null,
"option_group_name": null,
"performance_insights_kms_key_id": null,
"performance_insights_retention_period": null,
"port": null,
"preferred_backup_window": null,
"preferred_maintenance_window": null,
"processor_features": null,
"profile": null,
"promotion_tier": null,
"publicly_accessible": null,
"purge_cloudwatch_logs_exports": true,
"purge_tags": true,
"read_replica": null,
"region": null,
"restore_time": null,
"s3_bucket_name": null,
"s3_ingestion_role_arn": null,
"s3_prefix": null,
"security_token": null,
"skip_final_snapshot": false,
"snapshot_identifier": "arn:aws:rds:eu-west-1:xxx:snapshot:rds:confluence-2021-04-10-04-47",
"source_db_instance_identifier": null,
"source_engine": null,
"source_engine_version": null,
"source_region": null,
"state": "present",
"storage_encrypted": true,
"storage_type": "gp2",
"tags": {
"Circle": "Exquisite",
"Environment": "test"
},
"tde_credential_arn": null,
"tde_credential_password": null,
"timezone": null,
"use_latest_restorable_time": null,
"validate_certs": true,
"vpc_security_group_ids": [
"sg-00"
],
"wait": false,
"zone": "eu-west-1b"
}
},
"msg": "Unexpected failure for method restore_db_instance_from_db_snapshot with parameters {'CopyTagsToSnapshot': True, 'StorageType': 'gp2', 'Engine': 'postgres', 'VpcSecurityGroupIds': ['sg-00'], 'AvailabilityZone': 'eu-west-1b', 'DBSnapshotIdentifier': 'arn:aws:rds:eu-west-1:xxx:snapshot:rds:confluence-2021-04-10-04-47', 'DBSubnetGroupName': 'database-test', 'DBInstanceIdentifier': 'confluence-test-2', 'Tags': {'Environment': 'test', 'Circle': 'Exquisite'}}: Parameter validation failed:\nInvalid type for parameter Tags, value: {'Environment': 'test', 'Circle': 'Exquisite'}, type: <class 'dict'>, valid types: <class 'list'>, <class 'tuple'>"
}
@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module needs_triage plugins plugin (any type) python3 traceback labels Apr 6, 2021
@tremble
Copy link
Contributor

tremble commented Apr 7, 2021

Thanks for taking the time to open this issue.

Our integration tests seem to show that for the simplest cases creating an instance using tags works, could you provide the output while running ansible with "-vvv" it would be helpful to see the traceback from the exception.

@aardbol
Copy link
Author

aardbol commented Apr 10, 2021

Added traceback as requested

@tremble
Copy link
Contributor

tremble commented Apr 10, 2021

I believe this issue should be fixed by #414

Please could you try the patch on that PR and let us know if that fixes the issue for you.

@aardbol
Copy link
Author

aardbol commented Apr 12, 2021

Yes, that fixes it. Thanks!

@aardbol aardbol closed this as completed Apr 12, 2021
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue May 25, 2022
…llections#530)

Try to work around more DigitalOcean S3 incompatabilities

SUMMARY
fixes: ansible-collections#508
Trying to update S3 buckets with DigitalOcean is apparently failing again.  Try to work around this.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
s3_bucket
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module performance plugins plugin (any type) python3 traceback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants