diff --git a/avm/res/consumption/budget/README.md b/avm/res/consumption/budget/README.md index 4b4f942775..927392c5f1 100644 --- a/avm/res/consumption/budget/README.md +++ b/avm/res/consumption/budget/README.md @@ -26,8 +26,9 @@ The following section provides usage examples for the module, which were used to >**Note**: To reference the module, please use the following syntax `br/public:avm/res/consumption/budget:`. - [Using only defaults](#example-1-using-only-defaults) -- [Using large parameter set](#example-2-using-large-parameter-set) -- [WAF-aligned](#example-3-waf-aligned) +- [Using `thresholdType` `Forecasted`](#example-2-using-thresholdtype-forecasted) +- [Using large parameter set](#example-3-using-large-parameter-set) +- [WAF-aligned](#example-4-waf-aligned) ### Example 1: _Using only defaults_ @@ -89,7 +90,71 @@ module budget 'br/public:avm/res/consumption/budget:' = {

-### Example 2: _Using large parameter set_ +### Example 2: _Using `thresholdType` `Forecasted`_ + +This instance deploys the module with the minimum set of required parameters and `thresholdType` `Forecasted`. + + +

+ +via Bicep module + +```bicep +module budget 'br/public:avm/res/consumption/budget:' = { + name: 'budgetDeployment' + params: { + // Required parameters + amount: 500 + name: 'cbfcst001' + // Non-required parameters + contactEmails: [ + 'dummy@contoso.com' + ] + location: '' + thresholdType: 'Forecasted' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "amount": { + "value": 500 + }, + "name": { + "value": "cbfcst001" + }, + // Non-required parameters + "contactEmails": { + "value": [ + "dummy@contoso.com" + ] + }, + "location": { + "value": "" + }, + "thresholdType": { + "value": "Forecasted" + } + } +} +``` + +
+

+ +### Example 3: _Using large parameter set_ This instance deploys the module with most of its features enabled. @@ -175,7 +240,7 @@ module budget 'br/public:avm/res/consumption/budget:' = {

-### Example 3: _WAF-aligned_ +### Example 4: _WAF-aligned_ This instance deploys the module in alignment with the best-practices of the Azure Well-Architected Framework. diff --git a/avm/res/consumption/budget/main.json b/avm/res/consumption/budget/main.json index d51817dbd2..b68ced8a2d 100644 --- a/avm/res/consumption/budget/main.json +++ b/avm/res/consumption/budget/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.28.1.47646", - "templateHash": "13231547958069431465" + "version": "0.29.47.4906", + "templateHash": "9899827298268482806" }, "name": "Consumption Budgets", "description": "This module deploys a Consumption Budget for Subscriptions.", diff --git a/avm/res/consumption/budget/tests/e2e/forecasted/main.test.bicep b/avm/res/consumption/budget/tests/e2e/forecasted/main.test.bicep new file mode 100644 index 0000000000..91112be1f4 --- /dev/null +++ b/avm/res/consumption/budget/tests/e2e/forecasted/main.test.bicep @@ -0,0 +1,37 @@ +targetScope = 'subscription' + +metadata name = 'Using `thresholdType` `Forecasted`' +metadata description = 'This instance deploys the module with the minimum set of required parameters and `thresholdType` `Forecasted`.' + +// ========== // +// Parameters // +// ========== // + +@description('Optional. The location to deploy resources to.') +param resourceLocation string = deployment().location + +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') +param serviceShort string = 'cbfcst' + +@description('Optional. A token to inject into the name of each resource.') +param namePrefix string = '#_namePrefix_#' + +// ============== // +// Test Execution // +// ============== // + +@batchSize(1) +module testDeployment '../../../main.bicep' = [ + for iteration in ['init', 'idem']: { + name: '${uniqueString(deployment().name)}-test-${serviceShort}-${iteration}' + params: { + name: '${namePrefix}${serviceShort}001' + location: resourceLocation + amount: 500 + contactEmails: [ + 'dummy@contoso.com' + ] + thresholdType: 'Forecasted' + } + } +]