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 Logging add option to disable ACL setup #2136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abraverm
Copy link

SUMMARY

Add option acl to s3_logging for ACL setup on target logging bucket.
By default it is enabled, as it was previously, but adds an option to disable this setup.
The option adds and removes the ACL control relevant for S3 logging on the target bucket
This option is in case bucket polices are prefered over ACLs for permission management.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

s3_logging

ADDITIONAL INFORMATION

If two s3_loggings have been configured with the same logging bucket but with different acl setup, then the result would be determined by execution order.

Copy link

github-actions bot commented Aug 30, 2024

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/community.aws/actions/runs/10707872439

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

File changes:

  • M collections/community/aws/s3_logging_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/community.aws/community.aws/docsbuild/base/collections/community/aws/s3_logging_module.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/s3_logging_module.html
index a29e09a..26a4fe5 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/s3_logging_module.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/s3_logging_module.html
@@ -197,6 +197,20 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 </div></td>
 </tr>
 <tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-acl"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-acl"><strong>acl</strong></p>
+<a class="ansibleOptionLink" href="#parameter-acl" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
+<p><em class="ansible-option-versionadded">added in community.aws 8.3.0</em></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Setup target bucket ACLs to grant AWS special log delivery account to write server access logs.</p>
+<p>Setting to False will remove the ACL for log delivery on the target bucket.</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">false</span></code></p></li>
+<li><p><code class="ansible-option-default-bold docutils literal notranslate"><strong><span class="pre">true</span></strong></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
+</ul>
+</div></td>
+</tr>
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-aws_ca_bundle"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-aws-ca-bundle"><strong>aws_ca_bundle</strong></p>
 <a class="ansibleOptionLink" href="#parameter-aws_ca_bundle" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">path</span></p>
 </div></td>
@@ -204,7 +218,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 <p>The <code class="docutils literal notranslate"><span class="pre">AWS_CA_BUNDLE</span></code> environment variable may also be used.</p>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-aws_config"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-aws-config"><strong>aws_config</strong></p>
 <a class="ansibleOptionLink" href="#parameter-aws_config" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span></p>
 </div></td>
@@ -212,7 +226,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 <p>Parameters can be found in the AWS documentation <a class="reference external" href="https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config">https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config</a>.</p>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-debug_botocore_endpoint_logs"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-debug-botocore-endpoint-logs"><strong>debug_botocore_endpoint_logs</strong></p>
 <a class="ansibleOptionLink" href="#parameter-debug_botocore_endpoint_logs" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
 </div></td>
@@ -225,7 +239,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 </ul>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-endpoint_url"></div>
 <div class="ansibleOptionAnchor" id="parameter-ec2_url"></div>
 <div class="ansibleOptionAnchor" id="parameter-aws_endpoint_url"></div>
@@ -239,14 +253,14 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 <p>Support for the <code class="docutils literal notranslate"><span class="pre">EC2_URL</span></code> environment variable has been deprecated and will be removed in a release after 2024-12-01.</p>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-name"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-name"><strong>name</strong></p>
 <a class="ansibleOptionLink" href="#parameter-name" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
 </div></td>
 <td><div class="ansible-option-cell"><p>Name of the s3 bucket.</p>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-profile"></div>
 <div class="ansibleOptionAnchor" id="parameter-aws_profile"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-profile"><span id="ansible-collections-community-aws-s3-logging-module-parameter-aws-profile"></span><strong>profile</strong></p>
 <a class="ansibleOptionLink" href="#parameter-profile" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-aliases">aliases: aws_profile</span></p>
@@ -258,7 +272,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 <p>The <em>profile</em> option is mutually exclusive with the <em>aws_access_key</em>, <em>aws_secret_key</em> and <em>security_token</em> options.</p>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-region"></div>
 <div class="ansibleOptionAnchor" id="parameter-aws_region"></div>
 <div class="ansibleOptionAnchor" id="parameter-ec2_region"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-region"><span id="ansible-collections-community-aws-s3-logging-module-parameter-ec2-region"></span><span id="ansible-collections-community-aws-s3-logging-module-parameter-aws-region"></span><strong>region</strong></p>
@@ -273,7 +287,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 <p>Support for the <code class="docutils literal notranslate"><span class="pre">EC2_REGION</span></code> environment variable has been deprecated and will be removed in a release after 2024-12-01.</p>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-secret_key"></div>
 <div class="ansibleOptionAnchor" id="parameter-aws_secret_access_key"></div>
 <div class="ansibleOptionAnchor" id="parameter-aws_secret_key"></div>
@@ -290,7 +304,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 <p>Support for the <code class="docutils literal notranslate"><span class="pre">EC2_SECRET_KEY</span></code> environment variable has been deprecated and will be removed in a release after 2024-12-01.</p>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-session_token"></div>
 <div class="ansibleOptionAnchor" id="parameter-aws_session_token"></div>
 <div class="ansibleOptionAnchor" id="parameter-security_token"></div>
@@ -308,7 +322,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 <p>Support for the <code class="docutils literal notranslate"><span class="pre">EC2_SECRET_KEY</span></code> and <code class="docutils literal notranslate"><span class="pre">AWS_SECURITY_TOKEN</span></code> environment variables has been deprecated and will be removed in a release after 2024-12-01.</p>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-state"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-state"><strong>state</strong></p>
 <a class="ansibleOptionLink" href="#parameter-state" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -320,14 +334,14 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 </ul>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-target_bucket"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-target-bucket"><strong>target_bucket</strong></p>
 <a class="ansibleOptionLink" href="#parameter-target_bucket" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
 <td><div class="ansible-option-cell"><p>The bucket to log to. Required when state=present.</p>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-target_prefix"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-target-prefix"><strong>target_prefix</strong></p>
 <a class="ansibleOptionLink" href="#parameter-target_prefix" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -335,7 +349,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-s3-lo
 <p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">&quot;&quot;</span></code></p>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-validate_certs"></div><p class="ansible-option-title" id="ansible-collections-community-aws-s3-logging-module-parameter-validate-certs"><strong>validate_certs</strong></p>
 <a class="ansibleOptionLink" href="#parameter-validate_certs" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
 </div></td>

Copy link
Contributor

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

ansible-galaxy-importer FAILURE in 4m 40s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 36s
✔️ ansible-test-splitter SUCCESS in 4m 19s
✔️ integration-community.aws-1 SUCCESS in 9m 07s
Skipped 21 jobs

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.

Thanks for this, I think this is a better solution for what you're trying to achieve.

plugins/modules/s3_logging.py Show resolved Hide resolved
plugins/modules/s3_logging.py Show resolved Hide resolved
plugins/modules/s3_logging.py Outdated Show resolved Hide resolved
plugins/modules/s3_logging.py Show resolved Hide resolved
Copy link
Contributor

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

✔️ ansible-galaxy-importer SUCCESS in 4m 10s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 41s
✔️ ansible-test-splitter SUCCESS in 4m 25s
✔️ integration-community.aws-1 SUCCESS in 8m 21s
Skipped 21 jobs

@abraverm
Copy link
Author

abraverm commented Sep 9, 2024

@tremble , I have addressed your comments, but Github continue to say "1 change requested", I'm not sure what refers to.

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.

2 participants