Last active
January 14, 2021 13:55
-
-
Save jgontrum/56abc4d1a4f6143367d011ccc183177c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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