create_budget_action
(**kwargs)¶Creates a budget action.
See also: AWS API Documentation
Request Syntax
response = client.create_budget_action(
AccountId='string',
BudgetName='string',
NotificationType='ACTUAL'|'FORECASTED',
ActionType='APPLY_IAM_POLICY'|'APPLY_SCP_POLICY'|'RUN_SSM_DOCUMENTS',
ActionThreshold={
'ActionThresholdValue': 123.0,
'ActionThresholdType': 'PERCENTAGE'|'ABSOLUTE_VALUE'
},
Definition={
'IamActionDefinition': {
'PolicyArn': 'string',
'Roles': [
'string',
],
'Groups': [
'string',
],
'Users': [
'string',
]
},
'ScpActionDefinition': {
'PolicyId': 'string',
'TargetIds': [
'string',
]
},
'SsmActionDefinition': {
'ActionSubType': 'STOP_EC2_INSTANCES'|'STOP_RDS_INSTANCES',
'Region': 'string',
'InstanceIds': [
'string',
]
}
},
ExecutionRoleArn='string',
ApprovalModel='AUTOMATIC'|'MANUAL',
Subscribers=[
{
'SubscriptionType': 'SNS'|'EMAIL',
'Address': 'string'
},
]
)
[REQUIRED]
The account ID of the user. It's a 12-digit number.
[REQUIRED]
A string that represents the budget name. The ":" and "" characters aren't allowed.
[REQUIRED]
The type of a notification. It must be ACTUAL or FORECASTED.
[REQUIRED]
The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.
[REQUIRED]
The trigger threshold of the action.
The threshold of a notification.
The type of threshold for a notification.
[REQUIRED]
Specifies all of the type-specific parameters.
The Identity and Access Management (IAM) action definition details.
The Amazon Resource Name (ARN) of the policy to be attached.
A list of roles to be attached. There must be at least one role.
A list of groups to be attached. There must be at least one group.
A list of users to be attached. There must be at least one user.
The service control policies (SCPs) action definition details.
The policy ID attached.
A list of target IDs.
The Amazon Web Services Systems Manager (SSM) action definition details.
The action subType.
The Region to run the SSM document.
The EC2 and RDS instance IDs.
[REQUIRED]
The role passed for action execution and reversion. Roles and actions must be in the same account.
[REQUIRED]
This specifies if the action needs manual or automatic approval.
[REQUIRED]
A list of subscribers.
The subscriber to a budget notification. The subscriber consists of a subscription type and either an Amazon SNS topic or an email address.
For example, an email subscriber has the following parameters:
subscriptionType
of EMAIL
address
of example@example.com
The type of notification that Amazon Web Services sends to a subscriber.
The address that Amazon Web Services sends budget notifications to, either an SNS topic or an email.
When you create a subscriber, the value of Address
can't contain line breaks.
dict
Response Syntax
{
'AccountId': 'string',
'BudgetName': 'string',
'ActionId': 'string'
}
Response Structure
(dict) --
AccountId (string) --
The account ID of the user. It's a 12-digit number.
BudgetName (string) --
A string that represents the budget name. The ":" and "" characters aren't allowed.
ActionId (string) --
A system-generated universally unique identifier (UUID) for the action.
Exceptions
Budgets.Client.exceptions.InvalidParameterException
Budgets.Client.exceptions.InternalErrorException
Budgets.Client.exceptions.CreationLimitExceededException
Budgets.Client.exceptions.DuplicateRecordException
Budgets.Client.exceptions.NotFoundException
Budgets.Client.exceptions.AccessDeniedException
Budgets.Client.exceptions.ThrottlingException