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

url_mask in google_compute_region_network_endpoint_group.serverless_deployment should be optional #11242

Closed
yuryu opened this issue Mar 9, 2022 · 4 comments · Fixed by GoogleCloudPlatform/magic-modules#5883, #11517 or hashicorp/terraform-provider-google-beta#4227
Assignees
Labels

Comments

@yuryu
Copy link

yuryu commented Mar 9, 2022

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

✗ terraform -v
Terraform v1.1.7
on linux_amd64
+ provider registry.terraform.io/hashicorp/external v2.2.0
+ provider registry.terraform.io/hashicorp/google v4.13.0
+ provider registry.terraform.io/hashicorp/google-beta v4.13.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0

Affected Resource(s)

  • google_compute_region_network_endpoint_group

Terraform Configuration Files

terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "~> 4.13.0"
    }
    google-beta = {
      source  = "hashicorp/google-beta"
      version = "~> 4.13.0"
    }
  }
}

resource "google_compute_region_network_endpoint_group" "api" {
  provider              = google-beta
  name                  = "api-neg"
  network_endpoint_type = "SERVERLESS"
  region                = "us-central1"

  description = "API network endpoint group"

  serverless_deployment {
    platform = "apigateway.googleapis.com"
    resource = "api-uscentral1"
  }
}

Debug Output

https://gist.github.com/yuryu/3460cdf33ef985d715b39a47d906a905

Panic Output

Expected Behavior

It should create a NEG pointing to API Gateway api-uscentral1. Only one of resource and url_mask should be required.

Actual Behavior

Terraform stops with error:

│ Error: Missing required argument
│ 
│   on main.tf line 22, in resource "google_compute_region_network_endpoint_group" "api":
│   22:   serverless_deployment {
│ 
│ The argument "url_mask" is required, but no definition was found.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@yuryu yuryu added the bug label Mar 9, 2022
@c2thorn c2thorn self-assigned this Mar 9, 2022
@jhasselgren
Copy link

Looks like the problem is this line:
https://github.com/hashicorp/terraform-provider-google-beta/blob/bc1dba4806ad1b05138654bd5618d2ba1e4413db/google-beta/resource_compute_region_network_endpoint_group.go#L217

url_mask should be optional

@jose-lpa
Copy link

jose-lpa commented Apr 3, 2022

Hi there. Since the fix for this seems quite trivial, is it going to be added to the next release of the provider? If so, when would it be released? It's actually blocking me to get API Gateway deployed with Terraform, as I didn't have any luck setting the URL mask parameter, but it works with gcloud when I use the resource one. Thanks.

@aebrahim
Copy link

aebrahim commented Apr 6, 2022

I had the exact same issue as you did @jose-lpa

I've made GoogleCloudPlatform/magic-modules#5883 with this one-liner fix - hopefully it gets merged and into a release soon!

@github-actions
Copy link

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