Skip to content

Commit f638d40

Browse files
committed
Support for updating shape attribute in oci_database_db_system resource
1 parent 8b9173d commit f638d40

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
## 3.65.0 (Unreleased)
2+
3+
### Added
4+
- Support for updating `shape` attribute in `oci_database_db_system` resource
5+
26
## 3.64.0 (February 26, 2020)
37

48
### Added

oci/database_db_system_resource.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ func DatabaseDbSystemResource() *schema.Resource {
291291
"shape": {
292292
Type: schema.TypeString,
293293
Required: true,
294-
ForceNew: true,
295294
},
296295
"ssh_public_keys": {
297296
Type: schema.TypeSet,
@@ -859,6 +858,11 @@ func (s *DatabaseDbSystemResourceCrud) Update() error {
859858
}
860859
}
861860

861+
if shape, ok := s.D.GetOkExists("shape"); ok && s.D.HasChange("shape") {
862+
tmp := shape.(string)
863+
request.Shape = &tmp
864+
}
865+
862866
if sshPublicKeys, ok := s.D.GetOkExists("ssh_public_keys"); ok {
863867
set := sshPublicKeys.(*schema.Set)
864868
interfaces := set.List()

oci/database_db_system_resource_allvm_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,7 @@ func TestResourceDatabaseDBSystemAllVM(t *testing.T) {
433433
//backup_subnet_id = "${oci_core_subnet.t2.id}" // this requires a specific shape
434434
database_edition = "ENTERPRISE_EDITION"
435435
disk_redundancy = "NORMAL"
436-
cpu_core_count = "1"
437-
shape = "VM.Standard2.1"
436+
shape = "VM.Standard2.2"
438437
ssh_public_keys = ["ssh-rsa KKKLK3NzaC1yc2EAAAADAQABAAABAQC+UC9MFNA55NIVtKPIBCNw7++ACXhD0hx+Zyj25JfHykjz/QU3Q5FAU3DxDbVXyubgXfb/GJnrKRY8O4QDdvnZZRvQFFEOaApThAmCAM5MuFUIHdFvlqP+0W+ZQnmtDhwVe2NCfcmOrMuaPEgOKO3DOW6I/qOOdO691Xe2S9NgT9HhN0ZfFtEODVgvYulgXuCCXsJs+NUqcHAOxxFUmwkbPvYi0P0e2DT8JKeiOOC8VKUEgvVx+GKmqasm+Y6zHFW7vv3g2GstE1aRs3mttHRoC/JPM86PRyIxeWXEMzyG5wHqUu4XZpDbnWNxi6ugxnAGiL3CrIFdCgRNgHz5qS1l MustWin"]
439438
display_name = "{{.token}}"
440439
domain = "${oci_core_subnet.t.dns_label}.${oci_core_virtual_network.t.dns_label}.oraclevcn.com"
@@ -517,7 +516,7 @@ func TestResourceDatabaseDBSystemAllVM(t *testing.T) {
517516
resource.TestCheckResourceAttrSet(ResourceDatabaseResourceName, "time_created"),
518517
resource.TestCheckResourceAttr(ResourceDatabaseResourceName, "database_edition", "ENTERPRISE_EDITION"),
519518
resource.TestCheckResourceAttr(ResourceDatabaseResourceName, "disk_redundancy", "NORMAL"),
520-
resource.TestCheckResourceAttr(ResourceDatabaseResourceName, "shape", "VM.Standard2.1"),
519+
resource.TestCheckResourceAttr(ResourceDatabaseResourceName, "shape", "VM.Standard2.2"),
521520
resource.TestCheckResourceAttrSet(ResourceDatabaseResourceName, "cpu_core_count"),
522521
resource.TestCheckResourceAttr(ResourceDatabaseResourceName, "display_name", ResourceDatabaseToken),
523522
resource.TestCheckResourceAttr(ResourceDatabaseResourceName, "domain", "tfsubnet.tfvcn.oraclevcn.com"),

oci/oci_dependency_graph.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ func initDependencyGraph() {
103103
DependencyGraph["streamPool"] = append(DependencyGraph["streamPool"], "StreamingStream")
104104
DependencyGraph["subnet"] = append(DependencyGraph["subnet"], "ApigatewayGateway")
105105
DependencyGraph["subnet"] = append(DependencyGraph["subnet"], "CoreInstance")
106+
DependencyGraph["subnet"] = append(DependencyGraph["subnet"], "DatabaseAutonomousDatabase")
106107
DependencyGraph["subnet"] = append(DependencyGraph["subnet"], "DatabaseAutonomousExadataInfrastructure")
107108
DependencyGraph["subnet"] = append(DependencyGraph["subnet"], "FileStorageMountTarget")
108109
DependencyGraph["tableNameOr"] = append(DependencyGraph["tableNameOr"], "NosqlIndex")

website/docs/r/database_db_system.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ The following arguments are supported:
166166
* `license_model` - (Optional) The Oracle license model that applies to all the databases on the DB system. The default is LICENSE_INCLUDED.
167167
* `node_count` - (Optional) The number of nodes to launch for a 2-node RAC virtual machine DB system.
168168
* `nsg_ids` - (Optional) (Updatable) A list of the [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the network security groups (NSGs) that this DB system belongs to. Setting this to an empty array after the list is created removes the resource from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm).
169-
* `shape` - (Required) The shape of the DB system. The shape determines resources allocated to the DB system.
169+
* `shape` - (Required) (Updatable) The shape of the DB system. The shape determines resources allocated to the DB system.
170170
* For virtual machine shapes, the number of CPU cores and memory
171171
* For bare metal and Exadata shapes, the number of CPU cores, memory, and storage
172172

0 commit comments

Comments
 (0)