CI/CD & IaCJA · Japanese

Automating AWS Lambda Deployments via GitHub Actions and OIDC Authentication

A guide to automating AWS Lambda function deployments from GitHub Actions using OpenID Connect (OIDC) and short-lived IAM roles, eliminating long-lived static access keys from source repositories.

Curated by Vibe DevOps · approx. 469 words

Key Takeaways

  • OpenID Connect allows GitHub Actions to assume temporary AWS IAM permissions via AssumeRole without storing long-lived access keys.
  • The IAM role trust policy strictly restricts the subject (sub) claim to target branches, preventing unauthorized deployment requests from other repositories.
  • Workflow configurations must grant id-token: write permissions to mint GitHub OIDC tokens.
  • Polling the update status ensures the pipeline waits for function code updates to complete before initiating version transitions.

From Original Source

Configuring OIDC and Least-Privilege IAM Roles

The automated pipeline consists of three steps: registering GitHub as an OIDC identity provider in AWS IAM, provisioning an IAM role with a trust policy scoped to the repository's target branch, and configuring a workflow to package artifacts and deploy function updates.

IAM policies should follow least privilege, granting only function code update actions rather than broad configuration access. When zip artifact sizes exceed the 50 MB direct upload threshold, the pipeline must stage packages through an S3 bucket or transition to container images.

From Original Source

Update State Management and Deployment Strategies

Lambda function code updates run asynchronously on the cloud infrastructure. Consequently, CI/CD pipelines must include a step to wait for the update state to complete, preventing resource conflicts during rapid, successive deployments.

Beyond publishing immutable versions, engineers can leverage Lambda aliases with weighted routing to execute canary deployments, reducing blast radius and service downtime if issues arise in the new code.

Vibe DevOps Editorial Commentary

Operational Best Practices and Security Governance

Vibe DevOps perspective: Completely eliminating static access keys from repositories is an essential baseline to mitigate credential leakage across CI/CD pipelines. Engineering teams should enforce strict environment separation through branch-level claim conditions.

Pruning development dependencies prior to packaging optimizes deployment artifact size and reduces serverless cold start latencies.

Commands & Configuration Snippets

Verbatim extract for quick lookup. Verify against your infrastructure before running.

npm ci --omit=dev

Install production dependencies and remove development packages before packaging

aws lambda wait function-updated

Wait for the function code update status to complete before proceeding to the next step

⚠️ Operational Caveats & Limitations

  • Applies to standalone function code packaged as zip archives within the direct upload 50 MB threshold.

Read original post at Zenn — Topic GitHub Actions ↗


Explore Next on Vibe DevOps

More Global DevOps News

CI/CD & IaCJA · Source: Japanese

OpenTofu 1.7 to 1.12 Feature Comparison with Terraform

A technical breakdown of key OpenTofu 1.7 through 1.12 enhancements over Terraform, including dynamic enabled parameters, client-side state encryption, and variables in backend configurations.

Zenn — Topic TerraformSource: 30/10/2026Curated 03/11/2026