View a markdown version of this page

Step 2: Store your media in Amazon S3 - AWS End User Messaging

Step 2: Store your media in Amazon S3

AWS End User Messaging sends MMS media from an Amazon S3 bucket. You store your image, audio, video, or other media files in Amazon S3, and reference each file by its Amazon S3 URI when you send. The Amazon S3 bucket must be in the same AWS account and AWS Region as your MMS-capable origination identity, and the identity that calls send-media-message must have read access to the bucket.

To store MMS media in Amazon S3
  1. Create an Amazon S3 bucket in the same AWS Region as your origination identity, using the create-bucket command:

    aws s3api create-bucket --region us-east-1 --bucket BucketName
  2. Upload each media file to the bucket, using the cp command:

    aws s3 cp SourceFilePathAndName s3://BucketName/FileName
  3. Note the Amazon S3 URI of each file. This is the value you pass to the media-urls parameter when you send. Each message carries a single media file, so you pass one Amazon S3 URI:

    s3://BucketName/FileName

Grant the identity that sends MMS read access to the bucket. For example policies, see Identity-based policy examples for Amazon S3 in the Amazon S3 User Guide. For the supported media types and size limits, see the SendMediaMessage API reference.