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
Copy file name to clipboardExpand all lines: README.md
+12-11Lines changed: 12 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,12 @@ Run Bash in [AWS Lambda](https://aws.amazon.com/lambda/) via [Layers](https://do
4
4
5
5
See the [How To](#how-to) section to understand how to use these layers. Also see the [example.sh](example.sh) file for an example of how to write a Bash script compatible with this Layer.
6
6
7
+
### ARN
8
+
9
+
```
10
+
arn:aws:lambda:<region>:744348701589:layer:bash:1
11
+
```
12
+
7
13
## How To
8
14
9
15
### Getting Started
@@ -15,14 +21,14 @@ See the [How To](#how-to) section to understand how to use these layers. Also se
15
21
3. For the "Runtime" selection, select `Use custom runtime in function code or layer`.
16
22
4. In the "Designer" section of your function dashboard, select the `Layers` box.
17
23
5. Scroll down to the "Referenced Layers" section and click `Add a layer`.
18
-
6. Select the `Provide a layer version ARN` option, then copy/paste the [Layer ARN](#ARNs) for your region.
24
+
6. Select the `Provide a layer version ARN` option, then copy/paste the [Layer ARN](#ARN) for your region.
19
25
7. Click the `Add` button.
20
26
8. Click `Save` in the upper right.
21
27
9. Upload your code and start using Bash in AWS Lambda!
22
28
23
29
#### AWS CLI
24
30
25
-
1. Create a function that uses the `provided` runtime and the [Layer ARN](#ARNs) for your region.
31
+
1. Create a function that uses the `provided` runtime and the [Layer ARN](#ARN) for your region.
1. In the "Designer" section of your function dashboard, select the `Layers` box.
43
49
2. Scroll down to the "Referenced Layers" section and click `Add a layer`.
44
-
3. Select the `Provide a layer version ARN` option, then copy/paste the [Layer ARN](README.md#ARNs) for your region.
50
+
3. Select the `Provide a layer version ARN` option, then copy/paste the [Layer ARN](#ARN) for your region.
45
51
4. Click the `Add` button.
46
52
5. Still under the "Referenced Layers" section, select the previous version and click `Remove`.
47
53
6. Click `Save` in the upper right.
48
54
49
55
50
56
#### AWS CLI
51
57
52
-
1. Update your function's configration and add the [Layer ARN](README.md#ARNs) for your region.
58
+
1. Update your function's configration and add the [Layer ARN](#ARN) for your region.
53
59
54
60
```
55
61
$ aws lambda update-function-configuration \
@@ -121,6 +127,8 @@ Bash behaves in ways unlike other programming languages. As such, there are some
121
127
122
128
- The AWS CLI appears to be much slower than most of the AWS SDKs. Take this into consideration when comparing Bash with another language and evaluating execution times.
123
129
130
+
- If a command is logging unwanted messages to `stderr` that are being picked up in your response, you can see if there is something similiar to a `--silent` flag. If there is not, you can remove the messages to `stderr` by redirecting to /dev/null (`2>/dev/null`) or redirecting `stderr` to `stdout` for that command (`2>&1`) to send them to CloudWatch.
131
+
124
132
- With this method there is no `context` in the function, only `event` data. The `event` data is sent to your function as the first parameter. So to access the `event` data, use `$1`, for example `EVENT_DATA=$1`. In order to give some details that were availabe in the `context`, I export a few additional variables.
125
133
126
134
`AWS_LAMBDA_REQUEST_ID` - AWS Lambda Request ID
@@ -131,13 +139,6 @@ Bash behaves in ways unlike other programming languages. As such, there are some
131
139
132
140
`AWS_LAMBDA_TRACE_ID` - The sampling decision, trace ID, and parent segment ID of AWS XRay
0 commit comments