post https://api.pictory.ai/pictoryapis/v1/awsconnections
Steps to Create an AWS IAM Role with Trust Relationship for Pictory AWS Account to Access Videos or Images in a Private S3 Bucket to Create Videos using Private Media Assets
This guide explains how to create an AWS IAM Role with a trusted entity type set to "AWS Account", specifically allowing access for Another (Pictory) AWS Account ID: 701488979254.
Step 1: Log in to the AWS Management Console
- Open the AWS Management Console.
- Navigate to the IAM service by searching for "IAM" in the search bar.
Step 2: Create a New Role
- In the IAM Dashboard, click on Roles in the left navigation pane.
- Click the Create role button.
Step 3: Select Trusted Entity
- Under Trusted entity type, select Another AWS account.
- Enter the Account ID:
701488979254
. - Click Next and go to Add permissions.
- Skip Add permissions and click Next.
- Enter Role name PictoryCloudIntegrationRole and click Create role.
Step 4: Attach Inline Policy
- Go to Roles in IAM and search for PictoryCloudIntegrationRole.
- On the Permissions tab, click Add permissions and select Create inline policy.
- After proceeding, on the Specify permissions, go to the JSON tab and paste the following policy document:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetObject" ], "Resource": [ "arn:aws:s3:::{YOUR_S3_BUCKET}", "arn:aws:s3:::{YOUR_S3_BUCKET}/*" ] }, { "Effect": "Allow", "Action": [ "s3:ListAllMyBuckets" ], "Resource": [ "arn:aws:s3:::*" ] } ] }
- Replace
{YOUR_S3_BUCKET}
with the name of your S3 bucket. - Click Review policy, give it a name (e.g., s3_access_policy), and save.
Step 5: Configure Trust Relationship
- Go to Roles in IAM and search for PictoryCloudIntegrationRole.
- Go to the Trust relationships tab.
- Click Edit trust policy.
- Replace the existing trust policy with the following JSON:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::701488979254:role/CloudIntegrationRole" }, "Action": "sts:AssumeRole", "Condition": {} }, { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::701488979254:role/ecsTaskExecutionRole" }, "Action": "sts:AssumeRole", "Condition": {} }, { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::701488979254:root" }, "Action": "sts:AssumeRole", "Condition": {} } ] }
- Save the changes.
Your PictoryCloudIntegrationRole Role is Now Ready for Use!
The created PictoryCloudIntegrationRole role is now configured to allow trusted access to AWS Account ID 701488979254
and grant permissions for the specified S3 buckets and actions.
API Documentation: Register AWS Connection in Pictory
API Endpoint
Make a POST
request to the API endpoint:
https://api.pictory.ai/pictoryapis/v1/awsconnections
Request Structure
CURL Command:
curl --request POST \
--url https://api.pictory.ai/pictoryapis/v1/awsconnections \
--header 'Authorization: <access_token>' \
--header 'X-Pictory-User-Id: <Your-Pictory-User-ID>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"name": "PictoryPrivateVideosConnection",
"description": "Pictory Private Videos Connection",
"awsAccountId": "<YOUR_12_DIGIT_AWS_ACCOUNT>",
"awsRegion": "<YOUR_S3_BUCKET_REGION>",
"enabled": true
}
Request Body Parameters:
Field | Type | Required | Description |
---|---|---|---|
name | String | Yes | A unique name for the AWS connection. |
description | String | No | A brief description of the AWS connection. |
awsAccountId | String | Yes | The 12 Digit AWS account ID associated with the connection. |
awsRegion | String | Yes | The S3 bucket AWS Region. Example: us-east-2 . |
enabled | Boolean | Yes | Specifies whether the AWS connection is enabled. |
Example Request Body:
{
"enabled": true,
"name": "PictoryPrivateVideosConnection",
"description": "Pictory Private Videos Connection",
"awsAccountId": "<YOUR_12_DIGIT_AWS_ACCOUNT>",
"awsRegion": "<YOUR_S3_BUCKET_REGION>"
}
Headers
Header | Value | Description |
---|---|---|
Authorization | <access_token> | Token for API access. |
X-Pictory-User-Id | <Your-Pictory-User-ID> | Unique identifier for the user provided by Pictory. |
content-type | application/json | Specifies the request payload format. |
Example Response
Successful Response:
{
"enabled": true,
"name": "PictoryPrivateVideosConnection",
"description": "Pictory Private Videos Connection",
"awsAccountId": "<YOUR_12_DIGIT_AWS_ACCOUNT>",
"awsRegion": "<YOUR_S3_BUCKET_REGION>",
"connectionId": "20241207042423053xmex5z9ag9ivmp21",
"version": 1
}
Response Fields:
Field | Type | Description |
---|---|---|
name | String | The unique name of the AWS connection. |
description | String | The description of the AWS connection. |
awsAccountId | String | The 12 digit AWS account ID associated with the connection. |
awsRegion | String | The S3 bucket AWS Region. |
connectionId | String | A unique identifier for the created AWS connection. |
enabled | Boolean | Indicates whether the AWS connection is enabled. |
version | Number | The version number of the AWS connection configuration. |
Notes
The awsAccountId
and awsRegion
should match the details of your AWS setup and awsRegion
should be S3 bucket
region.
Using AWS Connection ID and Private Media Assets in Video Storyboard Request
Example Request
{
"awsConnectionId": "20241207042423053xmex5z9ag9ivmp21",
"videoName": "test_video",
"videoDescription": "test video",
"language": "en",
"audio": {
"autoBackgroundMusic": true,
"backGroundMusicVolume": 0.5
},
"scenes": [
{
"text": "Hello world! Good morning!",
"voiceOver": false,
"splitTextOnNewLine": false,
"splitTextOnPeriod": false,
"backgroundUri": "s3://{YOUR_S3_BUCKET}/hello_world.mp4",
"backgroundType": "video",
"loopBackgroundVideo": true,
"muteBackgroundVideo": true,
"minimumDuration": 5
},
{
"text": "Welcome and have a wonderful day ahead!",
"voiceOver": false,
"splitTextOnNewLine": false,
"splitTextOnPeriod": false,
"backgroundUri": "https://{YOUR_S3_BUCKET}.s3.us-east-1.amazonaws.com/welcome_everyone.mp4",
"backgroundType": "video",
"loopBackgroundVideo": true,
"muteBackgroundVideo": true,
"minimumDuration": 5
}
]
}
Notes
- Private Media Access: Ensure the
awsConnectionId
corresponds to the AWS connection that has permissions for the private S3 assets. - Background URIs: Private S3 URIs could be in the format
s3://{YOUR_S3_BUCKET}/key
, orhttps://{YOUR_S3_BUCKET}.s3.region.amazonaws.com/key
format.