jpetazzo / ampernetacle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: 404-NotAuthorizedOrNotFound

sdbluis opened this issue · comments

Hi guys!!

When I say yes in terraform apply, the error below appears, someone has already gone through this and resolved?

Enter a value: yes

oci_identity_compartment._: Creating...

│ Error: 404-NotAuthorizedOrNotFound
│ Provider version: 4.62.0, released on 2022-02-03.
│ Service: Identity Compartment
│ Error Message: Authorization failed or requested resource not found
│ OPC request ID: c4b2b593a54068f708582e3af3d9a326/51670FFB8C9EEA3544C679F1544929AE/A229E55109DEFFC641B26FE197062263
│ Suggestion: Either the resource has been deleted or service Identity Compartment need policy to access this resource. Policy reference: https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/policyreference.htm


│ with oci_identity_compartment.,
│ on main.tf line 1, in resource "oci_identity_compartment" "
":
│ 1: resource "oci_identity_compartment" "_" {

Hi @sdbluis I had the same error, when reloading my terminal and re-authenticating withoci session authenticateand running terraform validate and terraform plan the 404 was resolved, so I could run terraform apply.

Thanks @wagnermengue, I will test your solution and return!

@wagnermengue, I tested that today but the same issue persists. In my case I'm using the 4.63.0 provider version:

oci_identity_compartment._: Creating...
╷
│ Error: 401-NotAuthenticated 
│ Provider version: 4.63.0, released on 2022-02-09.  
│ Service: Identity Compartment 
│ Error Message: The required information to complete authentication was not provided or was incorrect. 
│ OPC request ID: <ID>
│ Suggestion: Please retry or contact support for help with service: Identity Compartment
│ 
│ 
│   with oci_identity_compartment._,
│   on main.tf line 1, in resource "oci_identity_compartment" "_":
│    1: resource "oci_identity_compartment" "_" {
│ 
╵

Could you help on that too? Thanks!

Hi @danielcn,

This might happen if you specified the wrong region when authenticating.

An OCI account is "homed" in one specific region, which you choose when you create the account. Then you can only use this region. Paid accounts can get access to other regions but free accounts are limited to their original region, I think.

If you log in with the web browser (at cloud.oracle.com) you will see your region in the URL (for me it shows https://cloud.oracle.com/?region=us-ashburn-1 for instance).

@jpetazzo and the Error: 404-NotAuthorizedOrNotFound?

@sdbluis did you try the terraform validate and terraform plan that was suggested above? I thought it had solved the issue. 🙂