# Send HLS content to Amazon S3 Stream targets in Wowza Streaming Engine™ [media server software](https://www.wowza.com/products/streaming-engine) allow you to send live streams to widely distributed destinations. This article explains how to create a Fastly stream target with a push connection to distribute your live streams using Wowza CDN. You need an Amazon AWS account and a Wowza Streaming Cloud account for this workflow. Alternatively, you may configure your connection for a pull-based workflow where the destination pulls the stream data from the server. Unless there is a specific need for a push-based workflow, it's strongly recommended to use a pull-based workflow instead. See [Scaling Wowza Streaming Engine with Wowza CDN](https://www.wowza.com/docs/using-wowza-cdn-with-wowza-streaming-engine) to learn more about the advantages and disadvantages of the push and pull workflows. To configure your stream target using a pull connection, see [Send a stream from Wowza Streaming Engine to a Wowza CDN HLS target using Wowza REST APIs](https://www.wowza.com/docs/how-to-send-a-stream-from-wowza-streaming-engine-to-a-wowza-cdn-hls-target-by-using-the-wowza-streaming-engine-and-wowza-video-rest-apis). ## Before you start Before you start, we recommend that you review and have access to the following items: - A valid Wowza Streaming Engine license and a Wowza CDN subscription through Wowza Video. [Contact our sales team](https://www.wowza.com/contact) for more information. - An Amazon Web Service account with create, read, and write access to S3 storage using access key security credentials. See [AWS Free Tier](https://aws.amazon.com/free/) to create a free account. - [Create a live application](https://www.wowza.com/docs/how-to-get-started-as-a-wowza-streaming-engine-manager-administrator#create-applications%C2%A05) in Wowza Streaming Engine Manager. ## 1. Create a bucket in AWS S3 See [Creating a bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html) for instructions on how to create a bucket in AWS. You must configure some settings to allow streams to be played back from your S3 bucket. 1. For your S3 bucket, enable **ACLs**. For best results, set **Object Ownership** to **Object Writer**. ![](https://dyzz9obi78pm5.cloudfront.net/app/image/id/6797ffbf4bd5a60f58072c71/n/aws-s3-bucket-object-ownership.png) 2. Enable **Public Access** for objects in the bucket. ![](https://dyzz9obi78pm5.cloudfront.net/app/image/id/679800de06eb8429490264b4/n/aws-s3-bucket-public-access.png) 3. For testing direct playback from the bucket, you may need to enable cross-origin resource sharing (CORS). After the bucket is created, select the **Permissions** tab for the bucket and add the following **CORS configuration**: > **Note:** CORS is only required for direct playback from the bucket. It's not required for playback via the Wowza CDN stream target. ```json [ { "AllowedHeaders": [], "AllowedMethods": ["GET"], "AllowedOrigins": ["*"], "ExposeHeaders": [] } ] ``` 4. Once your bucket is created, note the following information from your Amazon account: - **AWS bucket name** — for example, `my-s3-bucket`. - **AWS bucket region** — for example, `us-west-1`. - **AWS bucket URL** — used with the Wowza CDN stream target in Wowza Video. The format is: ``` https://[bucket-name].s3.[region].amazonaws.com/ ``` For example: `https://my-s3-bucket.s3.us-west-1.amazonaws.com/` > **Note:** For buckets in the us-east-1 region, AWS doesn't require the region in the URL (`https://[bucket-name].s3.amazonaws.com/`). This is a legacy format and won't work with Wowza CDN stream targets. Use the regionalised S3 URL instead: `https://[bucket-name].s3.us-east-1.amazonaws.com`. 5. Record your IAM credentials. These are set per user in AWS. See [Create an IAM admin and user group in AWS](https://support.wowza.com/hc/en-us/articles/4496018440091-create-an-iam-admin-and-user-group-in-aws) for more information. Record the following: - **AWS Access ID** — for example, `AKIAI6234VXXREN3KWJQ`. - **AWS Secret Access Key** — for example, `y1PFFPOEwSrUfvvvdalA1qs9sFDM7+QzQTMHoqP7`. ## 2. Enable the Wowza Streaming Engine stream target Before you push a stream, you must enable stream targets for your live Wowza Streaming Engine application. 1. Go to the contents panel of your live application and click **Stream Targets**. 2. On the **Stream Targets** page, click **Enable Stream Targets**. ![](https://dyzz9obi78pm5.cloudfront.net/app/image/id/645e752e592a0949dc701c08/n/wse-live-app-enable-stream-targets.png) When stream targets are enabled, a checkmark appears next to the **Stream Targets** text in the contents panel and the **Stream Targets** page shows the status as **Enabled**. ![](https://dyzz9obi78pm5.cloudfront.net/app/image/id/6463a2acc22ab341f16c8a8e/n/wse-live-application-stream-targets-checked.png) 3. Restart the application for changes to take effect. ## 3. Create a Wowza Streaming Engine stream target Once you've created your AWS S3 bucket and recorded your credentials, you can create a stream target in Wowza Streaming Engine to send your stream to AWS S3. The AWS S3 bucket is used as a storage location and works as an origin with Wowza Video. 1. Send the following POST request using the Wowza Streaming Engine REST API: ``` /v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/pushpublish/mapentries/{entryName} ``` In the sample request, make sure to: - Set **http.relativePlaylists** to **true**. It is **false** by default. - Set **streamName** to match the incoming stream name or transcoder rendition for each stream target. - Set **entryName** to a unique name for your stream target. - For adaptive bitrate entries, set **profile** to **group-manager** and **group.name** to a unique name for your stream target. - Set **cloudstorage.bucketName** to your [AWS bucket name](https://www.wowza.com/docs/send-apple-hls-and-mpeg-dash-content-to-amazon-s3-using-wowza-rest-apis#aws-bucket-name-region). - Set **cloudstorage.region** to your [AWS bucket region](https://www.wowza.com/docs/send-apple-hls-and-mpeg-dash-content-to-amazon-s3-using-wowza-rest-apis#aws-bucket-name-region). - Set **cloudstorage.accessID** to your [AWS access ID](https://www.wowza.com/docs/send-apple-hls-and-mpeg-dash-content-to-amazon-s3-using-wowza-rest-apis#aws-access-credentials). - Set **cloudstorage.secretAccessKey** to your [AWS secret access key](https://www.wowza.com/docs/send-apple-hls-and-mpeg-dash-content-to-amazon-s3-using-wowza-rest-apis#aws-access-credentials). - Include the **extraOptions** object in the POST request, as shown below. - Change any additional values to be unique to your stream target. - Before saving, use a [JSON validator](https://jsonlint.com) to validate the map entries. Copy the complete text after the = sign into the validator to check the syntax. > **Note:** For more information on map entries, see [Use CDNs and services to distribute live streams from Wowza Streaming Engine](https://www.wowza.com/docs/how-to-push-streams-to-cdns-and-other-services-push-publishing#group-manager). **Sample request — Single bitrate map entries:** ```bash curl -X POST \ -H 'Accept:application/json; charset=utf-8' \ -H 'Content-Type:application/json; charset=utf-8' \ http://localhost:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/pushpublish/mapentries/{entryName} \ -d '{ "entryName": "entryName", "sourceStreamName": "stream_name", "streamName": "stream_name", "profile": "cupertino-cloudstorage", "debugLog": false, "extraOptions": { "cloudstorage.provider": "S3", "cloudstorage.bucketName": "my-s3-bucket", "cloudstorage.region": "us-west-1", "cloudstorage.accessID": "AKIAI6IO5VXX-EXAMPLE", "cloudstorage.secretAccessKey": "y1PFFPOEwSrUfWyhalA1qs9sFDM7+QzQ-example", "cloudstorage.transportDebug": false, "http.relativePlaylists": true } }' ``` **Sample request — Adaptive bitrate map entries:** ```bash curl --location --request POST 'http://127.0.0.1:8087/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/pushpublish/mapentries/{entryName}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data-raw '{ "profile": "group-manager", "childProfile": "cupertino-cloudstorage", "sourceStreamName": "stream_name", "group.streamMatcher": "namePrefix", "group.name": "stream_name_ABR", "debugLog": false, "extraOptions": { "cloudstorage.provider": "S3", "cloudstorage.bucketName": "my-s3-bucket", "cloudstorage.region": "us-west-1", "cloudstorage.accessID": "AKIAI6IO5VXX-EXAMPLE", "cloudstorage.secretAccessKey": "y1PFFPOEwSrUfWyhalA1qs9sFDM7+QzQ-example", "cloudstorage.transportDebug": false, "http.relativePlaylists": true } }' ``` **Sample response:** ```json { "success": true, "message": "Entry (entryName) saved successfully", "data": null } ``` 2. Copy the URL for the playlist from your S3 bucket — for example: ``` https://my-s3-bucket.s3-us-west-1.amazonaws.com/myStream/playlist.m3u8 ``` > **Note:** For buckets in the [us-east-1](https://www.wowza.com/docs/send-apple-hls-and-mpeg-dash-content-to-amazon-s3-using-wowza-rest-apis#east) region, this URL will be in the legacy format and needs to be changed to include the region. 3. Test the playback using the playlist URL in your player. > **Note:** Some players will require [CORS headers](https://www.wowza.com/docs/send-apple-hls-and-mpeg-dash-content-to-amazon-s3-using-wowza-rest-apis#CORS) to be enabled for direct playback from the bucket. ## 4. Create a Wowza CDN stream target in Wowza Video After sending your content to your AWS S3 bucket, continue with these steps to use that storage location as an origin with Wowza Video. Setting up a Wowza CDN stream target allows you to manage traffic to your S3 bucket more efficiently while reducing costs when pulling content from that location. > **Note:** Only one Wowza CDN stream target needs to be created for each S3 bucket. You can use the following sample request, making sure to: - Set **custom_origin_region** to your [AWS bucket region](https://www.wowza.com/docs/send-apple-hls-and-mpeg-dash-content-to-amazon-s3-using-wowza-rest-apis#aws-bucket-name-region). Valid values are: - `us` – (United States) - `eu` – (Europe) - `asia` – (Asia) - `sa` – (South America) - `india` – (India) > Note: `custom_origin_region` is available in version 1.6 and later of the REST API. - Set **custom_origin_url** to your [AWS bucket URL](https://www.wowza.com/docs/send-apple-hls-and-mpeg-dash-content-to-amazon-s3-using-wowza-rest-apis#aws-bucket-name-region). - Change any values unique to your broadcast, using the API reference documentation as a resource. See the Endpoint Reference button below. **Sample request:** ```bash curl -X POST \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${WV_JWT}" \ -d '{ "stream_target_wowza_cdn": { "name": "My Wowza CDN target", "custom_origin_region": "us", "custom_origin_url": "https://my-s3-bucket.s3.us-west-1.amazonaws.com/" } }' "${WV_HOST}/api/${WV_VERSION}/stream_targets/wowza_cdn" ``` **Sample response:** The response includes a **custom_origin_url** you'll use for playback — for example, `https://cdn3.wowza.com/5/YVRyc3pjNnV5OEtr/`. ```json { "stream_target_wowza_cdn": { "id": "xvmjckfk", "name": "My Wowza CDN target", "state": "activated", "stream_name": "K2R3dEhW", "delivery_protocols": ["hls"], "playback_urls": { "hls": [ { "name": "default", "url": "https://cdn3.wowza.com/5/YVRyc3pjNnV5OEtr/[application-name]/[stream-name]" } ] }, "force_ssl_playback": false, "use_legacy_tls": false, "token_auth_enabled": false, "token_auth_playlist_only": false, "geoblock_enabled": false, "referer_enabled": false, "custom_origin_url": "https://my-s3-bucket.s3.us-west-1.amazonaws.com/", "custom_origin_region": "us", "created_at": "2025-01-29T21:43:17.000Z", "updated_at": "2025-01-29T21:43:17.000Z" } } ``` ## 5. Test playback As the root for your playback URL, you can use the **custom_origin_url** or the playback URL from the sample response in the last section. To test playback, append the path to the specific file inside the S3 bucket. **Single bitrate with stream name in the URL:** - Wowza CDN URL: `https://cdn3.wowza.com/5/YVRyc3pjNnV5OEtr/myStream/playlist.m3u8` - S3 URL: `https://my-s3-bucket.s3.us-west-1.amazonaws.com/myStream/playlist.m3u8` **Adaptive bitrate with group name in the URL:** - Wowza CDN URL: `https://cdn3.wowza.com/5/YVRyc3pjNnV5OEtr/myStream-ABR/playlist.m3u8` - S3 URL: `https://my-s3-bucket.s3.us-west-1.amazonaws.com/myStream-ABR/playlist.m3u8` ## More resources - [Scaling Wowza Streaming Engine with Wowza CDN](https://www.wowza.com/docs/using-wowza-cdn-with-wowza-streaming-engine) - [Push streams to Wowza CDN from Wowza Streaming Engine](https://www.wowza.com/docs/push-streams-to-wowza-cdn-from-wowza-streaming-engine) - [Pull streams from Wowza Streaming Engine to Wowza CDN](https://www.wowza.com/docs/how-to-stream-to-wowza-cdn)