Skip to content

Commit d922025

Browse files
authored
docs: Updated README with S3 bucket id handling (#157)
1 parent c21fb61 commit d922025

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module "lambda_function" {
5959
source_path = "../src/lambda-function1"
6060
6161
store_on_s3 = true
62-
s3_bucket = "my-bucket-with-lambda-builds"
62+
s3_bucket = "my-bucket-id-with-lambda-builds"
6363
6464
layers = [
6565
module.lambda_layer_s3.lambda_layer_arn,
@@ -86,7 +86,7 @@ module "lambda_layer_s3" {
8686
source_path = "../src/lambda-layer"
8787
8888
store_on_s3 = true
89-
s3_bucket = "my-bucket-with-lambda-builds"
89+
s3_bucket = "my-bucket-id-with-lambda-builds"
9090
}
9191
```
9292

@@ -115,8 +115,13 @@ locals {
115115
my_function_source = "../path/to/package.zip"
116116
}
117117
118+
resource "aws_s3_bucket" "builds" {
119+
bucket = "my-builds"
120+
acl = "private"
121+
}
122+
118123
resource "aws_s3_bucket_object" "my_function" {
119-
bucket = "my-bucket-with-lambda-builds"
124+
bucket = aws_s3_bucket.builds.id
120125
key = "${filemd5(local.my_function_source)}.zip"
121126
source = local.my_function_source
122127
}
@@ -131,7 +136,7 @@ module "lambda_function_existing_package_s3" {
131136
132137
create_package = false
133138
s3_existing_package = {
134-
bucket = "my-bucket-with-lambda-builds"
139+
bucket = aws_s3_bucket.builds.id
135140
key = aws_s3_bucket_object.my_function.id
136141
}
137142
}
@@ -180,7 +185,7 @@ module "lambda_layer_s3" {
180185
source_path = "../fixtures/python3.8-app1"
181186
182187
store_on_s3 = true
183-
s3_bucket = "my-bucket-with-lambda-builds"
188+
s3_bucket = "my-bucket-id-with-lambda-builds"
184189
}
185190
```
186191

0 commit comments

Comments
 (0)