javascriptv3/example_code/cross-services/photo_analyzer/README.md
Demonstrate the use of AWS Rekognition to analyze images located in an Amazon Simple Storage Service (Amazon S3) bucket.
Analyze many images and generate reports for each image in an Amazon S3 bucket, breaking the image down into a series of labels. Then, use Amazon Simple Email Service (Amazon SES) to send emails with a link to each report. The following AWS services are used:
To build this example, complete the following steps:
javascriptv3 folder.npm run deploy. This will use the AWS CLI to deploy the resources you need.This is a static site consisting only of HTML, CSS, and client-side JavaScript. However, a build step is required to enable the modules to work natively in the browser. The build step also uses your local credentials to fetch the CloudFormation outputs and supplies them as environment variables to Webpack.
A helper script has been provided to bundle the code and start an HTTP server. You'll need to provide the email address you verified in SES, and an AWS region as environment variables. Replace <EMAIL_ADDRESS> and <REGION> with your verified email and preferred AWS region (defaults to 'us-east-1').
VERIFIED_EMAIL_ADDRESS="<EMAIL_ADDRESS>" REGION="<REGION>" npm run dev
There will be terminal output that looks something like the below:
> @aws-doc-sdk-examples/[email protected] dev
> npm run build && npx http-server ./dist/
> @aws-doc-sdk-examples/[email protected] build
> webpack --mode development
asset main.js 2.07 MiB [compared for emit] (name: main)
asset vendors-node_modules_aws-sdk_credential-provider-cognito-identity_dist-es_loadCognitoIdentity_js.main.js 55.5 KiB [compared for emit] (id hint: vendors)
orphan modules 351 KiB [orphan] 347 modules
runtime modules 7.25 KiB 10 modules
javascript modules 1.15 MiB 544 modules
json modules 17.3 KiB
../../../node_modules/@aws-sdk/client-cognito-identity/package.json 3.21 KiB [built] [code generated]
../../../node_modules/@aws-sdk/client-s3/package.json 3.99 KiB [built] [code generated]
../../../node_modules/@aws-sdk/client-rekognition/package.json 3.1 KiB [built] [code generated]
../../../node_modules/@aws-sdk/client-ses/package.json 3.02 KiB [built] [code generated]
../../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json 4 KiB [built] [code generated]
webpack 5.94.0 compiled successfully in 848 ms
Starting up http-server, serving ./dist/
http-server version: 14.1.1
http-server settings:
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none
Available on:
http://127.0.0.1:8080
http://192.168.254.17:8080
http://11.129.21.155:8080
Hit CTRL-C to stop the server
aws s3 rm s3://bucket-name --recursivenpm run destroy.