Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error putting S3 Bucket Notification Configuration #235

Closed
JT-Bruch opened this issue Nov 10, 2021 · 2 comments
Closed

error putting S3 Bucket Notification Configuration #235

JT-Bruch opened this issue Nov 10, 2021 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@JT-Bruch
Copy link

What is the issue?

Every so often when a deployment happens we get this error occurring, it typically happens on the first deployment of a new environment. It looks like this has happened before #150

Is there anything I can do, or set a potential retry flag here?

Seems to be a pretty common issue as AWS has an article for it.

╷
│ Error: error putting S3 Bucket Notification Configuration: InvalidArgument: Unable to validate the following destination configurations
│ 	status code: 400, request id: 651ETZHV2GQ46XBB, host id: Sq4MDwXdLXToL7Mm0uADGw23Pod1vUD9UBDhP3NXhq4CR9ZQikFYy94AhvbiHLtOj90+Gh3iKh8=
│ 
│   with module.backoffice_tf_next.module.statics_deploy.aws_s3_bucket_notification.on_create,
│   on .terraform/modules/backoffice_tf_next/modules/statics-deploy/main.tf line 23, in resource "aws_s3_bucket_notification" "on_create":
│   23: resource "aws_s3_bucket_notification" "on_create" {
│ 
╵
╷
│ Error: error putting S3 Bucket Notification Configuration: InvalidArgument: Unable to validate the following destination configurations
│ 	status code: 400, request id: MPQW13FZDYQ8MMFN, host id: fYwjCEsjjkoPSAKrdPTGwMhxRIZ6WMmdNtN66bkkxyn9xbC8gybkraP3ZB4cpPad6lDELbj7Gck=
│ 
│   with module.marketplace_tf_next.module.statics_deploy.aws_s3_bucket_notification.on_create,
│   on .terraform/modules/marketplace_tf_next/modules/statics-deploy/main.tf line 23, in resource "aws_s3_bucket_notification" "on_create":
│   23: resource "aws_s3_bucket_notification" "on_create" {

@aaronsisler
Copy link

I am also trying this library for the first time and got the same 400 error.

@ofhouse
Copy link
Member

ofhouse commented Nov 10, 2021

Oh yes the error is pretty annoying 🙈
We already have a tracking ticket for it here: #138

It's currently planned for the upcoming 0.11 release.

The error is basically that we try to bind 2 input events (from S3 upload bucket and SQS queue) to the same Lambda.
Seems like AWS is not able to do this in parallel, when creating the resource.

Since we already use SQS here, the solution is basically to pipe the S3 bucket notification to SQS instead of calling the Lambda directly.
This way the Lambda will have only a single event input (SQS) which should solve the issue.
Another solution would be to split the single Lambdas into 2 separate Lambdas (One for S3 and one for SQS input).

@ofhouse ofhouse added the duplicate This issue or pull request already exists label Nov 10, 2021
@ofhouse ofhouse closed this as completed Jan 18, 2022
@nobletom123 nobletom123 mentioned this issue Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants