Open krolique opened 4 years ago
Ran into this issue just now as well, I believe the current workaround is to manually specify a depends_on
A temporary workaround would be:
resource "aws_dynamodb_table" "your_table" {
name = "your-table-name"
billing_mode = "PAY_PER_REQUEST"
hash_key = "hash_key_name"
stream_enabled = true
stream_view_type = "NEW_IMAGE"
attribute {
name = "attribute_name"
type = "S"
}
}
resource "aws_lambda_event_source_mapping" "map_events" {
event_source_arn = data.aws_dynamodb_table.your_table_on_aws.stream_arn
function_name = aws_lambda_function.your_lambda_function.arn
starting_position = "LATEST"
}
data "aws_dynamodb_table" "your_table_on_aws" {
name = "your-table-name"
depends_on = [aws_dynamodb_table.your_table]
}
resource "aws_lambda_function" "your_lambda_function" {
...
...
...
}
It worked for me. :)
@mattfysh running in to this issue as well, where are you specifying the depends_on
?
Hi all š Thank you for taking the time to file this and for the additional input. Given that there's been a few Terraform and AWS Provider releases since the last report, is anyone still experiencing this issue?
@justinretzolk I'm seeing this issue. Related to https://github.com/hashicorp/terraform-provider-aws/issues/23364 and https://github.com/hashicorp/terraform-provider-aws/issues/650
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Terraform apply should have created a DynamoDB stream, lambda function and mapped the stream events to the lambda function.
Actual Behavior
Terraform apply did not create the
aws_lambda_event_source_mapping
Steps to Reproduce
terraform apply
Important Factoids
References
0000