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

aws_lambda_event_source_mapping: "Error creating Lambda event source mapping" should report the ARN of the event_source_arn in output text #15753

Closed
ghost opened this issue Oct 20, 2020 · 4 comments · Fixed by #17933
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/lambda Issues and PRs that pertain to the lambda service.
Milestone

Comments

@ghost
Copy link

ghost commented Oct 20, 2020

This issue was originally opened by @jcollum as hashicorp/terraform#26654. It was migrated here as a result of the provider split. The original body of the issue is below.


Current Terraform Version

v0.12.29

Use-cases

When using aws_lambda_event_source_mapping the error code could help more. It's a little light on details, that's all.

Attempted Solutions

n/a/

Proposal

The output of our terraform deploy when it hits this error is:

 Error: Error creating Lambda event source mapping: InvalidParameterValueException: Error occurred while ReceiveMessage. SQS Error Code: AWS.SimpleQueueService.NonExistentQueue. SQS Error Message: The specified queue does not exist or you do not have access to it.
 {
   RespMetadata: {
     StatusCode: 400,
     RequestID: "def4a37c-105e-4d33-88a8-dddaeb009b03"
   },
   Message_: "Error occurred while ReceiveMessage. SQS Error Code: AWS.SimpleQueueService.NonExistentQueue. SQS Error Message: The specified queue does not exist or you do not have access to it.",
   Type: "User"
 }

It would be very helpful if Terraform would also output the arn that is hitting the NonExistentQueue error.

References

None recent.

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 20, 2020
@anGie44 anGie44 added enhancement Requests to existing resources that expand the functionality or scope. service/lambda Issues and PRs that pertain to the lambda service. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 20, 2020
@ewbankkit
Copy link
Contributor

Error message uses Id before it's set:

if err != nil {
return fmt.Errorf("error creating Lambda Event Source Mapping (%s): %w", d.Id(), err)
}
d.SetId(aws.StringValue(eventSourceMappingConfiguration.UUID))

@ewbankkit
Copy link
Contributor

Note that the event_source_arn will no longer be required when support for MQ queues and self-managed Kafka clusters is added.
I suggest logging the "target" (ARN, queue name or Kafka brokers) if create fails.

@ghost
Copy link
Author

ghost commented Apr 30, 2021

This has been released in version 3.38.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/lambda Issues and PRs that pertain to the lambda service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants