Skip to content

Commit 8f7b4c0

Browse files
tonglinMaxrovr
authored andcommitted
Added - Support for ACD - OKV Endpoint group| ADB-D and ADB-C@C
1 parent c869187 commit 8f7b4c0

26 files changed

+318
-58
lines changed

examples/database/atp-d/data_sources.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,8 @@ data "oci_database_cloud_autonomous_vm_cluster_resource_usage" "test_cloud_auton
6161

6262
data "oci_database_autonomous_database_software_image" "test_autonomous_database_software_image" {
6363
autonomous_database_software_image_id = oci_database_autonomous_database_software_image.autonomous_database_software_image.id
64+
}
65+
66+
data "oci_database_cloud_autonomous_vm_clusters" "test_cloud_autonomous_vm_clusters" {
67+
compartment_id = var.compartment_ocid
6468
}

examples/database/atp-d/exadata.tf

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ resource "oci_core_vcn" "test_vcn" {
88
dns_label = "examplevcn"
99
}
1010

11-
data "oci_identity_availability_domain" "ad" {
12-
compartment_id = var.compartment_ocid
13-
ad_number = 1
14-
}
15-
1611
resource "oci_core_security_list" "exadata_shapes_security_list" {
1712
compartment_id = var.compartment_ocid
1813
vcn_id = oci_core_vcn.test_vcn.id
@@ -162,12 +157,4 @@ resource "oci_core_network_security_group" "test_network_security_group" {
162157
#Required
163158
compartment_id = var.compartment_ocid
164159
vcn_id = oci_core_vcn.test_vcn.id
165-
}
166-
167-
data "oci_database_cloud_autonomous_vm_cluster" "test_cloud_autonomous_vm_cluster" {
168-
cloud_autonomous_vm_cluster_id = oci_database_cloud_autonomous_vm_cluster.test_cloud_autonomous_vm_cluster.id
169-
}
170-
171-
data "oci_database_cloud_autonomous_vm_clusters" "test_cloud_autonomous_vm_clusters" {
172-
compartment_id = var.compartment_ocid
173160
}

examples/database/atp-d/main.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container
5555
rotate_key_trigger = "true"
5656
version_preference = "LATEST_RELEASE_UPDATE"
5757
is_dst_file_update_enabled = false
58+
59+
// OKV related
60+
key_store_id = oci_database_key_store.test_key_store.id
61+
okv_end_point_group_name = "DUMMY_OKV_EPG_GROUP"
5862
}
5963

6064
resource "oci_database_autonomous_database_software_image" "autonomous_database_software_image" {
@@ -226,3 +230,15 @@ resource "oci_database_autonomous_container_database_dataguard_association" "tes
226230
peer_autonomous_container_database_display_name = "StandbyACD"
227231
peer_autonomous_container_database_compartment_id = var.compartment_ocid
228232
}
233+
234+
resource "oci_database_key_store" "test_key_store" {
235+
compartment_id = var.compartment_ocid
236+
display_name = "example-key-store"
237+
type_details {
238+
admin_username = "example-username"
239+
connection_ips = ["192.1.1.1"]
240+
secret_id = var.okv_secret
241+
type = "ORACLE_KEY_VAULT"
242+
vault_id = var.kms_vault_ocid
243+
}
244+
}

examples/database/atp-d/variables.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,11 @@ variable "tenant_subscription_id" {
6565
default = null
6666
variable "cloud_exadata_infrastructure_un_allocated_resource_db_servers" {
6767
default = []
68-
}
68+
}
69+
// key Store related var
70+
variable "okv_secret" {
71+
}
72+
73+
// key Store related var
74+
variable "kms_vault_ocid" {
75+
}

examples/database/exadata_cc/adbd-dg-ms/main.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container
294294
autonomous_vm_cluster_id = oci_database_autonomous_vm_cluster.primary_autonomous_vm_cluster.id
295295
display_name = "PrimaryACD"
296296
patch_model = "RELEASE_UPDATES"
297-
db_version = "19.25.0.1.0"
297+
db_version = "19.26.0.1.0"
298298
db_name = "PRIMARY"
299299

