Skip to content

Instantly share code, notes, and snippets.

@jgontrum
Last active January 14, 2021 13:55
Show Gist options
  • Save jgontrum/56abc4d1a4f6143367d011ccc183177c to your computer and use it in GitHub Desktop.
Save jgontrum/56abc4d1a4f6143367d011ccc183177c to your computer and use it in GitHub Desktop.
import boto3
import json
client = boto3.client('events')
rule = client.put_rule(
Name="MyRuleId",
ScheduleExpression="rate(2 minutes)",
State="ENABLED"
)
client.put_targets(
Rule="MyRuleId",
Targets=[
{
"Id": "MyTargetId",
"Arn": "MyLambdaFunctionARN",
"Input": json.dumps({"foo": "bar"})
}
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment