Skip to content

Instantly share code, notes, and snippets.

@badideasforsale
badideasforsale / create_gha_oidc_in_aws.sh
Last active July 18, 2025 05:21
Create OIDC connection for GitHub Actions to use in AWS
#!/bin/bash
# Script to create OIDC provider for GitHub Actions
# This script creates an OIDC provider in AWS for GitHub Actions to assume roles
# It also creates an IAM role with the appropriate trust policy for the specified repository
set -euo pipefail # Exit on error, undefined variables, and pipe failures
# Color codes for output formatting
readonly RED='\033[0;31m'