generated from oracle-devrel/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding new features to Deploy-Autonomous-Database-and-the-MovieStream…
…-data-sets-for-Oracle-LiveLabs
- Loading branch information
1 parent
79f81da
commit 8a20c57
Showing
11 changed files
with
195 additions
and
65 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
cloud-foundation/modules/cloud-foundation-library/database/adw_ecpus/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright © 2023, 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. | ||
|
||
locals { | ||
adw_download_wallet = { for key, value in var.adw_params : key => value if value.create_local_wallet == true } | ||
} | ||
|
||
resource "oci_database_autonomous_database_wallet" "autonomous_database_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" | ||
} | ||
|
||
resource "local_file" "autonomous_data_warehouse_wallet_file" { | ||
for_each = local.adw_download_wallet | ||
content_base64 = oci_database_autonomous_database_wallet.autonomous_database_wallet[each.key].content | ||
filename = "${path.cwd}/wallet_${each.value.db_name}.zip" | ||
} | ||
|
||
resource "oci_database_autonomous_database" "adw" { | ||
for_each = var.adw_params | ||
admin_password = each.value.database_admin_password | ||
compartment_id = each.value.compartment_id | ||
compute_model = each.value.compute_model | ||
compute_count = each.value.compute_count | ||
data_storage_size_in_tbs = each.value.size_in_tbs | ||
db_name = each.value.db_name | ||
display_name = each.value.db_name | ||
db_workload = each.value.db_workload | ||
db_version = each.value.db_version | ||
license_model = each.value.license_model | ||
is_mtls_connection_required = each.value.is_mtls_connection_required | ||
subnet_id = each.value.subnet_id | ||
nsg_ids = each.value.nsg_ids | ||
defined_tags = each.value.defined_tags | ||
is_auto_scaling_enabled = each.value.enable_auto_scaling | ||
is_free_tier = each.value.is_free_tier | ||
} |
49 changes: 49 additions & 0 deletions
49
cloud-foundation/modules/cloud-foundation-library/database/adw_ecpus/outputs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright © 2023, 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 "atp_db_id" { | ||
value = { | ||
for adw in oci_database_autonomous_database.adw: | ||
adw.display_name => adw.id | ||
} | ||
} | ||
|
||
output "ad" { | ||
value = { | ||
for idx, ad in oci_database_autonomous_database.adw: | ||
ad.db_name => { "connection_strings" : ad.connection_strings.0.all_connection_strings} | ||
} | ||
} | ||
|
||
output "db_connection" { | ||
value = one([ for b in oci_database_autonomous_database.adw : b.connection_strings]) | ||
} | ||
|
||
output "private_endpoint_ip" { | ||
value = one([for b in oci_database_autonomous_database.adw : b.private_endpoint_ip]) | ||
} | ||
|
||
output "private_endpoint" { | ||
value = ([for b in oci_database_autonomous_database.adw : b.private_endpoint]) | ||
} | ||
|
||
output "url" { | ||
value = [for b in oci_database_autonomous_database.adw : b.connection_urls.0.sql_dev_web_url] | ||
} | ||
|
||
output "graph_studio_url" { | ||
value = [for b in oci_database_autonomous_database.adw : b.connection_urls.0.graph_studio_url] | ||
} | ||
|
||
output "machine_learning_user_management_url" { | ||
value = [for b in oci_database_autonomous_database.adw : b.connection_urls.0.machine_learning_user_management_url] | ||
} | ||
|
||
output "adb_wallet_content" { | ||
value = oci_database_autonomous_database_wallet.autonomous_database_wallet["adw"].content | ||
} | ||
|
||
output "database_fully_qualified_name" { | ||
value = lower(trimsuffix(trimprefix(join("\n", [for b in oci_database_autonomous_database.adw : b.connection_urls.0.graph_studio_url]), "https://"), "/graphstudio/")) | ||
} | ||
|
24 changes: 24 additions & 0 deletions
24
cloud-foundation/modules/cloud-foundation-library/database/adw_ecpus/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright © 2023, 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 | ||
compute_model = string | ||
compute_count = number | ||
size_in_tbs = number | ||
db_name = string | ||
db_workload = string | ||
db_version = string | ||
license_model = string | ||
database_admin_password = string | ||
database_wallet_password = string | ||
enable_auto_scaling = bool | ||
is_free_tier = bool | ||
create_local_wallet = bool | ||
is_mtls_connection_required = bool | ||
subnet_id = string | ||
nsg_ids = list(string) | ||
defined_tags = map(string) | ||
})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.