Skip to content

Commit a3ead82

Browse files
committed
Adds info about lambda event source mapping issue
1 parent 4d62600 commit a3ead82

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,15 @@ So issues that exist on Vercel are likely to occur on this project too.
268268
After running the initial `terraform destroy` command (that failed) wait ~1 hour and run the command again.
269269
This time it should run successfully and delete the rest of the stack.
270270

271+
- Initial apply fails with error message `Error: error creating Lambda Event Source Mapping` ([#138](https://github.com/dealmore/terraform-aws-next-js/issues/138))
272+
273+
There is some race condition when the permissions are created for the static deployment Lambda.
274+
This should only happen on the first deployment.
275+
276+
**Workaround:**
277+
278+
You should be able to run`terraform apply` again and the stack creation would progreed without this error.
279+
271280
## License
272281

273282
Apache-2.0 - see [LICENSE](./LICENSE) for details.

modules/statics-deploy/main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,9 @@ module "deploy_trigger" {
199199
service = "s3"
200200
source_arn = aws_s3_bucket.static_upload.arn
201201
}
202-
# TODO: Check if we need this
203202
InvalidationQueue = {
204-
service = "sqs"
205-
source_arn = aws_sqs_queue.this.arn
203+
principal = "sqs.amazonaws.com"
204+
source_arn = aws_sns_topic.this.arn
206205
},
207206
}
208207

0 commit comments

Comments
 (0)