Terraform : Oracle Cloud Infrastructure (OCI) Provider
This article describes how to configure an Oracle Cloud Infrastructure (OCI) provider for Terraform.
oracle miscconfigurationintermediate
by OracleDba
15 views
This article describes how to configure an Oracle Cloud Infrastructure (OCI) provider for Terraform.
12
mkdir \git\oraclebase\terraform\oci\oci_provider
cd \git\oraclebase\terraform\oci\oci_provider1234567891011121314151617
# Variables.
variable "tenancy_ocid" { type = string }
variable "user_ocid" { type = string }
variable "private_key_path" { type = string }
variable "fingerprint" { type = string }
variable "region" { type = string }
variable "root_compartment_id" { type = string }
# Resources
provider "oci" {
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
private_key_path = var.private_key_path
fingerprint = var.fingerprint
region = var.region
}123456
tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaa..."
user_ocid = "ocid1.user.oc1..aaaaaaaa..."
private_key_path = "/Users/my_user/.oci/my-oci-key.pem"
fingerprint = "a5:68:0f:46:6d:06:43:5a:38:98:74:09:??:??:??:??"
region = "uk-london-1"
root_compartment_id = "ocid1.tenancy.oc1..aaaaaaaa..."1234567891011121314151617181920212223242526272829303132
terraform init
Initializing the backend...
Initializing provider plugins...
- Finding latest version of hashicorp/oci...
- Installing hashicorp/oci v4.13.0...
- Installed hashicorp/oci v4.13.0 (signed by HashiCorp)
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
terraform plan
No changes. Infrastructure is up-to-date.
This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.
terraform apply
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.Please to add comments
No comments yet. Be the first to comment!