Skip to content

Commit 921237e

Browse files
aavadhanMaxrovr
authored andcommitted
Added - Support for E6 - Standard x86 shape for BaseDB on DRCC Butterfly | BaseDB
1 parent a4b396b commit 921237e

29 files changed

+1254
-7
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# $Header$
2+
#
3+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
4+
# NAME
5+
# datasources.tf - Shepherd Data Source file
6+
#
7+
# USAGE
8+
#
9+
# NOTES
10+
# Terraform Example: TestDatabaseDataGuardAssociationResourceVmStdx86_basic
11+
# FILES
12+
#
13+
# DESCRIPTION
14+
#
15+
# MODIFIED MM/DD/YY
16+
# aavadhan 08/18/2025 - Created
17+
18+
19+
data "oci_core_services" "test_services" {
20+
filter {
21+
name = "name"
22+
regex = "true"
23+
values = [".*Oracle.*Services.*Network"]
24+
}
25+
}
26+
27+
data "oci_database_db_homes" "t" {
28+
compartment_id = var.compartment_id
29+
db_system_id = oci_database_db_system.test_db_system.id
30+
}
31+
32+
data "oci_database_databases" "db" {
33+
compartment_id = var.compartment_id
34+
db_home_id = data.oci_database_db_homes.t.db_homes.0.db_home_id
35+
}
36+
37+
data "oci_identity_availability_domains" "test_availability_domains" {
38+
compartment_id = var.tenancy_ocid
39+
}
40+
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# $Header$
2+
#
3+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
4+
# NAME
5+
# main.tf - Shepherd Main file
6+
#
7+
# USAGE
8+
# Use the following path for Example Test & Backward-Compatibility-Test: database/dataguard/vm_shape/vm_std_x86
9+
# NOTES
10+
# Terraform Example: TestDatabaseDataGuardAssociationResourceVmStdx86_basic
11+
# FILES
12+
#
13+
# DESCRIPTION
14+
#
15+
# MODIFIED MM/DD/YY
16+
# aavadhan 08/18/2025 - Created
17+
18+
19+
resource "oci_database_db_system" "test_db_system" {
20+
availability_domain = data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name
21+
compartment_id = var.compartment_id
22+
compute_model = "ECPU"
23+
compute_count = "4"
24+
data_storage_size_in_gb = "256"
25+
database_edition = "ENTERPRISE_EDITION"
26+
db_home {
27+
database {
28+
admin_password = "BEstrO0ng_#11"
29+
db_name = "tfDbName"
30+
}
31+
db_version = "19.0.0.0"
32+
display_name = "TFTestDbHome1"
33+
}
34+
db_system_options {
35+
storage_management = "LVM"
36+
}
37+
disk_redundancy = "NORMAL"
38+
display_name = "tfExampleDbSystemDataguardAssociationPrimary"
39+
domain = oci_core_subnet.test_subnet.subnet_domain_name
40+
hostname = "myOracleDB"
41+
license_model = "LICENSE_INCLUDED"
42+
node_count = "1"
43+
shape = "VM.Standard.x86"
44+
ssh_public_keys = [var.ssh_public_key]
45+
subnet_id = oci_core_subnet.test_subnet.id
46+
}
47+
48+
resource "oci_database_data_guard_association" "test_data_guard_association" {
49+
availability_domain = data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name
50+
backup_network_nsg_ids = [oci_core_network_security_group.test_network_security_group.id]
51+
compute_model = "ECPU"
52+
compute_count = "4"
53+
creation_type = "NewDbSystem"
54+
data_collection_options {
55+
is_diagnostics_events_enabled = "false"
56+
is_health_monitoring_enabled = "false"
57+
is_incident_logs_enabled = "false"
58+
}
59+
database_admin_password = "BEstrO0ng_#11"
60+
database_defined_tags = map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "databaseDefinedTags1")
61+
database_freeform_tags = {
62+
"databaseFreeformTagsK" = "databaseFreeformTagsV"
63+
}
64+
database_id = data.oci_database_databases.db.databases.0.id
65+
db_system_defined_tags = map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "dbSystemDefinedTags1")
66+
db_system_freeform_tags = {
67+
"dbSystemFreeformTagsK" = "dbSystemFreeformTagsV"
68+
}
69+
db_system_security_attributes = {
70+
"oracle-zpr.maxegresscount.mode" = "enforce"
71+
"oracle-zpr.maxegresscount.value" = "42"
72+
}
73+
delete_standby_db_home_on_delete = "true"
74+
depends_on = [oci_database_db_system.test_db_system]
75+
display_name = "tfExampleDbSystemDataguardAssociationStandby"
76+
domain = "tftestsubnet.dnslabel.oraclevcn.com"
77+
fault_domains = ["FAULT-DOMAIN-3"]
78+
hostname = "hostname"
79+
is_active_data_guard_enabled = "false"
80+
license_model = "BRING_YOUR_OWN_LICENSE"
81+
node_count = "1"
82+
nsg_ids = [oci_core_network_security_group.test_network_security_group.id]
83+
private_ip = "10.0.2.223"
84+
protection_mode = "MAXIMUM_PERFORMANCE"
85+
shape = "VM.Standard.x86"
86+
storage_volume_performance_mode = "BALANCED"
87+
subnet_id = oci_core_subnet.test_subnet.id
88+
time_zone = "US/Pacific"
89+
transport_type = "ASYNC"
90+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# $Header$
2+
#
3+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
4+
# NAME
5+
# variables.tf - Shepherd Data Source file
6+
#
7+
# USAGE
8+
#
9+
# NOTES
10+
# Terraform Example: TestDatabaseDataGuardAssociationResourceVmStdx86_basic
11+
# FILES
12+
#
13+
# DESCRIPTION
14+
#
15+
# MODIFIED MM/DD/YY
16+
# aavadhan 08/18/2025 - Created
17+
18+
resource "oci_core_vcn" "test_vcn" {
19+
cidr_block = "10.0.0.0/16"
20+
compartment_id = var.compartment_id
21+
display_name = "displayName"
22+
dns_label = "dnslabel"
23+
}
24+
25+
resource "oci_core_network_security_group" "test_network_security_group" {
26+
compartment_id = var.compartment_id
27+
display_name = "displayName2"
28+
freeform_tags = {
29+
"Department" = "Accounting"
30+
}
31+
32+
vcn_id = oci_core_vcn.test_vcn.id
33+
}
34+
35+
resource "oci_core_service_gateway" "test_service_gateway" {
36+
compartment_id = var.compartment_id
37+
display_name = "test_service_gateway"
38+
services {
39+
service_id = data.oci_core_services.test_services.services.0.id
40+
}
41+
vcn_id = oci_core_vcn.test_vcn.id
42+
}
43+
44+
resource "oci_core_default_route_table" "test_vcn_default_route_table" {
45+
manage_default_resource_id = oci_core_vcn.test_vcn.default_route_table_id
46+
route_rules {
47+
description = "Internal traffic for OCI Services"
48+
destination = data.oci_core_services.test_services.services[0].cidr_block
49+
destination_type = "SERVICE_CIDR_BLOCK"
50+
network_entity_id = oci_core_service_gateway.test_service_gateway.id
51+
}
52+
}
53+
54+
resource "oci_core_route_table" "test_route_table" {
55+
compartment_id = var.compartment_id
56+
display_name = "test_subnet_rt"
57+
route_rules {
58+
description = "Internal traffic for OCI Services"
59+
destination = data.oci_core_services.test_services.services[0].cidr_block
60+
destination_type = "SERVICE_CIDR_BLOCK"
61+
network_entity_id = oci_core_service_gateway.test_service_gateway.id
62+
}
63+
vcn_id = oci_core_vcn.test_vcn.id
64+
}
65+
66+
resource "oci_core_security_list" "test_security_list" {
67+
compartment_id = var.compartment_id
68+
display_name = "test_security_list"
69+
egress_security_rules {
70+
destination = "0.0.0.0/0"
71+
protocol = "6"
72+
}
73+
ingress_security_rules {
74+
protocol = "6"
75+
source = "0.0.0.0/0"
76+
}
77+
vcn_id = oci_core_vcn.test_vcn.id
78+
}
79+
80+
resource "oci_core_subnet" "test_subnet" {
81+
cidr_block = "10.0.2.0/24"
82+
compartment_id = var.compartment_id
83+
dhcp_options_id = oci_core_vcn.test_vcn.default_dhcp_options_id
84+
display_name = "test_subnet"
85+
dns_label = "tftestsubnet"
86+
prohibit_public_ip_on_vnic = "true"
87+
route_table_id = oci_core_route_table.test_route_table.id
88+
security_list_ids = [oci_core_security_list.test_security_list.id]
89+
vcn_id = oci_core_vcn.test_vcn.id
90+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# $Header$
2+
#
3+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
4+
# NAME
5+
# provider.tf - Shepherd Data Source file
6+
#
7+
# USAGE
8+
#
9+
# NOTES
10+
# Terraform Example: TestDatabaseDataGuardAssociationResourceVmStdx86_basic
11+
# FILES
12+
#
13+
# DESCRIPTION
14+
#
15+
# MODIFIED MM/DD/YY
16+
# aavadhan 08/18/2025 - Created
17+
18+
19+
20+
provider "oci" {
21+
auth = "SecurityToken"
22+
config_file_profile = "terraform-federation-test"
23+
region = var.region
24+
tenancy_ocid = var.compartment_id
25+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# $Header$
2+
#
3+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
4+
# NAME
5+
# variables.tf - Shepherd Data Source file
6+
#
7+
# USAGE
8+
#
9+
# NOTES
10+
# Terraform Example: TestDatabaseDataGuardAssociationResourceVmStdx86_basic
11+
# FILES
12+
#
13+
# DESCRIPTION
14+
#
15+
# MODIFIED MM/DD/YY
16+
# aavadhan 08/18/2025 - Created
17+
18+
19+
resource "oci_identity_tag_namespace" "tag-namespace1" {
20+
#Required
21+
compartment_id = var.tenancy_ocid
22+
description = "example tag namespace"
23+
name = var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"
24+
25+
is_retired = false
26+
}
27+
28+
resource "oci_identity_tag" "tag1" {
29+
#Required
30+
description = "example tag"
31+
name = "example-tag"
32+
tag_namespace_id = oci_identity_tag_namespace.tag-namespace1.id
33+
34+
is_retired = false
35+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# $Header$
2+
#
3+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
4+
# NAME
5+
# variables.tf - Shepherd Data Source file
6+
#
7+
# USAGE
8+
#
9+
# NOTES
10+
# Terraform Example: TestDatabaseDataGuardAssociationResourceVmStdx86_basic
11+
# FILES
12+
#
13+
# DESCRIPTION
14+
#
15+
# MODIFIED MM/DD/YY
16+
# aavadhan 08/18/2025 - Created
17+
18+
19+
variable "tenancy_ocid" {
20+
}
21+
22+
variable "region" {
23+
}
24+
25+
variable defined_tag_namespace_name {
26+
default = ""
27+
}
28+
29+
variable "ssh_public_key" {
30+
type = string
31+
}
32+
33+
variable "compartment_id" {
34+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# $Header$
2+
#
3+
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
4+
#
5+
# NAME
6+
# main.tf
7+
#
8+
# USAGE
9+
# Use the following path for the Example & Backward Compatibility tests: database/db_systems/db_vm/db_vm_std_x86
10+
# NOTES
11+
# Terraform Integration Test: TestResourceDatabaseDBSystemVMStdx86
12+
#
13+
# FILE(S)
14+
# database_db_system_resource_vm_std_x86_test.go
15+
#
16+
# MODIFIED MM/DD/YY
17+
# aavadhan 08/18/2025 - Created
18+
19+
data "oci_identity_availability_domain" "ad" {
20+
compartment_id = var.tenancy_ocid
21+
ad_number = 1
22+
}
23+
24+
# Get DB node list
25+
data "oci_database_db_nodes" "db_nodes" {
26+
compartment_id = var.compartment_ocid
27+
db_system_id = oci_database_db_system.test_db_system.id
28+
}
29+
30+
# Get DB node details
31+
data "oci_database_db_node" "db_node_details" {
32+
db_node_id = data.oci_database_db_nodes.db_nodes.db_nodes[0]["id"]
33+
}
34+
35+
36+
data "oci_database_db_homes" "db_homes" {
37+
compartment_id = var.compartment_ocid
38+
db_system_id = oci_database_db_system.test_db_system.id
39+
}
40+
41+
data "oci_database_databases" "databases" {
42+
compartment_id = var.compartment_ocid
43+
db_home_id = data.oci_database_db_homes.db_homes.db_homes[0].db_home_id
44+
}
45+
46+
data "oci_database_db_versions" "test_db_versions_by_db_system_id" {
47+
compartment_id = var.compartment_ocid
48+
db_system_id = oci_database_db_system.test_db_system.id
49+
}
50+
51+
52+
data "oci_database_db_system_shapes" "test_db_system_shapes" {
53+
availability_domain = data.oci_identity_availability_domain.ad.name
54+
compartment_id = var.compartment_ocid
55+
56+
filter {
57+
name = "shape"
58+
values = [var.db_system_shape]
59+
}
60+
}
61+
62+
data "oci_database_db_systems" "db_systems" {
63+
compartment_id = var.compartment_ocid
64+
65+
filter {
66+
name = "id"
67+
values = [oci_database_db_system.test_db_system.id]
68+
}
69+
}
70+
71+

0 commit comments

Comments
 (0)