pricing_rules
Creates, updates, deletes or gets a pricing_rule
resource or lists pricing_rules
in a region
Overview
Name | pricing_rules |
Type | Resource |
Description | A markup/discount that is defined for a specific set of services that can later be associated with a pricing plan. |
Id | aws.billingconductor.pricing_rules |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | Pricing rule ARN |
name | string | Pricing rule name |
description | string | Pricing rule description |
scope | string | A term used to categorize the granularity of a Pricing Rule. |
type | string | One of MARKUP, DISCOUNT or TIERING that describes the behaviour of the pricing rule. |
modifier_percentage | number | Pricing rule modifier percentage |
service | string | The service which a pricing rule is applied on |
billing_entity | string | The seller of services provided by AWS, their affiliates, or third-party providers selling services via AWS Marketplaces. Supported billing entities are AWS, AWS Marketplace, and AISPL. |
tiering | object | The set of tiering configurations for the pricing rule. |
usage_type | string | The UsageType which a SKU pricing rule is modifying |
operation | string | The Operation which a SKU pricing rule is modifying |
associated_pricing_plan_count | integer | The number of pricing plans associated with pricing rule |
creation_time | integer | Creation timestamp in UNIX epoch time format |
last_modified_time | integer | Latest modified timestamp in UNIX epoch time format |
tags | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Name, Scope, Type, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all pricing_rules
in a region.
SELECT
region,
arn,
name,
description,
scope,
type,
modifier_percentage,
service,
billing_entity,
tiering,
usage_type,
operation,
associated_pricing_plan_count,
creation_time,
last_modified_time,
tags
FROM aws.billingconductor.pricing_rules
WHERE region = 'us-east-1';
Gets all properties from an individual pricing_rule
.
SELECT
region,
arn,
name,
description,
scope,
type,
modifier_percentage,
service,
billing_entity,
tiering,
usage_type,
operation,
associated_pricing_plan_count,
creation_time,
last_modified_time,
tags
FROM aws.billingconductor.pricing_rules
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
INSERT
example
Use the following StackQL query and manifest file to create a new pricing_rule
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.billingconductor.pricing_rules (
Name,
Scope,
Type,
region
)
SELECT
'{{ Name }}',
'{{ Scope }}',
'{{ Type }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.billingconductor.pricing_rules (
Name,
Description,
Scope,
Type,
ModifierPercentage,
Service,
BillingEntity,
Tiering,
UsageType,
Operation,
Tags,
region
)
SELECT
'{{ Name }}',
'{{ Description }}',
'{{ Scope }}',
'{{ Type }}',
'{{ ModifierPercentage }}',
'{{ Service }}',
'{{ BillingEntity }}',
'{{ Tiering }}',
'{{ UsageType }}',
'{{ Operation }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: pricing_rule
props:
- name: Name
value: '{{ Name }}'
- name: Description
value: '{{ Description }}'
- name: Scope
value: '{{ Scope }}'
- name: Type
value: '{{ Type }}'
- name: ModifierPercentage
value: null
- name: Service
value: '{{ Service }}'
- name: BillingEntity
value: '{{ BillingEntity }}'
- name: Tiering
value:
FreeTier:
Activated: '{{ Activated }}'
- name: UsageType
value: '{{ UsageType }}'
- name: Operation
value: '{{ Operation }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.billingconductor.pricing_rules
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the pricing_rules
resource, the following permissions are required:
Create
billingconductor:CreatePricingRule,
billingconductor:ListPricingRules,
billingconductor:TagResource,
billingconductor:ListTagsForResource
Read
billingconductor:ListPricingRules,
billingconductor:ListTagsForResource
Update
billingconductor:UpdatePricingRule,
billingconductor:ListPricingRules,
billingconductor:TagResource,
billingconductor:UntagResource
Delete
billingconductor:DeletePricingRule,
billingconductor:ListPricingRules,
billingconductor:UntagResource
List
billingconductor:ListPricingRules,
billingconductor:ListTagsForResource