Skip to content

Commit 0ad4533

Browse files
committed
minor adjustments about Region usage
1 parent 50e510b commit 0ad4533

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Examples/S3EventNotifier/README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ If there are no errors, a ZIP file should be ready to deploy, located at `.build
3030

3131
## Deploy
3232

33+
[!IMPORTANT]
34+
The Lambda function and the S3 bucket must be located in the same AWS Region. In the code below, we use `eu-west-1` (Ireland).
35+
3336
To deploy the Lambda function, you can use the `aws` command line:
3437

3538
```bash
3639
aws lambda create-function \
40+
--region eu-west-1 \
3741
--function-name S3EventNotifier \
3842
--zip-file fileb://.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/S3EventNotifier/S3EventNotifier.zip \
3943
--runtime provided.al2 \
@@ -51,14 +55,16 @@ Besides deploying the Lambda function you also need to create the S3 bucket and
5155
```bash
5256
aws s3api create-bucket --bucket my-test-bucket --region eu-west-1 --create-bucket-configuration LocationConstraint=eu-west-1
5357

54-
aws lambda add-permission \
58+
aws lambda add-permission
59+
--region eu-west-1 \
5560
--function-name S3EventNotifier \
5661
--statement-id S3InvokeFunction \
5762
--action lambda:InvokeFunction \
5863
--principal s3.amazonaws.com \
5964
--source-arn arn:aws:s3:::my-test-bucket
6065

6166
aws s3api put-bucket-notification-configuration \
67+
--region eu-west-1 \
6268
--bucket my-test-bucket \
6369
--notification-configuration '{
6470
"LambdaFunctionConfigurations": [{
@@ -67,7 +73,7 @@ aws s3api put-bucket-notification-configuration \
6773
}]
6874
}'
6975

70-
aws s3 cp testfile.txt s3://my-test-bucket/
76+
touch testfile.txt && aws s3 cp testfile.txt s3://my-test-bucket/
7177
```
7278

7379
This will:
@@ -76,4 +82,7 @@ This will:
7682
- configure the bucket to send `s3:ObjectCreated:*` events to the Lambda function named `S3EventNotifier`;
7783
- upload a file named `testfile.txt` to the bucket.
7884

79-
Replace `<REGION>` with the region where you deployed the Lambda function and `<YOUR_ACCOUNT_ID>` with your actual AWS account ID.
85+
Replace `my-test-bucket` with your bucket name (bucket names are unique globaly and this one is already taken). Also replace `<REGION>` with the region where you deployed the Lambda function and `<YOUR_ACCOUNT_ID>` with your actual AWS account ID.
86+
87+
[!IMPORTANT]
88+
The Lambda function and the S3 bucket must be located in the same AWS Region. Adjust the code above according to your closest AWS Region.

0 commit comments

Comments
 (0)