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

S3 community.aws.aws_s3_cors rules error #404

Closed
csamarajeewa opened this issue Feb 10, 2021 · 2 comments · Fixed by #408
Closed

S3 community.aws.aws_s3_cors rules error #404

csamarajeewa opened this issue Feb 10, 2021 · 2 comments · Fixed by #408
Labels
bug This issue/PR relates to a bug has_pr needs_triage python3

Comments

@csamarajeewa
Copy link

SUMMARY

Switching to Ansible 2.10 from 2.9 using the collection module community.aws.aws_s3_cors rules I receive the following error trying to add cors rules to an s3 bucket. Previously using the same input arguments it succeeded without issues.

Input Args:

    "ansible_loop_var": "item",
    "boto3_version": "1.14.59",
    "botocore_version": "1.17.59",
    "changed": false,
    "invocation": {
        "module_args": {
            "aws_access_key": "REDACTED",
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": "REDACTED",
            "debug_botocore_endpoint_logs": false,
            "ec2_url": null,
            "name": "REDACTED",
            "profile": null,
            "region": null,
            "rules": [
                "{'allowed_methods': ['REDACTED', 'REDACTED'], 'allowed_origins': ['REDACTED'], 'allowed_headers': ['REDACTED'], 'max_age_seconds': REDACTED}"
            ],
            "security_token": "REDACTED",
            "state": "present",
            "validate_certs": true
        }
    },

Error:

ParamValidationError: Parameter validation failed:
Invalid type for parameter CORSConfiguration.CORSRules[0], value: {'allowed_methods': ['REDACTED', 'REDACTED'], 'allowed_origins': ['REDACTED'], 'allowed_headers': ['REDACTED'], 'max_age_seconds': REDACTED}, type: <type 'str'>, valid types: <type 'dict'>

The problem can be solved by changing rules arg spec to rules=dict(type='list'),

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.aws.aws_s3_cors rules

ANSIBLE VERSION
ansible 2.10.4
  config file = None
  configured module search path = ['/REDACTED/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /REDACTED/ansible-venv/ansible10/lib/python3.8/site-packages/ansible
  executable location = /REDACTED/ansible-venv/ansible10/bin/ansible
  python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]

CONFIGURATION

OS / ENVIRONMENT

Ubuntu Focal

STEPS TO REPRODUCE
Input Args:
    "ansible_loop_var": "item",
    "boto3_version": "1.14.59",
    "botocore_version": "1.17.59",
    "changed": false,
    "invocation": {
        "module_args": {
            "aws_access_key": "REDACTED",
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": "REDACTED",
            "debug_botocore_endpoint_logs": false,
            "ec2_url": null,
            "name": "REDACTED",
            "profile": null,
            "region": null,
            "rules": [
                "{'allowed_methods': ['REDACTED', 'REDACTED'], 'allowed_origins': ['REDACTED'], 'allowed_headers': ['REDACTED'], 'max_age_seconds': REDACTED}"
            ],
            "security_token": "REDACTED",
            "state": "present",
            "validate_certs": true
        }
    },
EXPECTED RESULTS
ACTUAL RESULTS

@ansibullbot
Copy link

Files identified in the description:
None

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

@markuman
Copy link
Member

markuman commented Feb 11, 2021

The issue was introduced with community.aws version 1.1.0.
So another workaround is to downgrade to version 1.0.0.

jillr pushed a commit that referenced this issue Feb 11, 2021
* #404 fix wrong element spec for rules param

* #404 documentation fix

Co-authored-by: Markus Bergholz <[email protected]>
ethemcemozkan pushed a commit to ethemcemozkan/community.aws that referenced this issue Feb 18, 2021
…tions#408)

* ansible-collections#404 fix wrong element spec for rules param

* ansible-collections#404 documentation fix

Co-authored-by: Markus Bergholz <[email protected]>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue Jul 19, 2021
…tions#408)

* ansible-collections#404 fix wrong element spec for rules param

* ansible-collections#404 documentation fix

Co-authored-by: Markus Bergholz <[email protected]>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue Jul 19, 2021
…tions#408)

* ansible-collections#404 fix wrong element spec for rules param

* ansible-collections#404 documentation fix

Co-authored-by: Markus Bergholz <[email protected]>
danielcotton pushed a commit to danielcotton/community.aws that referenced this issue Nov 23, 2021
…tions#408)

* ansible-collections#404 fix wrong element spec for rules param

* ansible-collections#404 documentation fix

Co-authored-by: Markus Bergholz <[email protected]>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue May 25, 2022
…nsible-collections#404)

Add constraints.txt and requirements.txt for unit/integration tests

SUMMARY
Now that we state that we support specific minimum versions of the AWS SDKs, make sure we base our unit/integration tests against them such that modules need to explicitly test/request newer versions of the SDKs.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
tests/integration
tests/unit
ADDITIONAL INFORMATION
Once merged into amazon.aws we should merge this into community.aws
Depends-On: ansible-collections#453
Depends-On: ansible-collections#454
Depends-On: ansible-collections#450
Depends-On: ansible-collections#496
See also: ansible/ansible-zuul-jobs#991

Reviewed-by: Jill R <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 has_pr needs_triage python3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants