The source code for NoOps presentation in ASW SYD12.
Since AWS Rekognition is not supported by AWS CloudFormation yet the collection should be created manually and passed to the template as a parameter:
aws rekognition create-collection --collection-id "noops-poc" --region us-west-2You need s3 bucket for temporary artifacts produced by aws cloudformation package command
aws s3api create-bucket --bucket noops-wip-pdx --region us-west-2- Get the code:
git clone https://github.com/SydneyDockerMeetupAWS/serverless-rekognition.git- Create lambda packages
aws cloudformation package --template-file template.yml --s3-bucket noops-wip-pdx --output-template-file out.yml- Deploy
aws cloudformation deploy --template-file out.yml --stack-name noopsPOC --capabilities CAPABILITY_IAM --region us-west-2Prepare pictures and run using aws cli:
aws s3 cp ../pic/jolie3.jpg s3://<imagesbucket>/users/ --metadata Name=Angelina,Surname=Jolie,id=whoknows@example.com- where is the name of the bucket created by the CFN deploy above.
- you can add as many pictures with the same id as you want
- Upload image on s3 (use the same bucket but the different prefix):
aws s3 cp ../pic/jolie4.jpg s3://<imagesbucket>/test/- invoke the Search Lambda function
aws --region us-west-2 lambda invoke --function-name <noopsPOC-Search> --invocation-type RequestResponse --payload "{ \"bucket\": \"<imagesbucket>\", \"key\": \"test/jolie4.jpg\" }" test.txt
