File tree Expand file tree Collapse file tree 5 files changed +65
-0
lines changed Expand file tree Collapse file tree 5 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ # Terraform : Oracle Cloud Infrastructure (OCI) Virtual Cloud Network (VCN)
2+
3+ Usage description.
4+
5+ * [ Terraform : Oracle Cloud Infrastructure (OCI) Virtual Cloud Network (VCN)] ( https://oracle-base.com/articles/misc/terraform-oci-vcn ) .
6+
7+ Related articles.
8+
9+ * [ Terraform : All Articles] ( https://oracle-base.com/articles/misc/articles-misc#terraform )
Original file line number Diff line number Diff line change 1+ # Variables.
2+ variable "tenancy_ocid" { type = string }
3+ variable "user_ocid" { type = string }
4+ variable "private_key_path" { type = string }
5+ variable "fingerprint" { type = string }
6+ variable "region" { type = string }
7+ variable "root_compartment_id" { type = string }
8+
9+
10+ # Resources
11+ provider "oci" {
12+ tenancy_ocid = var. tenancy_ocid
13+ user_ocid = var. user_ocid
14+ private_key_path = var. private_key_path
15+ fingerprint = var. fingerprint
16+ region = var. region
17+ }
Original file line number Diff line number Diff line change 1+ # Amend with your details.
2+ tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaa..."
3+ user_ocid = "ocid1.user.oc1..aaaaaaaa..."
4+ private_key_path = "/path-to-my/.oci/my-oci-key.pem"
5+ fingerprint = "a5:68:0f:46:6d:06:43:5a:38:98:74:??:??:??:??:??"
6+ region = "uk-london-1"
7+ root_compartment_id = "ocid1.tenancy.oc1..aaaaaaaa..."
Original file line number Diff line number Diff line change 1+ # Variables
2+ variable "compartment_id" { type = string }
3+ variable "vcn_display_name" { type = string }
4+
5+ variable "cidr_blocks" {
6+ type = list (string )
7+ default = [" 10.0.0.0/16" ]
8+ }
9+
10+
11+ # Resources
12+ resource "oci_core_vcn" "tf_vcn" {
13+ compartment_id = var. compartment_id
14+ cidr_blocks = var. cidr_blocks
15+ display_name = var. vcn_display_name
16+ }
17+
18+
19+ # Outputs
20+ output "vcn_name" {
21+ value = oci_core_vcn. tf_vcn . display_name
22+ }
23+
24+ output "vcn_id" {
25+ value = oci_core_vcn. tf_vcn . id
26+ }
27+
28+ output "default_security_list_id" {
29+ value = oci_core_vcn. tf_vcn . default_security_list_id
30+ }
Original file line number Diff line number Diff line change 1+ compartment_id = "ocid1.compartment.oc1..aaaaaaaa..."
2+ vcn_display_name = "obvcn3"
You can’t perform that action at this time.
0 commit comments