Warning
This content has been generated by machine translation. The translations are automated and have not undergone human review or validation.
14.2.3 Obtaining Terraform OCI Provider Connection Information
-
Tenancy OCID
Click Tenancy in the user profile in the upper right corner and check the Tenancy OCID
-
user OCID
Click User Settings in the user profile in the upper right corner and check the user OCID
-
region: Region Identifier to use
-
API Key - private_key_path, fingerprint
- Use the API Key used when installing OCI CLI.
- Or create a new one.
- Refer to 3.3 Creating Key Pair for SSH Connection to create SSH Key Pair to be used
- Click User Settings in the upper right user profile
- After selecting API Keys at the bottom left, click Add Key to copy and register the contents of the PEM format public key
- Copy the fingerprint you see after registration
-
variable “compartment_ocid”
- Open the navigation menu in the OCI console. Go to Identity & Security » Identity » Compartments.
- Click the desired compartment and check the OCID
Example of Terraform Variable File Creation
-
If the file name is different to change the variable according to the environment, the file name can be specified with the -var-file option when running terraform.
-
terraform.tfvars
# OCI authentication tenancy_ocid = "ocid1.tenancy.oc1..~~~" # Use the Tenancy OCID from #1 user_ocid = "ocid1.user.oc1..~~~" # Use the User OCID found in #2 compartment_ocid = "ocid1.compartment.oc1..~~~" # Use the target Compartment OCID from 5 private_key_path = "C:\\Users\\TheKoguryo\\.oci\\oci_api_key.pem" # Location of the private key among the SSH keys created in #3 fingerprint = "7b:e7:~~~~" # Fingerprint of Public Key registered as API Key in #3 region = "ap-seoul-1" # The target Region Name identified in 4
As an individual, this article was written with my personal time. There may be errors in the content of the article, and the opinions in the article are personal opinions.