update_billing_preferences
async
¶
update_billing_preferences(
feature: BillingFeature,
billing_preferences_per_key: BillingPreferencesPerKey,
*,
config_overrides: Optional[AsyncBillingClientConfig] = None,
) -> UpdateBillingPreferencesResponse
Updates billing preferences for the specified feature. Each feature targets a distinct billing capability and has its own set of supported keys. The action sets the value for each provided key; keys not present in the request are unchanged.
To set sharing keys (RI_SHARING, CREDIT_SHARING, CREDIT_LEVEL_SHARING, BENEFIT_LEVEL_SHARING, and sharing keys under CREDIT_PREFERENCE_OPTIONS), you must use the management account of a consolidated billing family. To set the credit/{creditId}/status key, you must own the credit or use the management account of its family.
Parameters:
-
feature(BillingFeature) –The feature to update. Valid values:
BILLING_ALERTS,RI_SHARING,CREDIT_SHARING,CREDIT_LEVEL_SHARING,CREDIT_PREFERENCE_OPTIONS,BENEFIT_LEVEL_SHARING. The history features (RI_SHARING_HISTORYandCREDIT_SHARING_HISTORY) are read-only and cannot be updated. -
billing_preferences_per_key(BillingPreferencesPerKey) –Key/value pairs to apply. All keys in a single request must be valid for the specified
featureand must not be duplicated. ForCREDIT_PREFERENCE_OPTIONS, all keys must reference the samecreditId.For
BENEFIT_LEVEL_SHARING, all keys must reference the same Reserved Instance or Savings Plan. To share it with the accounts in one Cost Category rule, send these three keys with the valueENABLED:-
benefit/{ri|sp}/{benefitId}/sharing/costCategoryArn/{costCategoryArn} -
benefit/{ri|sp}/{benefitId}/sharing/ruleName/{ruleName} -
benefit/{ri|sp}/{benefitId}/sharing/mode/{prioritized|restricted}
With
prioritized, any benefit that the rule's accounts don't use goes to the rest of your consolidated billing family, following your family sharing settings. Withrestricted, only the owner and the rule's accounts receive it. The Cost Category must belong to your account. To stop sharing, send the same three keys with the valueDISABLED.For
RI_SHARINGandCREDIT_SHARING, you can share benefits by account group. Each rule in a Cost Category is one group. Send exactly one of these group keys with the valueENABLED:-
open-sharing- Share across the whole consolidated billing family, with no groups. -
costcategory-prioritized/{costCategoryArn}- Share within each group first, then with the rest of the family. -
costcategory-restricted/{costCategoryArn}- An account in a group shares only with accounts in the same group.
For
RI_SHARING, thecostcategory-keys use a Cost Category that supports thebilling:rispgroupsharingresource type. To use a Cost Category that supports thebilling:benefitgroupsharingresource type, use thebenefitgroup-prioritized/orbenefitgroup-restricted/prefix instead. ForCREDIT_SHARING, the Cost Category must support thebilling:benefitgroupsharingresource type. The Cost Category must belong to your account.GetBillingPreferencesreturns the group key that is in effect. -
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this action.
-
InternalServerException–The request processing failed because of an unknown error, exception, or failure.
-
ThrottlingException–The request was denied due to request throttling.
-
ValidationException–The input fails to satisfy the constraints specified by an Amazon Web Services service.
-
UnknownServiceError–The service returned an error code this client does not model.