Terraform invalid arn for aws provider

1.4k Views Asked by At

I'm using AWS Chalice to configure my app, and packaging this to terraform config so that I can combine with the terraform config responsible for the creation of backing services (s3 buckets, elasticache instances etc).

Because chalice is not responsible for creating the S3 bucket itself, only the lambda and the event source mapping it's creating this arn arn:*:s3:::lambda-function-name which is failing terraform aws provider validation:

Error: "source_arn" (arn:*:s3:::fetchbb--warehouse-sync--dropbox-quickbase) is an invalid ARN:
invalid partition value (expecting to match regular expression: ^aws(-[a-z]+)*$)

This is the config that chalice is producting:

"aws_lambda_permission": {
  "lambda-function-name-s3event": {
    "statement_id": "lambda-function-name-s3event",
    "action": "lambda:InvokeFunction",
    "function_name": "lambda-function-name",
    "principal": "s3.amazonaws.com",
    "source_arn": "arn:*:s3:::lambda-function-name"
  },
  ...
}

I'm trying to work out if this is a legitimate arn. Is the issue with the terraform aws provider validation, or with the config that chalice is packaging?

0

There are 0 best solutions below