Skip to content

Commit 46cea7e

Browse files
authored
Candidate for release_v3.35.0
Candidate for release_v3.35.0
2 parents 9dfaa97 + d208e2d commit 46cea7e

File tree

158 files changed

+3451
-369
lines changed

Some content is hidden

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

158 files changed

+3451
-369
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
## 3.34.1 (Unreleased)
1+
## 3.35.0 (Unreleased)
2+
3+
### Added
4+
- Support for creating `instance_configuration` resource from the specified instance
5+
- Support for Budget Alerts for Cost Tracking Tags
6+
- Support for moving `oci_monitoring_alarm` across compartments
7+
- Support for moving `health_checks_http_monitor` and `health_checks_ping_monitor` resources across compartments
8+
- Support for moving `database_autonomous_database` and `database_db_system` resources across compartments
9+
- Support for moving `database_autonomous_container_database` and `database_autonomous_exadata_infrastructure` resources across compartments
10+
- Support for scheduling KMS vault deletion by specified time
11+
12+
### Fixed
13+
- Fixed `oci_load_balancer_backend_set` by explicitly making `session_persistence_configuration` and `lb_cookie_session_persistence_configuration` mutually exclusive [Issue #825](https://github.com/terraform-providers/terraform-provider-oci/issues/825)
14+
- Fixed use case of `oci_load_balancer_backend_set` with `lb_cookie_session_persistence_configuration` update operation without setting optional parameters `max_age_in_seconds` and `domain`
15+
- Fixed `oci_identity_user_capabilities_management` to correctly set `can_use_auth_tokens` field
16+
217
## 3.34.0 (July 17, 2019)
318

419
### Added

examples/autoscaling/compute.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,24 @@ resource "oci_autoscaling_auto_scaling_configuration" "TFAutoScalingConfiguratio
101101
}
102102
}
103103
}
104+
105+
rules {
106+
action {
107+
type = "CHANGE_COUNT_BY"
108+
value = "-1"
109+
}
110+
111+
display_name = "TFScaleInRule"
112+
113+
metric {
114+
metric_type = "CPU_UTILIZATION"
115+
116+
threshold {
117+
operator = "LT"
118+
value = "1"
119+
}
120+
}
121+
}
104122
}
105123

