Skip to content

Commit bdf98a8

Browse files
Added new solutions and upgraded modules
1 parent e26ad59 commit bdf98a8

File tree

25 files changed

+2738
-0
lines changed

25 files changed

+2738
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright © 2023, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
locals {
5+
adw_download_wallet = { for key, value in var.adw_params : key => value if value.create_local_wallet == true }
6+
}
7+
8+
resource "oci_database_autonomous_database_wallet" "autonomous_database_wallet" {
9+
for_each = var.adw_params
10+
autonomous_database_id = oci_database_autonomous_database.adw[each.key].id
11+
password = each.value.database_wallet_password
12+
base64_encode_content = "true"
13+
}
14+
15+
resource "local_file" "autonomous_data_warehouse_wallet_file" {
16+
for_each = local.adw_download_wallet
17+
content_base64 = oci_database_autonomous_database_wallet.autonomous_database_wallet[each.key].content
18+
filename = "${path.cwd}/wallet_${each.value.db_name}.zip"
19+
}
20+
21+
resource "oci_database_autonomous_database" "adw" {
22+
for_each = var.adw_params
23+
admin_password = each.value.database_admin_password
24+
compartment_id = each.value.compartment_id
25+
cpu_core_count = each.value.cpu_core_count
26+
data_storage_size_in_tbs = each.value.size_in_tbs
27+
db_name = each.value.db_name
28+
display_name = each.value.db_name
29+
db_workload = each.value.db_workload
30+
db_version = each.value.db_version
31+
license_model = each.value.license_model
32+
is_mtls_connection_required = each.value.is_mtls_connection_required
33+
subnet_id = each.value.subnet_id
34+
nsg_ids = each.value.nsg_ids
35+
defined_tags = each.value.defined_tags
36+
is_auto_scaling_enabled = each.value.enable_auto_scaling
37+
is_free_tier = each.value.is_free_tier
38+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright © 2023, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
output "atp_db_id" {
5+
value = {
6+
for adw in oci_database_autonomous_database.adw:
7+
adw.display_name => adw.id
8+
}
9+
}
10+
11+
output "ad" {
12+
value = {
13+
for idx, ad in oci_database_autonomous_database.adw:
14+
ad.db_name => { "connection_strings" : ad.connection_strings.0.all_connection_strings}
15+
}
16+
}
17+
18+
output "db_connection" {
19+
value = one([ for b in oci_database_autonomous_database.adw : b.connection_strings])
20+
}
21+
22+
output "private_endpoint_ip" {
23+
value = one([for b in oci_database_autonomous_database.adw : b.private_endpoint_ip])
24+
}
25+
26+
output "private_endpoint" {
27+
value = ([for b in oci_database_autonomous_database.adw : b.private_endpoint])
28+
}
29+
30+
output "url" {
31+
value = [for b in oci_database_autonomous_database.adw : b.connection_urls.0.sql_dev_web_url]
32+
}
33+
34+
output "graph_studio_url" {
35+
value = [for b in oci_database_autonomous_database.adw : b.connection_urls.0.graph_studio_url]
36+
}
37+
38+
output "machine_learning_user_management_url" {
39+
value = [for b in oci_database_autonomous_database.adw : b.connection_urls.0.machine_learning_user_management_url]
40+
}
41+
42+
output "adb_wallet_content" {
43+
value = oci_database_autonomous_database_wallet.autonomous_database_wallet["adw"].content
44+
}
45+
46+
output "database_fully_qualified_name" {
47+
value = lower(trimsuffix(trimprefix(join("\n", [for b in oci_database_autonomous_database.adw : b.connection_urls.0.graph_studio_url]), "https://"), "/graphstudio/"))
48+
}
49+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright © 2023, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
variable "adw_params" {
5+
type = map(object({
6+
compartment_id = string
7+
cpu_core_count = number
8+
size_in_tbs = number
9+
db_name = string
10+
db_workload = string
11+
db_version = string
12+
license_model = string
13+
database_admin_password = string
14+
database_wallet_password = string
15+
enable_auto_scaling = bool
16+
is_free_tier = bool
17+
create_local_wallet = bool
18+
is_mtls_connection_required = bool
19+
subnet_id = string
20+
nsg_ids = list(string)
21+
defined_tags = map(string)
22+
}))
23+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright © 2023, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
resource "oci_datacatalog_catalog" "this" {
5+
for_each = var.datacatalog_params
6+
compartment_id = each.value.compartment_id
7+
display_name = each.value.catalog_display_name
8+
defined_tags = each.value.defined_tags
9+
}
10+
11+
resource "oci_datacatalog_data_asset" "this" {
12+
for_each = var.datacatalog_params
13+
catalog_id = oci_datacatalog_catalog.this[each.key].id
14+
display_name = each.value.catalog_display_name
15+
type_key = data.oci_datacatalog_catalog_types.this[each.key].type_collection[0].items[0].key
16+
properties = {
17+
"default.database" = var.db_name
18+
"default.privateendpoint" = "false"
19+
}
20+
}
21+
22+
resource "oci_datacatalog_connection" "this" {
23+
for_each = var.datacatalog_params
24+
catalog_id = oci_datacatalog_catalog.this[each.key].id
25+
data_asset_key = oci_datacatalog_data_asset.this[each.key].id
26+
display_name = each.value.catalog_display_name
27+
is_default = "true"
28+
type_key = data.oci_datacatalog_catalog_types.that[each.key].type_collection[0].items[2].key
29+
properties = {
30+
"default.alias" = "${var.db_name}_low"
31+
"default.username" = each.value.dbusername
32+
"default.walletAndSecrets" = "plainWallet"
33+
}
34+
enc_properties = {
35+
"default.password" = each.value.dbpassword
36+
"default.wallet" = var.wallet
37+
}
38+
}
39+
40+
data "oci_datacatalog_catalog_types" "this" {
41+
for_each = var.datacatalog_params
42+
catalog_id = oci_datacatalog_catalog.this[each.key].id
43+
type_category = "dataAsset"
44+
name = "Autonomous Data Warehouse"
45+
state = "ACTIVE"
46+
}
47+
48+
49+
data "oci_datacatalog_catalog_types" "that" {
50+
for_each = var.datacatalog_params
51+
catalog_id = oci_datacatalog_catalog.this[each.key].id
52+
type_category = "connection"
53+
name = "Generic"
54+
state = "ACTIVE"
55+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright © 2023, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
output "datacatalog" {
5+
value = {
6+
for datacatalog in oci_datacatalog_catalog.this:
7+
datacatalog.display_name => datacatalog.display_name
8+
}
9+
}
10+
11+
output "datacatalog_data_asset" {
12+
value = {
13+
for datacatalog_data_asset in oci_datacatalog_data_asset.this:
14+
datacatalog_data_asset.display_name => datacatalog_data_asset.display_name
15+
}
16+
}
17+
18+
output "datacatalog_connection" {
19+
value = {
20+
for datacatalog_connection in oci_datacatalog_connection.this:
21+
datacatalog_connection.display_name => datacatalog_connection.display_name
22+
}
23+
}
24+
25+
# output "datacatalog_id" {
26+
# value = {
27+
# for dc in oci_datacatalog_catalog.this:
28+
# dc.display_name => dc.id
29+
# }
30+
# }
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright © 2023, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
variable "datacatalog_params" {
5+
type = map(object({
6+
compartment_id = string
7+
catalog_display_name = string
8+
defined_tags = map(string)
9+
dbusername = string
10+
dbpassword = string
11+
}))
12+
}
13+
14+
variable "db_name" {
15+
type = string
16+
}
17+
18+
variable "wallet" {}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright © 2023, Oracle and/or its affiliates.
2+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
.terraform
5+
*tfstate*
6+
*.pem
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--
2+
3+
# Copyright © 2023, Oracle and/or its affiliates.
4+
# All rights reserved. Licensed under the Universal Permissive License (UPL), Version 1.0 as shown at https://oss.oracle.com/licenses/upl.
5+
6+
7+
-->
8+
# Contributing to Oracle Cloud Foundation Terraform Framework
9+
10+
## Contributing to Oracle Cloud Foundation Terraform Framework
11+
12+
Oracle welcomes contributions to this repository from anyone.
13+
14+
If you want to submit a pull request to fix a bug or enhance an existing
15+
feature, please first open an issue and link to that issue when you
16+
submit your pull request.
17+
18+
If you have any questions about a possible submission, feel free to open
19+
an issue too.
20+
21+
## Pull request process
22+
23+
1. Fork this repository
24+
1. Create a branch in your fork to implement the changes. We recommend using
25+
the issue number as part of your branch name, e.g. `1234-fixes`
26+
1. Ensure that there is at least one test that would fail without the fix and
27+
passes post fix
28+
1. Submit the pull request. *Do not leave the pull request blank*. Explain exactly
29+
what your changes are meant to do and provide simple steps on how to validate
30+
your changes, ideally referencing the test. Ensure that you reference the issue
31+
you created as well. We will assign the pull request to 1-2 people for review
32+
before it is submitted internally and the PR is closed.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright © 2023 Oracle and/or its affiliates. All rights reserved.
2+
3+
The Universal Permissive License (UPL), Version 1.0
4+
5+
Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this
6+
software, associated documentation and/or data (collectively the "Software"), free of charge and under any and
7+
all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor
8+
hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or
9+
(ii) the Larger Works (as defined below), to deal in both
10+
11+
(a) the Software, and
12+
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software
13+
(each a “Larger Work” to which the Software is contributed by such licensors),
14+
15+
without restriction, including without limitation the rights to copy, create derivative works of, display,
16+
perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have
17+
sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms.
18+
19+
This license is subject to the following condition:
20+
The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must
21+
be included in all copies or substantial portions of the Software.
22+
23+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
24+
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
26+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27+
IN THE SOFTWARE.

0 commit comments

Comments
 (0)