Switching Avalon to use MediaConvert from ElasticTranscoder

Switching Avalon to use MediaConvert from ElasticTranscoder

Requirements

AWS account with sufficient privileges to create roles, policies, and use mediaconvert.

Description

Amazon ElasticTranscoder will be EOL and no longer usable on Nov 13, 2025. AWS Elemental MediaConvert is the replacement service offered by AWS. Avalon 8.2 will contain support for MediaConvert and default to it for Terraform installs, but given ElasticTranscoder’s timeline a manual upgrade will be necessary to avoid gaps in transcoding capability.

Upgrade Steps

For Terraform Installations

  1. Apply patch to avalon in Add support for AWS Elemental MediaConvert active_encode adapter by cjcolvar · Pull Request #6579 · avalonmediasystem/avalon and get the preset files from Add missing media convert presets by cjcolvar · Pull Request #6645 · avalonmediasystem/avalon

  2. Update avalon-terraform to the latest code

  3. Set encoding_engine_adapter = "media_convert" in terraform.tfvars

  4. Run terraform apply

  5. After Avalon has been built and deployed test ingesting a new file and check that it plays back

  6. Look in the AWS Console for MediaConvert and check that the job appears

For Non-Terraform Installations (or Terraform installations that cannot upgrade to the latest avalon-terraform)

  1. Apply patch to avalon in Add support for AWS Elemental MediaConvert active_encode adapter by cjcolvar · Pull Request #6579 · avalonmediasystem/avalon and get the preset files from Add missing media convert presets by cjcolvar · Pull Request #6645 · avalonmediasystem/avalon

  2. Create IAM role for mediaconvert (adjust role name as desired) and make note of the role’s ARN
    Using the CLI:

    aws iam create-role --role-name avalon-mediaconvert-role --assume-role-policy-document '{"Version": "2008-10-17", "Statement": [{"Action": "sts:AssumeRole", "Effect": "Allow", "Sid": "", "Principal": {"Service": "mediaconvert.amazonaws.com"}}]}'

    Using the AWS Console:

    1. Go to IAM → Roles → Create Role

    2. Fill in the form for step 1:
      Trusted Entity Type: AWS Service
      Use Case: MediaConvert

    3. Skip step 2

    4. Fill in the form for step 3 and create the role:
      Role name: avalon-mediaconvert-role

  3. Create policy for mediaconvert role using masterfiles and derivatives bucket ARNs and make note of the policy’s ARN
    Using the CLI:

    aws iam create-policy --policy-name avalon-mediaconvert-policy --policy-document '{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:List*", "s3:Get*" ], "Resource": ["<masterfiles-bucket-arn>", "<masterfiles-bucket-arn>/*"] }, { "Effect": "Allow", "Action": [ "s3:Put*" ], "Resource": ["<derivatives-bucket-arn>", "<derivatives-bucket-arn>/*"] } ] }'

    Using the AWS Console:

    1. Go to IAM → Policies → Create Policy

    2. Switch the Policy Editor to JSON and paste in the following:

      { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:List*", "s3:Get*" ], "Resource": ["<masterfiles-bucket-arn>", "<masterfiles-bucket-arn>/*"] }, { "Effect": "Allow", "Action": [ "s3:Put*" ], "Resource": ["<derivatives-bucket-arn>", "<derivatives-bucket-arn>/*"] } ] }
    3. Fill in the form for step 2 and create policy:
      Policy name: avalon-mediaconvert-policy

  4. Attach policy to role using the policy’s ARN
    Using CLI:

    aws iam attach-role-policy --role-name avalon-mediaconvert-role --policy-arn <avalon-mediaconvert-policy-arn>

    Using AWS Console:

    1. Go to IAM → Roles → avalon-mediaconvert-role

    2. Under Permission Policies click the Add Permissions drop down and select Attach Policies

    3. Find and select the avalon-mediaconvert-policy and click Add Permissions

  5. (If avalon-terraform installation) Update <namespace>-<appname>-compose-api-access policy using mediaconvert role ARN:
    Using AWS CLI:

    aws iam create-policy-version --policy-arn <compose-api-access-policy-arn> --set-as-default --policy-document '{ "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Action": [ "ssm:Get*", "ses:SendRawEmail", "ses:SendEmail", "s3:*", "logs:PutRetentionPolicy", "logs:PutLogEvents", "logs:DescribeLogStreams", "logs:DescribeLogGroups", "logs:CreateLogStream", "logs:CreateLogGroup", "elastictranscoder:ReadPreset", "elastictranscoder:ReadJob", "elastictranscoder:Read*", "elastictranscoder:ListPresets", "elastictranscoder:List*", "elastictranscoder:CreatePreset", "elastictranscoder:CreateJob", "elastictranscoder:CancelJob", "mediaconvert:*", "elasticfilesystem:*", "ec2:DescribeInstances", "cloudwatch:PutMetricData" ], "Resource": "*" }, { "Effect": "Allow", "Action": "iam:PassRole", "Resource": <mediaconvert-role-arn> } ] }'

    Using AWS Console:

    1. Go to IAM → Policies → <namespace>-<appname>-compose-api-access

    2. Edit as JSON:

      { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Action": [ "ssm:Get*", "ses:SendRawEmail", "ses:SendEmail", "s3:*", "logs:PutRetentionPolicy", "logs:PutLogEvents", "logs:DescribeLogStreams", "logs:DescribeLogGroups", "logs:CreateLogStream", "logs:CreateLogGroup", "elastictranscoder:ReadPreset", "elastictranscoder:ReadJob", "elastictranscoder:Read*", "elastictranscoder:ListPresets", "elastictranscoder:List*", "elastictranscoder:CreatePreset", "elastictranscoder:CreateJob", "elastictranscoder:CancelJob", "mediaconvert:*", "elasticfilesystem:*", "ec2:DescribeInstances", "cloudwatch:PutMetricData" ], "Resource": "*" }, { "Effect": "Allow", "Action": "iam:PassRole", "Resource": <mediaconvert-role-arn> } ] }
    3. Save Changes

  6. Update Avalon Settings or ENV variables in settings.yml or .env:

    SETTINGS__ENCODING__ENGINE_ADAPTER="media_convert" SETTINGS__ENCODING__MEDIA_CONVERT_ROLE=<avalon-mediaconvert-role-arn> SETTINGS__ENCODING__DERIVATIVE_BUCKET=<derivative-bucket-name> SETTINGS__ENCODING__PRESETS_PATH=config/media_convert_presets/
  7. (If avalon-terraform installation) Run CodeBuild build to create and deploy a new avalon container image

  8. After Avalon has been deployed test ingesting a new file and check that it plays back

  9. Look in the AWS Console for MediaConvert and check that the job appears