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

Rework s3_bucket to use ErrorHandler model #2478

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Jan 21, 2025

SUMMARY

s3_bucket has some support for non-AWS "S3" APIs, this PR reworks s3_bucket module to more consistently handle the various Errors that get thrown when the non-AWS-S3 API doesn't cleanly support some of the more advanced S3 features.

Our testing for non-AWS APIs is near non-existent, so it's important that the patterns displayed in the module are easy to follow and cleanly handle things a feature not being supported if someone doesn't try to use it.

Also fixes idempotency when setting the simplistic "templated" ACLs.

ISSUE TYPE
  • Bugfix Pull Request
  • Feature Pull Request
COMPONENT NAME

s3_bucket

ADDITIONAL INFORMATION

I plan on migrating the remaining S3 modules in amazon.aws but this is just the first one.

Copy link

github-actions bot commented Jan 21, 2025

Docs Build 📝

Thank you for contribution!✨

The docsite for this PR is available for download as an artifact from this run:
https://github.com/ansible-collections/amazon.aws/actions/runs/12886486917

You can compare to the docs for the main branch here:
https://ansible-collections.github.io/amazon.aws/branch/main

File changes:

  • M collections/amazon/aws/s3_bucket_module.html
Click to see the diff comparison.

NOTE: only file modifications are shown here. New and deleted files are excluded.
See the file list and check the published docs to see those files.

diff --git a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/s3_bucket_module.html b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/s3_bucket_module.html
index f24c2fb..d47bafd 100644
--- a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/s3_bucket_module.html
+++ b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/s3_bucket_module.html
@@ -223,6 +223,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-s3-bucke
 </div></td>
 <td><div class="ansible-option-cell"><p>The canned ACL to apply to the bucket.</p>
 <p>If your bucket uses the bucket owner enforced setting for S3 Object Ownership, ACLs are disabled and no longer affect permissions.</p>
+<p>If <code class="ansible-option-value docutils literal notranslate"><a class="reference internal" href="#ansible-collections-amazon-aws-s3-bucket-module-parameter-public-access-ignore-public-acls"><span class="std std-ref"><span class="pre">public_access.ignore_public_acls=true</span></span></a></code> setting <code class="ansible-option docutils literal notranslate"><strong><a class="reference internal" href="#ansible-collections-amazon-aws-s3-bucket-module-parameter-acl"><span class="std std-ref"><span class="pre">acl</span></span></a></strong></code> to a value other than <code class="ansible-value docutils literal notranslate"><span class="pre">private</span></code> may return success but not have an affect.</p>
 <p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
 <ul class="simple">
 <li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">&quot;private&quot;</span></code></p></li>

@tremble tremble requested a review from alinabuzachis January 21, 2025 11:50
@tremble tremble force-pushed the error_handlers/s3_bucket branch from 6c42750 to 340c1e8 Compare January 21, 2025 12:01
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/3a6ab77570aa4d47bb4329bca9253819

✔️ ansible-galaxy-importer SUCCESS in 5m 35s
✔️ build-ansible-collection SUCCESS in 10m 29s
✔️ ansible-test-splitter SUCCESS in 3m 55s
✔️ integration-amazon.aws-1 SUCCESS in 12m 54s
✔️ integration-amazon.aws-2 SUCCESS in 8m 17s
Skipped 42 jobs

@tremble tremble requested a review from hakbailey January 22, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant