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

google_redis_instance - auth_string #12563

Comments

@drandell
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Affected Resource(s)

  • google_redis_instance

Terraform Configuration Files

auth_string according to the docs can be populated but its generated by GCP. So this should be output only in the docs.
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/redis_instance

References

  • #0000
@drandell drandell added the bug label Sep 15, 2022
@edwardmedia edwardmedia self-assigned this Sep 15, 2022
@edwardmedia edwardmedia added this to the Goals milestone Sep 17, 2022
@edwardmedia edwardmedia removed their assignment Sep 17, 2022
@edwardmedia
Copy link
Contributor

edwardmedia commented Sep 17, 2022

@drandell I agreed auth_string should be in the exported section. Because this is a specially handled field, currently the code generation tool does not support adding a field like this into the exported section. As this is only for the doc, changing the label to documentation

https://github.com/GoogleCloudPlatform/magic-modules/blob/70352381f79e67152922421649d1b48cdacf8fe9/mmv1/products/redis/terraform.yaml#L18

https://github.com/GoogleCloudPlatform/magic-modules/blob/70352381f79e67152922421649d1b48cdacf8fe9/mmv1/templates/terraform/resource.html.markdown.erb#L156

@drandell
Copy link
Contributor Author

If I get some time this week I might make the PR for this, agree wrong label :)

@jlenuffgsoi
Copy link

Here is the google_redis_instance documentation from the Argument Reference section :

auth_string - (Optional) AUTH String set on the instance. This field will only be populated if auth_enabled is true.

Then, here I wrote this Terraform code :

resource "google_redis_instance" "main" {
  name               = "memory-cache"
  memory_size_gb     = var.redis_memory
  display_name       = "memory-cache"
  auth_enabled       = "true"
  auth_string        = var.redis_auth
  authorized_network = data.google_compute_network.shared_vpc.id
  connect_mode       = "PRIVATE_SERVICE_ACCESS"
  region             = local.region
  maintenance_policy {
    weekly_maintenance_window {
      day = "TUESDAY"
      start_time {
        hours   = 1
        minutes = 0
      }
    }
  }
  depends_on = [
    google_project_service.memorystore_redis
  ]
}

Finally, this is the error message I encounter :

╷
│ Error: Value for unconfigurable attribute
│
│   with google_redis_instance.main,
│   on redis.tf line 6, in resource "google_redis_instance" "main":
│    6:   auth_string        = var.redis_auth
│
│ Can't configure a value for "auth_string": its value will be decided automatically based on the result of applying this configuration.
╵

Thanks.

@github-actions
Copy link

github-actions bot commented Mar 6, 2023

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 Mar 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.