oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
757 stars 680 forks source link

Error creating Data Catalog Private Endpoint in Resource Manager and Cloud Shell #1540

Closed nugoncal closed 1 year ago

nugoncal commented 2 years ago

Community Note

Terraform Version and Provider Version

Terraform 1.0.0 (Resource Manager) , OCI provider v4.65

Affected Resource(s)

oci_datacatalog_catalog_private_endpoint

Terraform Configuration Files

https://github.com/oracle-devrel/terraform-oci-lakehouse/tree/private_endpoint_bug

Debug Output

I am not getting any debug output, even when requesting debug logs. The output is:

Error: 404-NotAuthorizedOrNotFound
Provider version: 4.65.0, released on 2022-02-23.
Service: Datacatalog Catalog Private Endpoint
Error Message: Unknown resource ocid1.subnet.oc1.uk-london-1.aaaaaaaaswofg7p2dkihotubknw5jlyql3ydoo3zdxcmpqxpinbrqqmlkl5a
OPC request ID: 739393148044c0b36f0ac50aa05f583c/5D614305BB2589BB31B7996FE3E110DD/419A11C593BA0E089E7A0B49CE5650E9
Suggestion: Either the resource has been deleted or service Datacatalog Catalog Private Endpoint need policy to access this resource. Policy reference: https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/policyreference.htm
  with oci_datacatalog_catalog_private_endpoint.lakehouse_catalog_mysql_private_endpoint[0],
  on datacatalog.tf line 95, in resource "oci_datacatalog_catalog_private_endpoint" "lakehouse_catalog_mysql_private_endpoint" 
  95: resource "oci_datacatalog_catalog_private_endpoint" "lakehouse_catalog_mysql_private_endpoint" {

Panic Output

Expected Behavior

I should have succeeded in creating the Data Catalog Private Endpoint in OCI Resource Manager or OCI Cloud Shell.

Actual Behavior

Error: 404-NotAuthorizedOrNotFound
Provider version: 4.65.0, released on 2022-02-23.
Service: Datacatalog Catalog Private Endpoint
Error Message: Unknown resource ocid1.subnet.oc1.uk-london-1.aaaaaaaaswofg7p2dkihotubknw5jlyql3ydoo3zdxcmpqxpinbrqqmlkl5a
OPC request ID: 739393148044c0b36f0ac50aa05f583c/5D614305BB2589BB31B7996FE3E110DD/419A11C593BA0E089E7A0B49CE5650E9
Suggestion: Either the resource has been deleted or service Datacatalog Catalog Private Endpoint need policy to access this resource. Policy reference: https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/policyreference.htm
  with oci_datacatalog_catalog_private_endpoint.lakehouse_catalog_mysql_private_endpoint[0],
  on datacatalog.tf line 95, in resource "oci_datacatalog_catalog_private_endpoint" "lakehouse_catalog_mysql_private_endpoint" 
  95: resource "oci_datacatalog_catalog_private_endpoint" "lakehouse_catalog_mysql_private_endpoint" {

Steps to Reproduce

Run the code from OCI Cloud Shell or OCI Resource Manager, with variable create_MDS = true. The code is available here: https://github.com/oracle-devrel/terraform-oci-lakehouse/tree/private_endpoint_bug For testing in OCI Resource Manager, refer to variables.tf and provider.tf in orm/ folder in the github repo. The error can be reproduced in OCI Resource Manager and OCI Cloud Shell, but not in CLI in my local machine, where I am authenticated as myself, tenancy admin.

tfvars for Cloud Shell testing:

region = tenancy_ocid = compartment_ocid= create_MDS = true

Important Factoids

Specific to OCI Resource Manager and Cloud Shell

References

ravinitp commented 1 year ago

We are very sorry that we couldn't respond to each and every issue reported on GitHub. Although we have refined the process to prioritize customer issues on GitHub, since this issue was reported a while ago, there is a good chance it may have been fixed in the latest version of Terraform Provider OCI. If you are still experiencing this issue, please create a new issue and label it as Bug.