Skip to main content
When you create an environment, Gapstack automatically creates two resources in your AWS account and region:
  1. An S3 bucket for artifacts
  2. An OpenID Connect (OIDC) IAM role so GitHub Actions can authenticate to AWS without long-lived access keys
Copy the bucket name and role from the environment Details page. Store those values as GitHub Actions variables, then add the following steps to your workflow.
Do not store AWS access keys in GitHub. Use the OIDC role from the environment.
1

Copy values from the environment Details page

Open the environment in Gapstack and click Details. Copy these fields:
  • OpenID Role → ROLE_TO_ASSUME
  • Artifacts → BUCKET_SOURCE
  • Region → AWS_REGION
  • The environment name → ENVIRONMENT and STAGE
Use the copy icon next to each field.
Environment Details page with OpenID Role and Artifacts highlighted. Each field has a copy button.

Copy OpenID Role and Artifacts from the environment Details page.

2

Add GitHub Actions variables

Add the values you copied as repository variables so the workflow can read them.
  1. In GitHub, open the repository.
  2. Click Settings.
  3. Click Secrets and variables, then Actions.
  4. Open the Variables tab.
  5. Click New repository variable for each variable below.
3

Set environment variables

Add an env block at the top of the workflow. It reads the repository variables you created.
4

Configure AWS credentials (OIDC)

Assume the environment OIDC role. GitHub issues a short-lived token. AWS trusts that token.
The job needs permissions: id-token: write so GitHub can mint the OIDC token.
5

Upload Artifact to S3

Copy the zip into the environment artifacts bucket. Change ./cmd/main.zip if your build output lives somewhere else.

Required GitHub Actions variables

Example workflow

APP_NAME comes from the repository name. The other values come from the GitHub Actions variables you added.

Next steps

After the file is in S3, create a Lambda and select that artifact. See Deploy a Lambda.