cicd intital pipeline testing #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: [5165-cicd] | |
pull_request: | |
branches: [5165-cicd] | |
env: | |
AWS_REGION: "ap-southeast-2" # Change to reflect your Region | |
# Permission can be added at job level or workflow level | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
AssumeRoleAndCallIdentity: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git clone the repository | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: arn:aws:iam::704910415367:role/tlc-ci-cd | |
role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
aws-region: ${{ env.AWS_REGION }} | |
# Hello from AWS: WhoAmI | |
- name: Sts GetCallerIdentity | |
run: | | |
aws sts get-caller-identity |