terraform-provider-oci icon indicating copy to clipboard operation
terraform-provider-oci copied to clipboard

Could not find a compartment named 'XXX' in your tenancy

Open oeresundsgruppen opened this issue 11 months ago • 4 comments

Running this:

terraform-provider-oci_v5.35.0.exe -command=export -compartment_name=XXX -output_path=test

and getting:

Could not find a compartment named 'XXX' in your tenancy

but XXX is both name of tenancy and hence root compartment - any idea ?

oeresundsgruppen avatar Mar 30 '24 18:03 oeresundsgruppen

It worked for me using the compartment id terraform-provider-oci_v5.35.0.exe -command=export -compartment_id=XXX -output_path=test

MartinRenze avatar Apr 10 '24 23:04 MartinRenze

Thanks, works with compartment_id although it throws a list of errors, but the oci export tool is updated often, so guess buggy... Now did you try to edit the tf-files and reapply ? Guess this requires a state file...

oeresundsgruppen avatar Apr 27 '24 17:04 oeresundsgruppen

I edited them, mostly deleting stuff that wasn related to the cluster I was interested in. I did this until the patch/apply stopped displaying any changes that would be applied. Then you can get the state file without doing any changes to your infrastructure.

MartinRenze avatar Apr 27 '24 17:04 MartinRenze

ok, so go into export directory, and terraform init, and then terraform apply - it throws tons of error, unsupported argument, operation canceled, insufficient blocks, guess this is still early days. Used terraform just fine with solace messaging setup...

oeresundsgruppen avatar Apr 27 '24 17:04 oeresundsgruppen