I have terraform stack which keeps locks in DynamoDB:
terraform {
backend "s3" {
bucket = "bucketname"
key = "my_key"
encrypt = "true"
role_arn = "arn:aws:iam::11111111:role/my_role"
dynamodb_table = "tf-remote-state-lock"
}
}
When I run terraform workspace new test it fails with (quite misleading) error:
failed to lock s3 state: 2 errors occurred:
* ResourceNotFoundException: Requested resource not found
* ResourceNotFoundException: Requested resource not found
If I turn on TF_LOG=DEBUG then I see 400 Bad Request (more details on pastebin)
What am I doing wrong and how to fix it?