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 in custom network - INVALID_ARGUMENT #1571

Closed
Chupaka opened this issue May 31, 2018 · 4 comments
Closed

google_redis_instance in custom network - INVALID_ARGUMENT #1571

Chupaka opened this issue May 31, 2018 · 4 comments
Assignees
Labels

Comments

@Chupaka
Copy link
Contributor

Chupaka commented May 31, 2018

Terraform Version

Terraform v0.11.7

  • provider.google v1.13.0

Affected Resource(s)

  • google_redis_instance

Terraform Configuration Files

provider "google" {
  credentials = "${file("terraform-admin.json")}"
  project     = "testing-3cef56d2"
  region      = "moon-west1"
  zone        = "moon-west1-a"
}

resource "google_compute_network" "test_network" {
  name = "test"
}

resource "google_redis_instance" "test_redis" {
  name           = "test-redis"
  memory_size_gb = 1

  authorized_network = "${google_compute_network.test_network.self_link}"
}

Expected Behavior

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.

Actual Behavior


1 error(s) occurred:

* google_redis_instance.test_redis: 1 error(s) occurred:

* google_redis_instance.test_redis: Error creating Instance: googleapi: Error 400: invalid authorized_network format, value should be full path to network resource
com.google.apps.framework.request.StatusException: <eye3 title='INVALID_ARGUMENT'/> generic::INVALID_ARGUMENT: invalid authorized_network format, value should be full path to network resource

Steps to Reproduce

  1. terraform apply

Workaround

To make it work, we used this hack:

authorized_network = "${replace(google_compute_network.test_network.self_link, "https://www.googleapis.com/compute/v1/", "")}"

Then it applied without errors.

Does it look like Google's error in API?..

@morgante
Copy link

For the time being, could you use google_compute_network.test_network.name instead?

I will follow up with the Redis team about allowing full URLs in the API.

@Chupaka
Copy link
Contributor Author

Chupaka commented May 31, 2018

That was what I began with. That doesn't work either, with the same error:

google_redis_instance.test_redis: Creating...
  authorized_network:  "" => "test"
<snip>
  memory_size_gb:      "" => "1"
  name:                "" => "test-redis"
<snip>
  tier:                "" => "BASIC"

Error: Error applying plan:

1 error(s) occurred:

* google_redis_instance.test_redis: 1 error(s) occurred:

* google_redis_instance.test_redis: Error creating Instance: googleapi: Error 400: invalid authorized_network format, value should be full path to network resource
com.google.apps.framework.request.StatusException: <eye3 title='INVALID_ARGUMENT'/> generic::INVALID_ARGUMENT: invalid authorized_network format, value should be full path to network resource

@morgante
Copy link

Interesting. I've filed a bug with the Redis team, but thanks for sharing your workaround.

@danawillow danawillow self-assigned this Jun 6, 2018
modular-magician pushed a commit to modular-magician/terraform-provider-google that referenced this issue Jun 6, 2018
The Redis API currently only accepts partial links. The tests weren't failing because they weren't actually using the network (oops). There were a few other test issues that I fixed while I was there.
Fixes hashicorp#1571.
olvesh pushed a commit to olvesh/terraform-provider-google that referenced this issue Jun 8, 2018
…-google

* 'master' of https://github.com/olvesh/terraform-provider-google: (24 commits)
  Cleanup after v1.14.0 release
  v1.14.0
  Update CHANGELOG.md
  Add new google_compute_regions (hashicorp#1603)
  Update CHANGELOG.md
  Fix forwarding rule data source test (hashicorp#1606)
  Update CHANGELOG.md
  Fix redis authorized network and tests. The Redis API currently only accepts partial links. The tests weren't failing because they weren't actually using the network (oops). There were a few other test issues that I fixed while I was there. Fixes hashicorp#1571. (hashicorp#1599)
  update auth docs (hashicorp#1587)
  Fix network_tier tests.
  Add documentation for network tier (hashicorp#1593)
  Warn about ip_version with ip_address in global forwarding rule (hashicorp#616)
  Update CHANGELOG.md
  add support for network tiers (hashicorp#1530)
  Update CHANGELOG.md
  Allow using in repo configuration for cloudbuild trigger (hashicorp#1557)
  Update CHANGELOG.md
  add update support for redis (hashicorp#1590)
  Update CHANGELOG.md
  Added GCP Netblock Data Source (hashicorp#1416) (hashicorp#1580)
  ...
@ghost
Copy link

ghost commented Nov 18, 2018

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 18, 2018
@github-actions github-actions bot added forward/review In review; remove label to forward service/redis-instance labels Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants