1. Packages
  2. Azure Native
  3. API Docs
  4. costmanagement
  5. getCostAllocationRule
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi

azure-native.costmanagement.getCostAllocationRule

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi

    Get a cost allocation rule by rule name and billing account or enterprise enrollment. Azure REST API version: 2020-03-01-preview.

    Other available API versions: 2023-08-01, 2023-09-01, 2023-11-01.

    Using getCostAllocationRule

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCostAllocationRule(args: GetCostAllocationRuleArgs, opts?: InvokeOptions): Promise<GetCostAllocationRuleResult>
    function getCostAllocationRuleOutput(args: GetCostAllocationRuleOutputArgs, opts?: InvokeOptions): Output<GetCostAllocationRuleResult>
    def get_cost_allocation_rule(billing_account_id: Optional[str] = None,
                                 rule_name: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetCostAllocationRuleResult
    def get_cost_allocation_rule_output(billing_account_id: Optional[pulumi.Input[str]] = None,
                                 rule_name: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetCostAllocationRuleResult]
    func LookupCostAllocationRule(ctx *Context, args *LookupCostAllocationRuleArgs, opts ...InvokeOption) (*LookupCostAllocationRuleResult, error)
    func LookupCostAllocationRuleOutput(ctx *Context, args *LookupCostAllocationRuleOutputArgs, opts ...InvokeOption) LookupCostAllocationRuleResultOutput

    > Note: This function is named LookupCostAllocationRule in the Go SDK.

    public static class GetCostAllocationRule 
    {
        public static Task<GetCostAllocationRuleResult> InvokeAsync(GetCostAllocationRuleArgs args, InvokeOptions? opts = null)
        public static Output<GetCostAllocationRuleResult> Invoke(GetCostAllocationRuleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCostAllocationRuleResult> getCostAllocationRule(GetCostAllocationRuleArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure-native:costmanagement:getCostAllocationRule
      arguments:
        # arguments dictionary

    The following arguments are supported:

    BillingAccountId string
    BillingAccount ID
    RuleName string
    Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters other than '_' and '-'. The max length is 260 characters.
    BillingAccountId string
    BillingAccount ID
    RuleName string
    Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters other than '_' and '-'. The max length is 260 characters.
    billingAccountId String
    BillingAccount ID
    ruleName String
    Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters other than '_' and '-'. The max length is 260 characters.
    billingAccountId string
    BillingAccount ID
    ruleName string
    Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters other than '_' and '-'. The max length is 260 characters.
    billing_account_id str
    BillingAccount ID
    rule_name str
    Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters other than '_' and '-'. The max length is 260 characters.
    billingAccountId String
    BillingAccount ID
    ruleName String
    Cost allocation rule name. The name cannot include spaces or any non alphanumeric characters other than '_' and '-'. The max length is 260 characters.

    getCostAllocationRule Result

    The following output properties are available:

    Id string
    Azure Resource Manager Id for the rule. This is a read ony value.
    Name string
    Name of the rule. This is a read only value.
    Properties Pulumi.AzureNative.CostManagement.Outputs.CostAllocationRulePropertiesResponse
    Cost allocation rule properties
    Type string
    Resource type of the rule. This is a read only value of Microsoft.CostManagement/CostAllocationRule.
    Id string
    Azure Resource Manager Id for the rule. This is a read ony value.
    Name string
    Name of the rule. This is a read only value.
    Properties CostAllocationRulePropertiesResponse
    Cost allocation rule properties
    Type string
    Resource type of the rule. This is a read only value of Microsoft.CostManagement/CostAllocationRule.
    id String
    Azure Resource Manager Id for the rule. This is a read ony value.
    name String
    Name of the rule. This is a read only value.
    properties CostAllocationRulePropertiesResponse
    Cost allocation rule properties
    type String
    Resource type of the rule. This is a read only value of Microsoft.CostManagement/CostAllocationRule.
    id string
    Azure Resource Manager Id for the rule. This is a read ony value.
    name string
    Name of the rule. This is a read only value.
    properties CostAllocationRulePropertiesResponse
    Cost allocation rule properties
    type string
    Resource type of the rule. This is a read only value of Microsoft.CostManagement/CostAllocationRule.
    id str
    Azure Resource Manager Id for the rule. This is a read ony value.
    name str
    Name of the rule. This is a read only value.
    properties CostAllocationRulePropertiesResponse
    Cost allocation rule properties
    type str
    Resource type of the rule. This is a read only value of Microsoft.CostManagement/CostAllocationRule.
    id String
    Azure Resource Manager Id for the rule. This is a read ony value.
    name String
    Name of the rule. This is a read only value.
    properties Property Map
    Cost allocation rule properties
    type String
    Resource type of the rule. This is a read only value of Microsoft.CostManagement/CostAllocationRule.

    Supporting Types

    CostAllocationProportionResponse

    Name string
    Target resource for cost allocation
    Percentage double
    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.
    Name string
    Target resource for cost allocation
    Percentage float64
    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.
    name String
    Target resource for cost allocation
    percentage Double
    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.
    name string
    Target resource for cost allocation
    percentage number
    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.
    name str
    Target resource for cost allocation
    percentage float
    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.
    name String
    Target resource for cost allocation
    percentage Number
    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.

    CostAllocationRuleDetailsResponse

    SourceResources List<Pulumi.AzureNative.CostManagement.Inputs.SourceCostAllocationResourceResponse>
    Source resources for cost allocation. At this time, this list can contain no more than one element.
    TargetResources List<Pulumi.AzureNative.CostManagement.Inputs.TargetCostAllocationResourceResponse>
    Target resources for cost allocation. At this time, this list can contain no more than one element.
    SourceResources []SourceCostAllocationResourceResponse
    Source resources for cost allocation. At this time, this list can contain no more than one element.
    TargetResources []TargetCostAllocationResourceResponse
    Target resources for cost allocation. At this time, this list can contain no more than one element.
    sourceResources List<SourceCostAllocationResourceResponse>
    Source resources for cost allocation. At this time, this list can contain no more than one element.
    targetResources List<TargetCostAllocationResourceResponse>
    Target resources for cost allocation. At this time, this list can contain no more than one element.
    sourceResources SourceCostAllocationResourceResponse[]
    Source resources for cost allocation. At this time, this list can contain no more than one element.
    targetResources TargetCostAllocationResourceResponse[]
    Target resources for cost allocation. At this time, this list can contain no more than one element.
    source_resources Sequence[SourceCostAllocationResourceResponse]
    Source resources for cost allocation. At this time, this list can contain no more than one element.
    target_resources Sequence[TargetCostAllocationResourceResponse]
    Target resources for cost allocation. At this time, this list can contain no more than one element.
    sourceResources List<Property Map>
    Source resources for cost allocation. At this time, this list can contain no more than one element.
    targetResources List<Property Map>
    Target resources for cost allocation. At this time, this list can contain no more than one element.

    CostAllocationRulePropertiesResponse

    CreatedDate string
    Time at which the rule was created. Rules that change cost for the same resource are applied in order of creation.
    Details Pulumi.AzureNative.CostManagement.Inputs.CostAllocationRuleDetailsResponse
    Resource information for the cost allocation rule
    Status string
    Status of the rule
    UpdatedDate string
    Time at which the rule was last updated.
    Description string
    Description of a cost allocation rule.
    CreatedDate string
    Time at which the rule was created. Rules that change cost for the same resource are applied in order of creation.
    Details CostAllocationRuleDetailsResponse
    Resource information for the cost allocation rule
    Status string
    Status of the rule
    UpdatedDate string
    Time at which the rule was last updated.
    Description string
    Description of a cost allocation rule.
    createdDate String
    Time at which the rule was created. Rules that change cost for the same resource are applied in order of creation.
    details CostAllocationRuleDetailsResponse
    Resource information for the cost allocation rule
    status String
    Status of the rule
    updatedDate String
    Time at which the rule was last updated.
    description String
    Description of a cost allocation rule.
    createdDate string
    Time at which the rule was created. Rules that change cost for the same resource are applied in order of creation.
    details CostAllocationRuleDetailsResponse
    Resource information for the cost allocation rule
    status string
    Status of the rule
    updatedDate string
    Time at which the rule was last updated.
    description string
    Description of a cost allocation rule.
    created_date str
    Time at which the rule was created. Rules that change cost for the same resource are applied in order of creation.
    details CostAllocationRuleDetailsResponse
    Resource information for the cost allocation rule
    status str
    Status of the rule
    updated_date str
    Time at which the rule was last updated.
    description str
    Description of a cost allocation rule.
    createdDate String
    Time at which the rule was created. Rules that change cost for the same resource are applied in order of creation.
    details Property Map
    Resource information for the cost allocation rule
    status String
    Status of the rule
    updatedDate String
    Time at which the rule was last updated.
    description String
    Description of a cost allocation rule.

    SourceCostAllocationResourceResponse

    Name string
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    ResourceType string
    Type of resources contained in this cost allocation rule
    Values List<string>
    Source Resources for cost allocation. This list cannot contain more than 25 values.
    Name string
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    ResourceType string
    Type of resources contained in this cost allocation rule
    Values []string
    Source Resources for cost allocation. This list cannot contain more than 25 values.
    name String
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    resourceType String
    Type of resources contained in this cost allocation rule
    values List<String>
    Source Resources for cost allocation. This list cannot contain more than 25 values.
    name string
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    resourceType string
    Type of resources contained in this cost allocation rule
    values string[]
    Source Resources for cost allocation. This list cannot contain more than 25 values.
    name str
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    resource_type str
    Type of resources contained in this cost allocation rule
    values Sequence[str]
    Source Resources for cost allocation. This list cannot contain more than 25 values.
    name String
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    resourceType String
    Type of resources contained in this cost allocation rule
    values List<String>
    Source Resources for cost allocation. This list cannot contain more than 25 values.

    TargetCostAllocationResourceResponse

    Name string
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    PolicyType string
    Method of cost allocation for the rule
    ResourceType string
    Type of resources contained in this cost allocation rule
    Values List<Pulumi.AzureNative.CostManagement.Inputs.CostAllocationProportionResponse>
    Target resources for cost allocation. This list cannot contain more than 25 values.
    Name string
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    PolicyType string
    Method of cost allocation for the rule
    ResourceType string
    Type of resources contained in this cost allocation rule
    Values []CostAllocationProportionResponse
    Target resources for cost allocation. This list cannot contain more than 25 values.
    name String
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    policyType String
    Method of cost allocation for the rule
    resourceType String
    Type of resources contained in this cost allocation rule
    values List<CostAllocationProportionResponse>
    Target resources for cost allocation. This list cannot contain more than 25 values.
    name string
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    policyType string
    Method of cost allocation for the rule
    resourceType string
    Type of resources contained in this cost allocation rule
    values CostAllocationProportionResponse[]
    Target resources for cost allocation. This list cannot contain more than 25 values.
    name str
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    policy_type str
    Method of cost allocation for the rule
    resource_type str
    Type of resources contained in this cost allocation rule
    values Sequence[CostAllocationProportionResponse]
    Target resources for cost allocation. This list cannot contain more than 25 values.
    name String
    If resource type is dimension, this must be either ResourceGroupName or SubscriptionId. If resource type is tag, this must be a valid Azure tag
    policyType String
    Method of cost allocation for the rule
    resourceType String
    Type of resources contained in this cost allocation rule
    values List<Property Map>
    Target resources for cost allocation. This list cannot contain more than 25 values.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi