@@ -31,8 +31,7 @@ func TestAccSumologicScanBudget_basic(t *testing.T) {
3131 testWindow := "Query"
3232 testApplicableOn := "PerEntity"
3333 testGroupBy := "User"
34- testAction := "StopScan"
35- testScope := "j"
34+ testAction := "StopForeGroundScan"
3635 testStatus := "active"
3736
3837 resource .Test (t , resource.TestCase {
@@ -41,7 +40,7 @@ func TestAccSumologicScanBudget_basic(t *testing.T) {
4140 CheckDestroy : testAccCheckScanBudgetDestroy (scanBudget ),
4241 Steps : []resource.TestStep {
4342 {
44- Config : testAccCheckSumologicScanBudgetConfigImported (testName , testCapacity , testUnit , testBudgetType , testWindow , testApplicableOn , testGroupBy , testAction , testScope , testStatus ),
43+ Config : testAccCheckSumologicScanBudgetConfigImported (testName , testCapacity , testUnit , testBudgetType , testWindow , testApplicableOn , testGroupBy , testAction , testStatus ),
4544 },
4645 {
4746 ResourceName : "sumologic_scan_budget.foo" ,
@@ -61,8 +60,7 @@ func TestAccSumologicScanBudget_create(t *testing.T) {
6160 testWindow := "Query"
6261 testApplicableOn := "PerEntity"
6362 testGroupBy := "User"
64- testAction := "StopScan"
65- testScope := "j"
63+ testAction := "StopForeGroundScan"
6664 testStatus := "active"
6765
6866 resource .Test (t , resource.TestCase {
@@ -71,19 +69,18 @@ func TestAccSumologicScanBudget_create(t *testing.T) {
7169 CheckDestroy : testAccCheckScanBudgetDestroy (scanBudget ),
7270 Steps : []resource.TestStep {
7371 {
74- Config : testAccSumologicScanBudget (testName , testCapacity , testUnit , testBudgetType , testWindow , testApplicableOn , testGroupBy , testAction , testScope , testStatus ),
72+ Config : testAccSumologicScanBudget (testName , testCapacity , testUnit , testBudgetType , testWindow , testApplicableOn , testGroupBy , testAction , testStatus ),
7573 Check : resource .ComposeTestCheckFunc (
7674 testAccCheckScanBudgetExists ("sumologic_scan_budget.test" , & scanBudget , t ),
7775 testAccCheckScanBudgetAttributes ("sumologic_scan_budget.test" ),
7876 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "name" , testName ),
7977 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "capacity" , strconv .Itoa (testCapacity )),
8078 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "unit" , testUnit ),
81- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "budgetType " , testBudgetType ),
79+ resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "budget_type " , testBudgetType ),
8280 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "window" , testWindow ),
83- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "applicableOn " , testApplicableOn ),
84- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "groupBy " , testGroupBy ),
81+ resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "applicable_on " , testApplicableOn ),
82+ resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "group_by " , testGroupBy ),
8583 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "action" , testAction ),
86- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "scope" , testScope ),
8784 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "status" , testStatus ),
8885 ),
8986 },
@@ -101,8 +98,7 @@ func TestAccSumologicScanBudget_update(t *testing.T) {
10198 testWindow := "Query"
10299 testApplicableOn := "PerEntity"
103100 testGroupBy := "User"
104- testAction := "StopScan"
105- testScope := "j"
101+ testAction := "StopForeGroundScan"
106102 testStatus := "active"
107103
108104 testUpdatedName := "Test Budget"
@@ -112,8 +108,7 @@ func TestAccSumologicScanBudget_update(t *testing.T) {
112108 testUpdatedWindow := "Daily"
113109 testUpdatedApplicableOn := "PerEntity"
114110 testUpdatedGroupBy := "User"
115- testUpdatedAction := "StopScan"
116- testUpdatedScope := "j"
111+ testUpdatedAction := "Warn"
117112 testUpdatedStatus := "active"
118113
119114 resource .Test (t , resource.TestCase {
@@ -122,34 +117,32 @@ func TestAccSumologicScanBudget_update(t *testing.T) {
122117 CheckDestroy : testAccCheckScanBudgetDestroy (scanBudget ),
123118 Steps : []resource.TestStep {
124119 {
125- Config : testAccSumologicScanBudget (testName , testCapacity , testUnit , testBudgetType , testWindow , testApplicableOn , testGroupBy , testAction , testScope , testStatus ),
120+ Config : testAccSumologicScanBudget (testName , testCapacity , testUnit , testBudgetType , testWindow , testApplicableOn , testGroupBy , testAction , testStatus ),
126121 Check : resource .ComposeTestCheckFunc (
127122 testAccCheckScanBudgetExists ("sumologic_scan_budget.test" , & scanBudget , t ),
128123 testAccCheckScanBudgetAttributes ("sumologic_scan_budget.test" ),
129124 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "name" , testName ),
130125 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "capacity" , strconv .Itoa (testCapacity )),
131126 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "unit" , testUnit ),
132- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "budgetType " , testBudgetType ),
127+ resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "budget_type " , testBudgetType ),
133128 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "window" , testWindow ),
134- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "applicableOn " , testApplicableOn ),
135- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "groupBy " , testGroupBy ),
129+ resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "applicable_on " , testApplicableOn ),
130+ resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "group_by " , testGroupBy ),
136131 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "action" , testAction ),
137- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "scope" , testScope ),
138132 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "status" , testStatus ),
139133 ),
140134 },
141135 {
142- Config : testAccSumologicScanBudgetUpdate (testUpdatedName , testUpdatedCapacity , testUpdatedUnit , testUpdatedBudgetType , testUpdatedWindow , testUpdatedApplicableOn , testUpdatedGroupBy , testUpdatedAction , testUpdatedScope , testUpdatedStatus ),
136+ Config : testAccSumologicScanBudgetUpdate (testUpdatedName , testUpdatedCapacity , testUpdatedUnit , testUpdatedBudgetType , testUpdatedWindow , testUpdatedApplicableOn , testUpdatedGroupBy , testUpdatedAction , testUpdatedStatus ),
143137 Check : resource .ComposeTestCheckFunc (
144138 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "name" , testUpdatedName ),
145139 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "capacity" , strconv .Itoa (testUpdatedCapacity )),
146140 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "unit" , testUpdatedUnit ),
147- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "budgetType " , testUpdatedBudgetType ),
141+ resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "budget_type " , testUpdatedBudgetType ),
148142 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "window" , testUpdatedWindow ),
149- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "applicableOn " , testUpdatedApplicableOn ),
150- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "groupBy " , testUpdatedGroupBy ),
143+ resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "applicable_on " , testUpdatedApplicableOn ),
144+ resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "group_by " , testUpdatedGroupBy ),
151145 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "action" , testUpdatedAction ),
152- resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "scope" , testUpdatedScope ),
153146 resource .TestCheckResourceAttr ("sumologic_scan_budget.test" , "status" , testUpdatedStatus ),
154147 ),
155148 },
@@ -197,55 +190,70 @@ func testAccCheckScanBudgetExists(name string, scanBudget *ScanBudget, t *testin
197190 return nil
198191 }
199192}
200- func testAccCheckSumologicScanBudgetConfigImported (name string , capacity int , unit string , budgetType string , window string , applicableOn string , groupBy string , action string , scope string , status string ) string {
193+ func testAccCheckSumologicScanBudgetConfigImported (name string , capacity int , unit string , budgetType string , window string , applicableOn string , groupBy string , action string , status string ) string {
201194 return fmt .Sprintf (`
202195resource "sumologic_scan_budget" "foo" {
203196 name = "%s"
204197 capacity = %d
205198 unit = "%s"
206- budgetType = "%s"
199+ budget_type = "%s"
207200 window = "%s"
208- applicableOn = "%s"
209- groupBy = "%s"
201+ applicable_on = "%s"
202+ group_by = "%s"
210203 action = "%s"
211- scope = "%s"
204+ scope {
205+ included_users = ["000000000000011C"]
206+ excluded_users = []
207+ included_roles = []
208+ excluded_roles = ["0000000000000196"]
209+ }
212210 status = "%s"
213211}
214- ` , name , capacity , unit , budgetType , window , applicableOn , groupBy , action , scope , status )
212+ ` , name , capacity , unit , budgetType , window , applicableOn , groupBy , action , status )
215213}
216214
217- func testAccSumologicScanBudget (name string , capacity int , unit string , budgetType string , window string , applicableOn string , groupBy string , action string , scope string , status string ) string {
215+ func testAccSumologicScanBudget (name string , capacity int , unit string , budgetType string , window string , applicableOn string , groupBy string , action string , status string ) string {
218216 return fmt .Sprintf (`
219217resource "sumologic_scan_budget" "test" {
220218 name = "%s"
221219 capacity = %d
222220 unit = "%s"
223- budgetType = "%s"
221+ budget_type = "%s"
224222 window = "%s"
225- applicableOn = "%s"
226- groupBy = "%s"
223+ applicable_on = "%s"
224+ group_by = "%s"
227225 action = "%s"
228- scope = "%s"
226+ scope {
227+ included_users = ["000000000000011C"]
228+ excluded_users = []
229+ included_roles = []
230+ excluded_roles = ["0000000000000196"]
231+ }
229232 status = "%s"
230233}
231- ` , name , capacity , unit , budgetType , window , applicableOn , groupBy , action , scope , status )
234+ ` , name , capacity , unit , budgetType , window , applicableOn , groupBy , action , status )
232235}
233236
234- func testAccSumologicScanBudgetUpdate (name string , capacity int , unit string , budgetType string , window string , applicableOn string , groupBy string , action string , scope string , status string ) string {
237+ func testAccSumologicScanBudgetUpdate (name string , capacity int , unit string , budgetType string , window string , applicableOn string , groupBy string , action string , status string ) string {
235238 return fmt .Sprintf (`
236239resource "sumologic_scan_budget" "test" {
237240 name = "%s"
238241 capacity = %d
239242 unit = "%s"
240- budgetType = "%s"
243+ budget_type = "%s"
241244 window = "%s"
242- applicableOn = "%s"
243- groupBy = "%s"
245+ applicable_on = "%s"
246+ group_by = "%s"
244247 action = "%s"
245- scope = "%s"
248+ scope {
249+ included_users = ["000000000000011C"]
250+ excluded_users = []
251+ included_roles = []
252+ excluded_roles = ["0000000000000196"]
253+ }
246254 status = "%s"
247255}
248- ` , name , capacity , unit , budgetType , window , applicableOn , groupBy , action , scope , status )
256+ ` , name , capacity , unit , budgetType , window , applicableOn , groupBy , action , status )
249257}
250258
251259func testAccCheckScanBudgetAttributes (name string ) resource.TestCheckFunc {
@@ -254,12 +262,11 @@ func testAccCheckScanBudgetAttributes(name string) resource.TestCheckFunc {
254262 resource .TestCheckResourceAttrSet (name , "name" ),
255263 resource .TestCheckResourceAttrSet (name , "capacity" ),
256264 resource .TestCheckResourceAttrSet (name , "unit" ),
257- resource .TestCheckResourceAttrSet (name , "budgetType " ),
265+ resource .TestCheckResourceAttrSet (name , "budget_type " ),
258266 resource .TestCheckResourceAttrSet (name , "window" ),
259- resource .TestCheckResourceAttrSet (name , "applicableOn " ),
260- resource .TestCheckResourceAttrSet (name , "groupBy " ),
267+ resource .TestCheckResourceAttrSet (name , "applicable_on " ),
268+ resource .TestCheckResourceAttrSet (name , "group_by " ),
261269 resource .TestCheckResourceAttrSet (name , "action" ),
262- resource .TestCheckResourceAttrSet (name , "scope" ),
263270 resource .TestCheckResourceAttrSet (name , "status" ),
264271 )
265272 return f (s )
0 commit comments