Skip to main content

pricing_rules

Creates, updates, deletes or gets a pricing_rule resource or lists pricing_rules in a region

Overview

Namepricing_rules
TypeResource
DescriptionA markup/discount that is defined for a specific set of services that can later be associated with a pricing plan.
Idawscc.billingconductor.pricing_rules

Fields

NameDatatypeDescription
arnstringPricing rule ARN
namestringPricing rule name
descriptionstringPricing rule description
scopestringA term used to categorize the granularity of a Pricing Rule.
typestringOne of MARKUP, DISCOUNT or TIERING that describes the behaviour of the pricing rule.
modifier_percentagenumberPricing rule modifier percentage
servicestringThe service which a pricing rule is applied on
billing_entitystringThe 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.
tieringobjectThe set of tiering configurations for the pricing rule.
usage_typestringThe UsageType which a SKU pricing rule is modifying
operationstringThe Operation which a SKU pricing rule is modifying
associated_pricing_plan_countintegerThe number of pricing plans associated with pricing rule
creation_timeintegerCreation timestamp in UNIX epoch time format
last_modified_timeintegerLatest modified timestamp in UNIX epoch time format
tagsarray
regionstringAWS region.

For more information, see AWS::BillingConductor::PricingRule.

Methods

NameResourceAccessible byRequired Params
create_resourcepricing_rulesINSERTName, Scope, Type, region
delete_resourcepricing_rulesDELETEIdentifier, region
update_resourcepricing_rulesUPDATEIdentifier, PatchDocument, region
list_resourcespricing_rules_list_onlySELECTregion
get_resourcepricing_rulesSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new pricing_rule resource, using stack-deploy.

/*+ 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
;

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:

ParameterDescription
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:

billingconductor:CreatePricingRule,
billingconductor:ListPricingRules,
billingconductor:TagResource,
billingconductor:ListTagsForResource