Skip to content

Add P8 lakehouse workflow (S3, Iceberg, Athena) — OIDC assume blocked - #9

Closed
nightmoose wants to merge 1 commit into
aws-runsfrom
aws/p8-lakehouse
Closed

nightmoose wants to merge 1 commit into
aws-runsfrom
aws/p8-lakehouse

Conversation

@nightmoose

Copy link
Copy Markdown
Owner

What

Project 8 of the AWS learning plan, in this private repo so it never touches ContractGate main or prod. examples/aws-lakehouse/ plus a branch-scoped workflow (.github/workflows/aws-p8-lakehouse.yml) that runs only on push to aws/p8-lakehouse (and workflow_dispatch), never on main.

The job is meant to assume nmb-terraform-deploy via GitHub OIDC, create a private Iceberg lakehouse on S3 + Glue + Athena, validate 10k Stripe-shaped charges with in-process contractgate (stripe_charges_raw), quarantine failures, run Athena drift queries, and tear everything down in an always() step.

This is on GitHub Actions because the bot box VPC endpoint policy denies s3:CreateBucket.

OIDC result — stopped here

Run: https://github.com/nightmoose/schemasmith/actions/runs/43013979948

aws-actions/configure-aws-credentials@v4 failed with:

Could not assume role with OIDC: Not authorized to perform sts:AssumeRoleWithWebIdentity

Audience was sts.amazonaws.com, role arn:aws:iam::065614567889:role/nmb-terraform-deploy, session gha-p8-lakehouse, branch aws/p8-lakehouse. The GitHub sub claim for this push is:

repo:nightmoose/schemasmith:ref:refs/heads/aws/p8-lakehouse

No AWS resources were created. The teardown step then failed with NoCredentialsError (expected; nothing to delete). Spend is $0.

The documented trust in nmb-chief/aws/iam/nmb-terraform-deploy-trust.json uses StringLike on token.actions.githubusercontent.com:sub for repo:nightmoose/schemasmith:*, which should have allowed this run. Live GetRole on nmb-terraform-deploy is denied for both nightmoose-bots and the deploy role itself, so I could not confirm the live document. I did not change the IAM trust.

The same role does work for ContractGate: the Terraform AWS plan workflow assumed it successfully on contractgate PR #411 today (run 43013009689).

Do not merge this for an apply until the trust allows repo:nightmoose/schemasmith:ref:refs/heads/aws/p8-lakehouse (or repo:nightmoose/schemasmith:* as already written in the documented policy).

Runs only on aws/p8-lakehouse via GitHub OIDC as nmb-terraform-deploy,
because the bot box cannot create S3 buckets. The job validates 10k
Stripe-shaped charges with contractgate, writes passed and quarantined
rows to Iceberg, runs Athena drift queries, and always tears the stack
down. Never runs on main.
@nightmoose

Copy link
Copy Markdown
Owner Author

Superseded by contractgate PR (P8 run from a branch there, where OIDC already works).

The assume failure here is explained by this repo's Actions OIDC subject customization:

{"use_default":true,"use_immutable_subject":true,"sub_claim_prefix":"repo:nightmoose@91439862/schemasmith@1451682729"}

With use_immutable_subject: true, the token sub is prefixed repo:nightmoose@91439862/schemasmith@1451682729, which does not match the IAM trust StringLike value repo:nightmoose/schemasmith:*. Contractgate has use_immutable_subject: false and prefix repo:nightmoose/contractgate, which does match repo:nightmoose/contractgate:*. The IAM trust was not changed.

Closing this PR. The lakehouse example itself now lives in nightmoose/contractgate on branch examples/aws-lakehouse.

@nightmoose

Copy link
Copy Markdown
Owner Author

Closed as superseded: P8 ran successfully from contractgate, where the OIDC subject matches the role trust.

@nightmoose nightmoose closed this Nov 11, 2026
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