You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# The role-to-assume should be the ARN of the IAM role you created for GitHub Actions OIDC
52
+
53
+
- name: Deploy Lambda Function
54
+
uses: aws-actions/aws-lambda-deploy@v1
55
+
with:
56
+
function-name: my-function-name
57
+
code-artifacts-dir: my-code-artifacts-dir
58
+
# handler: my-handler
59
+
# runtime: my-runtime
60
+
# Add any additional inputs your action supports
50
61
```
51
62
52
-
### Using S3 Deployment Method
63
+
The required parameters to deploy are function name, code artifacts directory, handler, and runtime. The function name and code artifacts directory need to be provided by the user. However, the handler and runtime do not and will default to index.handler and nodejs20.x if not provided.
This action relies on the [default behavior of the AWS SDK for JavaScript](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html) to determine AWS credentials and region. Use the [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) action to configure the GitHub Actions environment for AWS authentication.
189
207
190
-
### OpenID Connect (OIDC) - Recommended Approach
208
+
### OpenID Connect (OIDC)
191
209
192
210
We **highly recommend** using OpenID Connect (OIDC) to authenticate with AWS. OIDC allows your GitHub Actions workflows to access AWS resources without storing AWS credentials as long-lived GitHub secrets.
193
211
194
212
Here's an example of using OIDC with the aws-actions/configure-aws-credentials action:
195
213
196
214
```yaml
197
-
jobs:
198
-
deploy:
199
-
runs-on: ubuntu-latest
200
-
permissions:
201
-
id-token: write # Required for OIDC authentication
202
-
contents: read # Required to check out the repository
To use OIDC authentication, you must configure a trust policy in AWS IAM that allows GitHub Actions to assume an IAM role. Here's an example trust policy:
0 commit comments