Hello,
This is my very first post here, please be kind. 😉
Recently I have migrated a series of GCP projects from one account to another - due to the GCP restrictions in terms or Org renaming - and now I'm facing an issue with Terraform.
I'm trying to use Terraform on one of the projects that have been migrated but I'm getting an odd error:
...
google_dns_managed_zone.dns-managed-zone-production-[removed]-com: Creating...
╷
│ Error: Error creating ManagedZone: Post "https://dns.googleapis.com/dns/v1/projects/[removed]-production-[removed]/managedZones?alt=json": oauth2: cannot fetch token: 400 Bad Request
│ Response: {
│ "error": "invalid_grant",
│ "error_description": "Account has been deleted"
│ }
│
│ with google_dns_managed_zone.dns-managed-zone-production-[removed]-com,
│ on gcp-dns-zone.tf line 1, in resource "google_dns_managed_zone" "dns-managed-zone-production-[removed]-com":
│ 1: resource "google_dns_managed_zone" "dns-managed-zone-production-[removed]-com" {
│
I had the same account name on the initial account and I said I'd better revoke the account and do a re-auth (gcloud auth long [account]).
Even by re-authenticating I'm getting the same error. Strange thing is that I can use gcloud, I do a list of the projects, I can even list the storage buckets. I'd say that the "basics" are find but I still get that error when I want to use TF for infra deployment.
Any help with this would be much appreciated.
Thank you
Managed to sort this out by reinstall gcloud, wiped everything and reinstalled it.
You could have used 'terraform init -upgrade' to inform about the changes, it also clears the authentication cache.
I fixed it using the below command:
gcloud auth application-default login
User | Count |
---|---|
2 | |
1 | |
1 | |
1 |