This content originally appeared on DEV Community and was authored by Srinivasulu Paranduru
Step by step approach for creation of IAM Role in AWS and using in GitHub Actions Pipeline
Step1 : Create of Identity Provider for Github
Step2: Select the OpenIDConnect then give the necessary details as given below and then click on Add Provider
- For the provider URL: Use https://token.actions.githubusercontent.com
- For the "Audience": Use sts.amazonaws.com
Step3: Creation of IAM Role using Open ID Connector
Step 3.1:
Step 3.2:
- Select Identity Provider
- Select Audience
- Enter GitHub Organisation
Step 3.3: Select required permissions
Step 3.4: Enter the role name as GHOIDCRole then click on create role
Step 3.5: Keep the IAM Role handy and its needs to be included to be used in GitHub Pipeline
- arn:aws:iam::AWS_Account_ID:role/GHOIDCRole
Step 4: Create a github repo under your Github organisation
Step 4.1 : click on Actions
Step 4.2 :
To create a GitHub action to invoke the AWS CLI:
Create a basic workflow file, such as main.yml, in the .github/workflows directory of your repository. This sample workflow will assume the GHOIDCRole role, to perform the action aws sts get-caller-identity. Your repository can have multiple workflows, each performing different sets of tasks. After GitHub is authenticated to the role with the workflow, you can use AWS CLI commands in your account.
Paste the following example workflow into the file.
# This is a basic workflow to help you get started with Actions
name:Connect to an AWS role from a GitHub repository
# Controls when the action will run. Invokes the workflow on push events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
AWS_REGION : <"us-east-1"> #Change to reflect your Region
# Permission can be added at job level or
This content originally appeared on DEV Community and was authored by Srinivasulu Paranduru

Srinivasulu Paranduru | Sciencx (2025-02-13T18:03:04+00:00) GitHub Actions Pipeline using OpenIDConnect in AWS Cloud. Retrieved from https://www.scien.cx/2025/02/13/github-actions-pipeline-using-openidconnect-in-aws-cloud/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.