Skip to content

Commit 00b2ed9

Browse files
committed
Add virtual cloud network files.
1 parent c13bac7 commit 00b2ed9

File tree

5 files changed

+65
-0
lines changed

5 files changed

+65
-0
lines changed

oci/oci_vcn/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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)

oci/oci_vcn/oci_provider.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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..."

oci/oci_vcn/oci_vcn.tf

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
compartment_id = "ocid1.compartment.oc1..aaaaaaaa..."
2+
vcn_display_name = "obvcn3"

0 commit comments

Comments
 (0)