Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random provider returns same result with each apply/destroy cycle #217

Closed
1 task done
pmoosh opened this issue Mar 16, 2022 · 3 comments · Fixed by #220
Closed
1 task done

random provider returns same result with each apply/destroy cycle #217

pmoosh opened this issue Mar 16, 2022 · 3 comments · Fixed by #220
Assignees
Labels

Comments

@pmoosh
Copy link

pmoosh commented Mar 16, 2022

Terraform CLI and Provider Versions

Terraform v0.14.9
provider registry.terraform.io/hashicorp/random v3.1.1

Terraform Configuration

resource "random_pet" "hostname" {
  length    = 2
  separator = "-"
}


output "hostname" {
  value =  random_pet.hostname

}

terraform {
  required_providers {
    random = {
      source = "hashicorp/random"
      version = "3.1.1"
    }
  }
}

Expected Behavior

should return different hostname output with each apply/destroy cycle

Actual Behavior

always returns touched-walleye

Steps to Reproduce

  1. ` terraform init'
  2. terraform apply -auto-approve
  3. `terraform destroy -auto-approve
  4. terraform apply -auto-approve
  5. terraform destroy -auto-approve

How much impact is this issue causing?

High

Logs

no logs

Additional Information

this issue was introduced with version change from 3.1.0 to 3.1.1

Code of Conduct

  • I agree to follow this project's Code of Conduct
@pmoosh pmoosh added the bug label Mar 16, 2022
@pmoosh pmoosh changed the title return same result with each apply/destroy cycle random provider returns same result with each apply/destroy cycle Mar 16, 2022
@jkerry
Copy link

jkerry commented Mar 17, 2022

Sifting through the release diff the upgrade on this dependency pulled in 2 years of change and might have been unintentional:

release diff
dependency change

@detro
Copy link
Contributor

detro commented Mar 17, 2022

It looks like that in updating the dependency for generating petname, the developer has squeezed in a "reversal" of the default behaviour: dustinkirkland/golang-petname@8e5a1ed

The little library will generate the same name in order, unless non-determinism is desired (and that's what we want here).

I'll look into how easy it is to update our use of it VS merging a dependency reversal in @jkerry PR (thank you btw)

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.