budget_action#

State module for managing AWS Budget Actions.

async idem_aws.states.aws.budgets.budget_action.present(hub, ctx, name: str, budget_name: str, notification_type: str, action_type: str, action_threshold: ActionThreshold, definition: Definition, execution_role_arn: str, approval_model: str = None, subscribers: List[Subscriber] = None, resource_id: str = None) Dict[str, Any][source]#

Creates an AWS Budget Action with the requested name and rules.

Parameters:
  • name (str) – The unique name of the Budget Action.

  • budget_name (str) – A string that represents the budget name. The “:” and “” characters aren’t allowed.

  • notification_type (str) – The type of a notification. It must be ACTUAL or FORECASTED.

  • action_type (str) – 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.

  • action_threshold (dict[str, Any]) –

    The trigger threshold of the action.

    • ActionThresholdValue (float):

      The threshold of a notification.

    • ActionThresholdType (str):

      The type of threshold for a notification.

  • definition (dict[str, Any]) –

    Specifies all of the type-specific parameters.

    • IamActionDefinition (dict[str, Any], Optional):

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

      • PolicyArn (str):

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

      • Roles (list[str], Optional):

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

      • Groups (list[str], Optional):

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

      • Users (list[str], Optional):

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

    • ScpActionDefinition (dict[str, Any], Optional):

      The service control policies (SCPs) action definition details.

      • PolicyId (str):

        The policy ID attached.

      • TargetIds (list[str]):

        A list of target IDs.

    • SsmActionDefinition (dict[str, Any], Optional):

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

      • ActionSubType (str):

        The action subType.

      • Region (str):

        The Region to run the SSM document.

      • InstanceIds (list[str]):

        The EC2 and RDS instance IDs.

  • execution_role_arn (str) – The role passed for action execution and reversion. Roles and actions must be in the same account.

  • approval_model (str) – This specifies if the action needs manual or automatic approval.

  • subscribers (list[dict[str, Any]]) –

    A list of subscribers.

    The subscriber to a budget notification 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 (str):

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

    • Address (str):

      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.

  • resource_id (str, Optional) – Action ID to identify the resource.

Request Syntax:
[action-resource-id]:
  aws.budgets.budget_action.present:
    - resource_id: "string"
    - budget_name: "string"
    - notification_type: "string"
    - action_type: "string"
    - action_threshold:
        ActionThresholdType: "string"
        ActionThresholdValue: int
    - definition:
        IamActionDefinition:
          PolicyArn: "string"
          Users:
            - "string"
    - execution_role_arn: "string"
    - approval_model: "string"
    - status: "string"
    - subscribers:
        - Address: "string"
          SubscriptionType: "string"
Returns:

Dict[str, str]

Examples

12345a12-126d-1234-1ab2-1f4dca2a1234:
  aws.budgets.budget_action.present:
    - name: 12345a12-126d-1234-1ab2-1f4dca2a1234
    - resource_id: 12345a12-126d-1234-1ab2-1f4dca2a1234
    - budget_name: test_budget
    - notification_type: ACTUAL
    - action_type: APPLY_IAM_POLICY
    - action_threshold:
        ActionThresholdType: PERCENTAGE
        ActionThresholdValue: 123.0
    - definition:
        IamActionDefinition:
          PolicyArn: arn:aws:iam::123456789101:policy/budget_policy
          Users:
            - plokare
    - execution_role_arn: arn:aws:iam::123456789101:role/budget_role
    - approval_model: AUTOMATIC
    - status: STANDBY
    - subscribers:
        - Address: abc@test.com
          SubscriptionType: EMAIL
async idem_aws.states.aws.budgets.budget_action.absent(hub, ctx, name: str, budget_name: str = None, resource_id: str = None) Dict[str, Any][source]#

Deletes an AWS Budget Action.

Parameters:
  • name (str) – An Idem name of the AWS Budget Action.

  • budget_name (str, Optional) – Budget Name

  • resource_id (str, Optional) – Budget Action ID to identify the resource. Idem automatically considers this resource being absent if this field is not specified.

Request Syntax:
[action-resource-id]:
  aws.budgets.budget_action.absent:
    - name: value
    - budget_name: value
    - resource_id: value
Returns:

Dict[str, Any]

Examples

resource_is_absent:
  aws.budgets.budget_action.absent:
    - name: value
    - budget_name: value
    - resource_id: value
async idem_aws.states.aws.budgets.budget_action.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Lists the AWS Budget Actions.

Describe the resource in a way that can be recreated/managed with the corresponding “present” function.

Returns:

Dict[str, Any]

Examples

$ idem describe aws.budgets.budget_action