hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.83k stars 9.17k forks source link

[Bug]: Error in deprecated attribute (overwrite) in aws_ssm_parameter resource. #38113

Open ArthOdak opened 4 months ago

ArthOdak commented 4 months ago

Terraform Core Version

1.3.5

AWS Provider Version

5.2.0

Affected Resource(s)

resource "aws_ssm_parameter" "redshift_cluster_password" {
  name       = "master_password-${aws_redshift_cluster.terraform_redshift_cluster.id}"
  value      = random_string.password.result
  type       = "SecureString"
  key_id     = data.aws_kms_key.default_kms_key.arn
  overwrite  = true
  tags       = local.common_tags
  depends_on = [aws_redshift_cluster.terraform_redshift_cluster]
}

Expected Behavior

Creating a Redshift cluster with snapshot and Resource should be created successfully in system manager.

Actual Behavior

│ Error: Provider produced inconsistent final plan
│
│ When expanding the plan for module.red.aws_ssm_parameter.redshift_cluster_username to include new values learned so far during apply, provider      
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for .value: inconsistent values for sensitive attribute.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Relevant Error/Panic Output Snippet

│ Error: Provider produced inconsistent final plan
│
│ When expanding the plan for module.red.aws_ssm_parameter.redshift_cluster_username to include new values learned so far during apply, provider      
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for .value: inconsistent values for sensitive attribute.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Terraform Configuration Files

resource "aws_ssm_parameter" "redshift_cluster_password" {
  name       = "master_password-${aws_redshift_cluster.terraform_redshift_cluster.id}"
  value      = random_string.password.result
  type       = "SecureString"
  key_id     = data.aws_kms_key.default_kms_key.arn
  overwrite  = true
  tags       = local.common_tags
  depends_on = [aws_redshift_cluster.terraform_redshift_cluster]
}

Steps to Reproduce

terraform init terraform plan terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 4 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 4 months ago

Hey @ArthOdak 👋 Thank you for taking the time to raise this! I'll leave this open for someone on the team or in the community to review, but in the meantime it might be worth trying the random_password resource instead. I'm not certain that it'll behave differently, but it seems to be the more intentional resource from that provider.