Skip to content

[Bug]: Regression of S3 backend configuration partial configuration for version 1.10.0 #36198

@olahouze

Description

@olahouze

Terraform Version

1.10.0

Terraform Configuration Files

terraform {
  backend "s3" {
    # ...
  }
}

Debug Output

Error: Missing attribute separator

│ on -backend-config="assume_role={role_arn=arn:xxxxxx}" line 1:
│ (source code not available)

│ Expected a newline or comma to mark the beginning of the next attribute.

Expected Behavior

I use the “partial configuration” system in cli to supply parameters to my backend dynamically during terraform init.

This system only takes into account key/value pairs in cli mode (https://developer.hashicorp.com/terraform/language/backend#command-line-key-value-pairs)

Since the latest version of terraform, when I use an S3 as my backend, I have to specify the following parameters for assumes roles

terraform {
  backend "s3" {
  ...
    assume_role = {
          role_arn = “arn:xxxx”
        }
  }
}

The old way of working with only the “role_arn” field is no longer supported.

The cli backend configuration should be able to take in charge key/value pairs whose vlue is an object (in this case, a map).

Actual Behavior

I can therefore no longer dynamically provide the role to be used for my cli backend

Steps to Reproduce

terraform init --backend-config="key=xxx" -backend-config="assume_role={role_arn=arn:xxxx}"

Additional Context

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions