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

Importing a random password using an import block outputs a sensitive value during apply. #564

Open
1 task done
hguermeur opened this issue Apr 26, 2024 · 1 comment
Open
1 task done
Labels

Comments

@hguermeur
Copy link

hguermeur commented Apr 26, 2024

Terraform CLI and Provider Versions

Terraform v1.7.5
on linux_amd64

  • provider registry.terraform.io/hashicorp/random v3.6.1

Terraform Configuration

import {
  to = random_password.mypassword
  id = "Mysecurepassword3%"
}

resource "random_password" "mypassword" {
  length  = 30
  lower   = true
  special = true
  upper   = true

  lifecycle {
    ignore_changes = [length]
  }
}

Expected Behavior

random_password.mypassword: Importing... [id=none]
random_password.mypassword: Import complete [id=none]

Actual Behavior

random_password.mypassword: Importing... [id=Mysecurepassword3%]
random_password.mypassword: Import complete [id=Mysecurepassword3%]

Steps to Reproduce

terraform apply

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

Using terraform console :

> random_password.mypassword.id
"none"

Use sensitive does not help:

  id = sensitive("Mysecurepassword3%")

Code of Conduct

  • I agree to follow this project's Code of Conduct
@hguermeur hguermeur added the bug label Apr 26, 2024
@matthew-palmer
Copy link

Anything related to the random_password could use better obfuscation - related #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants