File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,12 @@ The code sample below reads the environment variable of a Lambda function that r
14
14
15
15
1 . Open a text editor and copy the following code:
16
16
17
- ```
18
- var AWS = require('aws-sdk');
19
-
20
- exports.handler = function(event, context, callback) {
21
-
22
- var bucketName = process.env.S3_BUCKET;
23
- callback(null, bucketName);
24
- }
25
- ```
17
+ ``` js
18
+ exports .handler = function (event , context , callback ) {
19
+ var bucketName = process .env .S3_BUCKET ;
20
+ callback (null , bucketName);
21
+ };
22
+ ```
26
23
27
24
1 . Save the file as * index\. js* \.
28
25
@@ -69,4 +66,4 @@ $ aws lambda update-function-configuration --function-name ReturnBucketName \
69
66
--environment Variables={S3_BUCKET=Prod}
70
67
```
71
68
72
- Run the ` aws lambda invoke ` command again using the same parameters\. This time, the Lambda function will return the Amazon S3 bucket name as ` Prod ` \.
69
+ Run the ` aws lambda invoke ` command again using the same parameters\. This time, the Lambda function will return the Amazon S3 bucket name as ` Prod ` \.
You can’t perform that action at this time.
0 commit comments