Skip to content

Commit b71348d

Browse files
committed
Automation Toolkit Release v2026.1.0
1 parent 589bf9e commit b71348d

12 files changed

Lines changed: 414 additions & 17 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#!/usr/bin/env python3
22

3+
from .awsCommonTools import *
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import boto3
2+
from botocore.exceptions import ClientError, NoCredentialsError
3+
4+
def read_aws_auth_properties(filepath):
5+
6+
aws_access_key_id = None
7+
aws_secret_access_key = None
8+
9+
with open(filepath, "r") as f:
10+
11+
for line in f:
12+
line = line.strip()
13+
if line == "" or line.startswith("#") or line.startswith("["):
14+
continue
15+
16+
if line.startswith("aws_access_key_id"):
17+
aws_access_key_id = line.split("=", 1)[1].strip()
18+
19+
elif line.startswith("aws_secret_access_key"):
20+
aws_secret_access_key = line.split("=", 1)[1].strip()
21+
22+
23+
if not aws_access_key_id or not aws_secret_access_key:
24+
print("Missing AWS authentication parameters in properties file")
25+
exit(1)
26+
27+
return aws_access_key_id, aws_secret_access_key
28+
29+
30+
class awsCommonTools():
31+
32+
def authenticate(self, propsfile):
33+
34+
aws_access_key_id, aws_secret_access_key = read_aws_auth_properties(propsfile)
35+
36+
try:
37+
38+
session = boto3.Session(
39+
aws_access_key_id=aws_access_key_id,
40+
aws_secret_access_key=aws_secret_access_key,
41+
region_name="us-east-1"
42+
)
43+
44+
# validate credentials
45+
sts = session.client("sts")
46+
sts.get_caller_identity()
47+
48+
return session
49+
50+
except NoCredentialsError:
51+
print("AWS credentials not found")
52+
exit(1)
53+
54+
except ClientError as e:
55+
print("Invalid AWS credentials:", e)
56+
exit(1)
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
#
4+
############################
5+
#
6+
# Variables Block
7+
# AWS OCI
8+
#
9+
############################
10+
11+
# ============================
12+
# Mandatory: AWS Authentication
13+
# ============================
14+
15+
variable "aws_region" {
16+
description = "AWS region for provider configuration"
17+
type = string
18+
default = "<AWS_REGION>"
19+
}
20+
21+
variable "aws_access_key" {
22+
description = "AWS Access Key"
23+
type = string
24+
sensitive = true
25+
default = "<AWS_ACCESS_KEY>"
26+
}
27+
28+
variable "aws_secret_key" {
29+
description = "AWS Secret Key"
30+
type = string
31+
sensitive = true
32+
default = "<AWS_SECRET_KEY>"
33+
}
34+
35+
###############################
36+
# Oracle ExaInfra @AWS ######
37+
###############################
38+
39+
variable "aws_oci_exa_infra" {
40+
description = "Map of Exadata Infrastructure configurations."
41+
type = map(object({
42+
environment = string
43+
region = string
44+
availability_zone = string
45+
availability_zone_id = string
46+
display_name = string
47+
shape = string
48+
compute_count = number
49+
storage_count = number
50+
database_server_type = string
51+
storage_server_type = string
52+
customer_contacts = list(object({ email = string }))
53+
54+
# Maintenance Window
55+
maintenance_window = optional(object({
56+
patching_mode = optional(string, "ROLLING")
57+
preference = optional(string, "NO_PREFERENCE")
58+
is_custom_action_timeout_enabled = optional(bool, false)
59+
custom_action_timeout_in_mins = optional(number, 15)
60+
days_of_week = optional(list(string), null)
61+
hours_of_day = optional(list(number), null)
62+
lead_time_in_weeks = optional(number, null)
63+
months = optional(list(string), null)
64+
weeks_of_month = optional(list(number), null)
65+
}), {})
66+
67+
# Tags
68+
tags = optional(map(string), {})
69+
}))
70+
default = {}
71+
}
72+
73+
74+
###############################
75+
# Oracle ExaVM Cluster @AWS ###
76+
###############################
77+
78+
variable "aws_oci_exa_vmclusters" {
79+
description = "Map of VM Cluster configurations"
80+
type = map(object({
81+
# MANDATORY
82+
environment = string
83+
region = string
84+
exadata_infrastructure_name = string
85+
odb_network_name = string
86+
display_name = string
87+
cluster_name = string
88+
gi_version = string
89+
hostname_prefix = string
90+
cpu_core_count = number
91+
memory_size_in_gbs = number
92+
data_storage_size_in_tbs = number
93+
db_node_storage_size_in_gbs = number
94+
ssh_public_keys = list(string)
95+
96+
# OPTIONAL
97+
license_model = string
98+
timezone = string
99+
scan_listener_port_tcp = number
100+
data_collection_options = object({
101+
is_diagnostics_events_enabled = bool
102+
is_health_monitoring_enabled = bool
103+
is_incident_logs_enabled = bool
104+
})
105+
timeout_create = string
106+
timeout_update = string
107+
timeout_delete = string
108+
109+
# IMMUTABLE
110+
is_local_backup_enabled = bool
111+
is_sparse_diskgroup_enabled = bool
112+
113+
# TAGS
114+
tags = map(string)
115+
}))
116+
default = {}
117+
}
118+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[Default]
2+
3+
##################################################################################################################
4+
## Required Parameters ##
5+
##################################################################################################################
6+
7+
# Friendly name for the AWS account environment
8+
# Generated terraform files will be prefixed with this
9+
prefix=
10+
11+
##################################################################################################################
12+
## Auth Details Parameters ##
13+
##################################################################################################################
14+
15+
# AWS Access Key
16+
aws_access_key_id=
17+
18+
# AWS Secret Key
19+
aws_secret_access_key=
20+
21+

