Skip to content

Commit aa0dba4

Browse files
cdomond-at-oraclevsin12
authored andcommitted
Added - Support for HeatWave MySQL Service: Extra Configuration Parameters, System Tags
1 parent caadd9e commit aa0dba4

28 files changed

+1532
-18
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
3+
variable "tenancy_ocid" {
4+
}
5+
6+
variable "user_ocid" {
7+
}
8+
9+
variable "fingerprint" {
10+
}
11+
12+
variable "private_key_path" {
13+
}
14+
15+
variable "region" {
16+
// Define the region where destination backup will be created.
17+
}
18+
19+
variable "compartment_ocid" {
20+
}
21+
22+
provider "oci" {
23+
tenancy_ocid = var.tenancy_ocid
24+
user_ocid = var.user_ocid
25+
fingerprint = var.fingerprint
26+
private_key_path = var.private_key_path
27+
region = var.region
28+
}
29+
30+
resource "oci_mysql_mysql_configuration" "test_mysql_configuration" {
31+
#Required
32+
compartment_id = var.compartment_ocid
33+
shape_name = "MySQL.VM.Standard.E3.1.8GB"
34+
35+
#Optional
36+
description = "test configuration created by terraform"
37+
display_name = "terraform test configuration"
38+
parent_configuration_id = data.oci_mysql_mysql_configurations.test_mysql_configurations.configurations[0].id
39+
variables {
40+
#Optional
41+
block_encryption_mode = "aes-128-ecb"
42+
binlog_group_commit_sync_delay = 10
43+
binlog_group_commit_sync_no_delay_count = 10
44+
replica_net_timeout = 60
45+
require_secure_transport = false
46+
local_infile = true
47+
thread_pool_query_threads_per_group = 10
48+
thread_pool_transaction_delay = 10
49+
innodb_redo_log_capacity = 104857600
50+
explain_format = "TRADITIONAL"
51+
explicit_defaults_for_timestamp = true
52+
sql_generate_invisible_primary_key = false
53+
temptable_max_ram = 1073741824
54+
innodb_change_buffering = "NONE"
55+
innodb_adaptive_hash_index = true
56+
innodb_undo_log_truncate = true
57+
table_definition_cache = 400
58+
table_open_cache = 4000
59+
relay_log_space_limit = 10
60+
optimizer_switch = "batched_key_access=off"
61+
replica_type_conversions = "ALL_LOSSY"
62+
replica_parallel_workers = 10
63+
auto_increment_increment = 10
64+
auto_increment_offset = 10
65+
skip_name_resolve = false
66+
max_user_connections = 10
67+
join_buffer_size = 262144
68+
max_seeks_for_key = 10
69+
range_optimizer_max_mem_size = 8388608
70+
innodb_autoinc_lock_mode = 2
71+
innodb_rollback_on_timeout = false
72+
innodb_online_alter_log_max_size = 134217728
73+
innodb_sort_buffer_size = 1048576
74+
thread_pool_size = 16
75+
innodb_numa_interleave = false
76+
long_query_time = 10
77+
}
78+
}
79+
80+
data "oci_mysql_mysql_configurations" "test_mysql_configurations" {
81+
compartment_id = var.compartment_ocid
82+
83+
#Optional
84+
state = "ACTIVE"
85+
shape_name = "MySQL.VM.Standard.E3.1.8GB"
86+
}
87+
88+
data "oci_identity_availability_domains" "test_availability_domains" {
89+
compartment_id = var.tenancy_ocid
90+
}

internal/integrationtest/mysql_channel_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ func TestMysqlChannelResource_basic(t *testing.T) {
261261
resource.TestCheckResourceAttrSet(datasourceName, "db_system_id"),
262262
resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"),
263263
resource.TestCheckResourceAttr(datasourceName, "is_enabled", "false"),
264-
265264
resource.TestCheckResourceAttr(datasourceName, "channels.#", "1"),
266265
resource.TestCheckResourceAttr(datasourceName, "channels.0.compartment_id", compartmentId),
267266
resource.TestCheckResourceAttr(datasourceName, "channels.0.display_name", "displayName2"),
@@ -300,7 +299,6 @@ func TestMysqlChannelResource_basic(t *testing.T) {
300299
compartmentIdVariableStr + ChannelUpdateResource,
301300
Check: acctest.ComposeAggregateTestCheckFuncWrapper(
302301
resource.TestCheckResourceAttrSet(singularDatasourceName, "channel_id"),
303-
304302
resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId),
305303
resource.TestCheckResourceAttr(singularDatasourceName, "description", "description2"),
306304
resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"),

internal/integrationtest/mysql_mysql_configuration_test.go

Lines changed: 160 additions & 5 deletions
Large diffs are not rendered by default.

internal/integrationtest/mysql_mysql_db_system_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ func TestMysqlMysqlDbSystemResource_basic(t *testing.T) {
320320
resource.TestCheckResourceAttr(datasourceName, "is_heat_wave_cluster_attached", "false"),
321321
resource.TestCheckResourceAttr(datasourceName, "is_up_to_date", "false"),
322322
resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"),
323-
324323
resource.TestCheckResourceAttr(datasourceName, "db_systems.#", "1"),
325324
resource.TestCheckResourceAttr(datasourceName, "db_systems.0.access_mode", "UNRESTRICTED"),
326325
resource.TestCheckResourceAttrSet(datasourceName, "db_systems.0.availability_domain"),
@@ -361,7 +360,6 @@ func TestMysqlMysqlDbSystemResource_basic(t *testing.T) {
361360
acctest.GenerateResourceFromRepresentationMap("oci_mysql_channel", "test_channel", acctest.Required, acctest.Create, MysqlChannelRepresentation),
362361
Check: acctest.ComposeAggregateTestCheckFuncWrapper(
363362
resource.TestCheckResourceAttrSet(singularDatasourceName, "db_system_id"),
364-
365363
resource.TestCheckResourceAttr(singularDatasourceName, "access_mode", "UNRESTRICTED"),
366364
resource.TestCheckResourceAttrSet(singularDatasourceName, "availability_domain"),
367365
resource.TestCheckResourceAttr(singularDatasourceName, "backup_policy.#", "1"),

internal/service/mysql/mysql_channel_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ func (s *MysqlChannelDataSourceCrud) SetData() error {
104104

105105
s.D.Set("state", s.Res.LifecycleState)
106106

107+
if s.Res.SystemTags != nil {
108+
s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags))
109+
}
110+
107111
if s.Res.Target != nil {
108112
targetArray := []interface{}{}
109113
if targetMap := ChannelTargetToMap(&s.Res.Target); targetMap != nil {

internal/service/mysql/mysql_channel_resource.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ func MysqlChannelResource() *schema.Resource {
267267
Type: schema.TypeString,
268268
Computed: true,
269269
},
270+
"system_tags": {
271+
Type: schema.TypeMap,
272+
Computed: true,
273+
Elem: schema.TypeString,
274+
},
270275
"time_created": {
271276
Type: schema.TypeString,
272277
Computed: true,
@@ -568,6 +573,10 @@ func (s *MysqlChannelResourceCrud) SetData() error {
568573

569574
s.D.Set("state", s.Res.LifecycleState)
570575

576+
if s.Res.SystemTags != nil {
577+
s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags))
578+
}
579+
571580
if s.Res.Target != nil {
572581
targetArray := []interface{}{}
573582
if targetMap := ChannelTargetToMap(&s.Res.Target); targetMap != nil {

internal/service/mysql/mysql_channels_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ func (s *MysqlChannelsDataSourceCrud) SetData() error {
171171

172172
mysqlChannel["state"] = r.LifecycleState
173173

174+
if r.SystemTags != nil {
175+
mysqlChannel["system_tags"] = tfresource.SystemTagsToMap(r.SystemTags)
176+
}
177+
174178
if r.Target != nil {
175179
targetArray := []interface{}{}
176180
if targetMap := ChannelTargetToMap(&r.Target); targetMap != nil {

internal/service/mysql/mysql_mysql_backup_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ func (s *MysqlMysqlBackupDataSourceCrud) SetData() error {
132132

133133
s.D.Set("state", s.Res.LifecycleState)
134134

135+
if s.Res.SystemTags != nil {
136+
s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags))
137+
}
138+
135139
if s.Res.TimeCopyCreated != nil {
136140
s.D.Set("time_copy_created", s.Res.TimeCopyCreated.String())
137141
}

internal/service/mysql/mysql_mysql_backup_resource.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,11 @@ func MysqlMysqlBackupResource() *schema.Resource {
501501
Type: schema.TypeString,
502502
Computed: true,
503503
},
504+
"system_tags": {
505+
Type: schema.TypeMap,
506+
Computed: true,
507+
Elem: schema.TypeString,
508+
},
504509
"time_copy_created": {
505510
Type: schema.TypeString,
506511
Computed: true,
@@ -877,6 +882,10 @@ func (s *MysqlMysqlBackupResourceCrud) SetData() error {
877882

878883
s.D.Set("state", s.Res.LifecycleState)
879884

885+
if s.Res.SystemTags != nil {
886+
s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags))
887+
}
888+
880889
if s.Res.TimeCopyCreated != nil {
881890
s.D.Set("time_copy_created", s.Res.TimeCopyCreated.String())
882891
}

internal/service/mysql/mysql_mysql_backups_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ func (s *MysqlMysqlBackupsDataSourceCrud) SetData() error {
198198

199199
mysqlBackup["state"] = r.LifecycleState
200200

201+
if r.SystemTags != nil {
202+
mysqlBackup["system_tags"] = tfresource.SystemTagsToMap(r.SystemTags)
203+
}
204+
201205
if r.TimeCopyCreated != nil {
202206
mysqlBackup["time_copy_created"] = r.TimeCopyCreated.String()
203207
}

0 commit comments

Comments
 (0)