Skip to content

Conversation

@Dragotic
Copy link
Contributor

@Dragotic Dragotic commented Nov 12, 2024

The latest addition to the output, apphub_service_uri, breaks the module due to the use of var.region which isn't a required variable and defaults to null.

Getting the region from the google_redis_instance resource instead will fix this.

│ Error: Invalid template interpolation value
│
│   on .terraform/modules/redis/outputs.tf line 75, in output "apphub_service_uri":
│   75:     service_id  = substr("${var.name}-${md5("${var.region}-${var.project_id}")}", 0, 63)
│     ├────────────────
│     │ var.region is null
│
│ The expression result is null. Cannot include a null value in a string template.

fixes #247

The latest addition to the output, `apphub_service_uri`, breaks the module due to the use of `var.region` which isn't a required variable and defaults to `null`.

Getting the region from the `google_redis_instance` resource instead will fix this.
@Dragotic Dragotic requested review from a team, imrannayer and q2w as code owners November 12, 2024 08:42
@google-cla
Copy link

google-cla bot commented Nov 12, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@tjy9206
Copy link
Contributor

tjy9206 commented Nov 12, 2024

/gcbrun

3 similar comments
@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer imrannayer self-assigned this Nov 12, 2024
@imrannayer
Copy link
Collaborator

/gcbrun

@Dragotic
Copy link
Contributor Author

@imrannayer is it failing or something?

@imrannayer
Copy link
Collaborator

getting following error:

estRedis 2024-11-12T18:41:48Z command.go:185: 
TestRedis 2024-11-12T18:41:48Z command.go:185: Error: Error waiting to create Instance: Error waiting for Creating Instance: Error code 10, message: Failed to perform tenant project creation
TestRedis 2024-11-12T18:41:48Z command.go:185: 
TestRedis 2024-11-12T18:41:48Z command.go:185:   with module.memstore.google_redis_instance.default,
TestRedis 2024-11-12T18:41:48Z command.go:185:   on ../../main.tf line 17, in resource "google_redis_instance" "default":
TestRedis 2024-11-12T18:41:48Z command.go:185:   17: resource "google_redis_instance" "default" {
TestRedis 2024-11-12T18:41:48Z command.go:185: 
TestRedis 2024-11-12T18:41:48Z retry.go:99: Returning due to fatal error: FatalError{Underlying: error while running command: exit status 1; 
Error: Error waiting to create Instance: Error waiting for Creating Instance: Error code 10, message: Failed to perform tenant project creation

  with module.memstore.google_redis_instance.default,
  on ../../main.tf line 17, in resource "google_redis_instance" "default":
  17: resource "google_redis_instance" "default" {

@imrannayer
Copy link
Collaborator

/gcbrun

@Dragotic
Copy link
Contributor Author

Yea, I don't see why this is happening. Probably irrelevant to the change but would also assume that the tenant project creation error would be a transient error. But, apparently, something is off since you tried it multiple times already.

@imrannayer
Copy link
Collaborator

/gcbrun

2 similar comments
@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer imrannayer merged commit ebef4be into terraform-google-modules:master Nov 14, 2024
4 checks passed
@Dragotic Dragotic deleted the patch-1 branch November 22, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use of null variable var.region in v12.0.0

3 participants