Skip to content

Commit

Permalink
fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
hyder committed Jul 13, 2020
2 parents b56ed44 + b243fc8 commit 496b3a6
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 11 deletions.
2 changes: 2 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
:uri-prereqs: {uri-docs}/prerequisites.adoc
:uri-quickstart: {uri-docs}/quickstart.adoc
:uri-reuse-module: {uri-rel-tree-base}/examples/
:uri-rm: {uri-docs}/resourcemanager.adoc
:uri-terraform: https://www.terraform.io
:uri-terraform-cidrsubnet-deconstructed: http://blog.itsjustcode.net/blog/2017/11/18/terraform-cidrsubnet-deconstructed/
:uri-terraform-hashicorp-examples: https://github.com/hashicorp/terraform-guides/tree/master/infrastructure-as-code/terraform-0.12-examples
Expand All @@ -48,6 +49,7 @@ This module is primarily meant to be reusable to create more advanced infrastruc

* Instructions
** {uri-quickstart}[Quickstart]
** {uri-rm}[Resource Manager]
** {uri-reuse-module}[Reusing as a Terraform module]
* {uri-terraform-options}[Terraform Options]

Expand Down
Binary file added docs/images/createstack.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/planlogs.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/review.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/tfplan.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/uploadzip.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/variable1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/variable2.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions docs/resourcemanager.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
= Resource Manager

:idprefix:
:idseparator: -
:sectlinks:
:bl: pass:[ +]


:uri-rm-overview: https://docs.cloud.oracle.com/en-us/iaas/Content/ResourceManager/Concepts/resourcemanager.htm
:uri-rm-stack: https://docs.cloud.oracle.com/en-us/iaas/Content/ResourceManager/Tasks/managingstacksandjobs.htm


. {uri-rm-overview}[Overview]
. {uri-rm-stack}[Create Stack]
. Step by Step Instructions


+
[source,bash]
----
git clone https://github.com/oracle-terraform-modules/terraform-oci-vcn.git
zip terraform-oci-vcn.zip *.tf schema.yaml -x main.tf
----


.Create Stack
image::images/createstack.PNG[align="center",width=640,height=480]

{bl}

.Upload zip file and select 0.12.x for Terraform version
image::images/uploadzip.PNG[align="center",width=640,height=480]

{bl}

.Configure variables as per your need
image::images/variable1.PNG[align="center",width=640,height=480]

{bl}

.Check the boxes if you need gateways
image::images/variable2.PNG[align="center",width=640,height=480]

{bl}

.Stack Review
image::images/review.PNG[align="center",width=640,height=480]

{bl}

.Terraform plan and then apply to create resource
image::images/tfplan.PNG[align="center",width=640,height=480]

{bl}

.Logs
image::images/planlogs.PNG[align="center",width=640,height=480]
4 changes: 2 additions & 2 deletions docs/terraformoptions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Ensure you review the {uri-terraform-dependencies}[dependencies].
|`label_prefix`
|a string to be prepended to the name of resources. *Required*.
|
|
|none


|===
Expand Down Expand Up @@ -111,4 +111,4 @@ tags = {
|
|

|===
|===
4 changes: 2 additions & 2 deletions nat.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

resource "oci_core_nat_gateway" "nat_gateway" {
compartment_id = var.compartment_id
display_name = "${var.label_prefix}-nat-gw"
display_name = var.label_prefix == "none" ? "nat-gateway" : "${var.label_prefix}-nat-gateway"

freeform_tags = var.tags

Expand All @@ -14,7 +14,7 @@ resource "oci_core_nat_gateway" "nat_gateway" {

resource "oci_core_route_table" "nat" {
compartment_id = var.compartment_id
display_name = "${var.label_prefix}-nat"
display_name = var.label_prefix == "none" ? "nat-route" : "${var.label_prefix}-nat-route"

freeform_tags = var.tags

Expand Down
3 changes: 2 additions & 1 deletion schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ variables:
type: string
title: VCN Name
required: true
default: vcn
default: Test VCN

vcn_dns_label:
title: VCN DNS Label
type: string
required: true
default: vcn
Expand Down
2 changes: 1 addition & 1 deletion servicegateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data "oci_core_services" "all_oci_services" {

resource "oci_core_service_gateway" "service_gateway" {
compartment_id = var.compartment_id
display_name = "${var.label_prefix}-sg-gw"
display_name = var.label_prefix == "none" ? "service-gateway" : "${var.label_prefix}-service-gateway"

freeform_tags = var.tags
services {
Expand Down
4 changes: 2 additions & 2 deletions terraform.tfvars.example
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright (c) 2019, 2020 Oracle Corporation and/or affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl

# provider identity parameters
# Region

region = "us-phoenix-1"

# general oci parameters

compartment_id = ""

label_prefix = "dev"
label_prefix = "none"

# vcn parameters
internet_gateway_enabled = false
Expand Down
1 change: 1 addition & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ variable "compartment_id" {
variable "label_prefix" {
description = "a string that will be prepended to all resources"
type = string
default = "none"
}

# vcn parameters
Expand Down
6 changes: 3 additions & 3 deletions vcn.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
resource "oci_core_vcn" "vcn" {
cidr_block = var.vcn_cidr
compartment_id = var.compartment_id
display_name = "${var.label_prefix}-${var.vcn_name}"
display_name = var.label_prefix == "none" ? var.vcn_name : "${var.label_prefix}-${var.vcn_name}"
dns_label = var.vcn_dns_label

freeform_tags = var.tags
}

resource "oci_core_internet_gateway" "ig" {
compartment_id = var.compartment_id
display_name = "${var.label_prefix}-ig-gw"
display_name = var.label_prefix == "none" ? "internet-gateway" : "${var.label_prefix}-internet-gateway"

freeform_tags = var.tags

Expand All @@ -23,7 +23,7 @@ resource "oci_core_internet_gateway" "ig" {

resource "oci_core_route_table" "ig" {
compartment_id = var.compartment_id
display_name = "${var.label_prefix}-ig"
display_name = var.label_prefix == "none" ? "internet-route" : "${var.label_prefix}-internet-route"

freeform_tags = var.tags

Expand Down

0 comments on commit 496b3a6

Please sign in to comment.