GitXplorerGitXplorer
h

terraform-validate-bug-repro

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
9d9ce27f15f841b779c00d5d8fc90bfb99b508fa

Update README.md

hhponde committed 3 years ago
Verified
fb6260dfe2b95c15dfcb652eb9ab0040a8ce84c0

Create README.md with steps to repro bug

hhponde committed 3 years ago
Unverified
ba312bf7f5961e91e50bdbd29ac1804f30be954a

first commit

hhponde committed 3 years ago

README

The README file for this repository.

terraform-validate-bug-repro

Example of bug around "terraform validate"

Steps

Steps to reproduce:

  • Have terraform version 1.1.7 (latest, also known to repro in 0.15.5)
  • Git clone this repo
  • Run terraform init (this sets up terraform state)
  • According to the validation logic around password_expiry the value of "2020-08-01T20:00:00Z" should fail since it's so much in the past.
  • terraform validate does not catch this:
❯ terraform validate
Success! The configuration is valid.
  • terraform console does catch this and prints it out as an error:
❯ terraform console
╷
│ Warning: Due to the problems above, some expressions may produce unexpected results.
│
│
╵

╷
│ Error: Invalid value for variable
│
│   on main.tf line 10, in module "ci-service-account":
│   10:   password_expiry = "2020-08-01T20:00:00Z"
│
│ 'password_expiry' must be ISO 8601 datetime and at least one must be valid for the next 30 days.
│
│ This was checked by the validation rule at service-account/main.tf:4,3-13.
╵

>

logs

With TF_LOG=trace: