Deploying without a stored keyintermediate
A pipeline can prove which repository and branch it is with a short-lived signed token, so the cloud trusts that exact branch for an hour instead of a key that works anywhere, forever.
The pipeline deploys with a cloud access key that never expires, stored in repository secrets, and the role it could use instead trusts any branch of any repository in the organisation. Swap the key for a short-lived token, and trust exactly one branch.
The job requests an identity token and assumes a role with no stored key; the role trusts web identity, for AWS, from one repository’s main branch.
Published in full, before you start — every point is one of these and there is nothing else.
A pipeline can prove which repository and branch it is with a short-lived signed token, so the cloud trusts that exact branch for an hour instead of a key that works anywhere, forever.