Skip to content

feat(changelog/bundle-upload): add optional aws-role-arn input - #314

Merged
Mpdreamz merged 2 commits into
mainfrom
feature/bundle-upload-explicit-role
Sep 3, 2026
Merged

feat(changelog/bundle-upload): add optional aws-role-arn input#314
Mpdreamz merged 2 commits into
mainfrom
feature/bundle-upload-explicit-role

Conversation

@Mpdreamz

Copy link
Copy Markdown
Member

Summary

Adds an optional aws-role-arn input to changelog/bundle-upload/action.yml.

When set: the specified IAM role is assumed directly via aws-actions/configure-aws-credentials (SHA-pinned at the existing pin), skipping the aws/auth repo-derived role derivation.

When empty (default): behaviour is unchanged — existing per-product entry-upload callers are unaffected.

Why

The changelog-promotion-bundle.yml workflow lives in elastic/docs-internal-workflows (a private repo). It needs to assume a single dedicated IAM role scoped to the bundle/ prefix of the private S3 bucket. That role is provisioned standalone in elastic/docs-infra with a trust policy pinned to elastic/docs-internal-workflows:environment:changelog-promotion-prod — not derived from a repository SHA.

Without this input, the workflow would need to add elastic/docs-internal-workflows to the shared repositories.yml list (100-entry, bucket-wide) — which is the wrong blast radius.

Changes

changelog/bundle-upload/action.yml:

  • New optional input aws-role-arn (empty default)
  • ARN format validated before any AWS call (rejects non-ARN values)
  • Two auth steps with if: conditions — explicit role path and the existing repo-derived path; exactly one runs per invocation

Test plan

  • Existing callers: verify aws-role-arn is absent from call sites — no behaviour change expected
  • Promotion workflow: pass the scoped role ARN; confirm configure-aws-credentials step runs (not aws/auth), and the call succeeds in the changelog-promotion-prod environment
  • Invalid ARN value: confirm the validate step rejects it before any AWS call

🤖 Generated with Claude Code

Adds an `aws-role-arn` input to the bundle-upload action. When set, the
specified IAM role is assumed directly via aws-actions/configure-aws-credentials
(SHA-pinned), bypassing the `aws/auth` repo-derived role derivation. When
empty, existing behaviour is unchanged.

Use case: docs-internal-workflows hosts a promotion workflow
(`changelog-promotion-bundle.yml`) that uploads to the `bundle/` prefix in
the private S3 bucket. That workflow runs in a GH Environment
(`changelog-promotion-prod`) and needs to assume a single dedicated,
narrowly-scoped role provisioned in docs-infra — not a role derived from
the caller's repository SHA. Passing the role ARN explicitly avoids adding
`elastic/docs-internal-workflows` to the shared `repositories.yml` list.

Existing callers (per-product entry-upload workflows) pass no `aws-role-arn`
and continue to get the repo-derived role as before.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner August 31, 2026 15:07
@Mpdreamz
Mpdreamz requested a review from theletterf August 31, 2026 15:07
@Mpdreamz Mpdreamz added the chore label Aug 31, 2026
Comment thread changelog/bundle-upload/action.yml Outdated
env:
AWS_ROLE_ARN: ${{ inputs.aws-role-arn }}
run: |
if [[ -n "${AWS_ROLE_ARN}" ]]; then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this validation really needed?

I would say the aws-action/configure-awscredentials action catches this and might have a more detailed error message (maybe).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed and done — removed in a5a8a75. configure-aws-credentials already validates the ARN and surfaces a clearer error; the pre-flight check was redundant.

configure-aws-credentials already validates the ARN and produces a clear
error on failure. The pre-flight check was an early-exit convenience with
no correctness benefit — removing it keeps the action lean.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Mpdreamz
Mpdreamz merged commit 3c4552c into main Sep 3, 2026
10 checks passed
@Mpdreamz
Mpdreamz deleted the feature/bundle-upload-explicit-role branch September 3, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants