2
votes

I have a lambda function and for that lambda function my cloudwatch event is a trigger on it...

at the end of the lambda function i need to delete the trigger (cloud watch event ) on that lambda function programatically using python .

how can i do that ? is there any python library to do that?

1

1 Answers

2
votes

The Python library you are looking for is the AWS SDK for Python, also called Boto3. This library is pre-loaded in the AWS Lambda environment. all you have to do is add import boto3 to your Lambda function.

I believe you will need to use the CloudWatchEvents client and either call delete_rule() or remove_targets() depending on exactly what you want to do.