question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-s3-notifications): Unable to validate the following destination configurations.

See original GitHub issue

What is the problem?

Error: An error occurred (InvalidArgument) when calling the PutBucketNotificationConfiguration operation: Unable to validate the following destination configurations. See the details in CloudWatch Log Stream:

Cloudwatch Log Stream didn’t seem to have further details.

Reproduction Steps

    const importedBucketFromName = s3.Bucket.fromBucketName(
      this,
      'imported-bucket-from-name',
      'bucket-name'
    );

    const importedLambdaFromArn = lambda.Function.fromFunctionArn(
      this,
      'external-lambda-from-arn',
      'lambda-arn'
    );

    importedBucketFromName.addEventNotification(
      s3.EventType.OBJECT_CREATED,
      new s3n.LambdaDestination(importedLambdaFromArn),
      { prefix: 'test/', suffix: '.yaml' }
    );

What did you expect to happen?

Bucket would have an event notification for the given config pointing to the lambda.

What actually happened?

Error shown was generated.

CDK CLI Version

2.2.0 (build 4f5c27c)

Framework Version

n/a

Node.js Version

16.11

OS

OSX

Language

Typescript

Language Version

TypeScript (4.4.4)

Other information

From what I have read this seems to be caused by a missing policy on either the S3 Bucket or Lambda function or both. My attempts to add these policies have not worked.

Perhaps this issue stems from both resources(lambda, bucket) being imported, and thus addEventNotification is not able to add the required policies. Any workaround would be greatly apprecaited.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:7
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ostecommented, Jan 5, 2022

Hi @NGL321, I am trying to plan feature development around this issue. I am wondering if it’s possible to get an idea of when this issue might be resolved. This way I can decide if it makes sense to look into a workaround.

Thanks in advance for any details.

1reaction
lili0allencommented, Jun 16, 2022

hi @NGL321

Switching to fromFunctionAttributes produces the same Unable to validate the following destination configurations. error.

Here is what I changed to:

    const importedLambdaFromArn = lambda.Function.fromFunctionAttributes(
      this,
      'external-lambda-from-arn',
      {
        functionArn: 'my-arn',
      }
    );

I had the same issue. You need to set “sameEnvironment” flag to “true” in fromFunctionAttributes() to allow CDK has permission to update your external lambda function.

something like:

{ functionArn: 'my-arn', sameEnvironment: true }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Avoid the "Unable to validate the following destination ...
I receive the following error: "Unable to validate the following destination configurations." When I try to set a dependency on the SNS topic ......
Read more >
S3 Bucket Lambda Event: Unable to validate the following ...
You are getting this message because your s3 bucket is missing permissions for invoking your lambda function. According to AWS ...
Read more >
What to do if you get an error “Unable to validate the following ...
Settings · Open the AWS Management Console. · Go to the Amazon SNS Settings page. · Click “Topic” in the left menu to...
Read more >
"Unable to validate the following destination configurations ...
I am trying to write a serverless configuration for my service. A requirement is that the S3 bucket sends notifications to an SQS...
Read more >
How do I resolve the validation error from Amazon S3 event ...
... avoid the error " Unable to validate the following destination configurations " when using S3 event notifications in AWS CloudFormation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found