Skip to content

Commit 5199230

Browse files
Archana Raminiravinitp
authored andcommitted
Added - Support for Shared Resources feature
1 parent 41ab0c3 commit 5199230

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

examples/metering_computation/usage/main.tf

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,12 @@
55
variable "tenancy_ocid" {
66
}
77

8-
variable "user_ocid" {
9-
}
10-
11-
variable "fingerprint" {
12-
}
13-
14-
variable "private_key_path" {
15-
}
16-
17-
variable "compartment_ocid" {
18-
}
19-
208
variable "region" {
219
}
2210

2311
provider "oci" {
24-
region = var.region
25-
tenancy_ocid = var.tenancy_ocid
26-
user_ocid = var.user_ocid
27-
fingerprint = var.fingerprint
28-
private_key_path = var.private_key_path
12+
auth = "SecurityToken"
13+
config_file_profile = "terraform-federation-test"
2914
}
3015

3116
variable "time_usage_ended" {

internal/service/metering_computation/metering_computation_usage_resource.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ func MeteringComputationUsageResource() *schema.Resource {
169169
Type: schema.TypeString,
170170
Computed: true,
171171
},
172+
"attributed_cost": {
173+
Type: schema.TypeString,
174+
Computed: true,
175+
},
176+
"attributed_usage": {
177+
Type: schema.TypeString,
178+
Computed: true,
179+
},
172180
"compartment_id": {
173181
Type: schema.TypeString,
174182
Computed: true,
@@ -522,6 +530,14 @@ func UsageSummaryToMap(obj oci_metering_computation.UsageSummary) map[string]int
522530
result["ad"] = string(*obj.Ad)
523531
}
524532

533+
if obj.AttributedCost != nil {
534+
result["attributed_cost"] = string(*obj.AttributedCost)
535+
}
536+
537+
if obj.AttributedUsage != nil {
538+
result["attributed_usage"] = string(*obj.AttributedUsage)
539+
}
540+
525541
if obj.CompartmentId != nil {
526542
result["compartment_id"] = string(*obj.CompartmentId)
527543
}

website/docs/r/metering_computation_usage.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ The following attributes are exported:
8080
* `group_by` - Aggregate the result by.
8181
* `items` - A list of usage items.
8282
* `ad` - The availability domain of the usage.
83+
* `attributed_cost` - The attributed cost with a max value of 9999999999.999999999999 and a minimum value of 0.
84+
* `attributed_usage` - The attributed usage with a max value of 9999999999.999999999999 and a minimum value of 0.
8385
* `compartment_id` - The compartment OCID.
8486
* `compartment_name` - The compartment name.
8587
* `compartment_path` - The compartment path, starting from root.

0 commit comments

Comments
 (0)