Terragrunt: lock_table deprecated

Created on 24 Aug 2017  路  13Comments  路  Source: gruntwork-io/terragrunt

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.

bug help wanted

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.

All 13 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dzirg44 picture dzirg44  路  3Comments

skang0601 picture skang0601  路  4Comments

shaharmor picture shaharmor  路  3Comments

MacFlurry picture MacFlurry  路  4Comments

mpkerr picture mpkerr  路  3Comments