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.78k stars 9.14k forks source link

aws_redshift_parameter_group import doesn't import all parameters #12057

Open mtekel opened 4 years ago

mtekel commented 4 years ago

Community Note

Terraform Version

Terraform v0.12.19

Affected Resource(s)

aws_redshift_parameter_group

Terraform Configuration Files

resource "aws_redshift_parameter_group" "main" {
      arn         = "arn:aws:redshift:us-east-1:1234556789:parametergroup:main"
      description = "main"
      family      = "redshift-1.0"
      id          = "main"
      name        = "main"
      tags        = {}

      parameter {
        name  = "extra_float_digits"
        value = "0"
      }

      parameter {
        name  = "max_concurrency_scaling_clusters"
        value = "1"
      }

      parameter {
        name  = "max_cursor_result_set_size"
        value = "default"
      }

     ...

Expected Behavior

All parameters are imported.

Actual Behavior

Only wlm_json_configuration parameter is imported. And it has whitespace issues (see https://github.com/terraform-providers/terraform-provider-aws/issues/12056)

Steps to Reproduce

1.terraform import aws_redshift_parameter_group.main main

  1. Configure all parameters as you see them in AWS
  2. terraform plan. Turns out it wants to add all params except wlm_json_configuration - if you have json in correct format.

Important factoids

I have checked state file after import and I do see only one parameter in the array:

"parameter": [
              {
                "name": "wlm_json_configuration",
                "value": "[{\"user_group_wild_card\": 0, \"query_group_wild_card\": 0, \"max_execution_time\": 0, \"query_group\": [\"admin_group_1\", \"admin_group_2\"], \"user_group\": [\"admin_group\", \"test_group\"], \"query_concurrency\": 4, \"memory_percent_to_use\": 30}, {\"user_group_wild_card\": 0, \"query_group_wild_card\": 0, \"max_execution_time\": 0, \"query_group\": [\"analytics_group_1\", \"analytics_group_2\"], \"user_group\": [\"analytics_group\"], \"query_concurrency\": 8, \"memory_percent_to_use\": 69}, {\"user_group_wild_card\": 0, \"query_group_wild_card\": 0, \"max_execution_time\": 0, \"query_group\": [], \"user_group\": [], \"query_concurrency\": 1, \"memory_percent_to_use\": 1}, {\"short_query_queue\": true}]"
              }
            ]

References

https://github.com/terraform-providers/terraform-provider-aws/issues/12056

justinretzolk commented 2 years ago

Hey @mtekel 👋 Thank you for taking the time to file this issue! Given that there's been a number of AWS Provider releases since you initially filed it, can you confirm whether you're still experiencing this behavior?

github-actions[bot] commented 1 week ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!