Skip to content

Commit

Permalink
Merge pull request #4 from oracle-devrel/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ionelpanaitescu authored Oct 26, 2021
2 parents dec616d + fd5da92 commit 379dbdf
Show file tree
Hide file tree
Showing 61 changed files with 4,519 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# # Copyright © 2021, Oracle and/or its affiliates.
# # All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

resource "oci_database_autonomous_database" "adw" {
for_each = {
for k,v in var.adw_params : k => v if v.compartment_id != ""
}
admin_password = each.value.database_admin_password
compartment_id = each.value.compartment_id
cpu_core_count = each.value.adw_cpu_core_count
data_storage_size_in_tbs = each.value.adw_size_in_tbs
db_name = each.value.adw_db_name
display_name = each.value.adw_db_name
db_workload = each.value.adw_db_workload
db_version = each.value.adw_db_version
is_auto_scaling_enabled = each.value.adw_enable_auto_scaling
is_free_tier = each.value.adw_is_free_tier
license_model = each.value.adw_license_model
# subnet_id = each.value.subnet_id
# nsg_ids = each.value.nsg_ids
defined_tags = each.value.defined_tags
}

resource "oci_database_autonomous_database_wallet" "autonomous_data_warehouse_wallet" {
for_each = var.adw_params
autonomous_database_id = oci_database_autonomous_database.adw[each.key].id
password = each.value.database_wallet_password
base64_encode_content = true
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# # Copyright © 2021, Oracle and/or its affiliates.
# # All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

output "ADW_Service_Console_URL" {
value = join(", ", [for x in oci_database_autonomous_database.adw : x.service_console_url])
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# # Copyright © 2021, Oracle and/or its affiliates.
# # All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

variable "adw_params" {
type = map(object({
compartment_id = string
adw_cpu_core_count = number
adw_size_in_tbs = number
adw_db_name = string
adw_db_workload = string
adw_db_version = string
adw_enable_auto_scaling = bool
adw_is_free_tier = bool
adw_license_model = string
database_admin_password = string
database_wallet_password = string
# subnet_id = string
# nsg_ids = list(string)
defined_tags = map(string)
}))
}






Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

resource "oci_datacatalog_catalog" "this" {
for_each = {
for k,v in var.datacatalog_params : k => v if v.compartment_id != ""
}
compartment_id = each.value.compartment_id
display_name = each.value.catalog_display_name
defined_tags = each.value.defined_tags
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

output "datacatalog" {
value = {
for datacatalog in oci_datacatalog_catalog.this:
datacatalog.display_name => datacatalog.display_name
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

variable "datacatalog_params" {
type = map(object({
compartment_id = string
catalog_display_name = string
defined_tags = map(string)
}))
}
37 changes: 37 additions & 0 deletions cloud-foundation/modules/cloud-foundation-library/oac/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright © 2021, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

resource "oci_analytics_analytics_instance" "oac" {
for_each = {
for k,v in var.oac_params : k => v if v.compartment_id != ""
}
compartment_id = each.value.compartment_id
feature_set = each.value.analytics_instance_feature_set
license_type = each.value.analytics_instance_license_type
name = each.value.analytics_instance_hostname
description = "Oracle Analytics Cloud"
idcs_access_token = each.value.analytics_instance_idcs_access_token
#Optional
defined_tags = each.value.defined_tags
network_endpoint_details {
#Required
network_endpoint_type = each.value.analytics_instance_network_endpoint_details_network_endpoint_type

#Optional
subnet_id = each.value.subnet_id
vcn_id = each.value.vcn_id
whitelisted_ips = each.value.analytics_instance_network_endpoint_details_whitelisted_ips

whitelisted_vcns {
#Optional
id = each.value.analytics_instance_network_endpoint_details_whitelisted_vcns_id
whitelisted_ips = each.value.whitelisted_ips
}
}
capacity {
capacity_type = each.value.analytics_instance_capacity_capacity_type
capacity_value = each.value.analytics_instance_capacity_value
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright © 2021, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

output "Analytics_URL" {
value = join(", ", [for x in oci_analytics_analytics_instance.oac : x.service_url])
}

22 changes: 22 additions & 0 deletions cloud-foundation/modules/cloud-foundation-library/oac/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright © 2021, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

variable "oac_params" {
type = map(object({
compartment_id = string
analytics_instance_feature_set = string
analytics_instance_license_type = string
analytics_instance_hostname = string
analytics_instance_idcs_access_token = string
analytics_instance_capacity_capacity_type = string
analytics_instance_capacity_value = number
defined_tags = map(string)
analytics_instance_network_endpoint_details_network_endpoint_type = string
subnet_id = string
vcn_id = string
analytics_instance_network_endpoint_details_whitelisted_ips = list(string)
analytics_instance_network_endpoint_details_whitelisted_vcns_id = string
whitelisted_ips = list(string)
}))
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

data "oci_objectstorage_namespace" "os" {
compartment_id = var.tenancy_ocid
}

resource "oci_objectstorage_bucket" "os" {
for_each = {
for k,v in var.bucket_params : k => v if v.compartment_id != ""
}
compartment_id = each.value.compartment_id
name = each.value.name
namespace = data.oci_objectstorage_namespace.os.namespace
access_type = each.value.access_type
storage_tier = each.value.storage_tier
object_events_enabled = each.value.events_enabled
defined_tags = each.value.defined_tags
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

output "buckets" {
value = {
for bucket in oci_objectstorage_bucket.os:
bucket.name => bucket.access_type
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

variable "tenancy_ocid" {
type = string
}

variable "bucket_params" {
type = map(object({
compartment_id = string
name = string
access_type = string
storage_tier = string
events_enabled = bool
defined_tags = map(string)
}))
}

26 changes: 26 additions & 0 deletions cloud-foundation/modules/cloud-foundation-library/odi/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright © 2021, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

resource "oci_dataintegration_workspace" "this" {
for_each = {
for k,v in var.odi_params : k => v if v.compartment_id != ""
}
#Required
compartment_id = each.value.compartment_id
display_name = each.value.display_name

#Optional
defined_tags = each.value.defined_tags
description = each.value.description
# dns_server_ip = var.workspace_dns_server_ip
# dns_server_zone = var.workspace_dns_server_zone
# freeform_tags = each.value.freeform_tags
# is_private_network_enabled = each.value.is_private_network_enabled
is_private_network_enabled = false
# subnet_id = each.value.subnet_id
# vcn_id = each.value.vcn_id
}




Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright © 2021, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

output "odi" {
value = {
for odi in oci_dataintegration_workspace.this:
odi.display_name => odi.display_name
}
}
15 changes: 15 additions & 0 deletions cloud-foundation/modules/cloud-foundation-library/odi/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright © 2021, Oracle and/or its affiliates.
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.

variable "odi_params" {
type = map(object({
compartment_id = string
display_name = string
description = string
# is_private_network_enabled = bool
# subnet_id = string
# vcn_id = string
defined_tags = map(string)
}))
}

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ resource "oci_core_drg_attachment" "these" {
### Subnets
resource "oci_core_subnet" "these" {

for_each = {for subnet in local.subnets : "${subnet.display_name}" => subnet if subnet.cidr != ""}
for_each = {for subnet in local.subnets : subnet.display_name => subnet if subnet.cidr != ""}
display_name = each.value.display_name
vcn_id = each.value.vcn_name != "" ? oci_core_vcn.these[each.value.vcn_name].id : each.value.vcn_id
availability_domain = each.value.availability_domain
Expand Down
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions cloud-foundation/solutions-for-oracle-res-mgr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Oracle Cloud Foundation Terraform Solution - Departmental data warehousing - business domain analytics


## <a name="Info"></a>Overview
This is the folder for the Oracle OCI Console Resource Manager files.
They will be automatically generated when something in the modules and/or solutions folders changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.terraform
*tfstate*
*.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!--
Copyright (c) 2000, 2020, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at
http://oss.oracle.com/licenses/upl.
-->
# Contributing to Oracle Cloud Foundation Terraform Framework

## Contributing to Oracle Cloud Foundation Terraform Framework

Oracle welcomes contributions to this repository from anyone.

If you want to submit a pull request to fix a bug or enhance an existing
feature, please first open an issue and link to that issue when you
submit your pull request.

If you have any questions about a possible submission, feel free to open
an issue too.

## Pull request process

1. Fork this repository
1. Create a branch in your fork to implement the changes. We recommend using
the issue number as part of your branch name, e.g. `1234-fixes`
1. Ensure that there is at least one test that would fail without the fix and
passes post fix
1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly
what your changes are meant to do and provide simple steps on how to validate
your changes, ideally referencing the test. Ensure that you reference the issue
you created as well. We will assign the pull request to 1-2 people for review
before it is submitted internally and the PR is closed.
27 changes: 27 additions & 0 deletions cloud-foundation/solutions/Departmental-DWH-Full-Solution/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright © 2021 Oracle and/or its affiliates. All rights reserved.

The Universal Permissive License (UPL), Version 1.0

Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this
software, associated documentation and/or data (collectively the "Software"), free of charge and under any and
all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor
hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or
(ii) the Larger Works (as defined below), to deal in both

(a) the Software, and
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software
(each a “Larger Work” to which the Software is contributed by such licensors),

without restriction, including without limitation the rights to copy, create derivative works of, display,
perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have
sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms.

This license is subject to the following condition:
The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must
be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
Loading

0 comments on commit 379dbdf

Please sign in to comment.