From e3e4351ef7ad6e95742eaeac90c5c867139c62bc Mon Sep 17 00:00:00 2001 From: Collin Poczatek Date: Wed, 8 Apr 2020 10:11:24 -0700 Subject: [PATCH] reorg dir structure --- simple/README.md => README_simple.md | 0 {simple/simple-orm => build-orm}/install.tf | 0 {simple/images => images}/mp-listing.png | Bin {simple/images => images}/oci-rm.png | Bin {simple/images => images}/tf-apply-done.png | Bin {simple/images => images}/tf-apply-orm.png | Bin {simple/images => images}/tf-apply1.png | Bin {simple/images => images}/tf-apply2.png | Bin {simple/images => images}/tf-destroy.png | Bin {simple/images => images}/tf-init-orm.png | Bin {simple/images => images}/tf-init.png | Bin {simple/images => images}/tf-plan-orm.png | Bin {simple/images => images}/tf-plan1.png | Bin {simple/images => images}/tf-plan2.png | Bin {simple/images => images}/tf-version.png | Bin {simple/images => images}/unzip-l.png | Bin simple/simple-cli/main.tf => main.tf | 0 .../marketplace.yaml => marketplace.yaml | 0 simple/simple-cli/provider.tf => provider.tf | 0 .../marketplace-subscription/main.tf | 47 --------------- .../marketplace-subscription/output.tf | 3 - .../marketplace-subscription/variables.tf | 17 ------ .../marketplace-subscription/versions.tf | 4 -- .../network-security-groups/nsg.tf | 57 ------------------ .../network-security-groups/output.tf | 4 -- .../network-security-groups/variables.tf | 20 ------ .../network-security-groups/versions.tf | 4 -- .../vcn-plus-subnet-default/network.tf | 40 ------------ .../vcn-plus-subnet-default/output.tf | 14 ----- .../vcn-plus-subnet-default/variables.tf | 42 ------------- .../vcn-plus-subnet-default/versions.tf | 4 -- .../marketplace-subscription/main.tf | 0 .../marketplace-subscription/output.tf | 0 .../marketplace-subscription/variables.tf | 0 .../marketplace-subscription/versions.tf | 0 .../network-security-groups/nsg.tf | 0 .../network-security-groups/output.tf | 0 .../network-security-groups/variables.tf | 0 .../network-security-groups/versions.tf | 0 .../vcn-plus-subnet-default/network.tf | 0 .../vcn-plus-subnet-default/output.tf | 0 .../vcn-plus-subnet-default/variables.tf | 0 .../vcn-plus-subnet-default/versions.tf | 0 ...vars.template => terraform.tfvars.template | 0 .../simple-cli/variables.tf => variables.tf | 0 simple/simple-cli/versions.tf => versions.tf | 0 46 files changed, 256 deletions(-) rename simple/README.md => README_simple.md (100%) rename {simple/simple-orm => build-orm}/install.tf (100%) rename {simple/images => images}/mp-listing.png (100%) rename {simple/images => images}/oci-rm.png (100%) rename {simple/images => images}/tf-apply-done.png (100%) rename {simple/images => images}/tf-apply-orm.png (100%) rename {simple/images => images}/tf-apply1.png (100%) rename {simple/images => images}/tf-apply2.png (100%) rename {simple/images => images}/tf-destroy.png (100%) rename {simple/images => images}/tf-init-orm.png (100%) rename {simple/images => images}/tf-init.png (100%) rename {simple/images => images}/tf-plan-orm.png (100%) rename {simple/images => images}/tf-plan1.png (100%) rename {simple/images => images}/tf-plan2.png (100%) rename {simple/images => images}/tf-version.png (100%) rename {simple/images => images}/unzip-l.png (100%) rename simple/simple-cli/main.tf => main.tf (100%) rename simple/simple-cli/marketplace.yaml => marketplace.yaml (100%) rename simple/simple-cli/provider.tf => provider.tf (100%) delete mode 100644 simple/terraform-modules/marketplace-subscription/main.tf delete mode 100644 simple/terraform-modules/marketplace-subscription/output.tf delete mode 100644 simple/terraform-modules/marketplace-subscription/variables.tf delete mode 100644 simple/terraform-modules/marketplace-subscription/versions.tf delete mode 100644 simple/terraform-modules/network-security-groups/nsg.tf delete mode 100644 simple/terraform-modules/network-security-groups/output.tf delete mode 100644 simple/terraform-modules/network-security-groups/variables.tf delete mode 100644 simple/terraform-modules/network-security-groups/versions.tf delete mode 100644 simple/terraform-modules/vcn-plus-subnet-default/network.tf delete mode 100644 simple/terraform-modules/vcn-plus-subnet-default/output.tf delete mode 100644 simple/terraform-modules/vcn-plus-subnet-default/variables.tf delete mode 100644 simple/terraform-modules/vcn-plus-subnet-default/versions.tf rename {simple/simple-cli/terraform-modules => terraform-modules}/marketplace-subscription/main.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/marketplace-subscription/output.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/marketplace-subscription/variables.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/marketplace-subscription/versions.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/network-security-groups/nsg.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/network-security-groups/output.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/network-security-groups/variables.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/network-security-groups/versions.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/vcn-plus-subnet-default/network.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/vcn-plus-subnet-default/output.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/vcn-plus-subnet-default/variables.tf (100%) rename {simple/simple-cli/terraform-modules => terraform-modules}/vcn-plus-subnet-default/versions.tf (100%) rename simple/simple-cli/terraform.tfvars.template => terraform.tfvars.template (100%) rename simple/simple-cli/variables.tf => variables.tf (100%) rename simple/simple-cli/versions.tf => versions.tf (100%) diff --git a/simple/README.md b/README_simple.md similarity index 100% rename from simple/README.md rename to README_simple.md diff --git a/simple/simple-orm/install.tf b/build-orm/install.tf similarity index 100% rename from simple/simple-orm/install.tf rename to build-orm/install.tf diff --git a/simple/images/mp-listing.png b/images/mp-listing.png similarity index 100% rename from simple/images/mp-listing.png rename to images/mp-listing.png diff --git a/simple/images/oci-rm.png b/images/oci-rm.png similarity index 100% rename from simple/images/oci-rm.png rename to images/oci-rm.png diff --git a/simple/images/tf-apply-done.png b/images/tf-apply-done.png similarity index 100% rename from simple/images/tf-apply-done.png rename to images/tf-apply-done.png diff --git a/simple/images/tf-apply-orm.png b/images/tf-apply-orm.png similarity index 100% rename from simple/images/tf-apply-orm.png rename to images/tf-apply-orm.png diff --git a/simple/images/tf-apply1.png b/images/tf-apply1.png similarity index 100% rename from simple/images/tf-apply1.png rename to images/tf-apply1.png diff --git a/simple/images/tf-apply2.png b/images/tf-apply2.png similarity index 100% rename from simple/images/tf-apply2.png rename to images/tf-apply2.png diff --git a/simple/images/tf-destroy.png b/images/tf-destroy.png similarity index 100% rename from simple/images/tf-destroy.png rename to images/tf-destroy.png diff --git a/simple/images/tf-init-orm.png b/images/tf-init-orm.png similarity index 100% rename from simple/images/tf-init-orm.png rename to images/tf-init-orm.png diff --git a/simple/images/tf-init.png b/images/tf-init.png similarity index 100% rename from simple/images/tf-init.png rename to images/tf-init.png diff --git a/simple/images/tf-plan-orm.png b/images/tf-plan-orm.png similarity index 100% rename from simple/images/tf-plan-orm.png rename to images/tf-plan-orm.png diff --git a/simple/images/tf-plan1.png b/images/tf-plan1.png similarity index 100% rename from simple/images/tf-plan1.png rename to images/tf-plan1.png diff --git a/simple/images/tf-plan2.png b/images/tf-plan2.png similarity index 100% rename from simple/images/tf-plan2.png rename to images/tf-plan2.png diff --git a/simple/images/tf-version.png b/images/tf-version.png similarity index 100% rename from simple/images/tf-version.png rename to images/tf-version.png diff --git a/simple/images/unzip-l.png b/images/unzip-l.png similarity index 100% rename from simple/images/unzip-l.png rename to images/unzip-l.png diff --git a/simple/simple-cli/main.tf b/main.tf similarity index 100% rename from simple/simple-cli/main.tf rename to main.tf diff --git a/simple/simple-cli/marketplace.yaml b/marketplace.yaml similarity index 100% rename from simple/simple-cli/marketplace.yaml rename to marketplace.yaml diff --git a/simple/simple-cli/provider.tf b/provider.tf similarity index 100% rename from simple/simple-cli/provider.tf rename to provider.tf diff --git a/simple/terraform-modules/marketplace-subscription/main.tf b/simple/terraform-modules/marketplace-subscription/main.tf deleted file mode 100644 index 8d88e1a..0000000 --- a/simple/terraform-modules/marketplace-subscription/main.tf +++ /dev/null @@ -1,47 +0,0 @@ -#Local variables pointing to the Marketplace catalog resource -#Eg. Modify accordingly to your Application/Listing -locals { - enabled = var.enabled ? 1 : 0 - listing_id = var.mp_listing_id - listing_resource_id = var.mp_listing_resource_id - listing_resource_version = var.mp_listing_resource_version -} - -#Get Image Agreement -resource "oci_core_app_catalog_listing_resource_version_agreement" "mp_image_agreement" { - count = local.enabled - - listing_id = local.listing_id - listing_resource_version = local.listing_resource_version -} - -#Accept Terms and Subscribe to the image, placing the image in a particular compartment -resource "oci_core_app_catalog_subscription" "mp_image_subscription" { - count = local.enabled - - compartment_id = var.compartment_id - eula_link = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].eula_link - listing_id = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].listing_id - listing_resource_version = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].listing_resource_version - oracle_terms_of_use_link = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].oracle_terms_of_use_link - signature = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].signature - time_retrieved = oci_core_app_catalog_listing_resource_version_agreement.mp_image_agreement[0].time_retrieved - - timeouts { - create = "20m" - } -} - -# Gets the partner image subscription -data "oci_core_app_catalog_subscriptions" "mp_image_subscription" { - count = local.enabled - - compartment_id = var.compartment_id - listing_id = local.listing_id - - filter { - name = "listing_resource_version" - values = [local.listing_resource_version] - } -} - diff --git a/simple/terraform-modules/marketplace-subscription/output.tf b/simple/terraform-modules/marketplace-subscription/output.tf deleted file mode 100644 index b92b82f..0000000 --- a/simple/terraform-modules/marketplace-subscription/output.tf +++ /dev/null @@ -1,3 +0,0 @@ -output "subscription" { - value = data.oci_core_app_catalog_subscriptions.mp_image_subscription.*.app_catalog_subscriptions -} \ No newline at end of file diff --git a/simple/terraform-modules/marketplace-subscription/variables.tf b/simple/terraform-modules/marketplace-subscription/variables.tf deleted file mode 100644 index 502e1ef..0000000 --- a/simple/terraform-modules/marketplace-subscription/variables.tf +++ /dev/null @@ -1,17 +0,0 @@ -variable "mp_listing_id" { -} - -variable "mp_listing_resource_id" { -} - -variable "mp_listing_resource_version" { -} - -variable "compartment_id" { -} - -variable "enabled" { - type = bool - default = true -} - diff --git a/simple/terraform-modules/marketplace-subscription/versions.tf b/simple/terraform-modules/marketplace-subscription/versions.tf deleted file mode 100644 index ac97c6a..0000000 --- a/simple/terraform-modules/marketplace-subscription/versions.tf +++ /dev/null @@ -1,4 +0,0 @@ - -terraform { - required_version = ">= 0.12" -} diff --git a/simple/terraform-modules/network-security-groups/nsg.tf b/simple/terraform-modules/network-security-groups/nsg.tf deleted file mode 100644 index 75aaca7..0000000 --- a/simple/terraform-modules/network-security-groups/nsg.tf +++ /dev/null @@ -1,57 +0,0 @@ -resource "oci_core_network_security_group" "nsg" { - #Required - compartment_id = var.compartment_ocid - vcn_id = var.vcn_id - - #Optional - display_name = var.nsg_display_name -} - -resource "oci_core_network_security_group_security_rule" "rule_egress_all" { - network_security_group_id = oci_core_network_security_group.nsg.id - - direction = "EGRESS" - protocol = "all" - destination = "0.0.0.0/0" -} - -resource "oci_core_network_security_group_security_rule" "rule_ingress_tcp443" { - network_security_group_id = oci_core_network_security_group.nsg.id - protocol = "6" - direction = "INGRESS" - source = var.nsg_whitelist_ip != "" ? var.nsg_whitelist_ip : "0.0.0.0/0" - stateless = false - - tcp_options { - destination_port_range { - min = 443 - max = 443 - } - } -} - -resource "oci_core_network_security_group_security_rule" "rule_ingress_all_icmp_type3_code4" { - network_security_group_id = oci_core_network_security_group.nsg.id - protocol = 1 - direction = "INGRESS" - source = var.nsg_whitelist_ip != "" ? var.nsg_whitelist_ip : "0.0.0.0/0" - stateless = true - - icmp_options { - type = 3 - code = 4 - } -} - -resource "oci_core_network_security_group_security_rule" "rule_ingress_vcn_icmp_type3" { - network_security_group_id = oci_core_network_security_group.nsg.id - protocol = 1 - direction = "INGRESS" - source = var.vcn_cidr_block - stateless = true - - icmp_options { - type = 3 - } -} - diff --git a/simple/terraform-modules/network-security-groups/output.tf b/simple/terraform-modules/network-security-groups/output.tf deleted file mode 100644 index 4d6d063..0000000 --- a/simple/terraform-modules/network-security-groups/output.tf +++ /dev/null @@ -1,4 +0,0 @@ -output "nsg_id" { - value = join("", oci_core_network_security_group.nsg.*.id) -} - diff --git a/simple/terraform-modules/network-security-groups/variables.tf b/simple/terraform-modules/network-security-groups/variables.tf deleted file mode 100644 index 666ae51..0000000 --- a/simple/terraform-modules/network-security-groups/variables.tf +++ /dev/null @@ -1,20 +0,0 @@ -variable "compartment_ocid" { -} - -variable "vcn_id" { -} - -variable "vcn_cidr_block" { -} - -variable "nsg_display_name" { -} - -variable "nsg_whitelist_ip" { - default = "" -} - -variable "use_existing_network" { - type = bool - default = false -} \ No newline at end of file diff --git a/simple/terraform-modules/network-security-groups/versions.tf b/simple/terraform-modules/network-security-groups/versions.tf deleted file mode 100644 index ac97c6a..0000000 --- a/simple/terraform-modules/network-security-groups/versions.tf +++ /dev/null @@ -1,4 +0,0 @@ - -terraform { - required_version = ">= 0.12" -} diff --git a/simple/terraform-modules/vcn-plus-subnet-default/network.tf b/simple/terraform-modules/vcn-plus-subnet-default/network.tf deleted file mode 100644 index d7330d4..0000000 --- a/simple/terraform-modules/vcn-plus-subnet-default/network.tf +++ /dev/null @@ -1,40 +0,0 @@ -# VCN comes with default route table, security list and DHCP options - -resource "oci_core_vcn" "vcn" { - count = var.use_existing_network ? 0:1 - cidr_block = var.vcn_cidr_block - dns_label = var.vcn_dns_label - compartment_id = var.compartment_ocid - display_name = var.vcn_display_name -} - -resource "oci_core_internet_gateway" "igw" { - count = var.use_existing_network ? 0:1 - compartment_id = var.compartment_ocid - display_name = var.igw_display_name - vcn_id = oci_core_vcn.vcn[count.index].id -} - -resource "oci_core_default_route_table" "default_route_table" { - count = var.use_existing_network ? 0:1 - manage_default_resource_id = oci_core_vcn.vcn[count.index].default_route_table_id - - route_rules { - destination = "0.0.0.0/0" - destination_type = "CIDR_BLOCK" - network_entity_id = oci_core_internet_gateway.igw[count.index].id - } -} - - -resource "oci_core_subnet" "public_subnet" { - count = var.use_existing_network ? 0:1 - compartment_id = var.compartment_ocid - vcn_id = oci_core_vcn.vcn[count.index].id - cidr_block = var.subnet_cidr_block - display_name = var.subnet_display_name - route_table_id = oci_core_vcn.vcn[count.index].default_route_table_id - dns_label = var.subnet_dns_label - prohibit_public_ip_on_vnic = "false" -} - diff --git a/simple/terraform-modules/vcn-plus-subnet-default/output.tf b/simple/terraform-modules/vcn-plus-subnet-default/output.tf deleted file mode 100644 index b8128ef..0000000 --- a/simple/terraform-modules/vcn-plus-subnet-default/output.tf +++ /dev/null @@ -1,14 +0,0 @@ - -output "vcn_id" { - value = !var.use_existing_network ? join("", oci_core_vcn.vcn.*.id) : var.vcn_id -} - -output "subnet_id" { - value = !var.use_existing_network ? join("", oci_core_subnet.public_subnet.*.id) : var.subnet_id -} - -output "vcn_cidr_block" { - value = !var.use_existing_network ? join("", oci_core_vcn.vcn.*.cidr_block) : var.vcn_cidr_block -} - - diff --git a/simple/terraform-modules/vcn-plus-subnet-default/variables.tf b/simple/terraform-modules/vcn-plus-subnet-default/variables.tf deleted file mode 100644 index b0f93b7..0000000 --- a/simple/terraform-modules/vcn-plus-subnet-default/variables.tf +++ /dev/null @@ -1,42 +0,0 @@ -variable "compartment_ocid" { -} - -variable "vcn_cidr_block" { - default = "" -} - -variable "vcn_dns_label" { - default = "vcn" -} - -variable "vcn_display_name" { - default = "vcn" -} - -variable "igw_display_name" { - default = "internet-gateway" -} - -variable "subnet_cidr_block" { -} - -variable "subnet_display_name" { - default = "subnet" -} - -variable "subnet_dns_label" { - default = "subnet" -} - -variable "use_existing_network" { - type = bool - default = false -} - -variable "vcn_id" { - default = "" -} - -variable "subnet_id" { - default = "" -} diff --git a/simple/terraform-modules/vcn-plus-subnet-default/versions.tf b/simple/terraform-modules/vcn-plus-subnet-default/versions.tf deleted file mode 100644 index ac97c6a..0000000 --- a/simple/terraform-modules/vcn-plus-subnet-default/versions.tf +++ /dev/null @@ -1,4 +0,0 @@ - -terraform { - required_version = ">= 0.12" -} diff --git a/simple/simple-cli/terraform-modules/marketplace-subscription/main.tf b/terraform-modules/marketplace-subscription/main.tf similarity index 100% rename from simple/simple-cli/terraform-modules/marketplace-subscription/main.tf rename to terraform-modules/marketplace-subscription/main.tf diff --git a/simple/simple-cli/terraform-modules/marketplace-subscription/output.tf b/terraform-modules/marketplace-subscription/output.tf similarity index 100% rename from simple/simple-cli/terraform-modules/marketplace-subscription/output.tf rename to terraform-modules/marketplace-subscription/output.tf diff --git a/simple/simple-cli/terraform-modules/marketplace-subscription/variables.tf b/terraform-modules/marketplace-subscription/variables.tf similarity index 100% rename from simple/simple-cli/terraform-modules/marketplace-subscription/variables.tf rename to terraform-modules/marketplace-subscription/variables.tf diff --git a/simple/simple-cli/terraform-modules/marketplace-subscription/versions.tf b/terraform-modules/marketplace-subscription/versions.tf similarity index 100% rename from simple/simple-cli/terraform-modules/marketplace-subscription/versions.tf rename to terraform-modules/marketplace-subscription/versions.tf diff --git a/simple/simple-cli/terraform-modules/network-security-groups/nsg.tf b/terraform-modules/network-security-groups/nsg.tf similarity index 100% rename from simple/simple-cli/terraform-modules/network-security-groups/nsg.tf rename to terraform-modules/network-security-groups/nsg.tf diff --git a/simple/simple-cli/terraform-modules/network-security-groups/output.tf b/terraform-modules/network-security-groups/output.tf similarity index 100% rename from simple/simple-cli/terraform-modules/network-security-groups/output.tf rename to terraform-modules/network-security-groups/output.tf diff --git a/simple/simple-cli/terraform-modules/network-security-groups/variables.tf b/terraform-modules/network-security-groups/variables.tf similarity index 100% rename from simple/simple-cli/terraform-modules/network-security-groups/variables.tf rename to terraform-modules/network-security-groups/variables.tf diff --git a/simple/simple-cli/terraform-modules/network-security-groups/versions.tf b/terraform-modules/network-security-groups/versions.tf similarity index 100% rename from simple/simple-cli/terraform-modules/network-security-groups/versions.tf rename to terraform-modules/network-security-groups/versions.tf diff --git a/simple/simple-cli/terraform-modules/vcn-plus-subnet-default/network.tf b/terraform-modules/vcn-plus-subnet-default/network.tf similarity index 100% rename from simple/simple-cli/terraform-modules/vcn-plus-subnet-default/network.tf rename to terraform-modules/vcn-plus-subnet-default/network.tf diff --git a/simple/simple-cli/terraform-modules/vcn-plus-subnet-default/output.tf b/terraform-modules/vcn-plus-subnet-default/output.tf similarity index 100% rename from simple/simple-cli/terraform-modules/vcn-plus-subnet-default/output.tf rename to terraform-modules/vcn-plus-subnet-default/output.tf diff --git a/simple/simple-cli/terraform-modules/vcn-plus-subnet-default/variables.tf b/terraform-modules/vcn-plus-subnet-default/variables.tf similarity index 100% rename from simple/simple-cli/terraform-modules/vcn-plus-subnet-default/variables.tf rename to terraform-modules/vcn-plus-subnet-default/variables.tf diff --git a/simple/simple-cli/terraform-modules/vcn-plus-subnet-default/versions.tf b/terraform-modules/vcn-plus-subnet-default/versions.tf similarity index 100% rename from simple/simple-cli/terraform-modules/vcn-plus-subnet-default/versions.tf rename to terraform-modules/vcn-plus-subnet-default/versions.tf diff --git a/simple/simple-cli/terraform.tfvars.template b/terraform.tfvars.template similarity index 100% rename from simple/simple-cli/terraform.tfvars.template rename to terraform.tfvars.template diff --git a/simple/simple-cli/variables.tf b/variables.tf similarity index 100% rename from simple/simple-cli/variables.tf rename to variables.tf diff --git a/simple/simple-cli/versions.tf b/versions.tf similarity index 100% rename from simple/simple-cli/versions.tf rename to versions.tf