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 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.
63
+
The required parameters to deploy are `function-name` and `code-artifacts-dir`. If a function with the name specified by `function-name` does not exist, it will be created with the provided code within `code-artifacts-dir` and configuration parameters using the [CreateFunction](https://docs.aws.amazon.com/lambda/latest/api/API_CreateFunction.html) API.
64
+
65
+
Handler and runtime default to index.handler and nodejs20.x but can be customized. For the full list of inputs this GitHub Action supports, see [Inputs](#inputs).
66
+
67
+
64
68
65
69
### Update Function Configuration
70
+
Function configuration will be updated using the [UpdateFunctionConfiguration](https://docs.aws.amazon.com/lambda/latest/api/API_UpdateFunctionConfiguration.html) API if configuration values differ from the deployed Lambda function's configuration.
66
71
72
+
As a first step, [GetFunctionConfiguration](https://docs.aws.amazon.com/lambda/latest/api/API_GetFunctionConfiguration.html) is called to perform a diff between the provided configuration parameters and the configuration of the currently deployed function. If there is no change, UpdateFunctionConfiguration will not be called.
67
73
```yaml
68
74
- name: Update Lambda configuration
69
75
uses: aws-actions/aws-lambda-deploy@v1
@@ -76,7 +82,7 @@ The required parameters to deploy are function name, code artifacts directory, h
76
82
```
77
83
78
84
### Using S3 Deployment Method
79
-
85
+
Optionally store code artifacts in S3 instead of direct `.zip` file upload.
80
86
```yaml
81
87
- name: Deploy Lambda function via S3
82
88
uses: aws-actions/aws-lambda-deploy@v1
@@ -88,7 +94,7 @@ The required parameters to deploy are function name, code artifacts directory, h
88
94
```
89
95
90
96
### Dry Run Mode
91
-
97
+
Validate parameters and permissions without any function code or configuration modifications.
92
98
```yaml
93
99
- name: Deploy on dry run mode
94
100
uses: aws-actions/aws-lambda-deploy@v1
@@ -99,7 +105,9 @@ The required parameters to deploy are function name, code artifacts directory, h
99
105
```
100
106
## Build from Source
101
107
102
-
To automate building your source code, add a build step based on your runtime and build process. Below are two commonly used examples for Node.js and Python:
108
+
To automate building your source code, add a build step based on your runtime and build process. This build step should be performed before the AWS Lambda Deploy step, and AWS Lambda Deploy's `code-artifacts-dir` parameter will typically be set to the build step's code artifact output directory.
109
+
110
+
Below are two commonly used Build examples for Node.js and Python:
103
111
104
112
### Node.js
105
113
@@ -109,7 +117,7 @@ To automate building your source code, add a build step based on your runtime an
109
117
# Install dependencies
110
118
npm ci
111
119
112
-
# Build
120
+
# Build
113
121
npm run build
114
122
```
115
123
### Python
@@ -119,7 +127,7 @@ To automate building your source code, add a build step based on your runtime an
119
127
run: |
120
128
# Install dependencies
121
129
pip install -r requirement.txt
122
-
130
+
123
131
# Build
124
132
python -m build
125
133
```
@@ -168,7 +176,7 @@ To automate building your source code, add a build step based on your runtime an
168
176
169
177
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.
170
178
171
-
### OpenID Connect (OIDC)
179
+
### OpenID Connect (OIDC)
172
180
173
181
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.
174
182
@@ -178,7 +186,8 @@ Here's an example of using OIDC with the aws-actions/configure-aws-credentials a
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