Skip to content

Commit 3462ed6

Browse files
authored
Release v3.24.0
Release v3.24.0
2 parents 38c89d8 + 2857c54 commit 3462ed6

File tree

58 files changed

+650
-3792
lines changed

Some content is hidden

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

58 files changed

+650
-3792
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
## 3.23.1 (Unreleased)
1+
## 3.24.0 (Unreleased)
2+
3+
### Added
4+
- Support data source for cost tracking tags
5+
- Singular data sources will reuse resource schema
6+
27
## 3.23.0 (April 17, 2019)
38

49
### Added

examples/identity/tags.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,12 @@ output "tags" {
3737
output "resource_defined_tags_key" {
3838
value = "${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}"
3939
}
40+
41+
data "oci_identity_cost_tracking_tags" "cost_tracking_tags" {
42+
#Required
43+
compartment_id = "${var.tenancy_ocid}"
44+
}
45+
46+
output cost_tracking_tags {
47+
value = "${data.oci_identity_cost_tracking_tags.cost_tracking_tags.tags}"
48+
}

oci/audit_configuration_data_source.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,12 @@ import (
1010
)
1111

1212
func AuditConfigurationDataSource() *schema.Resource {
13-
return &schema.Resource{
14-
Read: readSingularAuditConfiguration,
15-
Schema: map[string]*schema.Schema{
16-
"compartment_id": {
17-
Type: schema.TypeString,
18-
Required: true,
19-
},
20-
// Computed
21-
"retention_period_days": {
22-
Type: schema.TypeInt,
23-
Computed: true,
24-
},
25-
},
13+
fieldMap := make(map[string]*schema.Schema)
14+
fieldMap["compartment_id"] = &schema.Schema{
15+
Type: schema.TypeString,
16+
Required: true,
2617
}
18+
return GetSingularDataSourceItemSchema(AuditConfigurationResource(), fieldMap, readSingularAuditConfiguration)
2719
}
2820

2921
func readSingularAuditConfiguration(d *schema.ResourceData, m interface{}) error {

oci/autoscaling_auto_scaling_configuration_data_source.go

Lines changed: 5 additions & 227 deletions
Original file line numberDiff line numberDiff line change
@@ -6,238 +6,16 @@ import (
66
"context"
77

88
"github.com/hashicorp/terraform/helper/schema"
9-
"github.com/hashicorp/terraform/helper/validation"
109
oci_autoscaling "github.com/oracle/oci-go-sdk/autoscaling"
1110
)
1211

1312
func AutoscalingAutoScalingConfigurationDataSource() *schema.Resource {
14-
return &schema.Resource{
15-
Read: readSingularAutoscalingAutoScalingConfiguration,
16-
Schema: map[string]*schema.Schema{
17-
"auto_scaling_configuration_id": {
18-
Type: schema.TypeString,
19-
Required: true,
20-
},
21-
// Computed
22-
"compartment_id": {
23-
Type: schema.TypeString,
24-
Computed: true,
25-
},
26-
"cool_down_in_seconds": {
27-
Type: schema.TypeInt,
28-
Computed: true,
29-
},
30-
"defined_tags": {
31-
Type: schema.TypeMap,
32-
Computed: true,
33-
Elem: schema.TypeString,
34-
},
35-
"display_name": {
36-
Type: schema.TypeString,
37-
Computed: true,
38-
},
39-
"freeform_tags": {
40-
Type: schema.TypeMap,
41-
Computed: true,
42-
Elem: schema.TypeString,
43-
},
44-
"is_enabled": {
45-
Type: schema.TypeBool,
46-
Computed: true,
47-
},
48-
"policies": {
49-
Type: schema.TypeList,
50-
Computed: true,
51-
Elem: &schema.Resource{
52-
Schema: map[string]*schema.Schema{
53-
// Required
54-
"capacity": {
55-
Type: schema.TypeList,
56-
Required: true,
57-
ForceNew: true,
58-
MaxItems: 1,
59-
MinItems: 1,
60-
Elem: &schema.Resource{
61-
Schema: map[string]*schema.Schema{
62-
// Required
63-
"initial": {
64-
Type: schema.TypeInt,
65-
Required: true,
66-
ForceNew: true,
67-
},
68-
"max": {
69-
Type: schema.TypeInt,
70-
Required: true,
71-
ForceNew: true,
72-
},
73-
"min": {
74-
Type: schema.TypeInt,
75-
Required: true,
76-
ForceNew: true,
77-
},
78-
79-
// Optional
80-
81-
// Computed
82-
},
83-
},
84-
},
85-
"policy_type": {
86-
Type: schema.TypeString,
87-
Required: true,
88-
ForceNew: true,
89-
DiffSuppressFunc: EqualIgnoreCaseSuppressDiff,
90-
ValidateFunc: validation.StringInSlice([]string{
91-
"threshold",
92-
}, true),
93-
},
94-
"rules": {
95-
Type: schema.TypeList,
96-
Required: true,
97-
ForceNew: true,
98-
Elem: &schema.Resource{
99-
Schema: map[string]*schema.Schema{
100-
// Required
101-
"action": {
102-
Type: schema.TypeList,
103-
Required: true,
104-
ForceNew: true,
105-
MaxItems: 1,
106-
MinItems: 1,
107-
Elem: &schema.Resource{
108-
Schema: map[string]*schema.Schema{
109-
// Required
110-
"type": {
111-
Type: schema.TypeString,
112-
Required: true,
113-
ForceNew: true,
114-
},
115-
"value": {
116-
Type: schema.TypeInt,
117-
Required: true,
118-
ForceNew: true,
119-
},
120-
121-
// Optional
122-
123-
// Computed
124-
},
125-
},
126-
},
127-
"metric": {
128-
Type: schema.TypeList,
129-
Required: true,
130-
ForceNew: true,
131-
MaxItems: 1,
132-
MinItems: 1,
133-
Elem: &schema.Resource{
134-
Schema: map[string]*schema.Schema{
135-
// Required
136-
"metric_type": {
137-
Type: schema.TypeString,
138-
Required: true,
139-
ForceNew: true,
140-
},
141-
"threshold": {
142-
Type: schema.TypeList,
143-
Required: true,
144-
ForceNew: true,
145-
MaxItems: 1,
146-
MinItems: 1,
147-
Elem: &schema.Resource{
148-
Schema: map[string]*schema.Schema{
149-
// Required
150-
"operator": {
151-
Type: schema.TypeString,
152-
Required: true,
153-
ForceNew: true,
154-
},
155-
"value": {
156-
Type: schema.TypeInt,
157-
Required: true,
158-
ForceNew: true,
159-
},
160-
161-
// Optional
162-
163-
// Computed
164-
},
165-
},
166-
},
167-
168-
// Optional
169-
170-
// Computed
171-
},
172-
},
173-
},
174-
175-
// Optional
176-
"display_name": {
177-
Type: schema.TypeString,
178-
Optional: true,
179-
Computed: true,
180-
ForceNew: true,
181-
},
182-
183-
// Computed
184-
"id": {
185-
Type: schema.TypeString,
186-
Computed: true,
187-
},
188-
},
189-
},
190-
},
191-
192-
// Optional
193-
"display_name": {
194-
Type: schema.TypeString,
195-
Optional: true,
196-
Computed: true,
197-
ForceNew: true,
198-
},
199-
200-
// Computed
201-
"id": {
202-
Type: schema.TypeString,
203-
Computed: true,
204-
},
205-
"time_created": {
206-
Type: schema.TypeString,
207-
Computed: true,
208-
},
209-
},
210-
},
211-
},
212-
"auto_scaling_resources": {
213-
Type: schema.TypeList,
214-
Computed: true,
215-
Elem: &schema.Resource{
216-
Schema: map[string]*schema.Schema{
217-
// Required
218-
"id": {
219-
Type: schema.TypeString,
220-
Required: true,
221-
ForceNew: true,
222-
},
223-
"type": {
224-
Type: schema.TypeString,
225-
Required: true,
226-
ForceNew: true,
227-
},
228-
229-
// Optional
230-
231-
// Computed
232-
},
233-
},
234-
},
235-
"time_created": {
236-
Type: schema.TypeString,
237-
Computed: true,
238-
},
239-
},
13+
fieldMap := make(map[string]*schema.Schema)
14+
fieldMap["auto_scaling_configuration_id"] = &schema.Schema{
15+
Type: schema.TypeString,
16+
Required: true,
24017
}
18+
return GetSingularDataSourceItemSchema(AutoscalingAutoScalingConfigurationResource(), fieldMap, readSingularAutoscalingAutoScalingConfiguration)
24119
}
24220

24321
func readSingularAutoscalingAutoScalingConfiguration(d *schema.ResourceData, m interface{}) error {

oci/budget_alert_rule_data_source.go

Lines changed: 9 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -10,74 +10,16 @@ import (
1010
)
1111

1212
func BudgetAlertRuleDataSource() *schema.Resource {
13-
return &schema.Resource{
14-
Read: readSingularBudgetAlertRule,
15-
Schema: map[string]*schema.Schema{
16-
"alert_rule_id": {
17-
Type: schema.TypeString,
18-
Required: true,
19-
},
20-
"budget_id": {
21-
Type: schema.TypeString,
22-
Required: true,
23-
},
24-
// Computed
25-
"defined_tags": {
26-
Type: schema.TypeMap,
27-
Computed: true,
28-
Elem: schema.TypeString,
29-
},
30-
"description": {
31-
Type: schema.TypeString,
32-
Computed: true,
33-
},
34-
"display_name": {
35-
Type: schema.TypeString,
36-
Computed: true,
37-
},
38-
"freeform_tags": {
39-
Type: schema.TypeMap,
40-
Computed: true,
41-
Elem: schema.TypeString,
42-
},
43-
"message": {
44-
Type: schema.TypeString,
45-
Computed: true,
46-
},
47-
"recipients": {
48-
Type: schema.TypeString,
49-
Computed: true,
50-
},
51-
"state": {
52-
Type: schema.TypeString,
53-
Computed: true,
54-
},
55-
"threshold": {
56-
Type: schema.TypeFloat,
57-
Computed: true,
58-
},
59-
"threshold_type": {
60-
Type: schema.TypeString,
61-
Computed: true,
62-
},
63-
"time_created": {
64-
Type: schema.TypeString,
65-
Computed: true,
66-
},
67-
"time_updated": {
68-
Type: schema.TypeString,
69-
Computed: true,
70-
},
71-
"type": {
72-
Type: schema.TypeString,
73-
Computed: true,
74-
},
75-
"version": {
76-
Type: schema.TypeInt,
77-
Computed: true,
78-
},
79-
},
13+
fieldMap := make(map[string]*schema.Schema)
14+
fieldMap["alert_rule_id"] = &schema.Schema{
15+
Type: schema.TypeString,
16+
Required: true,
8017
}
18+
fieldMap["budget_id"] = &schema.Schema{
19+
Type: schema.TypeString,
20+
Required: true,
21+
}
22+
return GetSingularDataSourceItemSchema(BudgetAlertRuleResource(), fieldMap, readSingularBudgetAlertRule)
8123
}
8224

8325
func readSingularBudgetAlertRule(d *schema.ResourceData, m interface{}) error {

0 commit comments

Comments
 (0)