Skip to content

Commit 129ca84

Browse files
authored
Merge pull request #999 from terraform-providers/release_gh
Release gh
2 parents 41440f6 + f8a6109 commit 129ca84

File tree

81 files changed

+1918
-176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1918
-176
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 3.67.0 (Unreleased)
2+
3+
### Added
4+
- Support for Handling the VM (hypervisor) reboots info shared with the customer
5+
- Support for VM 20c Preview in DBAAS
6+
- Support for console connection for db nodes in BM and VM db systems
7+
8+
### Fixed
9+
- Fixed load balancer listener to write default hostnames in state [Github issue #975](https://github.com/terraform-providers/terraform-provider-oci/issues/975)
10+
111
## 3.66.0 (March 11, 2020)
212

313
### Added

examples/database/db_systems/datasources.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,12 @@ data "oci_database_db_system_shapes" "test_db_system_shapes" {
8080
values = ["${var.db_system_shape}"]
8181
}
8282
}
83+
84+
data "oci_database_db_node_console_connections" "test_db_node_console_connections" {
85+
db_node_id = "${lookup(data.oci_database_db_nodes.db_nodes.db_nodes[0], "id")}"
86+
}
87+
88+
data "oci_database_db_node_console_connection" "test_db_node_console_connection" {
89+
db_node_id = "${lookup(data.oci_database_db_nodes.db_nodes.db_nodes[0], "id")}"
90+
id = "${oci_database_db_node_console_connection.test_db_node_console_connection.id}"
91+
}

examples/database/db_systems/resources.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ resource "oci_database_db_system" "test_db_system" {
66
cpu_core_count = "${lookup(data.oci_database_db_system_shapes.test_db_system_shapes.db_system_shapes[0], "minimum_core_count")}"
77
database_edition = "${var.db_edition}"
88

9+
db_system_options {
10+
storage_management = "LVM"
11+
}
12+
913
db_home {
1014
database {
1115
admin_password = "${var.db_admin_password}"
@@ -80,3 +84,9 @@ resource "oci_database_backup" "test_backup" {
8084
database_id = "${oci_database_db_system.test_db_system.db_home.0.database.0.id}"
8185
display_name = "FirstBackup"
8286
}
87+
88+
resource "oci_database_db_node_console_connection" "test_db_node_console_connection" {
89+
#Required
90+
db_node_id = "${lookup(data.oci_database_db_nodes.db_nodes.db_nodes[0], "id")}"
91+
public_key = "ssh-rsa KKKLK3NzaC1yc2EAAAADAQABAAABAQC+UC9MFNA55NIVtKPIBCNw7++ACXhD0hx+Zyj25JfHykjz/QU3Q5FAU3DxDbVXyubgXfb/GJnrKRY8O4QDdvnZZRvQFFEOaApThAmCAM5MuFUIHdFvlqP+0W+ZQnmtDhwVe2NCfcmOrMuaPEgOKO3DOW6I/qOOdO691Xe2S9NgT9HhN0ZfFtEODVgvYulgXuCCXsJs+NUqcHAOxxFUmwkbPvYi0P0e2DT8JKeiOOC8VKUEgvVx+GKmqasm+Y6zHFW7vv3g2GstE1aRs3mttHRoC/JPM86PRyIxeWXEMzyG5wHqUu4XZpDbnWNxi6ugxnAGiL3CrIFdCgRNgHz5qS1l sample"
92+
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce
77
github.com/hashicorp/terraform v0.12.4-0.20190628193153-a74738cd35fc
88
github.com/mitchellh/cli v1.0.0
9-
github.com/oracle/oci-go-sdk v16.0.0+incompatible
9+
github.com/oracle/oci-go-sdk v17.0.0+incompatible
1010
github.com/stretchr/objx v0.1.1 // indirect
1111
github.com/stretchr/testify v1.3.0
1212
gopkg.in/yaml.v2 v2.2.2

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ github.com/oracle/oci-go-sdk v15.8.0+incompatible h1:SEJ4DBi6DUtCZH26hGtDhQiU3If
360360
github.com/oracle/oci-go-sdk v15.8.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
361361
github.com/oracle/oci-go-sdk v16.0.0+incompatible h1:4BbhAM6wz7u9vtYrBMCPeQ2oRV9oaaqsHenErPvpQs4=
362362
github.com/oracle/oci-go-sdk v16.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
363+
github.com/oracle/oci-go-sdk v17.0.0+incompatible h1:VueI9WISwu2+GwYd2WzuFO+M7ufSnpA707MooU+8xNs=
364+
github.com/oracle/oci-go-sdk v17.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
363365
github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58 h1:m3CEgv3ah1Rhy82L+c0QG/U3VyY1UsvsIdkh0/rU97Y=
364366
github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk=
365367
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs=

oci/database_autonomous_database_resource_test.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ var (
6666
"is_preview_version_with_service_terms_accepted": Representation{repType: Optional, create: `false`},
6767
"license_model": Representation{repType: Optional, create: `LICENSE_INCLUDED`},
6868
"data_safe_status": Representation{repType: Optional, create: `REGISTERED`, update: `not_REGISTERED`},
69-
"timeouts": RepresentationGroup{Required, autonomousDatabaseDtaSafeStatusTimeoutsRepresentation},
70-
}
71-
72-
autonomousDatabaseDtaSafeStatusTimeoutsRepresentation = map[string]interface{}{
73-
"delete": Representation{repType: Required, create: `10m`},
69+
"timeouts": RepresentationGroup{Required, autonomousDatabaseTimeoutsRepresentation},
7470
}
7571

7672
autonomousDatabaseRepresentationForSourceFromBackupId = representationCopyWithNewProperties(
@@ -99,15 +95,8 @@ var (
9995
"nsg_ids": Representation{repType: Optional, create: []string{`${oci_core_network_security_group.test_network_security_group.id}`}, update: []string{`${oci_core_network_security_group.test_network_security_group.id}`, `${oci_core_network_security_group.test_network_security_group2.id}`}},
10096
"private_endpoint_label": Representation{repType: Optional, create: `xlx4fcli`},
10197
"subnet_id": Representation{repType: Optional, create: `${oci_core_subnet.test_subnet.id}`},
102-
"timeouts": RepresentationGroup{Required, autonomousDatabasePrivateEndpointTimeoutsRepresentation},
10398
}), []string{"whitelisted_ips"})
10499

105-
autonomousDatabasePrivateEndpointTimeoutsRepresentation = map[string]interface{}{
106-
"create": Representation{repType: Required, create: `10m`},
107-
"update": Representation{repType: Required, create: `10m`},
108-
"delete": Representation{repType: Required, create: `10m`},
109-
}
110-
111100
AutonomousDatabasePrivateEndpointResourceDependencies = generateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", Required, Create, subnetRepresentation) +
112101
generateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", Required, Create, vcnRepresentation) +
113102
generateResourceFromRepresentationMap("oci_core_network_security_group", "test_network_security_group", Required, Create, networkSecurityGroupRepresentation) +

oci/database_autonomous_database_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ var (
6060
"is_preview_version_with_service_terms_accepted": Representation{repType: Optional, create: `false`},
6161
"license_model": Representation{repType: Optional, create: `LICENSE_INCLUDED`},
6262
"whitelisted_ips": Representation{repType: Optional, create: []string{`1.1.1.1/28`}},
63+
"timeouts": RepresentationGroup{Required, autonomousDatabaseTimeoutsRepresentation},
6364
}
6465

66+
autonomousDatabaseTimeoutsRepresentation = map[string]interface{}{
67+
"create": Representation{repType: Required, create: `20m`},
68+
"update": Representation{repType: Required, create: `20m`},
69+
"delete": Representation{repType: Required, create: `20m`},
70+
}
6571
autonomousDatabaseCopyWithUpdatedIPsRepresentation = getUpdatedRepresentationCopy("whitelisted_ips", Representation{repType: Optional, create: []string{"1.1.1.1/28", "1.1.1.29"}, update: []string{}}, autonomousDatabaseRepresentation)
6672

6773
autonomousDatabaseRepresentationForClone = representationCopyWithNewProperties(
@@ -376,7 +382,7 @@ func TestDatabaseAutonomousDatabaseResource_basic(t *testing.T) {
376382

377383
resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId),
378384
resource.TestCheckResourceAttr(singularDatasourceName, "connection_strings.#", "1"),
379-
resource.TestCheckResourceAttr(singularDatasourceName, "connection_strings.0.all_connection_strings.%", "5"),
385+
resource.TestCheckResourceAttr(singularDatasourceName, "connection_strings.0.all_connection_strings.%", "4"),
380386

381387
resource.TestCheckResourceAttr(singularDatasourceName, "connection_urls.#", "1"),
382388
resource.TestCheckResourceAttrSet(singularDatasourceName, "connection_urls.0.apex_url"),
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
3+
package oci
4+
5+
import (
6+
"context"
7+
"log"
8+
9+
"github.com/hashicorp/terraform/helper/schema"
10+
oci_database "github.com/oracle/oci-go-sdk/database"
11+
)
12+
13+
func DatabaseDbNodeConsoleConnectionDataSource() *schema.Resource {
14+
fieldMap := make(map[string]*schema.Schema)
15+
fieldMap["db_node_id"] = &schema.Schema{
16+
Type: schema.TypeString,
17+
Required: true,
18+
}
19+
fieldMap["id"] = &schema.Schema{
20+
Type: schema.TypeString,
21+
Required: true,
22+
}
23+
return GetSingularDataSourceItemSchema(DatabaseDbNodeConsoleConnectionResource(), fieldMap, readSingularDatabaseDbNodeConsoleConnection)
24+
}
25+
26+
func readSingularDatabaseDbNodeConsoleConnection(d *schema.ResourceData, m interface{}) error {
27+
sync := &DatabaseDbNodeConsoleConnectionDataSourceCrud{}
28+
sync.D = d
29+
sync.Client = m.(*OracleClients).databaseClient
30+
31+
return ReadResource(sync)
32+
}
33+
34+
type DatabaseDbNodeConsoleConnectionDataSourceCrud struct {
35+
D *schema.ResourceData
36+
Client *oci_database.DatabaseClient
37+
Res *oci_database.GetConsoleConnectionResponse
38+
}
39+
40+
func (s *DatabaseDbNodeConsoleConnectionDataSourceCrud) VoidState() {
41+
s.D.SetId("")
42+
}
43+
44+
func (s *DatabaseDbNodeConsoleConnectionDataSourceCrud) Get() error {
45+
request := oci_database.GetConsoleConnectionRequest{}
46+
47+
if dbNodeId, ok := s.D.GetOkExists("db_node_id"); ok {
48+
tmp := dbNodeId.(string)
49+
request.DbNodeId = &tmp
50+
}
51+
52+
if id, ok := s.D.GetOkExists("id"); ok {
53+
tmp := id.(string)
54+
request.ConsoleConnectionId = &tmp
55+
}
56+
57+
dbNodeId, id, error := parseDbNodeConsoleConnectionCompositeId(s.D.Id())
58+
if error == nil {
59+
request.DbNodeId = &dbNodeId
60+
request.ConsoleConnectionId = &id
61+
} else {
62+
log.Printf("[WARN] Get() unable to parse current ID: %s", s.D.Id())
63+
}
64+
65+
request.RequestMetadata.RetryPolicy = getRetryPolicy(false, "database")
66+
67+
response, err := s.Client.GetConsoleConnection(context.Background(), request)
68+
if err != nil {
69+
return err
70+
}
71+
72+
s.Res = &response
73+
return nil
74+
}
75+
76+
func (s *DatabaseDbNodeConsoleConnectionDataSourceCrud) SetData() error {
77+
if s.Res == nil {
78+
return nil
79+
}
80+
81+
s.D.SetId(*s.Res.Id)
82+
83+
if s.Res.CompartmentId != nil {
84+
s.D.Set("compartment_id", *s.Res.CompartmentId)
85+
}
86+
87+
if s.Res.ConnectionString != nil {
88+
s.D.Set("connection_string", *s.Res.ConnectionString)
89+
}
90+
91+
if s.Res.Fingerprint != nil {
92+
s.D.Set("fingerprint", *s.Res.Fingerprint)
93+
}
94+
95+
s.D.Set("state", s.Res.LifecycleState)
96+
97+
return nil
98+
}

0 commit comments

Comments
 (0)