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

Add permission to upload ACL in ExtraArgs #318

Merged
merged 11 commits into from
May 7, 2021
Merged

Add permission to upload ACL in ExtraArgs #318

merged 11 commits into from
May 7, 2021

Conversation

cbcoutinho
Copy link
Contributor

Use the permission ACL when uploading objects (fixes #219)

@ansibullbot
Copy link

@ansibullbot ansibullbot added community_review docs module module needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed community_review labels Apr 6, 2021
docs/amazon.aws.aws_s3_module.rst Outdated Show resolved Hide resolved
@goneri goneri requested a review from tremble April 7, 2021 12:34
@alinabuzachis
Copy link
Collaborator

@cbcoutinho Thank you for your contribution. Could you kindly include a functional test and a changelog? Thanks.

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.

The change looks sane, 3 minor issues:

  • Please add a changelog fragment (https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to)
  • To ensure your docs change isn't automatically overwritten please update the docs at the start of the module (the .rst is auto generated)
  • To reduce the risk of a regression being introduced please add an integration test entry (tests/integration/targets/aws_s3/tasks/main.yml). You'll need to update the bucket policy and then upload using the new features.

@cbcoutinho
Copy link
Contributor Author

cbcoutinho commented Apr 7, 2021

@cbcoutinho Thank you for your contribution. Could you kindly include a functional test and a changelog? Thanks.

@alinabuzachis How do you recommend testing this functionality? Is it possible to mock S3 bucket ACLs or do you have to supply S3 credentials and test against existing infra?

@tremble
Copy link
Contributor

tremble commented Apr 7, 2021

@alinabuzachis How do you recommend testing this functionality? Is it possible to mock S3 bucket ACLs or do you have to supply S3 credentials and test against existing infra?

We have a set of integration tests which are just Ansible roles which will be run in CI (tests/integration/targets/aws_s3/tasks/main.yml) temporary credentials will be automatically supplied (see the module_defaults at the start of the yaml file)

This reverts commit f00cb89.
CHANGELOG.rst Outdated Show resolved Hide resolved
@ansibullbot ansibullbot added integration tests/integration tests tests labels Apr 7, 2021
@cbcoutinho
Copy link
Contributor Author

@tremble I'm a little unclear exactly how to test this, and I'm having trouble understanding the testing framework here. Is it possible to specify the IAM role used during the PUT operation? Ideally, I would want to XFAIL a test that uses the wrong permission and another that passes using the correct, but I don't know how to declare that using these targets.

I'm assuming the credentials used to create the bucket are the same used to do the uploading, which is not the scenario I'm trying to address.

@cbcoutinho cbcoutinho marked this pull request as draft April 8, 2021 17:04
@cbcoutinho
Copy link
Contributor Author

Setting this PR as a draft to denote WIP

alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 19, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 19, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 19, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 19, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 19, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 19, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this pull request Jul 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
jillr pushed a commit to jillr/amazon.aws that referenced this pull request Jul 27, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
jillr pushed a commit to jillr/amazon.aws that referenced this pull request Aug 20, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
jillr pushed a commit to jillr/amazon.aws that referenced this pull request Aug 26, 2021
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d6ff623
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Sep 18, 2023
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Sep 18, 2023
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Oct 24, 2023
* import order

* Add retry decorators

* Switch tests to using module_defaults

* module_defaults

* Add initial _info tests

* Handle Boto Errors with fail_json_aws

* Test state=absent when IGW missing

* Support not purging tags

* Support converting Tags from boto to dict

* Add tagging tests

* Use random CIDR for VPC

* Add check_mode tests

* changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_review docs integration tests/integration module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_s3 can't PUT when mandatory bucket-owner-full-control
6 participants