Skip to main content

pricing_rules

Creates, updates, deletes, gets or lists a pricing_rules resource.

Overview

Namepricing_rules
TypeResource
Idaws.billingconductor.pricing_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) used to uniquely identify a pricing rule. (pattern: <code>(arn:aws(-cn)?:billingconductor::[0-9]{12}:pricingrule/)?[a-zA-Z0-9]{10}</code>)
associated_pricing_plan_countinteger (int64)The pricing plans count that this pricing rule is associated with.
billing_entitystringThe seller of services provided by Amazon Web Services, their affiliates, or third-party providers selling services via Amazon Web Services Marketplace. (pattern: <code>[a-zA-Z0-9() ]+</code>)
creation_timeinteger (int64)The time when the pricing rule was created.
descriptionstringThe pricing rule description.
last_modified_timeinteger (int64)The most recent time when the pricing rule was modified.
modifier_percentagenumber (double)A percentage modifier applied on the public pricing rates.
namestringThe name of a pricing rule. (pattern: <code>[a-zA-Z0-9_+=.-@]+</code>)
operationstringOperation is the specific Amazon Web Services action covered by this line item. This describes the specific usage of the line item. If the Scope attribute is set to SKU, this attribute indicates which operation the PricingRule is modifying. For example, a value of RunInstances:0202 indicates the operation of running an Amazon EC2 instance. (pattern: <code>\S+</code>)
scopestringThe scope of pricing rule that indicates if it is globally applicable, or if it is service-specific. (GLOBAL, SERVICE, BILLING_ENTITY, SKU)
servicestringIf the Scope attribute is SERVICE, this attribute indicates which service the PricingRule is applicable for. (pattern: <code>[a-zA-Z0-9]+</code>)
tieringobjectThe set of tiering configurations for the pricing rule.
typestringThe type of pricing rule. (MARKUP, DISCOUNT, TIERING)
usage_typestringUsage type is the unit that each service uses to measure the usage of a specific type of resource. If the Scope attribute is set to SKU, this attribute indicates which usage type the PricingRule is modifying. For example, USW2-BoxUsage:m2.2xlarge describes an M2 High Memory Double Extra Large instance in the US West (Oregon) Region. (pattern: <code>\S+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_pricing_rulesselectregionDescribes a pricing rule that can be associated to a pricing plan, or set of pricing plans.
create_pricing_ruleinsertregionX-Amzn-Client-TokenCreates a pricing rule can be associated to a pricing plan, or a set of pricing plans.
associate_pricing_rulesupdateregion, PricingRuleArnsConnects an array of PricingRuleArns to a defined PricingPlan. The maximum number PricingRuleArn that can be associated in one call is 30.
update_pricing_ruleupdateregionUpdates an existing pricing rule.
delete_pricing_ruledeleteregionDeletes the pricing rule that's identified by the input Amazon Resource Name (ARN).
disassociate_pricing_rulesexecregion, PricingRuleArnsDisassociates a list of pricing rules from a pricing plan.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
X-Amzn-Client-TokenstringA unique, case-sensitive identifier that you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.

SELECT examples

Describes a pricing rule that can be associated to a pricing plan, or set of pricing plans.

SELECT
arn,
associated_pricing_plan_count,
billing_entity,
creation_time,
description,
last_modified_time,
modifier_percentage,
name,
operation,
scope,
service,
tiering,
type,
usage_type
FROM aws.billingconductor.pricing_rules
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a pricing rule can be associated to a pricing plan, or a set of pricing plans.

INSERT INTO aws.billingconductor.pricing_rules (
Name,
Description,
Scope,
Type,
ModifierPercentage,
Service,
Tags,
BillingEntity,
Tiering,
UsageType,
Operation,
region,
`X-Amzn-Client-Token`
)
SELECT
'{{ Name }}',
'{{ Description }}',
'{{ Scope }}',
'{{ Type }}',
{{ ModifierPercentage }},
'{{ Service }}',
'{{ Tags }}',
'{{ BillingEntity }}',
'{{ Tiering }}',
'{{ UsageType }}',
'{{ Operation }}',
'{{ region }}',
'{{ X-Amzn-Client-Token }}'
RETURNING
arn
;

UPDATE examples

Connects an array of PricingRuleArns to a defined PricingPlan. The maximum number PricingRuleArn that can be associated in one call is 30.

UPDATE aws.billingconductor.pricing_rules
SET
Arn = '{{ Arn }}',
PricingRuleArns = '{{ PricingRuleArns }}'
WHERE
region = '{{ region }}' --required
AND PricingRuleArns = '{{ PricingRuleArns }}' --required
RETURNING
arn;

DELETE examples

Deletes the pricing rule that's identified by the input Amazon Resource Name (ARN).

DELETE FROM aws.billingconductor.pricing_rules
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Disassociates a list of pricing rules from a pricing plan.

EXEC aws.billingconductor.pricing_rules.disassociate_pricing_rules
@region='{{ region }}' --required
@@json=
'{
"Arn": "{{ Arn }}",
"PricingRuleArns": "{{ PricingRuleArns }}"
}'
;