106124
auto_scaling_resources {

examples/budget/main.tf

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ provider "oci" {
2222

2323
resource "oci_budget_budget" "test_budget" {
2424
#Required
25-
amount = "1"
26-
compartment_id = "${var.tenancy_ocid}"
27-
reset_period = "MONTHLY"
28-
target_compartment_id = "${var.compartment_ocid}"
25+
amount = "1"
26+
compartment_id = "${var.tenancy_ocid}"
27+
reset_period = "MONTHLY"
28+
target_type = "COMPARTMENT"
29+
30+
targets = [
31+
"${var.compartment_ocid}",
32+
]
2933

3034
#Optional
3135
description = "budget1 description"
@@ -38,17 +42,17 @@ data "oci_budget_budget" "budget1" {
3842

3943
output "budget" {
4044
value = {
41-
amount = "${data.oci_budget_budget.budget1.amount}"
42-
compartment_id = "${data.oci_budget_budget.budget1.compartment_id}"
43-
reset_period = "${data.oci_budget_budget.budget1.reset_period}"
44-
target_compartment_id = "${data.oci_budget_budget.budget1.target_compartment_id}"
45-
description = "${data.oci_budget_budget.budget1.description}"
46-
display_name = "${data.oci_budget_budget.budget1.display_name}"
47-
alert_rule_count = "${data.oci_budget_budget.budget1.alert_rule_count}"
48-
state = "${data.oci_budget_budget.budget1.state}"
49-
time_created = "${data.oci_budget_budget.budget1.time_created}"
50-
time_updated = "${data.oci_budget_budget.budget1.time_updated}"
51-
version = "${data.oci_budget_budget.budget1.version}"
45+
amount = "${data.oci_budget_budget.budget1.amount}"
46+
compartment_id = "${data.oci_budget_budget.budget1.compartment_id}"
47+
reset_period = "${data.oci_budget_budget.budget1.reset_period}"
48+
targets = "${data.oci_budget_budget.budget1.targets.0}"
49+
description = "${data.oci_budget_budget.budget1.description}"
50+
display_name = "${data.oci_budget_budget.budget1.display_name}"
51+
alert_rule_count = "${data.oci_budget_budget.budget1.alert_rule_count}"
52+
state = "${data.oci_budget_budget.budget1.state}"
53+
time_created = "${data.oci_budget_budget.budget1.time_created}"
54+
time_updated = "${data.oci_budget_budget.budget1.time_updated}"
55+
version = "${data.oci_budget_budget.budget1.version}"
5256

5357
# These values are not always present
5458
// actual_spend = "${data.oci_budget_budget.budget1.actual_spend}"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-oci
33
require (
44
github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce // indirect
55
github.com/hashicorp/terraform v0.12.4-0.20190628193153-a74738cd35fc
6-
github.com/oracle/oci-go-sdk v5.15.0+incompatible
6+
github.com/oracle/oci-go-sdk v6.0.0+incompatible
77
github.com/stretchr/objx v0.1.1 // indirect
88
github.com/stretchr/testify v1.3.0
99
gopkg.in/yaml.v2 v2.2.2

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ github.com/oracle/oci-go-sdk v5.14.0+incompatible h1:RL/BN87saea2/iGFCT3jmr+IK42
274274
github.com/oracle/oci-go-sdk v5.14.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
275275
github.com/oracle/oci-go-sdk v5.15.0+incompatible h1:rTlmaWEe255HczQJ2uOPM9xw3prU9jNk5GxPy+RFi3k=
276276
github.com/oracle/oci-go-sdk v5.15.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
277+
github.com/oracle/oci-go-sdk v6.0.0+incompatible h1:oxUPiF7KPhC0hRoAhAK3hTIZ1K0cz3NfawAQK3Sslb8=
278+
github.com/oracle/oci-go-sdk v6.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
277279
github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk=
278280
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
279281
github.com/pkg/errors v0.0.0-20170505043639-c605e284fe17/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

httpreplay/recorder.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ type roundTripperProxy struct {
4242
}
4343

4444
func (rtp *roundTripperProxy) RoundTrip(r *http.Request) (*http.Response, error) {
45-
return rtp.recorder.RoundTrip(r, rtp.chained)
45+
res, err := rtp.recorder.RoundTrip(r, rtp.chained)
46+
if err != nil && err.Error() == "Requested interaction not found" {
47+
debugLogf("stop RoundTrip for err: %v", err)
48+
panic(err)
49+
}
50+
51+
return res, err
4652
}
4753

4854
func (rtp *roundTripperProxy) CancelRequest(r *http.Request) {

oci/budget_alert_rule_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var (
4747
"defined_tags": Representation{repType: 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")}`},
4848
"description": Representation{repType: Optional, create: `description`, update: `description2`},
4949
"display_name": Representation{repType: Optional, create: `displayName`, update: `displayName2`},
50-
"freeform_tags": Representation{repType: Optional, create: map[string]string{"bar-key": "value"}, update: map[string]string{"Department": "Accounting"}},
50+
"freeform_tags": Representation{repType: Optional, create: map[string]string{"Department": "Finance"}, update: map[string]string{"Department": "Accounting"}},
5151
"message": Representation{repType: Optional, create: `message`, update: `message2`},
5252
}
5353

oci/budget_budget_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ func (s *BudgetBudgetDataSourceCrud) SetData() error {
104104
s.D.Set("target_compartment_id", *s.Res.TargetCompartmentId)
105105
}
106106

107+
s.D.Set("target_type", s.Res.TargetType)
108+
109+
s.D.Set("targets", s.Res.Targets)
110+
107111
if s.Res.TimeCreated != nil {
108112
s.D.Set("time_created", s.Res.TimeCreated.String())
109113
}

oci/budget_budget_resource.go

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ func BudgetBudgetResource() *schema.Resource {
3535
Type: schema.TypeString,
3636
Required: true,
3737
},
38-
"target_compartment_id": {
39-
Type: schema.TypeString,
40-
Required: true,
41-
ForceNew: true,
42-
},
4338

4439
// Optional
4540
"defined_tags": {
@@ -65,6 +60,30 @@ func BudgetBudgetResource() *schema.Resource {
6560
Computed: true,
6661
Elem: schema.TypeString,
6762
},
63+
"target_compartment_id": {
64+
Type: schema.TypeString,
65+
Optional: true,
66+
Computed: true,
67+
ForceNew: true,
68+
ConflictsWith: []string{"target_type"},
69+
Deprecated: FieldDeprecatedForAnother("target_compartment_id", "target_type"),
70+
},
71+
"target_type": {
72+
Type: schema.TypeString,
73+
Optional: true,
74+
Computed: true,
75+
ForceNew: true,
76+
ConflictsWith: []string{"target_compartment_id"},
77+
},
78+
"targets": {
79+
Type: schema.TypeList,
80+
Optional: true,
81+
Computed: true,
82+
ForceNew: true,
83+
Elem: &schema.Schema{
84+
Type: schema.TypeString,
85+
},
86+
},
6887

6988
// Computed
7089
"actual_spend": {
@@ -209,6 +228,22 @@ func (s *BudgetBudgetResourceCrud) Create() error {
209228
request.TargetCompartmentId = &tmp
210229
}
211230

231+
if targetType, ok := s.D.GetOkExists("target_type"); ok {
232+
request.TargetType = oci_budget.CreateBudgetDetailsTargetTypeEnum(targetType.(string))
233+
}
234+
235+
request.Targets = []string{}
236+
if targets, ok := s.D.GetOkExists("targets"); ok {
237+
interfaces := targets.([]interface{})
238+
tmp := make([]string, len(interfaces))
239+
for i := range interfaces {
240+
if interfaces[i] != nil {
241+
tmp[i] = interfaces[i].(string)
242+
}
243+
}
244+
request.Targets = tmp
245+
}
246+
212247
request.RequestMetadata.RetryPolicy = getRetryPolicy(s.DisableNotFoundRetries, "budget")
213248

214249
response, err := s.Client.CreateBudget(context.Background(), request)
@@ -340,6 +375,10 @@ func (s *BudgetBudgetResourceCrud) SetData() error {
340375
s.D.Set("target_compartment_id", *s.Res.TargetCompartmentId)
341376
}
342377

378+
s.D.Set("target_type", s.Res.TargetType)
379+
380+
s.D.Set("targets", s.Res.Targets)
381+
343382
if s.Res.TimeCreated != nil {
344383
s.D.Set("time_created", s.Res.TimeCreated.String())
345384
}

0 commit comments

Comments
 (0)