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.

Terraform aws provider invalid arn for s3 lambda permission

See original GitHub issue

Packaging the chalice app for terraform is giving me an invalid source_arn error for the aws_lambda_permission s3event "source_arn": "arn:*:s3:::lambda-function-name

Error: "source_arn" (arn:*:s3:::lambda-function-name) is an invalid ARN:
invalid partition value (expecting to match regular expression: ^aws(-[a-z]+)*$)

I can’t determine whether this is an issue with the validation of the provider or with how chalice is packaging this up?

https://github.com/aws/chalice/blob/ba93124276c3f2d360286396e536520c9fa5fecf/chalice/package.py#L853

chalice 1.18.1 & 1.19.0, python 3.8.0, terraform aws provider 3.4.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jameslscommented, Oct 14, 2020

@kapilt Should be fixed in #1550. I switched it over to ${data.aws_partition.chalice.partition}.

0reactions
kapiltcommented, Oct 14, 2020

a previous version in #1417 used a terraform data partition to construct arns, that should be used again to fix these issues, it was removed for reasons of inconsistencies on dns suffix, but it should be retained for arn construction.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Terraform invalid arn for aws provider - Stack Overflow
Because chalice is not responsible for creating the S3 bucket itself, only the lambda and the event source mapping it's creating this arn...
Read more >
aws_lambda_permission | Resources | hashicorp/aws
Resource: aws_lambda_permission. Gives an external source (like an EventBridge Rule, SNS, or S3) permission to access the Lambda function.
Read more >
Resolve "Invalid principal in policy" error in Amazon S3
I'm trying to add or edit the bucket policy of my Amazon Simple Storage Service (Amazon S3) bucket using the console.
Read more >
Ensure that lambda function permission has a source arn ...
When the principal is an AWS service, the ARN of the specific resource within that service to grant permission to. Without this, any...
Read more >
Terraform Import - Leaving Click Ops Behind - Earthly Blog
Above, I'm pulling in the terraform AWS provider and setting my region. ... My lambda also uses S3 to cache results and so...
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