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

Unclear what will be replaced in-line for random_string change #316

Closed
1 task done
syphernl opened this issue Sep 8, 2022 · 2 comments
Closed
1 task done

Unclear what will be replaced in-line for random_string change #316

syphernl opened this issue Sep 8, 2022 · 2 comments
Labels
Milestone

Comments

@syphernl
Copy link

syphernl commented Sep 8, 2022

Terraform CLI and Provider Versions

Terraform v1.2.9
on linux_amd64

  • provider registry.terraform.io/hashicorp/aws v3.75.2
  • provider registry.terraform.io/hashicorp/random v3.4.2

Terraform Configuration

resource "random_string" "rds_password" {
  length  = 32
  special = false
}

Expected Behavior

A more clear explanation as to what will change, so that this change can be approved properly.

Actual Behavior

Terraform only indicates the following:

Terraform will perform the following actions:

  # random_string.rds_password will be updated in-place
  ~ resource "random_string" "rds_password" {
        id          = "REDACTED"
        # (11 unchanged attributes hidden)
    }

Before and after there is a slight difference in the statefile (namely override_special and sensitive_attributes:

{
      "mode": "managed",
      "type": "random_string",
      "name": "rds_password",
      "provider": "provider[\"registry.terraform.io/hashicorp/random\"]",
      "instances": [
        {
          "schema_version": 2,
          "attributes": {
            "id": "REDACTED",
            "keepers": null,
            "length": 32,
            "lower": true,
            "min_lower": 0,
            "min_numeric": 0,
            "min_special": 0,
            "min_upper": 0,
            "number": true,
            "numeric": true,
            "override_special": null,
            "result": "REDACTED",
            "special": false,
            "upper": true
          },
          "sensitive_attributes": [
            
          ],
          "private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ=="
        }
      ]
    },

After:

    {
      "mode": "managed",
      "type": "random_string",
      "name": "rds_password",
      "provider": "provider[\"registry.terraform.io/hashicorp/random\"]",
      "instances": [
        {
          "schema_version": 2,
          "attributes": {
            "id": "REDACTED",
            "keepers": null,
            "length": 32,
            "lower": true,
            "min_lower": 0,
            "min_numeric": 0,
            "min_special": 0,
            "min_upper": 0,
            "number": true,
            "numeric": true,
            "override_special": "",
            "result": "REDACTED",
            "special": false,
            "upper": true
          },
          "sensitive_attributes": []
        }
      ]
    },

Steps to Reproduce

  1. terraform apply on Random < 3.4.0
  2. terraform apply on Random >= 3.4.0

How much impact is this issue causing?

Low

Logs

No response

Additional Information

This could be related to #302

Code of Conduct

  • I agree to follow this project's Code of Conduct
@syphernl syphernl added the bug label Sep 8, 2022
@bflad bflad added this to the v3.4.3 milestone Sep 9, 2022
@bflad
Copy link
Contributor

bflad commented Sep 9, 2022

Hi @syphernl 👋 Thank you for raising this and apologies you ran into trouble here.

The provider unfortunately does not have any control about the plan difference output in this case as Terraform (due to some legacy reasons) is likely hiding the override_special attribute errantly going from null to "" with version 3.4.2.

The good news though is that this should be resolved by upgrading to 3.4.3, which was recently released. If the resource happened to be applied with 3.4.2, it may show one more plan to go from "" back to null then it'll stabilize. Additional reference: #312

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 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants