:doc:`Budgets <../../budgets>` / Client / create_budget_action

********************
create_budget_action
********************



.. py:method:: Budgets.Client.create_budget_action(**kwargs)

  

  Creates a budget action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/budgets-2016-10-20/CreateBudgetAction>`_  


  **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'
            },
        ],
        ResourceTags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type AccountId: string
  :param AccountId: **[REQUIRED]** 

    The account ID of the user. It's a 12-digit number.

    

  
  :type BudgetName: string
  :param BudgetName: **[REQUIRED]** 

    A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.

    

  
  :type NotificationType: string
  :param NotificationType: **[REQUIRED]** 

    The type of a notification. It must be ACTUAL or FORECASTED.

    

  
  :type ActionType: string
  :param ActionType: **[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.

    

  
  :type ActionThreshold: dict
  :param ActionThreshold: **[REQUIRED]** 

    The trigger threshold of the action.

    

  
    - **ActionThresholdValue** *(float) --* **[REQUIRED]** 

      The threshold of a notification.

      

    
    - **ActionThresholdType** *(string) --* **[REQUIRED]** 

      The type of threshold for a notification.

      

    
  
  :type Definition: dict
  :param Definition: **[REQUIRED]** 

    Specifies all of the type-specific parameters.

    

  
    - **IamActionDefinition** *(dict) --* 

      The Identity and Access Management (IAM) action definition details.

      

    
      - **PolicyArn** *(string) --* **[REQUIRED]** 

        The Amazon Resource Name (ARN) of the policy to be attached.

        

      
      - **Roles** *(list) --* 

        A list of roles to be attached. There must be at least one role.

        

      
        - *(string) --* 

        
    
      - **Groups** *(list) --* 

        A list of groups to be attached. There must be at least one group.

        

      
        - *(string) --* 

        
    
      - **Users** *(list) --* 

        A list of users to be attached. There must be at least one user.

        

      
        - *(string) --* 

        
    
    
    - **ScpActionDefinition** *(dict) --* 

      The service control policies (SCPs) action definition details.

      

    
      - **PolicyId** *(string) --* **[REQUIRED]** 

        The policy ID attached.

        

      
      - **TargetIds** *(list) --* **[REQUIRED]** 

        A list of target IDs.

        

      
        - *(string) --* 

        
    
    
    - **SsmActionDefinition** *(dict) --* 

      The Amazon Web Services Systems Manager (SSM) action definition details.

      

    
      - **ActionSubType** *(string) --* **[REQUIRED]** 

        The action subType.

        

      
      - **Region** *(string) --* **[REQUIRED]** 

        The Region to run the SSM document.

        

      
      - **InstanceIds** *(list) --* **[REQUIRED]** 

        The EC2 and RDS instance IDs.

        

      
        - *(string) --* 

        
    
    
  
  :type ExecutionRoleArn: string
  :param ExecutionRoleArn: **[REQUIRED]** 

    The role passed for action execution and reversion. Roles and actions must be in the same account.

    

  
  :type ApprovalModel: string
  :param ApprovalModel: **[REQUIRED]** 

    This specifies if the action needs manual or automatic approval.

    

  
  :type Subscribers: list
  :param Subscribers: **[REQUIRED]** 

    A list of subscribers.

    

  
    - *(dict) --* 

      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:

       

      
      * A ``subscriptionType`` of ``EMAIL``
       
      * An ``address`` of ``example@example.com``
      

      

    
      - **SubscriptionType** *(string) --* **[REQUIRED]** 

        The type of notification that Amazon Web Services sends to a subscriber.

        

      
      - **Address** *(string) --* **[REQUIRED]** 

        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.

        

      
    

  :type ResourceTags: list
  :param ResourceTags: 

    An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.

    

  
    - *(dict) --* 

      The tag structure that contains a tag key and value.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The key that's associated with the tag.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

        The value that's associated with the tag.

        

      
    

  
  :rtype: dict
  :returns: 
    
    **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, and the "/action/" substring, aren't allowed.

        
      

      - **ActionId** *(string) --* 

        A system-generated universally unique identifier (UUID) for the action.

        
  
  **Exceptions**
  
  *   :py:class:`Budgets.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`Budgets.Client.exceptions.InternalErrorException`

  
  *   :py:class:`Budgets.Client.exceptions.CreationLimitExceededException`

  
  *   :py:class:`Budgets.Client.exceptions.DuplicateRecordException`

  
  *   :py:class:`Budgets.Client.exceptions.NotFoundException`

  
  *   :py:class:`Budgets.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Budgets.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Budgets.Client.exceptions.ServiceQuotaExceededException`

  