cd3_automation_toolkit/connectCloud.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def main():
88
print("Example: python connectCloud.py oci connectOCI.properties")
99
print("Example: python connectCloud.py azure connectAzure.properties")
1010
print("Example: python connectCloud.py gcp connectGCP.properties")
11+
print("Example: python connectCloud.py aws connectAWS.properties")
1112
return
1213

1314
cloud_provider = sys.argv[1].lower()
@@ -19,8 +20,10 @@ def main():
1920
script_name = 'user-scripts/connectAzure.py'
2021
elif cloud_provider == 'gcp':
2122
script_name = 'user-scripts/connectGCP.py'
23+
elif cloud_provider == 'aws':
24+
script_name = 'user-scripts/connectAWS.py'
2225
else:
23-
print("Invalid cloud provider. Use 'azure' or 'oci' or 'gcp'.")
26+
print("Invalid cloud provider. Use 'azure' or 'aws' or 'oci' or 'gcp'.")
2427
return
2528

2629
try:

cd3_automation_toolkit/gcpcloud/python/database/templates/exa-infra-gcp-template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
#
55
############################
6-
# Exa Infra @Azure
7-
# Exa Infra @Azure - tfvars
6+
# Exa Infra @GCP
7+
# Exa Infra @GCP - tfvars
88
############################
99

