@@ -31,14 +31,15 @@ func TestAccSumologicIngestBudgetV2_basic(t *testing.T) {
3131 testDescription := "description-7hUwr"
3232 testAction := "stopCollecting"
3333 testCapacityBytes := 1000
34+ testBudgetType := "dailyVolume"
3435
3536 resource .Test (t , resource.TestCase {
3637 PreCheck : func () { testAccPreCheck (t ) },
3738 Providers : testAccProviders ,
3839 CheckDestroy : testAccCheckIngestBudgetV2Destroy (ingestBudgetV2 ),
3940 Steps : []resource.TestStep {
4041 {
41- Config : testAccCheckSumologicIngestBudgetV2ConfigImported (testName , testScope , testTimezone , testResetTime , testAuditThreshold , testDescription , testAction , testCapacityBytes ),
42+ Config : testAccCheckSumologicIngestBudgetV2ConfigImported (testName , testScope , testTimezone , testResetTime , testAuditThreshold , testDescription , testAction , testCapacityBytes , testBudgetType ),
4243 },
4344 {
4445 ResourceName : "sumologic_ingest_budget_v2.foo" ,
@@ -58,13 +59,14 @@ func TestAccSumologicIngestBudgetV2_create(t *testing.T) {
5859 testDescription := "description-900AB"
5960 testAction := "stopCollecting"
6061 testCapacityBytes := 1000
62+ testBudgetType := "dailyVolume"
6163 resource .Test (t , resource.TestCase {
6264 PreCheck : func () { testAccPreCheck (t ) },
6365 Providers : testAccProviders ,
6466 CheckDestroy : testAccCheckIngestBudgetV2Destroy (ingestBudgetV2 ),
6567 Steps : []resource.TestStep {
6668 {
67- Config : testAccSumologicIngestBudgetV2 (testName , testScope , testTimezone , testResetTime , testAuditThreshold , testDescription , testAction , testCapacityBytes ),
69+ Config : testAccSumologicIngestBudgetV2 (testName , testScope , testTimezone , testResetTime , testAuditThreshold , testDescription , testAction , testCapacityBytes , testBudgetType ),
6870 Check : resource .ComposeTestCheckFunc (
6971 testAccCheckIngestBudgetV2Exists ("sumologic_ingest_budget_v2.test" , & ingestBudgetV2 , t ),
7072 testAccCheckIngestBudgetV2Attributes ("sumologic_ingest_budget_v2.test" ),
@@ -76,6 +78,7 @@ func TestAccSumologicIngestBudgetV2_create(t *testing.T) {
7678 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "description" , testDescription ),
7779 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "action" , testAction ),
7880 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "capacity_bytes" , strconv .Itoa (testCapacityBytes )),
81+ resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "budget_type" , testBudgetType ),
7982 ),
8083 },
8184 },
@@ -92,6 +95,7 @@ func TestAccSumologicIngestBudgetV2_update(t *testing.T) {
9295 testDescription := "description-2tAk8"
9396 testAction := "stopCollecting"
9497 testCapacityBytes := 1000
98+ testBudgetType := "dailyVolume"
9599
96100 testUpdatedName := "Developer BudgetUpdate"
97101 testUpdatedScope := "_sourceCategory=*prod*nginx*Update"
@@ -101,14 +105,15 @@ func TestAccSumologicIngestBudgetV2_update(t *testing.T) {
101105 testUpdatedDescription := "description-pY8kDUpdate"
102106 testUpdatedAction := "keepCollecting"
103107 testUpdatedCapacityBytes := 1001
108+ testUpdatedBudgetType := "dailyVolume"
104109
105110 resource .Test (t , resource.TestCase {
106111 PreCheck : func () { testAccPreCheck (t ) },
107112 Providers : testAccProviders ,
108113 CheckDestroy : testAccCheckIngestBudgetV2Destroy (ingestBudgetV2 ),
109114 Steps : []resource.TestStep {
110115 {
111- Config : testAccSumologicIngestBudgetV2 (testName , testScope , testTimezone , testResetTime , testAuditThreshold , testDescription , testAction , testCapacityBytes ),
116+ Config : testAccSumologicIngestBudgetV2 (testName , testScope , testTimezone , testResetTime , testAuditThreshold , testDescription , testAction , testCapacityBytes , testBudgetType ),
112117 Check : resource .ComposeTestCheckFunc (
113118 testAccCheckIngestBudgetV2Exists ("sumologic_ingest_budget_v2.test" , & ingestBudgetV2 , t ),
114119 testAccCheckIngestBudgetV2Attributes ("sumologic_ingest_budget_v2.test" ),
@@ -120,10 +125,11 @@ func TestAccSumologicIngestBudgetV2_update(t *testing.T) {
120125 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "description" , testDescription ),
121126 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "action" , testAction ),
122127 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "capacity_bytes" , strconv .Itoa (testCapacityBytes )),
128+ resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "budget_type" , testBudgetType ),
123129 ),
124130 },
125131 {
126- Config : testAccSumologicIngestBudgetV2Update (testUpdatedName , testUpdatedScope , testUpdatedTimezone , testUpdatedResetTime , testUpdatedAuditThreshold , testUpdatedDescription , testUpdatedAction , testUpdatedCapacityBytes ),
132+ Config : testAccSumologicIngestBudgetV2Update (testUpdatedName , testUpdatedScope , testUpdatedTimezone , testUpdatedResetTime , testUpdatedAuditThreshold , testUpdatedDescription , testUpdatedAction , testUpdatedCapacityBytes , testUpdatedBudgetType ),
127133 Check : resource .ComposeTestCheckFunc (
128134 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "name" , testUpdatedName ),
129135 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "scope" , testUpdatedScope ),
@@ -133,6 +139,7 @@ func TestAccSumologicIngestBudgetV2_update(t *testing.T) {
133139 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "description" , testUpdatedDescription ),
134140 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "action" , testUpdatedAction ),
135141 resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "capacity_bytes" , strconv .Itoa (testUpdatedCapacityBytes )),
142+ resource .TestCheckResourceAttr ("sumologic_ingest_budget_v2.test" , "budget_type" , testUpdatedBudgetType ),
136143 ),
137144 },
138145 },
@@ -179,7 +186,7 @@ func testAccCheckIngestBudgetV2Exists(name string, ingestBudgetV2 *IngestBudgetV
179186 return nil
180187 }
181188}
182- func testAccCheckSumologicIngestBudgetV2ConfigImported (name string , scope string , timezone string , resetTime string , auditThreshold int , description string , action string , capacityBytes int ) string {
189+ func testAccCheckSumologicIngestBudgetV2ConfigImported (name string , scope string , timezone string , resetTime string , auditThreshold int , description string , action string , capacityBytes int , budgetType string ) string {
183190 return fmt .Sprintf (`
184191resource "sumologic_ingest_budget_v2" "foo" {
185192 name = "%s"
@@ -190,11 +197,12 @@ resource "sumologic_ingest_budget_v2" "foo" {
190197 description = "%s"
191198 action = "%s"
192199 capacity_bytes = %d
200+ budget_type = "%s"
193201}
194- ` , name , scope , timezone , resetTime , auditThreshold , description , action , capacityBytes )
202+ ` , name , scope , timezone , resetTime , auditThreshold , description , action , capacityBytes , budgetType )
195203}
196204
197- func testAccSumologicIngestBudgetV2 (name string , scope string , timezone string , resetTime string , auditThreshold int , description string , action string , capacityBytes int ) string {
205+ func testAccSumologicIngestBudgetV2 (name string , scope string , timezone string , resetTime string , auditThreshold int , description string , action string , capacityBytes int , budgetType string ) string {
198206 return fmt .Sprintf (`
199207resource "sumologic_ingest_budget_v2" "test" {
200208 name = "%s"
@@ -205,11 +213,12 @@ resource "sumologic_ingest_budget_v2" "test" {
205213 description = "%s"
206214 action = "%s"
207215 capacity_bytes = %d
216+ budget_type = "%s"
208217}
209- ` , name , scope , timezone , resetTime , auditThreshold , description , action , capacityBytes )
218+ ` , name , scope , timezone , resetTime , auditThreshold , description , action , capacityBytes , budgetType )
210219}
211220
212- func testAccSumologicIngestBudgetV2Update (name string , scope string , timezone string , resetTime string , auditThreshold int , description string , action string , capacityBytes int ) string {
221+ func testAccSumologicIngestBudgetV2Update (name string , scope string , timezone string , resetTime string , auditThreshold int , description string , action string , capacityBytes int , budgetType string ) string {
213222 return fmt .Sprintf (`
214223resource "sumologic_ingest_budget_v2" "test" {
215224 name = "%s"
@@ -220,8 +229,9 @@ resource "sumologic_ingest_budget_v2" "test" {
220229 description = "%s"
221230 action = "%s"
222231 capacity_bytes = %d
232+ budget_type = "%s"
223233}
224- ` , name , scope , timezone , resetTime , auditThreshold , description , action , capacityBytes )
234+ ` , name , scope , timezone , resetTime , auditThreshold , description , action , capacityBytes , budgetType )
225235}
226236
227237func testAccCheckIngestBudgetV2Attributes (name string ) resource.TestCheckFunc {
@@ -234,6 +244,7 @@ func testAccCheckIngestBudgetV2Attributes(name string) resource.TestCheckFunc {
234244 resource .TestCheckResourceAttrSet (name , "audit_threshold" ),
235245 resource .TestCheckResourceAttrSet (name , "description" ),
236246 resource .TestCheckResourceAttrSet (name , "action" ),
247+ resource .TestCheckResourceAttrSet (name , "budget_type" ),
237248 resource .TestCheckResourceAttrSet (name , "capacity_bytes" ),
238249 )
239250 return f (s )
0 commit comments