Terraform-provider-google: data google_service_account:account_id overly restrictive

Created on 6 Oct 2020  路  2Comments  路  Source: hashicorp/terraform-provider-google


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

Status: Downloaded newer image for hashicorp/terraform:0.13.3
docker.io/hashicorp/terraform:0.13.3

Initializing the backend...

Successfully configured the backend "gcs"! Terraform will automatically
use this backend unless the backend configuration changes.

Initializing provider plugins...
- Finding hashicorp/google versions matching ">= 3.3.*"...
- Installing hashicorp/google v3.42.0...
- Installed hashicorp/google v3.42.0 (signed by HashiCorp)

Terraform has been successfully initialized!

Affected Resource(s)

  • data source google_service_account

Terraform Configuration Files

data "google_service_account" "compute_default" {
  account_id = "1234567890-compute" # this is line 14 (see below)
}

Debug Output

Already have image: hashicorp/terraform:0.13.3

Error: "account_id" ("1234567890-compute") doesn't match regexp "^[a-z](?:[-a-z0-9]{4,28}[a-z0-9])$"

  on main.tf line 14, in data "google_service_account" "compute_default":
  14:   account_id = "1234567890-compute"

Expected Behavior

the data source returns the data for this (generated by default by GCP) service account

Actual Behavior

See error above

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #3212
bug

All 2 comments

I will move this to enhancement bucket for google_service_account data source. It will get triaged and worked on if team decides to take off the validation.

Was this page helpful?
0 / 5 - 0 ratings