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 | awscc.billingconductor.pricing_rules |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
arn | string | Pricing rule ARN |
region | string | AWS region. |
For more information, see AWS::BillingConductor::PricingRule.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | pricing_rules | INSERT | Name, Scope, Type, region |
delete_resource | pricing_rules | DELETE | Identifier, region |
update_resource | pricing_rules | UPDATE | Identifier, PatchDocument, region |
list_resources | pricing_rules_list_only | SELECT | region |
get_resource | pricing_rules | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.billingconductor.pricing_rules
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all pricing_rules in a region.
SELECT
region,
arn
FROM awscc.billingconductor.pricing_rules_list_only
WHERE
region = '{{ region }}';
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 awscc.billingconductor.pricing_rules (
Name,
Scope,
Type,
region
)
SELECT
'{{ name }}',
'{{ scope }}',
'{{ type }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.billingconductor.pricing_rules (
Name,
Description,
Scope,
Type,
ModifierPercentage,
Service,
BillingEntity,
Tiering,
UsageType,
Operation,
Tags,
region
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ scope }}',
'{{ type }}',
'{{ modifier_percentage }}',
'{{ service }}',
'{{ billing_entity }}',
'{{ tiering }}',
'{{ usage_type }}',
'{{ operation }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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: modifier_percentage
value: null
- name: service
value: '{{ service }}'
- name: billing_entity
value: '{{ billing_entity }}'
- name: tiering
value:
free_tier:
activated: '{{ activated }}'
- name: usage_type
value: '{{ usage_type }}'
- name: operation
value: '{{ operation }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a pricing_rule resource, using stack-deploy.
/*+ update */
UPDATE awscc.billingconductor.pricing_rules
SET PatchDocument = string('{{ {
"Name": name,
"Description": description,
"Type": type,
"ModifierPercentage": modifier_percentage,
"Tiering": tiering,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.billingconductor.pricing_rules
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the pricing_rules resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
billingconductor:CreatePricingRule,
billingconductor:ListPricingRules,
billingconductor:TagResource,
billingconductor:ListTagsForResource
billingconductor:ListPricingRules,
billingconductor:ListTagsForResource
billingconductor:UpdatePricingRule,
billingconductor:ListPricingRules,
billingconductor:TagResource,
billingconductor:UntagResource
billingconductor:DeletePricingRule,
billingconductor:ListPricingRules,
billingconductor:UntagResource
billingconductor:ListPricingRules,
billingconductor:ListTagsForResource