300300
#Optional
@@ -355,8 +355,11 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container
355355

356356
resource "oci_database_autonomous_container_database_add_standby" "test_autonomous_container_database_add_standby" {
357357
autonomous_container_database_id = oci_database_autonomous_container_database.test_autonomous_container_database_primary.id
358-
fast_start_fail_over_lag_limit_in_seconds = "0"
359-
is_automatic_failover_enabled = "true"
358+
359+
# add standby blocked auto fail over
360+
# fast_start_fail_over_lag_limit_in_seconds = "0"
361+
# is_automatic_failover_enabled = "true"
362+
360363
peer_autonomous_container_database_backup_config {
361364
backup_destination_details {
362365
type = "LOCAL"

examples/database/exadata_cc/adbd/acd.tf

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resource "random_string" "db_unique_name" {
66

77
resource "oci_database_autonomous_container_database" "autonomous_container_database" {
88
autonomous_vm_cluster_id = oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id
9-
db_version = "19.25.0.1.0"
9+
db_version = "19.26.0.1.0"
1010
backup_config {
1111
backup_destination_details {
1212
type = "LOCAL"
@@ -26,6 +26,23 @@ resource "oci_database_autonomous_container_database" "autonomous_container_data
2626
service_level_agreement_type = "STANDARD"
2727
version_preference = "LATEST_RELEASE_UPDATE"
2828
is_dst_file_update_enabled = false
29+
30+
#Optional
31+
// OKV related
32+
key_store_id = oci_database_key_store.test_key_store.id
33+
okv_end_point_group_name = "DUMMY_OKV_EPG_GROUP"
34+
}
35+
36+
resource "oci_database_key_store" "test_key_store" {
37+
compartment_id = var.compartment_ocid
38+
display_name = "example-key-store"
39+
type_details {
40+
admin_username = "example-username"
41+
connection_ips = ["192.1.1.1"]
42+
secret_id = var.okv_secret
43+
type = "ORACLE_KEY_VAULT"
44+
vault_id = var.kms_vault_ocid
45+
}
2946
}
3047

3148
data "oci_database_autonomous_container_database_resource_usage" "test_autonomous_container_database_resource_usages" {

examples/database/exadata_cc/adbd/variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,12 @@ variable "ssh_public_key" {
2121

2222
variable "avm_certificate_id"{
2323

24+
}
25+
26+
// key Store related var
27+
variable "okv_secret" {
28+
}
29+
30+
// key Store related var
31+
variable "kms_vault_ocid" {
2432
}

internal/integrationtest/database_autonomous_container_database_resource_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ var (
4444

4545
ACDatabaseRepresentation = map[string]interface{}{
4646
"db_split_threshold": acctest.Representation{RepType: acctest.Optional, Create: `8`},
47+
"okv_end_point_group_name": acctest.Representation{RepType: acctest.Optional, Create: `DUMMY_OKV_EPG_GROUP`, Update: `DUMMY_OKV_EPG_GROUP_2`},
4748
"distribution_affinity": acctest.Representation{RepType: acctest.Optional, Create: `MINIMUM_DISTRIBUTION`},
4849
"net_services_architecture": acctest.Representation{RepType: acctest.Optional, Create: `DEDICATED`},
4950
"vm_failover_reservation": acctest.Representation{RepType: acctest.Optional, Create: `25`},
@@ -55,7 +56,7 @@ var (
5556
"key_store_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_key_store.test_key_store.id}`},
5657
"compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`},
5758
"db_unique_name": acctest.Representation{RepType: acctest.Optional, Create: acbDBName},
58-
"defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
59+
"defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`},
5960
"freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}},
6061
"maintenance_window_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseAutonomousContainerDatabaseMaintenanceWindowDetailsRepresentation},
6162
"service_level_agreement_type": acctest.Representation{RepType: acctest.Optional, Create: `STANDARD`},
@@ -76,7 +77,7 @@ var (
7677
"key_store_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_key_store.test_key_store.id}`},
7778
"compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`},
7879
"db_unique_name": acctest.Representation{RepType: acctest.Optional, Create: acbDBName},
79-
"defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
80+
"defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`},
8081
"freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}},
8182
"maintenance_window_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseAutonomousContainerDatabaseMaintenanceWindowDetailsRepresentation},
8283
"service_level_agreement_type": acctest.Representation{RepType: acctest.Optional, Create: `STANDARD`},
@@ -192,7 +193,7 @@ var (
192193
"compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`},
193194
"display_name": acctest.Representation{RepType: acctest.Required, Create: `Key Store1`},
194195
"type_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseKeyStoreTypeDetailsRepresentation},
195-
"defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
196+
"defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`},
196197
"freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}},
197198
"lifecycle": acctest.RepresentationGroup{RepType: acctest.Optional, Group: lifecycleGroupWithTagsIgnoreChanges},
198199
}
@@ -380,7 +381,7 @@ func TestDatabaseExaccAutonomousContainerDatabaseFromAdsi_basic(t *testing.T) {
380381

381382
// verify resource import
382383
{
383-
Config: config + ExaccACDRequiredOnlyResource,
384+
Config: config + compartmentIdVariableStr + ExaccACDRequiredOnlyResource,
384385
ImportState: true,
385386
ImportStateVerify: true,
386387
ImportStateVerifyIgnore: []string{
@@ -495,7 +496,7 @@ func TestDatabaseAutonomousContainerDatabaseFromAdsi_basic(t *testing.T) {
495496

496497
// verify resource import
497498
{
498-
Config: config + ACDRequiredOnlyResource,
499+
Config: config + compartmentIdVariableStr + ACDRequiredOnlyResource,
499500
ImportState: true,
500501
ImportStateVerify: true,
501502
ImportStateVerifyIgnore: []string{
@@ -763,6 +764,7 @@ func TestDatabaseExaccAutonomousContainerDatabase_basic(t *testing.T) {
763764
resource.TestCheckResourceAttr(resourceName, "distribution_affinity", "MINIMUM_DISTRIBUTION"),
764765
resource.TestCheckResourceAttr(resourceName, "display_name", "containerdatabases2"),
765766
resource.TestCheckResourceAttrSet(resourceName, "memory_per_oracle_compute_unit_in_gbs"),
767+
resource.TestCheckResourceAttr(resourceName, "okv_end_point_group_name", "DUMMY_OKV_EPG_GROUP"),
766768
resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"),
767769
resource.TestCheckResourceAttrSet(resourceName, "id"),
768770
resource.TestCheckResourceAttrSet(resourceName, "key_store_id"),
@@ -811,6 +813,7 @@ func TestDatabaseExaccAutonomousContainerDatabase_basic(t *testing.T) {
811813
resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.type", "NFS"),
812814
resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.vpc_user", "bkupUser1"),
813815
resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId),
816+
resource.TestCheckResourceAttr(resourceName, "okv_end_point_group_name", "DUMMY_OKV_EPG_GROUP_2"),
814817
resource.TestCheckResourceAttr(resourceName, "db_split_threshold", "8"),
815818
resource.TestCheckResourceAttr(resourceName, "db_unique_name", acbDBName),
816819
resource.TestCheckResourceAttr(resourceName, "distribution_affinity", "MINIMUM_DISTRIBUTION"),
@@ -941,7 +944,7 @@ func TestDatabaseExaccAutonomousContainerDatabase_basic(t *testing.T) {
941944
},
942945
// verify resource import
943946
{
944-
Config: config + DatabaseAutonomousContainerDatabaseRequiredOnlyResource,
947+
Config: config + compartmentIdVariableStr + DatabaseAutonomousContainerDatabaseRequiredOnlyResource,
945948
ImportState: true,
946949
ImportStateVerify: true,
947950
ImportStateVerifyIgnore: []string{

0 commit comments

Comments
 (0)