forked from Azure/bicep-registry-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
108 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:<version>`. | ||
- [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:<version>' = { | |
</details> | ||
<p> | ||
|
||
### 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`. | ||
|
||
|
||
<details> | ||
|
||
<summary>via Bicep module</summary> | ||
|
||
```bicep | ||
module budget 'br/public:avm/res/consumption/budget:<version>' = { | ||
name: 'budgetDeployment' | ||
params: { | ||
// Required parameters | ||
amount: 500 | ||
name: 'cbfcst001' | ||
// Non-required parameters | ||
contactEmails: [ | ||
'[email protected]' | ||
] | ||
location: '<location>' | ||
thresholdType: 'Forecasted' | ||
} | ||
} | ||
``` | ||
|
||
</details> | ||
<p> | ||
|
||
<details> | ||
|
||
<summary>via JSON Parameter file</summary> | ||
|
||
```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": [ | ||
"[email protected]" | ||
] | ||
}, | ||
"location": { | ||
"value": "<location>" | ||
}, | ||
"thresholdType": { | ||
"value": "Forecasted" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
</details> | ||
<p> | ||
|
||
### 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:<version>' = { | |
</details> | ||
<p> | ||
|
||
### 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. | ||
|
||
|
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
37 changes: 37 additions & 0 deletions
37
avm/res/consumption/budget/tests/e2e/forecasted/main.test.bicep
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 |
---|---|---|
@@ -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: [ | ||
'[email protected]' | ||
] | ||
thresholdType: 'Forecasted' | ||
} | ||
} | ||
] |