Skip to content

Commit 274a1df

Browse files
authored
Candidate for release_v3.49.0
Candidate for release_v3.49.0
2 parents 075608a + d00b17b commit 274a1df

File tree

62 files changed

+5149
-1337
lines changed

Some content is hidden

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

62 files changed

+5149
-1337
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
## 3.48.1 (Unreleased)
1+
## 3.49.0 (Unreleased)
2+
3+
### Added
4+
- Support for Oracle Content and Experience
5+
26
## 3.48.0 (October 16, 2019)
37

48
### Added

examples/compute/image/image.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,5 @@ data "oci_core_images" "supported_shape_images" {
128128
}
129129

130130
output "supported_shape_images" {
131-
value = "${data.oci_core_images.supported_shape_images}"
131+
value = "${data.oci_core_images.supported_shape_images.images}"
132132
}

examples/compute/instance/instance.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,23 @@ resource "oci_core_vcn" "test_vcn" {
252252
dns_label = "testvcn"
253253
}
254254

255+
resource "oci_core_internet_gateway" "test_internet_gateway" {
256+
compartment_id = "${var.compartment_ocid}"
257+
display_name = "TestInternetGateway"
258+
vcn_id = "${oci_core_vcn.test_vcn.id}"
259+
}
260+
261+
resource "oci_core_default_route_table" "default_route_table" {
262+
manage_default_resource_id = "${oci_core_vcn.test_vcn.default_route_table_id}"
263+
display_name = "DefaultRouteTable"
264+
265+
route_rules {
266+
destination = "0.0.0.0/0"
267+
destination_type = "CIDR_BLOCK"
268+
network_entity_id = "${oci_core_internet_gateway.test_internet_gateway.id}"
269+
}
270+
}
271+
255272
resource "oci_core_subnet" "test_subnet" {
256273
availability_domain = "${data.oci_identity_availability_domain.ad.name}"
257274
cidr_block = "10.1.20.0/24"

examples/networking/route_table_attachment/route_table_attachment.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,17 @@ resource "oci_core_instance" "example_instance" {
101101
availability_domain = "${data.oci_identity_availability_domain.ad.name}"
102102
compartment_id = "${var.compartment_ocid}"
103103
display_name = "testInstance"
104-
hostname_label = "instance"
105-
image = "${var.instance_image_ocid[var.region]}"
106104
shape = "${var.instance_shape}"
107105

108106
create_vnic_details {
107+
hostname_label = "instance"
109108
subnet_id = "${oci_core_subnet.example_subnet.id}"
110109
skip_source_dest_check = true
111110
assign_public_ip = true
112111
}
112+
113+
source_details {
114+
source_type = "image"
115+
source_id = "${var.instance_image_ocid[var.region]}"
116+
}
113117
}

examples/oce/main.tf

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
3+
variable "tenancy_ocid" {}
4+
5+
variable "tenancy_name" {}
6+
7+
variable "user_ocid" {}
8+
variable "fingerprint" {}
9+
variable "private_key_path" {}
10+
variable "compartment_ocid" {}
11+
variable "region" {}
12+
13+
variable "admin_email" {}
14+
15+
variable "idcs_access_token" {}
16+
17+
provider "oci" {
18+
region = "${var.region}"
19+
tenancy_ocid = "${var.tenancy_ocid}"
20+
user_ocid = "${var.user_ocid}"
21+
fingerprint = "${var.fingerprint}"
22+
private_key_path = "${var.private_key_path}"
23+
}
24+
25+
resource "oci_oce_oce_instance" "test_oce_instance" {
26+
admin_email = "${var.admin_email}"
27+
compartment_id = "${var.compartment_ocid}"
28+
idcs_access_token = "${var.idcs_access_token}"
29+
name = "testoceinstance"
30+
object_storage_namespace = "${var.tenancy_name}"
31+
tenancy_id = "${var.tenancy_ocid}"
32+
tenancy_name = "${var.tenancy_name}"
33+
}
34+
35+
data "oci_oce_oce_instances" "test_oce_instances" {
36+
compartment_id = "${var.compartment_ocid}"
37+
38+
filter {
39+
name = "id"
40+
values = ["${oci_oce_oce_instance.test_oce_instance.id}"]
41+
}
42+
43+
state = "Active"
44+
}
45+
46+
data "oci_oce_oce_instance" "test_oce_instance" {
47+
oce_instance_id = "${oci_oce_oce_instance.test_oce_instance.id}"
48+
}
49+
50+
output "active_oce_instances" {
51+
value = ["${data.oci_oce_oce_instances.test_oce_instances.oce_instances}"]
52+
}
53+
54+
output "output_nested_service_data" {
55+
value = "${jsondecode(data.oci_oce_oce_instance.test_oce_instance.service.dns).A.domain}"
56+
}

examples/storage/block/volume_group/block.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ resource "oci_core_volume" "t2" {
4242
compartment_id = "${var.compartment_ocid}"
4343
display_name = "-tf-volume-with-backup-policy"
4444
size_in_gbs = "${var.DBSize}"
45-
backup_policy_id = "${data.oci_core_volume_backup_policies.test_boot_volume_backup_policies.volume_backup_policies.0.id}"
45+
}
46+
47+
resource "oci_core_volume_backup_policy_assignment" "policy" {
48+
asset_id = "${oci_core_volume.t2.id}"
49+
policy_id = "${data.oci_core_volume_backup_policies.test_boot_volume_backup_policies.volume_backup_policies.0.id}"
4650
}
4751

4852
data "oci_core_volume_backup_policies" "test_boot_volume_backup_policies" {

oci/audit_configuration_resource.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ func AuditConfigurationResource() *schema.Resource {
2323
"compartment_id": {
2424
Type: schema.TypeString,
2525
Required: true,
26+
ForceNew: true,
2627
},
27-
28-
// Optional
2928
"retention_period_days": {
3029
Type: schema.TypeInt,
31-
Optional: true,
32-
Computed: true,
30+
Required: true,
3331
},
3432

33+
// Optional
34+
3535
// Computed
3636
},
3737
}

oci/audit_configuration_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@ import (
1313
)
1414

1515
var (
16-
ConfigurationRequiredOnlyResource = ConfigurationResourceDependencies +
17-
generateResourceFromRepresentationMap("oci_audit_configuration", "test_configuration", Required, Create, configurationRepresentation)
18-
1916
ConfigurationResourceConfig = ConfigurationResourceDependencies +
2017
generateResourceFromRepresentationMap("oci_audit_configuration", "test_configuration", Optional, Update, configurationRepresentation)
2118

2219
configurationSingularDataSourceRepresentation = map[string]interface{}{
2320
"compartment_id": Representation{repType: Required, create: `${var.tenancy_ocid}`},
2421
}
2522

26-
//@CODEGEN the service does not allow retention_period_days to be optional but it is optional in the spec HYD-9426. Service only supports PUT but not POST
2723
configurationRepresentation = map[string]interface{}{
2824
"compartment_id": Representation{repType: Required, create: `${var.tenancy_ocid}`},
2925
"retention_period_days": Representation{repType: Required, create: `100`, update: `91`},
@@ -58,6 +54,7 @@ func TestAuditConfigurationResource_basic(t *testing.T) {
5854
Config: config + ConfigurationResourceDependencies +
5955
generateResourceFromRepresentationMap("oci_audit_configuration", "test_configuration", Required, Create, configurationRepresentation),
6056
Check: resource.ComposeAggregateTestCheckFunc(
57+
resource.TestCheckResourceAttr(resourceName, "compartment_id", tenancyId),
6158
resource.TestCheckResourceAttr(resourceName, "retention_period_days", "100"),
6259

6360
func(s *terraform.State) (err error) {
@@ -72,6 +69,7 @@ func TestAuditConfigurationResource_basic(t *testing.T) {
7269
Config: config + ConfigurationResourceDependencies +
7370
generateResourceFromRepresentationMap("oci_audit_configuration", "test_configuration", Optional, Update, configurationRepresentation),
7471
Check: resource.ComposeAggregateTestCheckFunc(
72+
resource.TestCheckResourceAttr(resourceName, "compartment_id", tenancyId),
7573
resource.TestCheckResourceAttr(resourceName, "retention_period_days", "91"),
7674

7775
func(s *terraform.State) (err error) {

oci/core_dedicated_vm_host_resource.go

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/hashicorp/terraform/helper/schema"
99

1010
oci_core "github.com/oracle/oci-go-sdk/core"
11+
oci_work_requests "github.com/oracle/oci-go-sdk/workrequests"
1112
)
1213

1314
func CoreDedicatedVmHostResource() *schema.Resource {
@@ -89,6 +90,7 @@ func createCoreDedicatedVmHost(d *schema.ResourceData, m interface{}) error {
8990
sync := &CoreDedicatedVmHostResourceCrud{}
9091
sync.D = d
9192
sync.Client = m.(*OracleClients).computeClient
93+
sync.workRequestClient = m.(*OracleClients).workRequestClient
9294

9395
return CreateResource(d, sync)
9496
}
@@ -105,6 +107,7 @@ func updateCoreDedicatedVmHost(d *schema.ResourceData, m interface{}) error {
105107
sync := &CoreDedicatedVmHostResourceCrud{}
106108
sync.D = d
107109
sync.Client = m.(*OracleClients).computeClient
110+
sync.workRequestClient = m.(*OracleClients).workRequestClient
108111

109112
return UpdateResource(d, sync)
110113
}
@@ -113,6 +116,7 @@ func deleteCoreDedicatedVmHost(d *schema.ResourceData, m interface{}) error {
113116
sync := &CoreDedicatedVmHostResourceCrud{}
114117
sync.D = d
115118
sync.Client = m.(*OracleClients).computeClient
119+
sync.workRequestClient = m.(*OracleClients).workRequestClient
116120
sync.DisableNotFoundRetries = true
117121

118122
return DeleteResource(d, sync)
@@ -121,6 +125,7 @@ func deleteCoreDedicatedVmHost(d *schema.ResourceData, m interface{}) error {
121125
type CoreDedicatedVmHostResourceCrud struct {
122126
BaseCrud
123127
Client *oci_core.ComputeClient
128+
workRequestClient *oci_work_requests.WorkRequestClient
124129
Res *oci_core.DedicatedVmHost
125130
DisableNotFoundRetries bool
126131
}
@@ -200,8 +205,13 @@ func (s *CoreDedicatedVmHostResourceCrud) Create() error {
200205
return err
201206
}
202207

203-
s.Res = &response.DedicatedVmHost
204-
return nil
208+
workId := response.OpcWorkRequestId
209+
identifier, err := WaitForWorkRequestWithErrorHandling(s.workRequestClient, workId, "dedicatedvmhost", oci_work_requests.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries)
210+
if err != nil {
211+
return err
212+
}
213+
s.D.SetId(*identifier)
214+
return s.Get()
205215
}
206216

207217
func (s *CoreDedicatedVmHostResourceCrud) Get() error {
@@ -272,8 +282,19 @@ func (s *CoreDedicatedVmHostResourceCrud) Delete() error {
272282

273283
request.RequestMetadata.RetryPolicy = getRetryPolicy(s.DisableNotFoundRetries, "core")
274284

275-
_, err := s.Client.DeleteDedicatedVmHost(context.Background(), request)
276-
return err
285+
response, err := s.Client.DeleteDedicatedVmHost(context.Background(), request)
286+
if err != nil {
287+
return err
288+
}
289+
290+
workId := response.OpcWorkRequestId
291+
if workId != nil {
292+
_, err = WaitForWorkRequestWithErrorHandling(s.workRequestClient, workId, "dedicatedvmhost", oci_work_requests.WorkRequestResourceActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries)
293+
if err != nil {
294+
return err
295+
}
296+
}
297+
return nil
277298
}
278299

279300
func (s *CoreDedicatedVmHostResourceCrud) SetData() error {
@@ -331,9 +352,16 @@ func (s *CoreDedicatedVmHostResourceCrud) updateCompartment(compartment interfac
331352

332353
changeCompartmentRequest.RequestMetadata.RetryPolicy = getRetryPolicy(s.DisableNotFoundRetries, "core")
333354

334-
_, err := s.Client.ChangeDedicatedVmHostCompartment(context.Background(), changeCompartmentRequest)
355+
response, err := s.Client.ChangeDedicatedVmHostCompartment(context.Background(), changeCompartmentRequest)
335356
if err != nil {
336357
return err
337358
}
359+
workId := response.OpcWorkRequestId
360+
if workId != nil {
361+
_, err = WaitForWorkRequestWithErrorHandling(s.workRequestClient, workId, "dedicatedvmhost", oci_work_requests.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries)
362+
if err != nil {
363+
return err
364+
}
365+
}
338366
return nil
339367
}

oci/core_drg_resource.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ func (s *CoreDrgResourceCrud) updateCompartment(compartment interface{}) error {
278278
return err
279279
}
280280
workId := response.OpcWorkRequestId
281-
_, err = WaitForWorkRequest(s.workRequestClient, workId, "core", oci_work_requests.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries)
281+
// work request doesn't return identifier once succeeded
282+
_, err = WaitForWorkRequest(s.workRequestClient, workId, "core", oci_work_requests.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries, false)
282283
if err != nil {
283284
return err
284285
}

0 commit comments

Comments
 (0)