The terraform remote state configuration directive lock_table for the S3 backend is deprecated in favour of the new directive dynamodb_table
terraform throws the following warning when initialising the backend:
Initializing the backend...
"lock_table": [DEPRECATED] please use the dynamodb_table attribute
I tried using dynamodb_table in the terragrunt remote config but it is not recognised.
Ah, good catch. Should be a straightforward fix. PRs very welcome!
I shall take a look. This could be my first go code...
Thank you!
did you get an error? I switched to dynamodb_table and am getting no errors.
No error, just the deprecation warning.
No, I mean you indicate that terragrunt did not recognize the dynamodb_table option. Did you get an error for that?
I can't remember 100%, but I think it just got ignored.
I started a new Terragrunt/Terraform project and tried to use terragrunt init with dynamodb_table and Terragrunt didn't create a DynamoDB table automatically like it would if I had used lock_table.
Hmm, I switched mine to dynamodb_table and locking is still done. Granted, I haven't tried making a new state file.
@grimm26 I expect the distinction here is between having a dynamodb table that already exists vs creating a new one. If the lock table doesn't exist, vanilla terraform doesn't create it. That's something terragrunt handles.
I haven't looked at the code directly, but I would assume that terragrunt passes the entire terragrunt.remote_state.config block to terraform init, rather than whitelisting specific variables, which explains why switching to dynamodb_table works just fine with an existing configuration. On the other hand, since creating a new locktable is handled within terragrunt, this code path would have the lock_table key name hardcoded.
End result, it's entirely consistent that s/lock_table/dynamodb_table/ would work fine on existing infrastructure but cause an error when creating a new environment.
Fixed by #309.
I'm still getting this message in the log ""lock_table": [DEPRECATED] please use the dynamodb_table attribute"
Did you update your remote state config to use dynamodb_table instead of lock_table?
Most helpful comment
I started a new Terragrunt/Terraform project and tried to use terragrunt init with dynamodb_table and Terragrunt didn't create a DynamoDB table automatically like it would if I had used lock_table.