Importing existing GCP service account violates pulumi id regex.
See original GitHub issueI’m attempting to import an existing service account in GCP. The service account is created by default when enabling the Cloud Build api. The id of my default service account is 418715367700-compute. Attempting to set that value in go returns the following error:
Diagnostics:
gcp:serviceAccount:Account (cloud-build):
error: gcp:serviceAccount/account:Account resource 'cloud-build' has a problem: "account_id" ("418715367700-compute") doesn't match regexp "^[a-z](?:[-a-z0-9]{4,28}[a-z0-9])$"
error: Preview failed: one or more inputs failed to validate
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
gcp.serviceAccount.Account - Pulumi
Documentation for the gcp.serviceAccount.Account resource with examples, input properties, output properties, lookup functions, and supporting types.
Read more >gcp.serviceAccount.IAMBinding - Pulumi
Documentation for the gcp.serviceAccount.IAMBinding resource with examples, input properties, output properties, lookup functions, and supporting types.
Read more >Integrating Google Cloud Build | CI/CD - Pulumi
You can do this by navigating to the IAM tab in the GCP Console. Cloud Build service account. If you do not grant...
Read more >gcp.logging.Metric - Pulumi
Documentation for the gcp.logging.Metric resource with examples, input properties, output properties, lookup functions, and supporting types.
Read more >Installation & Configuration Service Account - Pulumi
Provides an overview of how set up a Google Cloud Platform Service Account with Pulumi.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This appears to still be an issue.
#361 is marked as fixing this issue, and this issue was closed as a result, but I believe that is a mistake, as I commented there. #361 fixes #359, and this issue is unrelated and should be re-opened.
@stack72 Can you confirm and re-open?
The ID for the default service account for Compute Engine is
{NUMERIC_PROJECT_ID}-compute, and is auto-generated by GCP.It appears the GCP Terraform provider has the same issue. There’s a dedicated resource mentioned in a comment on that issue for the default Compute Engine service account (resource, source), which I presume doesn’t have the regular restrictions.
Pulumi has a dedicated function for returning the default service account. However, I can’t find a corresponding resource in the Pulumi documentation.
Oh! I did not know about that. It did help. Thank you!