{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-billing-and-cost-management/json-schema/amazon-billing-and-cost-management-create-budget-action-request-schema.json",
  "title": "CreateBudgetActionRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-billing-and-cost-management-budget-actions-api-openapi.yml#/components/schemas/CreateBudgetActionRequest",
  "type": "object",
  "properties": {
    "AccountId": {
      "type": "string"
    },
    "BudgetName": {
      "type": "string"
    },
    "NotificationType": {
      "type": "string",
      "enum": [
        "ACTUAL",
        "FORECASTED"
      ]
    },
    "ActionType": {
      "type": "string",
      "enum": [
        "APPLY_IAM_POLICY",
        "APPLY_SCP_POLICY",
        "RUN_SSM_DOCUMENTS"
      ],
      "description": "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."
    },
    "ActionThreshold": {
      "$ref": "#/$defs/ActionThreshold"
    },
    "Definition": {
      "$ref": "#/$defs/Definition"
    },
    "ExecutionRoleArn": {
      "type": "string",
      "description": "The role passed for action execution and reversion. Roles and actions must be in the same account."
    },
    "ApprovalModel": {
      "type": "string",
      "enum": [
        "AUTOMATIC",
        "MANUAL"
      ],
      "description": "This specifies if the action needs manual or automatic approval."
    },
    "Subscribers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BudgetsSubscriber"
      }
    },
    "ResourceTags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ResourceTag"
      },
      "description": "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."
    }
  },
  "required": [
    "AccountId",
    "BudgetName",
    "NotificationType",
    "ActionType",
    "ActionThreshold",
    "Definition",
    "ExecutionRoleArn",
    "ApprovalModel",
    "Subscribers"
  ],
  "$defs": {
    "ActionThreshold": {
      "type": "object",
      "properties": {
        "ActionThresholdValue": {
          "type": "number"
        },
        "ActionThresholdType": {
          "type": "string",
          "enum": [
            "PERCENTAGE",
            "ABSOLUTE_VALUE"
          ]
        }
      },
      "required": [
        "ActionThresholdValue",
        "ActionThresholdType"
      ]
    },
    "BudgetsSubscriber": {
      "type": "object",
      "properties": {
        "SubscriptionType": {
          "type": "string",
          "enum": [
            "SNS",
            "EMAIL"
          ],
          "description": "The type of notification that Amazon Web Services sends to a subscriber."
        },
        "Address": {
          "type": "string",
          "description": "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."
        }
      },
      "required": [
        "SubscriptionType",
        "Address"
      ]
    },
    "Definition": {
      "type": "object",
      "properties": {
        "IamActionDefinition": {
          "$ref": "#/$defs/IamActionDefinition"
        },
        "ScpActionDefinition": {
          "$ref": "#/$defs/ScpActionDefinition"
        },
        "SsmActionDefinition": {
          "$ref": "#/$defs/SsmActionDefinition"
        }
      }
    },
    "IamActionDefinition": {
      "type": "object",
      "properties": {
        "PolicyArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the policy to be attached."
        },
        "Roles": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of roles to be attached. There must be at least one role."
        },
        "Groups": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of groups to be attached. There must be at least one group."
        },
        "Users": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of users to be attached. There must be at least one user."
        }
      },
      "required": [
        "PolicyArn"
      ]
    },
    "ResourceTag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key that's associated with the tag."
        },
        "Value": {
          "type": "string",
          "description": "The value that's associated with the tag."
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    },
    "ScpActionDefinition": {
      "type": "object",
      "properties": {
        "PolicyId": {
          "type": "string",
          "description": "The policy ID attached."
        },
        "TargetIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of target IDs."
        }
      },
      "required": [
        "PolicyId",
        "TargetIds"
      ]
    },
    "SsmActionDefinition": {
      "type": "object",
      "properties": {
        "ActionSubType": {
          "type": "string",
          "enum": [
            "STOP_EC2_INSTANCES",
            "STOP_RDS_INSTANCES"
          ],
          "description": "The action subType."
        },
        "Region": {
          "type": "string",
          "description": "The Region to run the SSM document."
        },
        "InstanceIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The EC2 and RDS instance IDs."
        }
      },
      "required": [
        "ActionSubType",
        "Region",
        "InstanceIds"
      ]
    }
  }
}