Skip to content

Commit

Permalink
Merge branch 'Azure:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
hundredacres authored Aug 20, 2024
2 parents 4ba8a77 + 04b5efb commit d2e3313
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 6 deletions.
73 changes: 69 additions & 4 deletions avm/res/consumption/budget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions avm/res/consumption/budget/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
37 changes: 37 additions & 0 deletions avm/res/consumption/budget/tests/e2e/forecasted/main.test.bicep
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'
}
}
]

0 comments on commit d2e3313

Please sign in to comment.