https://www.youtube.com/channel/UCbbp2FFbVQkuFYTJCZ92JQg
- IAM Role with SNS and cloudwatch Access
- SNS Topic with subsriber that reveives the message
- Lambda function with code that sends sms to a topic
- Cloudwatch event rule that will trigger based off event pattern
- Create the IAM Role
- Create the SNS Topic
- Create the Lambda function
- Create the cloudwatch event rule with event pattern
- Simulate the event with login/ logout
-
Fork/Clone this repo.
-
Package the code and package with this command. Make sure to replace the s3 bucket name with a bucket you own
aws cloudformation package --template-file sendSMSwhenConsoleLogin.yaml --s3-bucket your-s3-bucket --output-template-file output.yaml
-
Deploy the stack with this command. You need to supply the email of the receipient in this command.
aws cloudformation deploy --template-file output.yaml --stack-name console-login-sns-test1 --parameter-overrides SNSEmailParameter=youremail@gmail.com --capabilities CAPABILITY_NAMED_IAM CAPABILITY_IAM
-
Now check your email for SNS confirmation to confirm subscription.
-
Now log out and log back into the AWS Management Console. You should receive an email in a few minutes mentioning the user who logged in as well in the email.
Logged in - 7:05 Notified- almost immediately