[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Mon Sep 02 2019

How to create an S3 role-based output on Bitmovin for Analytics exports

OverviewLink Icon

S3 role-based Outputs are an alternative way of service to access your AWS S3 bucket to be used as an Input (Encoding) and/or Output (Encoding/Analytics). Instead of providing an Access/Secret key pair, we provide you with an AWS IAM user name, which you can grant specific access rights in your account so it can access your desired S3 bucket.

NOTE: At this time, S3 role-based buckets support progressive output files (MP4 / MOV / TS muxings) only. We are working on adding support for segmented output types in the future.

To do that, you create an IAM role in your AWS account, and attach an IAM policy to it. This policy states which bucket can be accessed by our user, and which permissions are granted to it.

Create an IAM Role in your AWS accountLink Icon

In order to continue, you will have to create a Role in your AWS account. Please see our tutorial to learn how to create a AWS IAM Role. If you want to learn more about Roles in AWS, please see their documentation.

(Java) S3 role-based Output for Analytics ExampleLink Icon

This example uses our latest Open API client for Java, which is available on Github.

Create a new S3 role-based Output

1bitmovinApi = BitmovinApi.builder().withApiKey("YOUR_BITMOVIN_API_KEY").build();
2
3List<AclEntry> s3RoleBasedAclPermissions = new ArrayList<>();
4AclEntry aclEntry = new AclEntry();
5aclEntry.setPermission(AclPermission.PRIVATE);
6s3RoleBasedAclPermissions.add(aclEntry);
7
8S3RoleBasedOutput s3RoleBasedOutput = new S3RoleBasedOutput();
9s3RoleBasedOutput.setBucketName("<BUCKET_NAME>");
10s3RoleBasedOutput.setRoleArn("<AWS_ARN_ROLE>");
11s3RoleBasedOutput.setExternalId("<AWS_ROLE_EXT_ID>");
12s3RoleBasedOutput.setAcl(s3RoleBasedAclPermissions);
13
14s3RoleBasedOutput = bitmovinApi.analytics.outputs.s3RoleBased.create(s3RoleBasedOutput);

Use an existing S3 role-based Output

1bitmovinApi = BitmovinApi.builder().withApiKey("YOUR_BITMOVIN_API_KEY").build();
2
3S3RoleBasedOutput s3RoleBasedOutput = bitmovinApi.analytics.outputs.s3RoleBased.get("YOUR_S3_ROLE_BASED_OUTPUT_ID");

(CURL) S3 role-based Output for Analytics ExampleLink Icon

Create a new S3 role-based Output

API reference: create a role-based S3 Output:

1curl -X POST \
2 https://api.bitmovin.com/v1/analytics/outputs/s3-role-based \
3 -H 'Content-Type: application/json' \
4 -H 'x-api-key: YOUR_BITMOVIN_API_KEY' \
5 -d '{
6 "bucketName": "<BUCKET_NAME>",
7 "roleArn": "<AWS_ARN_ROLE>",
8 "externalId": "<AWS_ROLE_EXT_ID>",
9 "acl": [
10 {
11 "permission": "PRIVATE"
12 }
13 ]
14}'

Get a existing S3 role-based Output

API reference: get a S3 role-based Output

1curl https://api.bitmovin.com/v1/analytics/outputs/s3-role-based/YOUR_S3_ROLE_BASED_OUTPUT_ID \
2 -H 'Content-Type: application/json' \
3 -H 'x-api-key: YOUR_BITMOVIN_API_KEY'

What's next?Link Icon

Now that you have an S3 role-based Output for Bitmovin Analytics available, you can export your Bitmovin analytics Data to it :)

Give us feedback