2525 }
2626
2727 budgetDataSourceRepresentation = map [string ]interface {}{
28- "compartment_id" : Representation {repType : Required , create : `${var.compartment_id }` },
28+ "compartment_id" : Representation {repType : Required , create : `${var.tenancy_ocid }` },
2929 "display_name" : Representation {repType : Optional , create : `displayName` , update : `displayName2` },
3030 "state" : Representation {repType : Optional , create : `AVAILABLE` },
3131 "filter" : RepresentationGroup {Required , budgetDataSourceFilterRepresentation }}
3636
3737 budgetRepresentation = map [string ]interface {}{
3838 "amount" : Representation {repType : Required , create : `100` , update : `200` },
39- "compartment_id" : Representation {repType : Required , create : `${var.compartment_id }` },
40- "reset_period" : Representation {repType : Required , create : `MONTHLY` , update : `MONTHLY` },
39+ "compartment_id" : Representation {repType : Required , create : `${var.tenancy_ocid }` },
40+ "reset_period" : Representation {repType : Required , create : `MONTHLY` },
4141 "target_compartment_id" : Representation {repType : Required , create : `${var.compartment_id}` },
4242 "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")}` },
4343 "description" : Representation {repType : Optional , create : `description` , update : `description2` },
@@ -54,6 +54,7 @@ func TestBudgetBudgetResource_basic(t *testing.T) {
5454
5555 compartmentId := getEnvSettingWithBlankDefault ("compartment_ocid" )
5656 compartmentIdVariableStr := fmt .Sprintf ("variable \" compartment_id\" { default = \" %s\" }\n " , compartmentId )
57+ tenancyId := getEnvSettingWithBlankDefault ("tenancy_ocid" )
5758
5859 resourceName := "oci_budget_budget.test_budget"
5960 datasourceName := "data.oci_budget_budgets.test_budgets"
@@ -74,7 +75,7 @@ func TestBudgetBudgetResource_basic(t *testing.T) {
7475 generateResourceFromRepresentationMap ("oci_budget_budget" , "test_budget" , Required , Create , budgetRepresentation ),
7576 Check : resource .ComposeAggregateTestCheckFunc (
7677 resource .TestCheckResourceAttr (resourceName , "amount" , "100" ),
77- resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
78+ resource .TestCheckResourceAttr (resourceName , "compartment_id" , tenancyId ),
7879 resource .TestCheckResourceAttr (resourceName , "reset_period" , "MONTHLY" ),
7980 resource .TestCheckResourceAttrSet (resourceName , "target_compartment_id" ),
8081
@@ -96,7 +97,7 @@ func TestBudgetBudgetResource_basic(t *testing.T) {
9697 Check : resource .ComposeAggregateTestCheckFunc (
9798 resource .TestCheckResourceAttrSet (resourceName , "alert_rule_count" ),
9899 resource .TestCheckResourceAttr (resourceName , "amount" , "100" ),
99- resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
100+ resource .TestCheckResourceAttr (resourceName , "compartment_id" , tenancyId ),
100101 resource .TestCheckResourceAttr (resourceName , "defined_tags.%" , "1" ),
101102 resource .TestCheckResourceAttr (resourceName , "description" , "description" ),
102103 resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName" ),
@@ -122,7 +123,7 @@ func TestBudgetBudgetResource_basic(t *testing.T) {
122123 Check : resource .ComposeAggregateTestCheckFunc (
123124 resource .TestCheckResourceAttrSet (resourceName , "alert_rule_count" ),
124125 resource .TestCheckResourceAttr (resourceName , "amount" , "200" ),
125- resource .TestCheckResourceAttr (resourceName , "compartment_id" , compartmentId ),
126+ resource .TestCheckResourceAttr (resourceName , "compartment_id" , tenancyId ),
126127 resource .TestCheckResourceAttr (resourceName , "defined_tags.%" , "1" ),
127128 resource .TestCheckResourceAttr (resourceName , "description" , "description2" ),
128129 resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName2" ),
@@ -150,14 +151,14 @@ func TestBudgetBudgetResource_basic(t *testing.T) {
150151 compartmentIdVariableStr + BudgetResourceDependencies +
151152 generateResourceFromRepresentationMap ("oci_budget_budget" , "test_budget" , Optional , Update , budgetRepresentation ),
152153 Check : resource .ComposeAggregateTestCheckFunc (
153- resource .TestCheckResourceAttr (datasourceName , "compartment_id" , compartmentId ),
154+ resource .TestCheckResourceAttr (datasourceName , "compartment_id" , tenancyId ),
154155 resource .TestCheckResourceAttr (datasourceName , "display_name" , "displayName2" ),
155156 resource .TestCheckResourceAttr (datasourceName , "state" , "AVAILABLE" ),
156157
157158 resource .TestCheckResourceAttr (datasourceName , "budgets.#" , "1" ),
158159 resource .TestCheckResourceAttrSet (datasourceName , "budgets.0.alert_rule_count" ),
159160 resource .TestCheckResourceAttr (datasourceName , "budgets.0.amount" , "200" ),
160- resource .TestCheckResourceAttr (datasourceName , "budgets.0.compartment_id" , compartmentId ),
161+ resource .TestCheckResourceAttr (datasourceName , "budgets.0.compartment_id" , tenancyId ),
161162 resource .TestCheckResourceAttr (datasourceName , "budgets.0.defined_tags.%" , "1" ),
162163 resource .TestCheckResourceAttr (datasourceName , "budgets.0.description" , "description2" ),
163164 resource .TestCheckResourceAttr (datasourceName , "budgets.0.display_name" , "displayName2" ),
@@ -181,7 +182,7 @@ func TestBudgetBudgetResource_basic(t *testing.T) {
181182
182183 resource .TestCheckResourceAttrSet (singularDatasourceName , "alert_rule_count" ),
183184 resource .TestCheckResourceAttr (singularDatasourceName , "amount" , "200" ),
184- resource .TestCheckResourceAttr (singularDatasourceName , "compartment_id" , compartmentId ),
185+ resource .TestCheckResourceAttr (singularDatasourceName , "compartment_id" , tenancyId ),
185186 resource .TestCheckResourceAttr (singularDatasourceName , "defined_tags.%" , "1" ),
186187 resource .TestCheckResourceAttr (singularDatasourceName , "description" , "description2" ),
187188 resource .TestCheckResourceAttr (singularDatasourceName , "display_name" , "displayName2" ),
0 commit comments