rule#

Exec module for managing Cloudwatch Event Rule.

async idem_aws.exec.aws.events.rule.get(hub, ctx, name, resource_id: str, event_bus_name: str = None) Dict[source]#

Get an event rule resource.

Parameters:
  • name (str) – The name of the Idem state.

  • resource_id (str) – The name of the AWS CloudWatch Events rule to identify the resource.

  • event_bus_name (str, Optional) – The name or ARN of the event bus to associate with this rule. If you omit this, the default event bus is used.

Returns:

{"result": True|False, "comment": list, "ret": None|dict}

Examples

Calling this exec module function from the cli with resource_id

idem exec aws.events.rule.get name="asg_1" resource_id="resource_id"

Calling this exec module function from within a state module in pure python

async def state_function(hub, ctx, name, resource_id):
    ret = await hub.exec.aws.events.rule.get(
        ctx=ctx,
        name=name,
        resource_id=resource_id
    )

Using in a state:

my_unmanaged_resource:
  exec.run:
    - path: aws.events.rule.get
    - kwargs:
        name: my_resources
        resource_id: idem-test-events-rule48f593a7-e5ff-48ee-ab30-422241a7e693
async idem_aws.exec.aws.events.rule.list_(hub, ctx, name: str = None) Dict[source]#

List event rules from AWS.

Parameters:

name (str, Optional) – The name of the Idem state.

Returns:

Dict[str, Any]

Examples

Calling this exec module function from the cli

idem exec aws.events.rule.list name="my_resources"

Calling this exec module function from within a state module in pure python.

async def state_function(hub, ctx, name):
    await hub.exec.aws.events.rule.list(
        ctx=ctx,
        name=name
    )

Using in a state:

my_unmanaged_resource:
  exec.run:
    - path: aws.events.rule.list
    - kwargs:
        name: my_resources