pspulumiyaml.azurenative.consumption.psm1
using module pspulumiyaml function Invoke-AzureNativeFunctionConsumptionGetBudget { param ( [parameter(mandatory=$False,HelpMessage='Budget Name.)')] [string] $budgetName, [parameter(mandatory=$False,HelpMessage='The scope associated with budget operations. This includes ''/subscriptions/{subscriptionId}/'' for subscription scope, ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'' for resourceGroup scope, ''/providers/Microsoft.Billing/billingAccounts/{billingAccountId}'' for Billing Account scope, ''/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'' for Department scope, ''/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'' for EnrollmentAccount scope, ''/providers/Microsoft.Management/managementGroups/{managementGroupId}'' for Management Group scope, ''/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'' for billingProfile scope, ''providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'' for invoiceSection scope.)')] [string] $scope ) process { $arguments = @{} $arguments["budgetName"] = $budgetName $arguments["scope"] = $scope $functionObject = Invoke-PulumiFunction -Name azure-native:consumption:getBudget -variableName $([guid]::NewGuid().Guid) -Arguments $arguments return $functionObject } } class Notification { [ValidateSet('EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo')] [string] $operator [ValidateSet('en-us', 'ja-jp', 'zh-cn', 'de-de', 'es-es', 'fr-fr', 'it-it', 'ko-kr', 'pt-br', 'ru-ru', 'zh-tw', 'cs-cz', 'pl-pl', 'tr-tr', 'da-dk', 'en-gb', 'hu-hu', 'nb-no', 'nl-nl', 'pt-pt', 'sv-se')] [string] $locale [ValidateSet('en-us', 'ja-jp', 'zh-cn', 'de-de', 'es-es', 'fr-fr', 'it-it', 'ko-kr', 'pt-br', 'ru-ru', 'zh-tw', 'cs-cz', 'pl-pl', 'tr-tr', 'da-dk', 'en-gb', 'hu-hu', 'nb-no', 'nl-nl', 'pt-pt', 'sv-se')] [string[]] $contactRoles [ValidateSet('en-us', 'ja-jp', 'zh-cn', 'de-de', 'es-es', 'fr-fr', 'it-it', 'ko-kr', 'pt-br', 'ru-ru', 'zh-tw', 'cs-cz', 'pl-pl', 'tr-tr', 'da-dk', 'en-gb', 'hu-hu', 'nb-no', 'nl-nl', 'pt-pt', 'sv-se')] [string[]] $contactGroups [ValidateSet('en-us', 'ja-jp', 'zh-cn', 'de-de', 'es-es', 'fr-fr', 'it-it', 'ko-kr', 'pt-br', 'ru-ru', 'zh-tw', 'cs-cz', 'pl-pl', 'tr-tr', 'da-dk', 'en-gb', 'hu-hu', 'nb-no', 'nl-nl', 'pt-pt', 'sv-se')] [int] $threshold [ValidateSet('Actual')] [string] $thresholdType [ValidateSet('Actual')] [bool] $enabled [ValidateSet('Actual')] [string[]] $contactEmails } function New-AzureNativeTypeConsumptionNotification { param ( [parameter(mandatory=$False,HelpMessage='The comparison operator.)')] [string] [ValidateSet('EqualTo', 'GreaterThan', 'GreaterThanOrEqualTo')] $operator, [parameter(mandatory=$False,HelpMessage='Language in which the recipient will receive the notification)')] [string] [ValidateSet('en-us', 'ja-jp', 'zh-cn', 'de-de', 'es-es', 'fr-fr', 'it-it', 'ko-kr', 'pt-br', 'ru-ru', 'zh-tw', 'cs-cz', 'pl-pl', 'tr-tr', 'da-dk', 'en-gb', 'hu-hu', 'nb-no', 'nl-nl', 'pt-pt', 'sv-se')] $locale, [parameter(mandatory=$False,HelpMessage='Contact roles to send the budget notification to when the threshold is exceeded.)')] [string[]] $contactRoles, [parameter(mandatory=$False,HelpMessage='Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully qualified Azure resource id. Only supported at Subscription or Resource Group scopes.)')] [string[]] $contactGroups, [parameter(mandatory=$False,HelpMessage='Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is always percent and has to be between 0 and 1000.)')] [int] $threshold, [parameter(mandatory=$False,HelpMessage='The type of threshold)')] [string] [ValidateSet('Actual')] $thresholdType, [parameter(mandatory=$False,HelpMessage='The notification is enabled or not.)')] [bool] $enabled, [parameter(mandatory=$False,HelpMessage='Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must have at least one contact email specified.)')] [string[]] $contactEmails ) process { return $([Notification]$PSBoundParameters) } } class BudgetComparisonExpression { [string[]] $values [string] $name [ValidateSet('In')] [string] $operator } function New-AzureNativeTypeConsumptionBudgetComparisonExpression { param ( [parameter(mandatory=$False,HelpMessage='Array of values to use for comparison)')] [string[]] $values, [parameter(mandatory=$False,HelpMessage='The name of the column to use in comparison.)')] [string] $name, [parameter(mandatory=$False,HelpMessage='The operator to use for comparison.)')] [string] [ValidateSet('In')] $operator ) process { return $([BudgetComparisonExpression]$PSBoundParameters) } } class BudgetFilterProperties { [BudgetComparisonExpression] $tags [BudgetComparisonExpression] $dimensions } function New-AzureNativeTypeConsumptionBudgetFilterProperties { param ( [parameter(mandatory=$False,HelpMessage='Has comparison expression for a tag)')] [BudgetComparisonExpression] $tags, [parameter(mandatory=$False,HelpMessage='Has comparison expression for a dimension)')] [BudgetComparisonExpression] $dimensions ) process { return $([BudgetFilterProperties]$PSBoundParameters) } } class BudgetFilter { [BudgetFilterProperties[]] $and [BudgetComparisonExpression] $dimensions [BudgetFilterProperties] $not [BudgetComparisonExpression] $tags } function New-AzureNativeTypeConsumptionBudgetFilter { param ( [parameter(mandatory=$False,HelpMessage='The logical "AND" expression. Must have at least 2 items.)')] $and, [parameter(mandatory=$False,HelpMessage='Has comparison expression for a dimension)')] [BudgetComparisonExpression] $dimensions, [parameter(mandatory=$False,HelpMessage='The logical "NOT" expression.)')] [BudgetFilterProperties] $not, [parameter(mandatory=$False,HelpMessage='Has comparison expression for a tag)')] [BudgetComparisonExpression] $tags ) process { return $([BudgetFilter]$PSBoundParameters) } } class BudgetTimePeriod { [string] $startDate [string] $endDate } function New-AzureNativeTypeConsumptionBudgetTimePeriod { param ( [parameter(mandatory=$False,HelpMessage='The start date for the budget.)')] [string] $startDate, [parameter(mandatory=$False,HelpMessage='The end date for the budget. If not provided, we default this to 10 years from the start date.)')] [string] $endDate ) process { return $([BudgetTimePeriod]$PSBoundParameters) } } function New-AzureNativeConsumptionBudget { [Alias('azure_native_consumption_budget')] param ( [parameter(mandatory=$False,HelpMessage='Dictionary of notifications associated with the budget. Budget can have up to five notifications.)')] [Notification] $notifications, [parameter(mandatory=$False,HelpMessage='The total amount of cost to track with the budget)')] [int] $amount, [parameter(mandatory=$False,HelpMessage='May be used to filter budgets by user-specified dimensions and/or tags.)')] [BudgetFilter] $filter, [parameter(mandatory=$False,HelpMessage='The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers)')] [string] [ValidateSet('Monthly', 'Quarterly', 'Annually', 'BillingMonth', 'BillingQuarter', 'BillingAnnual')] $timeGrain, [parameter(mandatory=$False,HelpMessage='The scope associated with budget operations. This includes ''/subscriptions/{subscriptionId}/'' for subscription scope, ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'' for resourceGroup scope, ''/providers/Microsoft.Billing/billingAccounts/{billingAccountId}'' for Billing Account scope, ''/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'' for Department scope, ''/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'' for EnrollmentAccount scope, ''/providers/Microsoft.Management/managementGroups/{managementGroupId}'' for Management Group scope, ''/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'' for billingProfile scope, ''providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'' for invoiceSection scope.)')] [string] $scope, [parameter(mandatory=$False,HelpMessage='The category of the budget, whether the budget tracks cost or usage.)')] [string] [ValidateSet('Cost')] $category, [parameter(mandatory=$False,HelpMessage='eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.)')] [string] $eTag, [parameter(mandatory=$False,HelpMessage='Budget Name.)')] [string] $budgetName, [parameter(mandatory=$False,HelpMessage='Has start and end date of the budget. The start date must be first of the month and should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve months. Past start date should be selected within the timegrain period. There are no restrictions on the end date.)')] [BudgetTimePeriod] $timePeriod, [parameter(mandatory,HelpMessage='The reference to call when you want to make a dependency to another resource')] [string] $pulumiid ) process { $resource = [pulumiresource]::new($pulumiid, "azure-native:consumption:Budget") $resource.properties["amount"] = $amount $resource.properties["category"] = $category $resource.properties["scope"] = $scope $resource.properties["timeGrain"] = $timeGrain $resource.properties["timePeriod"] = $timePeriod if($PSBoundParameters.Keys -icontains 'notifications') { $resource.properties["notifications"] = $notifications } if($PSBoundParameters.Keys -icontains 'filter') { $resource.properties["filter"] = $filter } if($PSBoundParameters.Keys -icontains 'eTag') { $resource.properties["eTag"] = $eTag } if($PSBoundParameters.Keys -icontains 'budgetName') { $resource.properties["budgetName"] = $budgetName } $global:pulumiresources += $resource return $resource } } |