pricing_rules
Creates, updates, deletes, gets or lists a pricing_rules resource.
Overview
| Name | pricing_rules |
| Type | Resource |
| Id | aws.billingconductor.pricing_rules |
Fields
The following fields are returned by SELECT queries:
- list_pricing_rules
| Name | Datatype | Description |
|---|---|---|
arn | string | The 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_count | integer (int64) | The pricing plans count that this pricing rule is associated with. |
billing_entity | string | The 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_time | integer (int64) | The time when the pricing rule was created. |
description | string | The pricing rule description. |
last_modified_time | integer (int64) | The most recent time when the pricing rule was modified. |
modifier_percentage | number (double) | A percentage modifier applied on the public pricing rates. |
name | string | The name of a pricing rule. (pattern: <code>[a-zA-Z0-9_+=.-@]+</code>) |
operation | string | Operation 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>) |
scope | string | The scope of pricing rule that indicates if it is globally applicable, or if it is service-specific. (GLOBAL, SERVICE, BILLING_ENTITY, SKU) |
service | string | If the Scope attribute is SERVICE, this attribute indicates which service the PricingRule is applicable for. (pattern: <code>[a-zA-Z0-9]+</code>) |
tiering | object | The set of tiering configurations for the pricing rule. |
type | string | The type of pricing rule. (MARKUP, DISCOUNT, TIERING) |
usage_type | string | Usage 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_pricing_rules | select | region | Describes a pricing rule that can be associated to a pricing plan, or set of pricing plans. | |
create_pricing_rule | insert | region | X-Amzn-Client-Token | Creates a pricing rule can be associated to a pricing plan, or a set of pricing plans. |
associate_pricing_rules | update | region, PricingRuleArns | Connects an array of PricingRuleArns to a defined PricingPlan. The maximum number PricingRuleArn that can be associated in one call is 30. | |
update_pricing_rule | update | region | Updates an existing pricing rule. | |
delete_pricing_rule | delete | region | Deletes the pricing rule that's identified by the input Amazon Resource Name (ARN). | |
disassociate_pricing_rules | exec | region, PricingRuleArns | Disassociates 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
X-Amzn-Client-Token | string | A 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
- list_pricing_rules
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
- create_pricing_rule
- Manifest
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
;
# Description fields are for documentation purposes
- name: pricing_rules
props:
- name: region
value: "{{ region }}"
description: Required parameter for the pricing_rules resource.
- name: Name
value: "{{ Name }}"
- name: Description
value: "{{ Description }}"
- name: Scope
value: "{{ Scope }}"
valid_values: ['GLOBAL', 'SERVICE', 'BILLING_ENTITY', 'SKU']
- name: Type
value: "{{ Type }}"
valid_values: ['MARKUP', 'DISCOUNT', 'TIERING']
- name: ModifierPercentage
value: {{ ModifierPercentage }}
- name: Service
value: "{{ Service }}"
- name: Tags
value: "{{ Tags }}"
- name: BillingEntity
value: "{{ BillingEntity }}"
- name: Tiering
description: |
The set of tiering configurations for the pricing rule.
value:
FreeTier:
Activated: {{ Activated }}
- name: UsageType
value: "{{ UsageType }}"
- name: Operation
value: "{{ Operation }}"
- name: X-Amzn-Client-Token
value: "{{ X-Amzn-Client-Token }}"
description: A 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.
description: A 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.
UPDATE examples
- associate_pricing_rules
- update_pricing_rule
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;
Updates an existing pricing rule.
UPDATE aws.billingconductor.pricing_rules
SET
Arn = '{{ Arn }}',
Name = '{{ Name }}',
Description = '{{ Description }}',
Type = '{{ Type }}',
ModifierPercentage = {{ ModifierPercentage }},
Tiering = '{{ Tiering }}'
WHERE
region = '{{ region }}' --required
RETURNING
arn,
associated_pricing_plan_count,
billing_entity,
description,
last_modified_time,
modifier_percentage,
name,
operation,
scope,
service,
tiering,
type,
usage_type;
DELETE examples
- delete_pricing_rule
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
- disassociate_pricing_rules
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 }}"
}'
;