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

Not Authorized to access this resource/ap #492

Open
rahultople87 opened this issue Dec 16, 2024 · 0 comments
Open

Not Authorized to access this resource/ap #492

rahultople87 opened this issue Dec 16, 2024 · 0 comments

Comments

@rahultople87
Copy link

rahultople87 commented Dec 16, 2024

Issue description: "Not Authorized to access this resource/api"

When was the issue observed for the first time (please mention if it ever worked properly or whether there has been a change which may have caused the issue):

We are using this https://registry.terraform.io/providers/hashicorp/googleworkspace/latest/docs/resources/user
terraform module to create the users in the Google Workspace.

The Terraform user creation resource is calling Google API.

  1. POST to create user
  2. GET to retrieve the user

We are able to create the users but after user creation we are getting below error


GET /admin/directory/v1/users/<#UNIQUE_USER_ID>?alt=json&prettyPrint=false HTTP/1.1
Host: admin.googleapis.com
User-Agent: google-api-go-client/0.5
X-Goog-Api-Client: gl-go/1.16.2 gdcl/0.79.0
Accept-Encoding: gzip

-----------------------------------------------------: timestamp=
[INFO] provider.terraform-provider-googleworkspace:
[DEBUG] Google Workspace API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 403 Forbidden
Content-Type: application/json; charset=UTF-8
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
"error": {
"code": 403,
"message": "Not Authorized to access this resource/api",
"errors": [
{
"message": "Not Authorized to access this resource/api",
"domain": "global",
"reason": "forbidden"
}
]
}
}


Our goal is to manage users through Terraform, however when we create users, in state file the user accounts are marked as tainted. Since the user accounts are marked as tainted, in the subsequent runs, we get duplicate user error. To work around the duplicate user issue we have to untaint and then only are able to make any updates. The untaint adds a step which may cause issues and potential human error.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant