Skip to content

Commit

Permalink
Example with openID credentials (#252)
Browse files Browse the repository at this point in the history
# Description

In the examples we offer, there is not a single mention of OpenID
Credentials. This PR offers an example stolen from #248 thanks @thenanor
for your help!

this should close #248
  • Loading branch information
gagoar committed Aug 6, 2024
1 parent ac1835f commit d8bcdc0
Showing 1 changed file with 33 additions and 9 deletions.
42 changes: 33 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ This action allows you to synchronously invoke a Lambda function and get the res

## Table of contents

- [Input parameters](#input-parameters)
- [Credentials](#credentials)
- [Invocation](#invocation)
- [Output](#output)
- [Examples](#examples)
- [Basic example](#basic-example)
- [Using output](#using-output)
- [Specifying alias/version](#specifying-aliasversion)
- [Handling logs](#handling-logs)
- [Invoke AWS Lambda](#invoke-aws-lambda)
- [Table of contents](#table-of-contents)
- [Input parameters](#input-parameters)
- [Credentials](#credentials)
- [Invocation](#invocation)
- [Output](#output)
- [Examples](#examples)
- [Basic example](#basic-example)
- [Using output](#using-output)
- [Specifying alias/version](#specifying-aliasversion)
- [Handling logs](#handling-logs)
- [OpenID Credentials](#openid-credentials)

<hr>

Expand Down Expand Up @@ -157,3 +160,24 @@ These steps process logs returned from the invocation:
- name: Store tail logs to file
run: echo "${{ fromJSON(steps.foobar.outputs.response).LogResult }}" > invocation-logs.json
```

### OpenID Credentials

You can also use OpenID Credentials via `aws-actions/configure-aws-credentials`:
```yaml
- name: Assume AWS role
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: the_arn_of_the_role_you_want_to_assume
aws-region: eu-west-1
- name: Invoke the Lambda
uses: gagoar/invoke-aws-lambda@master
with:
AWS_ACCESS_KEY_ID: ${{env.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{env.AWS_SECRET_ACCESS_KEY}}
AWS_SESSION_TOKEN: ${{env.AWS_SESSION_TOKEN}}
REGION: ${{env.AWS_REGION}}
FunctionName: foobarFunction
Payload: '{ "myParameter": false }'
```

0 comments on commit d8bcdc0

Please sign in to comment.