-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consumption
- remove 4.0 flag and fix tests (#27511)
* fix comsumption issue * remove forcenew for threshold_type * terrafmt * link issue * skip delete error on 404 * remove linked issue * remove _disappear test and revert skipping 404 in deleting
- Loading branch information
Showing
6 changed files
with
9 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,18 +111,6 @@ func TestAccConsumptionBudgetResourceGroup_completeUpdate(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccConsumptionBudgetResourceGroup_disappears(t *testing.T) { | ||
data := acceptance.BuildTestData(t, "azurerm_consumption_budget_resource_group", "test") | ||
r := ConsumptionBudgetResourceGroupResource{} | ||
|
||
data.ResourceTest(t, r, []acceptance.TestStep{ | ||
data.DisappearsStep(acceptance.DisappearsStepData{ | ||
Config: r.basic, | ||
TestResource: r, | ||
}), | ||
}) | ||
} | ||
|
||
func (ConsumptionBudgetResourceGroupResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { | ||
id, err := budgets.ParseScopedBudgetID(state.ID) | ||
if err != nil { | ||
|
@@ -404,12 +392,10 @@ resource "azurerm_consumption_budget_resource_group" "test" { | |
} | ||
notification { | ||
enabled = true | ||
threshold = 90.0 | ||
operator = "EqualTo" | ||
// We don't update the value of threshold_type because toggling between the two seems to be broken | ||
// See the comment on threshold_type in the schema for more details | ||
threshold_type = "Forecasted" | ||
enabled = true | ||
threshold = 90.0 | ||
operator = "EqualTo" | ||
threshold_type = "Actual" | ||
contact_emails = [ | ||
"[email protected]", | ||
|
@@ -439,16 +425,3 @@ resource "azurerm_consumption_budget_resource_group" "test" { | |
} | ||
`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, consumptionBudgetTestStartDate().Format(time.RFC3339)) | ||
} | ||
|
||
func (t ConsumptionBudgetResourceGroupResource) Destroy(ctx context.Context, client *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { | ||
id, err := budgets.ParseScopedBudgetID(state.ID) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
if _, err = client.Consumption.BudgetsClient.Delete(ctx, *id); err != nil { | ||
return nil, fmt.Errorf("deleting %s: %+v", *id, err) | ||
} | ||
|
||
return utils.Bool(true), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters