AmpereComputing / terraform-oci-ampere-a1

Terraform for launching OCI Ampere A1 Instances
Apache License 2.0
15 stars 9 forks source link

Usage as module don't work. #5

Closed dazmagar closed 7 months ago

dazmagar commented 1 year ago

Hello. I copied the main.tf file from the modules\oci-ampere-a1\examples\ubuntu2204 directory and placed it in the root of my project. Created a terraform.tfvars file in the root of my project and put the necessary variables there (which have already been tested more than once on other projects)

Then I ran terraform init, and all dependencies downloaded without errors.

When I execute terraform plan I get the following error:

╷ │ Error: Invalid provider configuration │ │ Provider "registry.terraform.io/hashicorp/oci" requires explicit configuration. Add a provider block to the root module and configure the │ provider's required arguments as described in the provider documentation. │ ╵ ╷ │ Error: can not create client, bad configuration: did not find a proper configuration for tenancy │ │ with provider["registry.terraform.io/hashicorp/oci"], │ on line 0: │ (source code not available)

image

ppouliot commented 1 year ago

Thanks for the info. Maybe I need some better documentation. That looks like you are missing your OCI Credentials. You can add yours via a terraform.tfvars in the directory with the code calling the module. If you look at the examples within this repo, you'll see working use cases. For example if you dropped a terraform.tfvars with the appropriate OCI credentials into one of those those directories under the examples folder and ran terraform plan from it, it should work.

ppouliot commented 1 year ago

I've updated the documentation to point to the examples directory to show how to use it as a module. Can give one of the examples a try and let me know how you make out?

ppouliot commented 7 months ago

Closing issue