hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.5k stars 9.52k forks source link

possible bug in aws_secretsmanager_secret_version #23993

Closed Korbl closed 4 years ago

Korbl commented 4 years ago

Hello, when using any password stored in AWS Secrets manager and retrieved via aws_secretsmanager_secret_version, it is unable to handle passwords with special characters. This seems to be new as we never ran into this prior to upgrading to 0.12

Terraform v0.12.19

Terraform Configuration Files

data "aws_secretsmanager_secret_version" "this" {
  secret_id     = var.secret_id
  version_stage = var.version_stage
  version_id    = var.version_id
}

output "secret_map" {
  value = data.aws_secretsmanager_secret_version.this.secret_string
}

resource "aws_elasticache_replication_group" "redis" {
transit_encryption_enabled    = .True
auth_token                 = jsondecode(module.get-mobileapi-redis-secret.test_map["redis_password"]

When this code is run and there is a % & $ n the password, it fails with the error

" Error: Error creating Elasticache Replication Group: InvalidParameterValue: Invalid AuthToken provided."

When the % and % are removed , it deploys fine.

Debug Output

2020-01-30T12:35:05.377+0100 [DEBUG] plugin: plugin process exited: path=/Users/sitschner/Files/Jumbo/terrafrom/prod/.terraform/plugins/darwin_amd64/terraform-provider-aws_v2.46.0_x4 pid=60308 2020-01-30T12:35:05.377+0100 [DEBUG] plugin: plugin exited 2020/01/30 12:35:05 [WARN] Provider "registry.terraform.io/-/aws" produced an invalid plan for module.mobileapi_redis-b.aws_elasticache_replication_group.redis, but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations:

Expected Behavior

I should be able to use special characters in a password , like I did in 0.11

Actual Behavior

Can't use special characters.

Steps to Reproduce

ghost commented 4 years ago

This issue has been automatically migrated to terraform-providers/terraform-provider-aws#11818 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to terraform-providers/terraform-provider-aws#11818.

ghost commented 4 years ago

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.