Skip to content

Comments

[tests] Update ELB access log S3 bucket policies to use service principal#2845

Open
tremble wants to merge 4 commits intoansible-collections:mainfrom
tremble:elb_logging
Open

[tests] Update ELB access log S3 bucket policies to use service principal#2845
tremble wants to merge 4 commits intoansible-collections:mainfrom
tremble:elb_logging

Conversation

@tremble
Copy link
Contributor

@tremble tremble commented Feb 13, 2026

SUMMARY

Replace legacy region-specific AWS account ID approach with the
recommended service principal method for both Classic and Application
Load Balancers. This simplifies the bucket policies and allows tests
to run in any AWS region without maintaining a region-to-account-id
mapping.

See also: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/enable-access-logging.html
and #2773

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

elb_application_lb
elb_classic_lb

ADDITIONAL INFORMATION

Assisted-by: Claude Sonnet 4.5 noreply@anthropic.com

tremble and others added 4 commits February 13, 2026 11:00
Replace legacy region-specific AWS account ID approach with the
recommended service principal method for both Classic and Application
Load Balancers. This simplifies the bucket policies and allows tests
to run in any AWS region without maintaining a region-to-account-id
mapping.

Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
The S3 bucket policy template requires the aws_account variable to
properly construct the Resource ARN with the account ID. The
elb_application_lb tests already fetch this via aws_caller_info,
but elb_classic_lb tests were missing this setup step.

Add aws_caller_info call and set_fact to define aws_account before
creating S3 buckets in the elb_classic_lb integration tests.

Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Expand the S3 bucket policy template to allow ELB access logs to be written
to paths with different prefixes (default and updated), enabling testing of
logging prefix updates.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@softwarefactory-project-zuul
Copy link
Contributor

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

✔️ ansible-galaxy-importer SUCCESS in 5m 29s
✔️ build-ansible-collection SUCCESS in 11m 22s
✔️ ansible-test-splitter SUCCESS in 4m 20s
✔️ integration-amazon.aws-1 SUCCESS in 20m 11s
✔️ integration-amazon.aws-2 SUCCESS in 9m 04s
Skipped 42 jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant