Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.

Commit d29b901

Browse files
authored
Merge pull request #9 from oracle-devrel/adb-module
Added remote adb-module
2 parents 2bd6efb + 83ff3d9 commit d29b901

File tree

6 files changed

+41
-37
lines changed

6 files changed

+41
-37
lines changed

database.tf

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,25 @@ locals {
55
atp_private_endpoint = (var.free_tier == false && var.atp_private_endpoint == true) ? true : false
66
}
77

8-
resource "oci_database_autonomous_database" "ATPdatabase" {
9-
admin_password = var.atp_password
10-
compartment_id = var.compartment_ocid
11-
cpu_core_count = var.atp_cpu_core_count
12-
data_storage_size_in_tbs = var.atp_data_storage_size_in_tbs
13-
db_name = var.atp_db_name
14-
db_version = var.atp_db_version
15-
display_name = var.atp_name
16-
freeform_tags = var.atp_freeform_tags
17-
license_model = var.atp_license_model
18-
is_free_tier = var.free_tier
19-
nsg_ids = local.atp_private_endpoint ? [oci_core_network_security_group.ATPSecurityGroup.id] : null
20-
private_endpoint_label = local.atp_private_endpoint ? var.atp_private_endpoint_label : null
21-
subnet_id = local.atp_private_endpoint ? oci_core_subnet.vcn01_subnet_db01.id : null
22-
defined_tags = { "${oci_identity_tag_namespace.ArchitectureCenterTagNamespace.name}.${oci_identity_tag.ArchitectureCenterTag.name}" = var.release }
8+
module "terraform-oci-arch-adb" {
9+
source = "github.com/oracle-devrel/terraform-oci-arch-adb"
10+
compartment_ocid = var.compartment_ocid
11+
adb_database_db_name = var.atp_db_name
12+
adb_database_display_name = var.atp_name
13+
adb_password = var.atp_password
14+
adb_database_db_workload = "OLTP"
15+
adb_free_tier = var.free_tier
16+
adb_database_cpu_core_count = var.atp_cpu_core_count
17+
adb_database_data_storage_size_in_tbs = var.atp_data_storage_size_in_tbs
18+
adb_database_db_version = var.atp_db_version
19+
adb_database_freeform_tags = var.atp_freeform_tags
20+
adb_database_license_model = var.atp_license_model
21+
use_existing_vcn = local.atp_private_endpoint
22+
adb_private_endpoint = local.atp_private_endpoint
23+
adb_private_endpoint_label = local.atp_private_endpoint ? var.atp_private_endpoint_label : null
24+
vcn_id = local.atp_private_endpoint ? oci_core_vcn.vcn01.id : null
25+
adb_subnet_id = local.atp_private_endpoint ? oci_core_subnet.vcn01_subnet_db01.id : null
26+
adb_nsg_id = local.atp_private_endpoint ? oci_core_network_security_group.ATPSecurityGroup.id : null
27+
defined_tags = { "${oci_identity_tag_namespace.ArchitectureCenterTagNamespace.name}.${oci_identity_tag.ArchitectureCenterTag.name}" = var.release }
2328
}
2429

25-
resource "random_password" "wallet_password" {
26-
length = 16
27-
special = true
28-
}
29-
30-
resource "oci_database_autonomous_database_wallet" "atp_wallet" {
31-
autonomous_database_id = oci_database_autonomous_database.ATPdatabase.id
32-
password = random_password.wallet_password.result
33-
base64_encode_content = "true"
34-
}

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ output "generated_ssh_private_key" {
2323
}
2424

2525
output "wallet_password" {
26-
value = [random_password.wallet_password.result]
26+
value = [module.terraform-oci-arch-adb.adb_database.adb_wallet_content]
2727
sensitive = true
2828
}

remote.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ data "template_file" "tomcat_context_xml" {
3939
}
4040

4141
resource "null_resource" "tomcat-server-config" {
42-
depends_on = [oci_core_instance.tomcat-server, oci_database_autonomous_database.ATPdatabase]
42+
depends_on = [oci_core_instance.tomcat-server, module.terraform-oci-arch-adb.adb_database]
4343
count = var.numberOfNodes
4444

4545
provisioner "local-exec" {
46-
command = "echo '${oci_database_autonomous_database_wallet.atp_wallet.content}' >> ${var.atp_tde_wallet_zip_file}_encoded-${count.index}"
46+
command = "echo '${module.terraform-oci-arch-adb.adb_database.adb_wallet_content}' >> ${var.atp_tde_wallet_zip_file}_encoded-${count.index}"
4747
}
4848

4949
provisioner "local-exec" {

schema.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ variables:
178178
type: enum
179179
title: "LoadBalancer Shape"
180180
description: "Choose LoadBalancer Shape"
181-
default: "10Mbps-Micro"
181+
default: "flexible"
182182
required: false
183183
enum:
184184
- "flexible"
@@ -209,7 +209,7 @@ variables:
209209
flex_lb_max_shape:
210210
type: enum
211211
required: false
212-
default: "100"
212+
default: "10"
213213
title: "LB Flex Max Shape"
214214
description: "Choose Maximum Shape for Flex Load Balancer."
215215
enum:
@@ -355,7 +355,7 @@ variables:
355355
minimum: 1
356356
maximum: 128
357357
multipleOf: 1
358-
default: 10
358+
default: 6
359359
title: "Flex Shape Memory (GB)"
360360
description: "Choose number GB for Flex Shape Memory."
361361
visible:
@@ -399,7 +399,11 @@ variables:
399399
required: true
400400
title: "ATP Database Private Endpoint"
401401
description: "Check the box to deploy ATP Database with Private Endpoint."
402-
visible: free_tier
402+
visible:
403+
and:
404+
- eq:
405+
- free_tier
406+
- false
403407

404408
atp_cpu_core_count:
405409
type: number
@@ -470,8 +474,13 @@ variables:
470474
required: false
471475
visible:
472476
and:
473-
- ATP_private_endpoint
474-
- free_tier
477+
- eq:
478+
- ATP_private_endpoint
479+
- true
480+
- eq:
481+
- free_tier
482+
- false
483+
475484
default: "ATPPrivateEndpoint"
476485
title: "ATP Database Private Endpoint Label"
477486
description: "Choose ATP Database Private Endpoint label."

scripts/tomcat_bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ sudo -u tomcat nohup /u01/apache-tomcat-${tomcat_version}/bin/startup.sh &
8888

8989
# Download TODOAPP and deploy in Tomcat
9090
echo '== 8. Download TODOAPP and deploy in Tomcat'
91-
wget -O /home/opc/todoapp.war https://github.com/oracle-quickstart/oci-arch-tomcat-autonomous/releases/latest/download/todoapp-atp.war
91+
wget -O /home/opc/todoapp.war https://github.com/oracle-devrel/terraform-oci-arch-tomcat-autonomous/releases/latest/download/todoapp-atp.war
9292
chown opc:opc /home/opc/todoapp.war
9393
cp /home/opc/todoapp.war /u01/apache-tomcat-${tomcat_version}/webapps
9494
chown tomcat:tomcat /u01/apache-tomcat-${tomcat_version}/webapps/todoapp.war

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ variable "vcn01_subnet_db01_display_name" {
7575
}
7676

7777
variable "lb_shape" {
78-
default = "10Mbps-Micro"
78+
default = "flexible"
7979
}
8080

8181
variable "flex_lb_min_shape" {
8282
default = "10"
8383
}
8484

8585
variable "flex_lb_max_shape" {
86-
default = "100"
86+
default = "10"
8787
}
8888

8989
variable "InstanceShape" {

0 commit comments

Comments
 (0)