Skip to content

Adding subnet to google_container_cluster.additional_ip_ranges_config fails on zonal clusters with subnet name #24912

@saska

Description

@saska

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 a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Hello,

ran into this on an older provider and didn't find a report. Docs say

The additional_ip_ranges_config block supports:

    [subnetwork](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster#subnetwork-2) - (Required) Name of the subnetwork. This can be the full path of the subnetwork or just the name.

However, with a cluster with location = <zone> it seems to fail with (a fairly cryptic since it's the cluster itself throwing the error)

Error: Cannot determine region: set in this resource, or set provider-level 'region' or 'zone'. 

if you provide google_compute_subnetwork.subnetname.name but seems to work fine with google_compute_subnetwork.subnetname.id.

Which is all fine and there's a seemingly understandable underlying reason so maybe it's easiest to just mention it in the docs?

Terraform Version & Provider Version(s)

Terraform v1.11.3
on

  • provider registry.terraform.io/hashicorp/google v6.5.0
  • provider registry.terraform.io/hashicorp/google-beta v6.5.0

Affected Resource(s)

google_container_cluster
google_compute_subnetwork

Terraform Configuration

Debug Output

No response

Expected Behavior

No response

Actual Behavior

No response

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions