anomaly_subscription#

State module for managing Amazon anomaly subscription.

async idem_aws.states.aws.costexplorer.anomaly_subscription.present(hub, ctx, name: str, monitor_arn_list: List, subscribers: List, threshold: float, frequency: str, subscription_name: str, resource_id: str = None) Dict[str, Any][source]#

Adds a subscription to a cost anomaly detection monitor.

You can use each subscription to define subscribers with email or SNS notifications. Email subscribers can set a dollar threshold and a time frequency for receiving notifications.

Parameters:
  • name (str) – An Idem name of the resource - The name for the subscription.

  • AnomalySubscription (dict) –

    The cost anomaly subscription object that you want to create.
    • MonitorArnList (list)

      An Idem list of cost anomaly monitors.

    • Subscribers (list)
      A list of subscribers to notify.
      • (dict)
        The recipient of AnomalySubscription notifications.
        • Address (str)

          The email address or SNS Amazon Resource Name (ARN). This depends on the Type .

        • Type (str)

          The notification delivery channel.

        • Status (str)

          Indicates if the subscriber accepts the notifications.

    • Threshold (float)

      The dollar value that triggers a notification if the threshold is exceeded.

    • Frequency (str)

      The frequency that anomaly reports are sent over email.

    • SubscriptionName (str)

      The name for the subscription.

  • resource_id (str, Optional) – Subscription ARN to identify the resource

Request Syntax:
[subscription_name]:
  aws.costexplorer.anomaly_subscription.present:
    - resource_id: "string"
    - monitor_arn_list: list
    - subscribers:
        - Address: "string"
          Status: "string"
          Type: "string"
    - threshold: float
    - frequency: "string"
    - subscription_name: "string"
Returns:

Dict[str, str]

Examples

arn:aws:ce::12345678910:anomalysubscription/12345678-1234-1234-1234-1234567891011:
  aws.costexplorer.anomaly_subscription.present:
    - resource_id: arn:aws:ce::12345678910:anomalysubscription/12345678-1234-1234-1234-1234567891011
    - monitor_arn_list:
        - arn:aws:ce::12345678910:anomalymonitor/12345678-1234-1234-1234-1234567891011
    - subscribers:
        - Address: abc@email.com
          Status: CONFIRMED
          Type: EMAIL
    - threshold: 10.0
    - frequency: DAILY
    - subscription_name: test_subscription
async idem_aws.states.aws.costexplorer.anomaly_subscription.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any][source]#

Deletes a cost anomaly subscription.

Parameters:
  • name (str) – An Idem name of the resource.

  • resource_id (str, Optional) – Subscription ARN to identify the resource

Returns:

Dict[str, Any]

Examples

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

Retrieves the cost anomaly subscription objects for the account.

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

Returns:

Dict[str, Any]

Examples

$ idem describe aws.costexplorer.anomaly_subscription