Skip to content

Instantly share code, notes, and snippets.

View danixmarques's full-sized avatar
🎯
Focusing

Daniel Marques danixmarques

🎯
Focusing
View GitHub Profile
@danixmarques
danixmarques / cloudwatch-alarm
Last active January 18, 2024 10:49
Create lambda resource base policy to allow CloudWatch Alarm invoke a lambda function
# Create lambda resource base policy to allow CloudWatch Alarm invoke lambda function
aws lambda add-permission \
--function-name <your-lambda-function-name> \
--statement-id AlarmAction \
--action lambda:invokefunction \
--principal sns.amazonaws.com \
--source-arn arn:aws:sns:<your-aws-region>:<your-aws-account-id>:<your-sns-topic-name>
# Force CloudWatch Alarm become IN ALARM state