Partager via


Microsoft.CostManagement costAllocationRules 2020-03-01-preview

Bicep resource definition

The costAllocationRules resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.CostManagement/costAllocationRules resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.CostManagement/costAllocationRules@2020-03-01-preview' = {
  scope: resourceSymbolicName or scope
  name: 'string'
  properties: {
    description: 'string'
    details: {
      sourceResources: [
        {
          name: 'string'
          resourceType: 'string'
          values: [
            'string'
          ]
        }
      ]
      targetResources: [
        {
          name: 'string'
          policyType: 'string'
          resourceType: 'string'
          values: [
            {
              name: 'string'
              percentage: int
            }
          ]
        }
      ]
    }
    status: 'string'
  }
}

Property Values

CostAllocationProportion

Name Description Value
name Target resource for cost allocation string (required)
percentage Percentage of source cost to allocate to this resource. This value can be specified to two decimal places and the total percentage of all resources in this rule must sum to 100.00. int (required)

CostAllocationRuleDetails

Name Description Value
sourceResources Source resources for cost allocation. At this time, this list can contain no more than one element. SourceCostAllocationResource[]
targetResources Target resources for cost allocation. At this time, this list can contain no more than one element. TargetCostAllocationResource[]

CostAllocationRuleProperties

Name Description Value
description Description of a cost allocation rule. string
details Resource information for the cost allocation rule CostAllocationRuleDetails (required)
status Status of the rule 'Active'
'NotActive'
'Processing' (required)

Microsoft.CostManagement/costAllocationRules

Name Description Value
name The resource name string (required)
properties Cost allocation rule properties CostAllocationRuleProperties
scope Use when creating a resource at a scope that is different than the deployment scope. Set this property to the symbolic name of a resource to apply the extension resource.

SourceCostAllocationResource

Name Description Value
name If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag string (required)
resourceType Type of resources contained in this cost allocation rule 'Dimension'
'Tag' (required)
values Source Resources for cost allocation. This list cannot contain more than 25 values. string[] (required)

TargetCostAllocationResource

Name Description Value
name If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag string (required)
policyType Method of cost allocation for the rule 'FixedProportion' (required)
resourceType Type of resources contained in this cost allocation rule 'Dimension'
'Tag' (required)
values Target resources for cost allocation. This list cannot contain more than 25 values. CostAllocationProportion[] (required)

ARM template resource definition

The costAllocationRules resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.CostManagement/costAllocationRules resource, add the following JSON to your template.

{
  "type": "Microsoft.CostManagement/costAllocationRules",
  "apiVersion": "2020-03-01-preview",
  "name": "string",
  "properties": {
    "description": "string",
    "details": {
      "sourceResources": [
        {
          "name": "string",
          "resourceType": "string",
          "values": [ "string" ]
        }
      ],
      "targetResources": [
        {
          "name": "string",
          "policyType": "string",
          "resourceType": "string",
          "values": [
            {
              "name": "string",
              "percentage": "int"
            }
          ]
        }
      ]
    },
    "status": "string"
  }
}

Property Values

CostAllocationProportion

Name Description Value
name Target resource for cost allocation string (required)
percentage Percentage of source cost to allocate to this resource. This value can be specified to two decimal places and the total percentage of all resources in this rule must sum to 100.00. int (required)

CostAllocationRuleDetails

Name Description Value
sourceResources Source resources for cost allocation. At this time, this list can contain no more than one element. SourceCostAllocationResource[]
targetResources Target resources for cost allocation. At this time, this list can contain no more than one element. TargetCostAllocationResource[]

CostAllocationRuleProperties

Name Description Value
description Description of a cost allocation rule. string
details Resource information for the cost allocation rule CostAllocationRuleDetails (required)
status Status of the rule 'Active'
'NotActive'
'Processing' (required)

Microsoft.CostManagement/costAllocationRules

Name Description Value
apiVersion The api version '2020-03-01-preview'
name The resource name string (required)
properties Cost allocation rule properties CostAllocationRuleProperties
type The resource type 'Microsoft.CostManagement/costAllocationRules'

SourceCostAllocationResource

Name Description Value
name If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag string (required)
resourceType Type of resources contained in this cost allocation rule 'Dimension'
'Tag' (required)
values Source Resources for cost allocation. This list cannot contain more than 25 values. string[] (required)

TargetCostAllocationResource

Name Description Value
name If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag string (required)
policyType Method of cost allocation for the rule 'FixedProportion' (required)
resourceType Type of resources contained in this cost allocation rule 'Dimension'
'Tag' (required)
values Target resources for cost allocation. This list cannot contain more than 25 values. CostAllocationProportion[] (required)

Exemples d’utilisation

Terraform (AzAPI provider) resource definition

The costAllocationRules resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.CostManagement/costAllocationRules resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.CostManagement/costAllocationRules@2020-03-01-preview"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      description = "string"
      details = {
        sourceResources = [
          {
            name = "string"
            resourceType = "string"
            values = [
              "string"
            ]
          }
        ]
        targetResources = [
          {
            name = "string"
            policyType = "string"
            resourceType = "string"
            values = [
              {
                name = "string"
                percentage = int
              }
            ]
          }
        ]
      }
      status = "string"
    }
  }
}

Property Values

CostAllocationProportion

Name Description Value
name Target resource for cost allocation string (required)
percentage Percentage of source cost to allocate to this resource. This value can be specified to two decimal places and the total percentage of all resources in this rule must sum to 100.00. int (required)

CostAllocationRuleDetails

Name Description Value
sourceResources Source resources for cost allocation. At this time, this list can contain no more than one element. SourceCostAllocationResource[]
targetResources Target resources for cost allocation. At this time, this list can contain no more than one element. TargetCostAllocationResource[]

CostAllocationRuleProperties

Name Description Value
description Description of a cost allocation rule. string
details Resource information for the cost allocation rule CostAllocationRuleDetails (required)
status Status of the rule 'Active'
'NotActive'
'Processing' (required)

Microsoft.CostManagement/costAllocationRules

Name Description Value
name The resource name string (required)
parent_id The ID of the resource to apply this extension resource to. string (required)
properties Cost allocation rule properties CostAllocationRuleProperties
type The resource type "Microsoft.CostManagement/costAllocationRules@2020-03-01-preview"

SourceCostAllocationResource

Name Description Value
name If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag string (required)
resourceType Type of resources contained in this cost allocation rule 'Dimension'
'Tag' (required)
values Source Resources for cost allocation. This list cannot contain more than 25 values. string[] (required)

TargetCostAllocationResource

Name Description Value
name If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag string (required)
policyType Method of cost allocation for the rule 'FixedProportion' (required)
resourceType Type of resources contained in this cost allocation rule 'Dimension'
'Tag' (required)
values Target resources for cost allocation. This list cannot contain more than 25 values. CostAllocationProportion[] (required)