1

Trying to set Object Locking on an AWS bucket module (which is working fine without object locking configuration) I get the error :

invalid or unknown key: object_lock_configuration

The error message makes me think about a syntax error but can't see it, so here is the bucket definition:

resource "aws_s3_bucket" "new_b" { bucket = "${lower(var.sia)}-${var.bucket_name}-${lower(var.env)}" acl = "${var.bucket_acl}" object_lock_configuration { object_lock_enabled = "${var.locking}" } lifecycle_rule { id = "default" prefix = "" enabled = "${var.default_lifecycle}" expiration { days = "${var.default_expiry_days}" } } tags { Name = "${lower(var.sia)}-${var.bucket_name}-${lower(var.env)}" Sia = "${upper(var.sia)}" Env = "${upper(var.env)}" Author = "${var.author}" } } 

I am running it with : Terraform v0.11.13 + provider.aws v1.52.0 + provider.template v1.0.0

1 Answer 1

0

Setting object lock configuration for a bucket requires version 1.56.0 of the Terraform AWS provider.

cf. https://github.com/terraform-providers/terraform-provider-aws/issues/6634#issuecomment-454621706

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.