When invoking the Lambda Function, Cloudwatch Events passes the "event" json object into the lambda handler which contains a key:value pair of {"source":"aws.events"}.
This change takes advantage of that to only send the tweet when invoked by the scheduled event. Otherwise, it will respond with a json object carrying the message. This will allow users to hit an api endpoint (that will be made in the infra repo) and receive a "random" response.
Resolves #4
When invoking the Lambda Function, Cloudwatch Events passes the "event" json object into the lambda handler which contains a key:value pair of {"source":"aws.events"}.
This change takes advantage of that to only send the tweet when invoked by the scheduled event. Otherwise, it will respond with a json object carrying the message. This will allow users to hit an api endpoint (that will be made in the infra repo) and receive a "random" response.