-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add lambda for publishing a photo * Add lambda definition in CDK
- Loading branch information
1 parent
c3b07be
commit 51ff0ce
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from pierrot.src.clients.flickr.client import Flickr | ||
from pierrot.src.clients.s3.client import S3 | ||
from pierrot.src.clients.twitter.client import Twitter | ||
from pierrot.src.config import Config | ||
from pierrot.src.logging import get_logger | ||
from pierrot.src.pierrot import Pierrot | ||
|
||
|
||
log = get_logger(__name__) | ||
|
||
|
||
def do_work(event, context) -> None: | ||
log.info(f'Event: {event}, Context: {context}') | ||
|
||
flickr_config = Config.get_flickr_config() | ||
s3_config = Config.get_s3_config() | ||
twitter_config = Config.get_twitter_config() | ||
|
||
flickr = Flickr(flickr_config) | ||
s3 = S3(s3_config) | ||
twitter = Twitter(twitter_config) | ||
|
||
pierrot = Pierrot( | ||
flickr_username=flickr_config.photos_owner, | ||
flickr=flickr, | ||
s3=s3, | ||
twitter=twitter, | ||
) | ||
pierrot.publish_photo() |