5

I haven't made any changes to my terraform scripts, and deploys started failing with an error like this:

2020/10/09 05:00:42 [DEBUG] Using modified User-Agent: Terraform/0.12.26 TFE/v202007-2
Error: Unsupported attribute
  on .terraform/modules/rds.rds/main.tf line 3, in locals:
   3:   master_password      = var.password == "" ? random_id.master_password.b64 : var.password
This object has no argument, nested block, or exported attribute named "b64".

2
  • As per this doc registry.terraform.io/providers/hashicorp/random/latest/docs/…, I don't see b64 is supported. Only b64_url & b64_std are supported.
    – harshavmb
    Commented Oct 12, 2020 at 19:14
  • 1
    To avoid this automatic plugin upgrades, we use network mirrors to download the compatible versions from the internal Artifactory. This guarantees the tests & deployments use the same version of plugins. Also, no need to connect to the public terraform registry..
    – harshavmb
    Commented Oct 12, 2020 at 19:16

1 Answer 1

9

According to the changelog for release v3.0.0:

https://github.com/hashicorp/terraform-provider-random/blob/master/CHANGELOG.md#300-october-09-2020

Remove deprecated b64 attribute

Terraform helpfully suggests:

The following providers do not have any version constraints in configuration,
so the latest version was installed.
To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version = "..." constraints to the
corresponding provider blocks in configuration, with the constraint strings
suggested below.
* provider.null: version = "~> 3.0"
* provider.random: version = "~> 3.0"
* provider.template: version = "~> 2.2"
* provider.tfe: version = "~> 0.22"

The immediate solution to the error, is to rollback the random provider by adding required_providers to a terraform block, probably in main.tf

terraform {
  required_providers {
    random = {
      version = "~> 2.3.0"
    }
  }
}
1
  • 1
    Good job Aaron - this saved us some pain
    – duncanhall
    Commented Oct 9, 2020 at 9:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.