1010
gcp_oci_exa_infra = {

cd3_automation_toolkit/gcpcloud/python/gcpCommonTools.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def split_tag_values(columnname, columnvalue, tempdict):
2626
except IndexError as e:
2727
pass"""
2828
tempdict = {columnname: multivalues}
29-
print("if")
3029
else:
3130
# If there is only one tag; split them only by "="; each key-value pair is stored as a list
3231
columnname = commonTools.check_column_headers(columnname)
@@ -38,6 +37,4 @@ def split_tag_values(columnname, columnvalue, tempdict):
3837
except IndexError as e:
3938
pass"""
4039
tempdict = {columnname: [multivalues]}
41-
print("else")
42-
print(tempdict)
4340
return tempdict

cd3_automation_toolkit/gcpcloud/terraform/exadata-gcp.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
module "exa-infra-gcp" {
1111
source = "./modules/gcp-oci-exa-infra"
12-
for_each = var.gcp_oci_exa_infra
12+
for_each = var.gcp_oci_exa_infra != null ? var.gcp_oci_exa_infra : {}
1313

1414
infra_config = each.value
1515
labels = each.value.labels
@@ -53,7 +53,7 @@ output "exa_infra_id" {
5353

5454
module "exa-vmcluster-gcp" {
5555
source = "./modules/gcp-oci-exa-vmcluster"
56-
for_each = var.gcp_oci_exa_vmclusters
56+
for_each = var.gcp_oci_exa_vmclusters != null ? var.gcp_oci_exa_vmclusters : {}
5757

5858
cluster_config = each.value
5959
db_server_ocids = data.google_oracle_database_db_servers.this[each.key].db_servers[*].properties.0.ocid

cd3_automation_toolkit/gcpcloud/terraform/modules/gcp-oci-exa-vmcluster/main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ resource "google_oracle_database_odb_subnet" "odb_client_subnet" {
3737
odb_subnet_id = var.cluster_config.odb_client_subnet_id
3838
location = var.cluster_config.location
3939
project = var.cluster_config.odb_network_project
40-
odbnetwork = var.cluster_config.create_odb_network ==true ? google_oracle_database_odb_network.odb_network[0].odb_network_id : "projects/${var.cluster_config.project}/locations/${var.cluster_config.location}/odbNetworks/${var.cluster_config.odb_network_id}"
40+
odbnetwork = var.cluster_config.create_odb_network ==true ? google_oracle_database_odb_network.odb_network[0].odb_network_id : "${var.cluster_config.odb_network_id}"
4141
cidr_range = var.cluster_config.client_subnet_cidr
4242
purpose = "CLIENT_SUBNET"
4343
labels = var.labels
@@ -49,7 +49,7 @@ resource "google_oracle_database_odb_subnet" "odb_backup_subnet" {
4949
odb_subnet_id = var.cluster_config.odb_backup_subnet_id
5050
location = var.cluster_config.location
5151
project = var.cluster_config.odb_network_project
52-
odbnetwork = var.cluster_config.create_odb_network ==true ? google_oracle_database_odb_network.odb_network[0].odb_network_id : "projects/${var.cluster_config.project}/locations/${var.cluster_config.location}/odbNetworks/${var.cluster_config.odb_network_id}"
52+
odbnetwork = var.cluster_config.create_odb_network ==true ? google_oracle_database_odb_network.odb_network[0].odb_network_id : "projects/${var.cluster_config.odb_network_project}/locations/${var.cluster_config.location}/odbNetworks/${var.cluster_config.odb_network_id}"
5353
cidr_range = var.cluster_config.backup_subnet_cidr
5454
purpose = "BACKUP_SUBNET"
5555
labels = var.labels
@@ -64,9 +64,9 @@ resource "google_oracle_database_cloud_vm_cluster" "vm_cluster" {
6464
exadata_infrastructure = var.exadata_infrastructure_id
6565
display_name = var.cluster_config.display_name
6666
cloud_vm_cluster_id = var.cluster_config.cloud_vm_cluster_id
67-
odb_network = var.cluster_config.create_odb_network == true ? google_oracle_database_odb_network.odb_network[0].id : "projects/${var.cluster_config.project}/locations/${var.cluster_config.location}/odbNetworks/${var.cluster_config.odb_network_id}"
68-
odb_subnet = var.cluster_config.create_odb_network_subnets == true ? google_oracle_database_odb_subnet.odb_client_subnet[0].id : "projects/${var.cluster_config.project}/locations/${var.cluster_config.location}/odbNetworks/${var.cluster_config.odb_network_id}/odbSubnets/${var.cluster_config.odb_client_subnet_id}"
69-
backup_odb_subnet = var.cluster_config.create_odb_network_subnets == true ? google_oracle_database_odb_subnet.odb_backup_subnet[0].id : "projects/${var.cluster_config.project}/locations/${var.cluster_config.location}/odbNetworks/${var.cluster_config.odb_network_id}/odbSubnets/${var.cluster_config.odb_backup_subnet_id}"
67+
odb_network = var.cluster_config.create_odb_network == true ? google_oracle_database_odb_network.odb_network[0].id : "projects/${var.cluster_config.odb_network_project}/locations/${var.cluster_config.location}/odbNetworks/${var.cluster_config.odb_network_id}"
68+
odb_subnet = var.cluster_config.create_odb_network_subnets == true ? google_oracle_database_odb_subnet.odb_client_subnet[0].id : "projects/${var.cluster_config.odb_network_project}/locations/${var.cluster_config.location}/odbNetworks/${var.cluster_config.odb_network_id}/odbSubnets/${var.cluster_config.odb_client_subnet_id}"
69+
backup_odb_subnet = var.cluster_config.create_odb_network_subnets == true ? google_oracle_database_odb_subnet.odb_backup_subnet[0].id : "projects/${var.cluster_config.odb_network_project}/locations/${var.cluster_config.location}/odbNetworks/${var.cluster_config.odb_network_id}/odbSubnets/${var.cluster_config.odb_backup_subnet_id}"
7070
properties {
7171
gi_version = var.cluster_config.gi_version
7272
db_server_ocids = var.db_server_ocids
@@ -91,7 +91,7 @@ resource "google_oracle_database_cloud_vm_cluster" "vm_cluster" {
9191
time_zone {
9292
id = var.cluster_config.time_zone
9393
}
94-
scan_listener_port_tcp = var.cluster_config.scan_listener_port_tcp
94+
#scan_listener_port_tcp = var.cluster_config.scan_listener_port_tcp
9595
}
9696
labels = var.labels
9797

cd3_automation_toolkit/gcpcloud/terraform/variables.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ variable "gcp_oci_exa_infra" {
5151
###############################
5252

5353
variable "gcp_oci_exa_vmclusters" {
54-
description = "Map of VM Cluster configurations"
54+
description = "Map of GCP VM Cluster configurations"
5555
type = map(object({
5656
# MANDATORY
5757
location = string
@@ -71,19 +71,20 @@ variable "gcp_oci_exa_vmclusters" {
7171

7272
display_name = string
7373
cloud_vm_cluster_id = string
74-
cluster_name = string
74+
cluster_name = optional(string)
7575
gi_version = string
7676
hostname_prefix = string
77+
7778
cpu_core_count = number
7879
memory_size_gb = number
7980
data_storage_size_tb = number
8081
db_node_storage_size_gb = number
82+
8183
node_count = optional(number)
8284
ocpu_count = optional(number)
8385
disk_redundancy = optional(string)
8486
ssh_public_keys = list(string)
8587

86-
8788
# OPTIONAL
8889
license_type = string
8990
time_zone = string

0 commit comments

Comments
 (0)