AWS Media Services
AWSOfficialPublished by AWS
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured framework for managing end-to-end video streaming pipelines using AWS Media Services. It acts as an orchestrator that enforces mandatory rule-loading sequences to ensure configurations adhere to service constraints, security best practices, and performance requirements. It covers the full lifecycle of live, linear, and VOD workflows, including ingest, encoding, packaging, ad insertion, and CDN delivery.
What it does
- Provides a mandatory dependency-based workflow for building and modifying streaming pipelines.
- Enforces the loading of specific service rules to prevent configuration errors.
- Offers a comprehensive troubleshooting guide for cross-service signal chain issues.
- Includes a discovery checklist to gather requirements before resource deployment.
- Defines strict startup and shutdown sequences for live streaming events.
- Provides best practices for cost optimization and resilience in media architectures.
When to use it
- When building or modifying live, linear, or VOD video streaming workflows.
- When troubleshooting errors, latency, or sync issues across AWS media services.
- When auditing existing configurations for compliance or performance optimization.
- When planning a new media project and needing to understand service dependencies.
- When configuring complex features like SCTE-35 ad insertion, DRM, or epoch locking.
Advantages
- Prevents common configuration errors by enforcing dependency-aware resource creation.
- Ensures compliance with service-specific constraints and security policies.
- Reduces troubleshooting time by providing structured, service-specific diagnostic paths.
- Promotes architectural best practices for resilience and cost efficiency.
- Standardizes the approach to complex media tasks like ad insertion and CDN integration.
Usage examples
- “I need to set up a live event workflow using MediaConnect, MediaLive, and MediaPackage. What is the correct order?”
- The agent will load the core rules, the live event workflow file, and the relevant service rules, then guide you through the dependency-ordered creation process starting with VPC/IAM, followed by MediaPackage, MediaConnect, and finally MediaLive.
- “My MediaLive channel is failing to start and showing pipeline errors. How do I fix it?”
- The agent will load the core rules and the MediaLive troubleshooting file, then prompt you to check specific pipeline failover settings and encoder configurations based on the loaded rules.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/aws/aws-media-services/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip aws-media-services.zip -d .agents/skills
Documentation by AWS
AWS Media Services
Use this skill when the user is doing ANY of the following with AWS media services:
Building or modifying a video workflow (ingest, encoding, packaging, ad insertion, CDN delivery)
Reviewing, evaluating, or auditing an existing or proposed configuration for best practices, compliance, or correctness
Troubleshooting errors, alerts, or unexpected behavior
Asking questions about service constraints, compatibility rules, encoder settings, IAM policies, security groups, DRM, SCTE-35, caching, scaling, or any other AWS media topic
Planning a new workflow and needs to understand requirements, dependencies, or the discovery checklist
Optimizing cost, resilience, or performance of an existing workflow
If the user mentions ANY AWS media service by name (MediaConnect, MediaLive, MediaConvert, MediaPackage, MediaTailor) or related concepts (HLS, DASH, CMAF, ABR ladder, SCTE-35, epoch locking, origin shield, CDI, SRT, RTMP, transcode, live streaming, VOD pipeline, ad insertion, SSAI), load this skill.
This file is the orchestrator. It tells you which reference files to load based on the user's task. Do not load all files at once. Load on demand per the routing table below.
MANDATORY FIRST STEP — Read Before Doing Anything Else
STOP. Before you make ANY API call, pull ANY resource configuration, write ANY code, or produce ANY recommendation, you MUST load the required rule files into context. No exceptions. This applies to every task type: building, modifying, evaluating, troubleshooting, or answering questions.
The rule content is split across:
references/service-rules-core.md— cross-service compatibility constraints, common agent mistakes, and security considerations. ALWAYS loaded.references/service-rules-encoding.md— shared encoder settings (QVBR, GOP, profiles, quality tuning, deinterlacing). Loaded for any encoding task.references/service-rules-mediaconnect.mdreferences/service-rules-medialive.mdreferences/service-rules-mediaconvert.mdreferences/service-rules-mediapackage.mdreferences/service-rules-mediatailor.mdreferences/service-rules-cloudfront.md
Per-service rule files are loaded conditionally based on which services the query involves. Without the relevant rules loaded, you will produce recommendations based on general knowledge that may contradict the documented rules, flag correct configurations as problems, or miss critical constraints entirely.
Sequence (every time):
Read
references/service-rules-core.md— confirm it is in context before proceeding. ALWAYS required.Determine the task type and consult the Task Routing tables below to identify both the workflow/troubleshooting file AND the per-service rules to co-load.
For ad-hoc questions that don't match a workflow or troubleshooting category: if the user names specific service(s), load those service rule files. If the question is symptom-based or you cannot determine which services are involved, load ALL per-service rule files.
Only then begin resource discovery, API calls, or implementation.
If you find yourself about to call aws medialive describe-channel or similar
and you have NOT yet read the core rules file plus the relevant per-service
rules, stop and go back to step 1.
Task Routing
Building or modifying a workflow
Determine the workflow type. Load the matching workflow file AND the per-service rules listed in the right column (the core rules file is already loaded from the mandatory first step above).
| Workflow type | Workflow file | Service rules to co-load |
|---|---|---|
| Live event (ingest → encode → package → deliver) | references/workflow-live-event.md | mediaconnect + medialive + encoding + mediapackage + cloudfront (+ mediatailor if ads) |
| Linear channel (24/7 with schedule, ad insertion) | references/workflow-linear-channel.md | medialive + encoding + mediapackage + mediatailor + cloudfront |
| VOD pipeline (file-based transcode → package → deliver) | references/workflow-vod-pipeline.md | mediaconvert + encoding + mediapackage + cloudfront |
| Live-to-VOD (live + archive/harvest → VOD transcode) | references/workflow-live-event.md + references/workflow-vod-pipeline.md | union of live event + VOD pipeline |
| Ad insertion (SSAI/CSAI, MediaTailor scaling) | references/workflow-ad-insertion.md | medialive + encoding + mediapackage + mediatailor + cloudfront |
| Contribution transport (MediaConnect, SRT, DX, encoders) | references/workflow-contribution-distribution.md | mediaconnect + medialive + encoding |
| Router-based switching (master control, dynamic routing, playout) | references/workflow-contribution-distribution.md | mediaconnect + medialive + encoding |
| Resilience (dual-AZ, dual-region, epoch locking, multi-CDN, ops readiness) | references/workflow-resilience-patterns.md | ALL (cross-cutting) |
| Cost optimization (reserved vs on-demand, channel classes, right-sizing) | references/workflow-cost-optimization.md | ALL (cross-cutting) |
| Subtitles and accessibility (captions, multi-language, auto-captioning) | references/workflow-subtitles-accessibility.md | medialive + mediaconvert + encoding |
Troubleshooting
Load the relevant troubleshooting file(s) for the problem area AND the per-service rules listed in the right column. The core rules file is already loaded from the mandatory first step above. Load only the files needed.
| Problem area | Troubleshooting file | Service rules to co-load |
|---|---|---|
| MediaConnect flow issues, source connectivity, VPC interfaces, MediaConnect Router | references/troubleshooting-mediaconnect.md | mediaconnect |
| MediaLive channel errors, alerts, encoding, pipeline failover | references/troubleshooting-medialive.md | medialive + encoding |
| MediaPackage ingest failures, manifest issues, access denied, v1→v2 migration | references/troubleshooting-mediapackage.md | mediapackage |
| MediaConvert job failures, codec errors, output issues, automation | references/troubleshooting-mediaconvert.md | mediaconvert + encoding |
| MediaTailor ad insertion, ADS issues, SSAI scaling, session management | references/troubleshooting-mediatailor.md | mediatailor + medialive + mediapackage + cloudfront |
| CloudFront origin errors, cache behavior, multi-CDN, Embedded POPs (ePOP) | references/troubleshooting-cloudfront.md | cloudfront + mediapackage |
| Cross-service signal chain (no video, latency, sync, AZ alignment, IAM, failover) | references/troubleshooting-pipeline.md | ALL |
Quick reference
For a quick answer about a specific service's constraints, valid parameter values, or compatibility rules:
references/service-rules-core.mdis already loaded (mandatory first step).If the user names specific service(s) in the query, load those per-service rule files (e.g.
references/service-rules-medialive.md).If the question crosses service boundaries (e.g., MediaPackage→MediaTailor compatibility), the cross-service rules are already in
service-rules-core.md.If you can't determine which services are involved, load ALL per-service rule files.
This includes the following topics:
MediaTailor scaling patterns (multi-region, CDN origin shield, prefetch)
MediaConnect Router (paired resilient zonal endpoints) and downstream NDI converter caveats
Epoch locking and cross-region failover
Contribution transport (SRT tuning, Direct Connect sizing, RTP+FEC)
Multi-CDN architecture patterns
CloudFront advanced patterns (Embedded POPs / ePOP, CF Functions, segment sharding)
Operational readiness for live events (capacity planning, KPI baselines)
DRM production patterns and MediaPackage v1→v2 migration
Audio, HDR, and codec configuration details
Workflow Discovery Checklist
Before creating ANY resources for a new workflow, gather requirements from the user in a fixed order (mode → cost/scale → approach → source → network → encoding → ad insertion → packaging → IAM → VOD-specific). Do not proceed until all required items are answered; later questions depend on earlier answers.
Load references/workflow-discovery-checklist.md for the full ordered question
set whenever building or modifying a workflow.
Plan Validation (before presenting to user)
Before presenting a proposed configuration to the user, cross-check against the loaded service rules:
Codec/container compatibility (e.g., HEVC requires fMP4, not TS)
GOP/segment duration alignment across all ABR rungs
Dependency ordering (downstream before upstream)
IAM trust policy includes all required service principals + sts:TagSession
IAM permissions scoped to specific resource ARNs (no Resource: "*")
Security posture (CIDR scoped, OAC configured, no Principal: *)
All prerequisite resources included (IAM roles, VPC, MediaPackage channel MUST be in the plan before resources that depend on them)
Do NOT make API calls during this step. This is a rules-based review of the proposed plan against constraints already in context.
Agents MUST NOT skip dependency steps to save time. All prerequisites (IAM, VPC, MediaPackage channel, etc.) MUST be created before resources that reference them. Skipping steps and fixing errors reactively leads to circular troubleshooting loops. Execute the plan in dependency order.
Resource Creation Order
Respect dependency order — a resource must exist before anything that references it (live chain, VOD chain, live-to-VOD addition, and the common flow patterns table).
Load references/resource-creation-order.md for the full dependency chains and
flow-pattern table when creating resources.
Startup and Shutdown (Live Only)
Start upstream first and poll each resource to its ready state before proceeding
(STARTING ≠ running); shut down in reverse (STOPPING ≠ stopped). Poll on a
tight ~5s cadence.
Load references/startup-shutdown.md for the ordered start/stop tables and the
polling pattern (including MediaConnect Router lifecycle) when operating a live
workflow.
Tooling
When available, the AWS MCP Server is recommended for sandboxed execution and audit logging:
AWS MCP Server (
aws-mcp-server): AWS API access, Agent SOPs for guided multi-step workflows, and documentation search viasearch_documentationandread_documentation.AWS IaC MCP Server (
aws-iac-mcp-server): CloudFormation template validation, CDK documentation search, CDK code samples, and IaC best practices.
Large response warning: MediaLive describe-channel and MediaPackage list-*
calls return very large JSON. Always use --query (JMESPath) to extract only the
fields you need.
# Good — extract only what you need
aws medialive describe-channel --channel-id 12345 --query "{State:State,Name:Name,Id:Id}"
aws medialive list-channels --query "Channels[].{Name:Name,Id:Id,State:State}"
aws mediapackagev2 list-origin-endpoints --channel-group-name X --channel-name Y \
--query "Items[].{Name:OriginEndpointName,Url:HlsManifests[0].Url}"Files
- ATTRIBUTION.mdAdded by AutoGineer930 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer67 B
- SKILL.md11.6 KiB
- references/resource-creation-order.md2.3 KiB
- references/service-rules-cloudfront.md9.6 KiB
- references/service-rules-core.md16.6 KiB
- references/service-rules-encoding.md6.3 KiB
- references/service-rules-mediaconnect.md11.3 KiB
- references/service-rules-mediaconvert.md1.3 KiB
- references/service-rules-medialive.md9.4 KiB
- references/service-rules-mediapackage.md6.6 KiB
- references/service-rules-mediatailor.md20.6 KiB
- references/startup-shutdown.md2.2 KiB
- references/troubleshooting-cloudfront.md4.9 KiB
- references/troubleshooting-mediaconnect.md4.7 KiB
- references/troubleshooting-mediaconvert.md4.3 KiB
- references/troubleshooting-medialive.md5.7 KiB
- references/troubleshooting-mediapackage.md5.7 KiB
- references/troubleshooting-mediatailor.md22.2 KiB
- references/troubleshooting-pipeline.md6.2 KiB
- references/workflow-ad-insertion.md7.9 KiB
- references/workflow-contribution-distribution.md12.7 KiB
- references/workflow-cost-optimization.md13.8 KiB
- references/workflow-discovery-checklist.md4.4 KiB
- references/workflow-linear-channel.md4.7 KiB
- references/workflow-live-event.md20.1 KiB
- references/workflow-resilience-patterns.md5.6 KiB
- references/workflow-subtitles-accessibility.md3.4 KiB
- references/workflow-vod-pipeline.md5.4 KiB
references/workflow-live-event.md
Live Event Workflow
Cross-service pattern guidance for live event workflows.
Signal chain: Source → MediaConnect → MediaLive → MediaPackage v2 → (MediaTailor) → CloudFront → Viewers
Architecture Selection
IF source is on-premises or remote (ST 2110, CDI, SRT):
→ Full chain: Source → MediaConnect → MediaLive → MediaPackage v2 → CloudFront
→ LOAD references/workflow-contribution-distribution.md for transport protocol details
IF source is cloud-native or direct push (RTMP, HLS pull):
→ Direct ingest: Source → MediaLive → MediaPackage v2 → CloudFront
IF delivering both H.264 and HEVC:
→ Dual channel: Source → MediaConnect → [ML Channel A (H.264) + ML Channel B (HEVC)] → MediaPackage v2 → CloudFront
IF user mentions redundancy, failover, multi-region, or epoch locking:
→ LOAD references/workflow-resilience-patterns.mdResource Creation Sequence
DEPENDENCY GRAPH:
Step 1 [VPC, IAM]
↓
Step 2 [MediaPackage v2] ──────────────────────────┐
↓ │
Step 3 [MediaConnect Flow] (if contribution) │
↓ │
Step 4 [MediaLive Input] │
↓ │
Step 5 [MediaConnect Output] (CDI only) │
↓ │
Step 6 [MediaLive Channel] ←── needs ingest URL ───┘
↓
Step 7 [MediaTailor] (optional)
↓
Step 8 [CloudFront]Step 1: Foundation (VPC, IAM)
| Preconditions | None (first step) |
| Outputs | vpc_id, subnet_ids[] (≥2 AZs), security_group_id, iam_role_arn |
| Needed by | Steps 2-6 |
Actions:
Create or identify VPC with subnets in ≥2 Availability Zones
Create security groups with rules for ingest traffic (scope to source CIDR)
Create IAM role with trust policy for the services actually used in the chain
The trust policy below is for the common case where MediaConnect feeds
MediaLive. If MediaConnect is NOT in the chain (e.g., RTMP_PUSH, SRT, or
HLS-pull direct to MediaLive), drop mediaconnect.amazonaws.com from the
Service array.
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {
"Service": ["medialive.amazonaws.com", "mediaconnect.amazonaws.com"]
},
"Action": ["sts:AssumeRole", "sts:TagSession"]
}]
}The role also needs permission policies sufficient for what each service
does — at minimum: mediapackagev2:PutObject on the target channel for
MediaLive→MediaPackage v2 ingest, plus any S3, SSM, secrets, or KMS
permissions the channel touches. Do NOT attach AmazonMediaLiveFullAccess
to a service role — that policy grants medialive:* and is intended for
human operators, not for the role MediaLive assumes.
MediaConnect input type: The role MUST include mediaconnect:ManagedDescribeFlow, ManagedAddOutput, and ManagedRemoveOutput with Resource flow:* + output:* (account/region scoped). Specific flow ARNs do not work.
Validation: Call iam:GetRole and confirm the principals match the
services in your chain. MediaConnect returns "Unable to assume role" if its
principal is missing when it is needed.
Step 2: MediaPackage v2
| Preconditions | IAM role exists (Step 1) |
| Outputs | channel_ingest_url, origin_endpoint_url |
| Needed by | Step 6 (ingest URL), Step 7/8 (origin endpoint URL) |
Actions:
Create Channel Group (no
InputTypefield — it is namespacing only)Create Channel under the channel group with
InputType: CMAF(orHLS)Create Origin Endpoint (under the channel) with the desired manifest types
Endpoint policy — see decision below
Decision: Access control
IF building the full chain with CloudFront (Step 8):
→ Do NOT add a policy here. Leave the endpoint in default-deny.
The OAC-scoped policy will be applied in Step 8 after the distribution
ID is known. An open (`Principal: "*"`) policy MUST NOT be used, even
temporarily.
IF dev/test only (no CDN, need immediate playback validation):
→ Add a scoped endpoint policy for `mediapackagev2:GetObject` with an
`aws:SourceIp` condition restricting to the developer's IP/CIDR, or
configure OAC from the start. Do NOT use `Principal: "*"`, even for
testing — an open policy is easily copied to production and left in place.Validation: GET {origin_endpoint_url} returns 200 (when authorized) or 403 (default-deny). If 403 from production traffic, the endpoint policy is missing or doesn't match the CDN's identity.
Step 3: MediaConnect Flow
| Preconditions | VPC, subnets, security groups (Step 1) |
| Outputs | flow_arn, flow_source_ingest_ip |
| Needed by | Step 4 (MEDIACONNECT input type) or Step 5 (CDI output) |
| Skip if | Direct ingest (no contribution transport) |
Decision: Flow size
IF source is ST 2110 JPEG XS or CDI:
→ Large (150 Mbps) or Extra Large (400 Mbps)
→ EFA interface REQUIRED
IF source is SRT/RTP ≤80 Mbps:
→ Standard (80 Mbps)
IF source is SRT/RTP >80 Mbps:
→ Large (150 Mbps)Actions:
Create flow with source configuration matching ingest protocol
Add VPC interfaces (EFA for CDI/ST2110, ENA otherwise)
Do NOT create outputs yet (need MediaLive input endpoint IPs first)
Source-side ingest details (operationally required):
After the flow becomes ACTIVE, read the source-side ingest details from
the flow description and hand them to the team operating the source
encoder. For SRT listener and RTP/UDP sources, the relevant fields are
Flow.Source.IngestIp and Flow.Source.IngestPort — the encoder must
connect to that IP/port pair.
The source encoder is started later in the Startup Sequence (see below); without an active source feed, the channel will start but not produce output.
Validation: describe-flow shows Status: STANDBY and source configuration is correct. Once started, Status: ACTIVE and CloudWatch SourceBitRate > 0 confirms the encoder is actually delivering content.
Step 4: MediaLive Input
| Preconditions | VPC, subnets (Step 1); MediaConnect flow (Step 3, if applicable) |
| Outputs | input_id, input_endpoint_ips[] |
| Needed by | Step 5 (CDI output destination), Step 6 (channel input attachment) |
Decision: Input type
IF MediaConnect is in chain AND source is NOT UHD:
→ MEDIACONNECT input type (references flow ARN directly)
→ This SKIPS Step 5 entirely (auto-wires output)
IF MediaConnect is in chain AND source IS UHD/uncompressed:
→ CDI input type
→ Step 5 is REQUIRED (manual output, same-AZ constraint)
IF no MediaConnect:
→ SRT, RTMP_PUSH, or RTP input type (direct from source encoder)Actions:
Create input with selected type, VPC config, and security group
Capture input endpoint IPs/URLs from the response
Pipeline redundancy (CRITICAL for STANDARD class):
A STANDARD-class MediaLive channel runs two pipelines and needs two
sources of content. The shape of the input depends on input type:
MEDIACONNECT input type, STANDARD channel: the input MUST reference TWO MediaConnect flow ARNs (one per pipeline). A single-flow input forces the channel into single-pipeline operation regardless of class. The two flows MUST be in different AZs for full AZ redundancy.
MEDIACONNECT input type, SINGLE_PIPELINE channel: one flow ARN.
CDI input type, any class: both subnets are provided at input creation. STANDARD uses both; SINGLE_PIPELINE uses one.
SRT, RTMP_PUSH, RTP (push-based): STANDARD class provisions two ingest endpoints from a single input definition. The source encoder MUST push to both endpoints.
HLS pull, MP4 file (pull-based): the input definition is a single object containing the source URL(s); both pipelines pull from it independently. No encoder push configuration is required.
Validation: describe-input shows State: ATTACHED or DETACHED (not CREATING or DELETED). For MEDIACONNECT inputs on STANDARD channels, confirm MediaConnectFlows has two entries.
Step 5: MediaConnect Output (CDI only)
| Preconditions | Flow exists (Step 3), MediaLive input exists (Step 4) |
| Outputs | Output attached to flow |
| Needed by | Step 6 (content flows from source through to MediaLive) |
| Skip if | Using MEDIACONNECT input type (auto-wired) or no MediaConnect |
Constraint: MediaConnect output and MediaLive CDI input MUST be in the same AZ. Verify using AZ IDs (e.g., use1-az1), not AZ names.
Actions:
Create output on the MediaConnect flow targeting MediaLive input endpoint IPs
Set encoding names:
raw(video),pcm(audio),smpte291(ancillary)
Validation: describe-flow shows output with Status: ACTIVE after flow is started.
Step 6: MediaLive Channel
| Preconditions | Input (Step 4), MediaPackage ingest URL (Step 2), IAM role (Step 1) |
| Outputs | channel_id |
| Needed by | Startup sequence |
Decision: Channel class
IF production live event:
→ STANDARD (dual-pipeline, automatic failover)
→ LOAD references/workflow-resilience-patterns.md for pipeline redundancy, input failover, and dual-AZ patterns
IF dev/test or cost-sensitive non-critical:
→ SINGLE_PIPELINEDecision: Output group type
IF destination is MediaPackage v2:
→ CmafIngestGroupSettings (NOT HlsGroupSettings)
IF destination is S3 archive:
→ ArchiveGroupSettings
IF destination is non-MediaPackage HLS:
→ HlsGroupSettingsActions:
Create channel with input attachment, encoder settings, output group
Set output destination to the MediaPackage v2 ingest URLs from Step 2 (see Destination wiring below)
Configure GOP size = 2 seconds across all ABR rungs (segment duration must be an integer multiple of GOP size — e.g., 2s GOP with 6s segments)
Destination wiring (CRITICAL for STANDARD class):
A MediaPackage v2 channel returns two ingest endpoints (IngestEndpoints[0]
and IngestEndpoints[1]) for pipeline redundancy. A STANDARD-class
MediaLive channel's Destinations[].Settings array MUST contain BOTH
endpoint URLs — [0] for pipeline 0 and [1] for pipeline 1. Pumping
both pipelines into the same endpoint defeats the redundancy that STANDARD
class provides.
Destinations:
- Id: emp-dest
Settings:
- Url: <IngestEndpoints[0].Url> # pipeline 0
- Url: <IngestEndpoints[1].Url> # pipeline 1For SINGLE_PIPELINE channels, use one Settings entry with IngestEndpoints[0].Url.
IF using MediaTailor (ad insertion):
LOAD
references/workflow-ad-insertion.mdfor SSAI scaling patterns and ADS configurationSet
Scte35Type: SCTE_35_WITHOUT_SEGMENTATIONinCmafIngestGroupSettingsEnable
EXT-X-PROGRAM-DATE-TIMEin output settingsWithout both, MediaTailor will have no ad break signals
Canonical CMAF Ingest output-group shape:
For MediaPackage v2, the typical pattern is one shared audio output plus one video-only output per ABR rung. This keeps a single audio rendition across all video qualities (no audio bitrate change on ABR switches) and matches what most production deployments do.
OutputGroups:
- Name: cmaf
OutputGroupSettings:
CmafIngestGroupSettings:
Destination: { DestinationRefId: emp-dest }
Scte35Type: SCTE_35_WITHOUT_SEGMENTATION # only when SCTE-35 is in use
Outputs:
# Shared audio output — referenced by all video rungs via the manifest
- OutputName: audio_aac
AudioDescriptionNames: [audio_shared]
OutputSettings:
CmafIngestOutputSettings: { NameModifier: _audio }
# Video-only outputs per rung
- OutputName: video_1080p
VideoDescriptionName: video_1080p
OutputSettings:
CmafIngestOutputSettings: { NameModifier: _1080p }
- OutputName: video_720p
VideoDescriptionName: video_720p
OutputSettings:
CmafIngestOutputSettings: { NameModifier: _720p }
- OutputName: video_480p
VideoDescriptionName: video_480p
OutputSettings:
CmafIngestOutputSettings: { NameModifier: _480p }AudioDescriptions[] defines audio_shared once. VideoDescriptions[]
defines video_1080p / video_720p / video_480p. Multiple language
tracks are added by defining additional AudioDescriptions and additional
audio-only Outputs (one per language).
Validation: describe-channel shows State: IDLE. Channel is ready to start.
Step 7: MediaTailor (optional)
| Preconditions | MediaPackage origin endpoint URL (Step 2), ADS URL from customer |
| Outputs | mediatailor_playback_url |
| Needed by | Step 8 (CloudFront origin) |
| Skip if | No ad insertion needed |
Actions:
Create playback configuration with video content source and ADS URL
Configure CDN prefixes (content and ad segment)
Configure slate URL (shown when no ad fills the break)
Validation: GET {mediatailor_playback_url} returns a rewritten manifest with MediaTailor session tokens.
Step 8: CloudFront Distribution (REQUIRED for production)
| Preconditions | MediaTailor URL (Step 7) or MediaPackage endpoint URL (Step 2) |
| Outputs | distribution_domain_name (viewer-facing URL) |
| Needed by | Viewers |
A CDN is REQUIRED for any production live workflow. MediaPackage v2 has a 1000 RPS hard limit and will not scale to viewer traffic without a CDN fronting it. Every CDN that pulls from MediaPackage v2 MUST have Origin Shield enabled.
Skip this step ONLY for dev/test workflows where viewer count is bounded and origin RPS is well below the limit.
Decision: Origin
IF using MediaTailor:
→ Origin = MediaTailor playback URL
→ MediaTailor session init (POST) requires AllowedMethods to include POST
IF no MediaTailor:
→ Origin = MediaPackage v2 origin endpoint URL
→ Configure OAC (Origin Access Control), and set the MediaPackage v2
endpoint policy to allow only this distributionActions:
Create custom cache policies (MUST be created before the distribution):
Manifest cache policy: DefaultTTL = half the segment duration configured on MediaPackage (e.g., 3s for 6s segments). If using MediaTailor personalized manifests, TTL MUST be 0 (unique per viewer, MUST NOT be cached).
Segment cache policy: MinTTL=86400, DefaultTTL=86400, MaxTTL=86400 (segments are immutable).
Managed
CachingOptimizedMUST NOT be used for manifest behaviors. It sets a 24-hour default TTL that causes stale manifests.
Set
ViewerProtocolPolicy: redirect-to-httpson all cache behaviors to enforce encryption in transit. If using a custom domain (CNAME), attach an ACM certificate provisioned in us-east-1 and set minimum protocol version toTLSv1.2_2021.Create OAC (Origin Access Control):
Origin type:
mediapackagev2Signing protocol: SigV4
Signing behavior: Always
Create the CloudFront distribution with MediaPackage v2 origin, attach the OAC from step 3. Capture the distribution ID from the response.
MUST update the MediaPackage v2 endpoint policy to allow ONLY this distribution. This step is REQUIRED — without it, CloudFront receives 403 from the endpoint. The policy requires the distribution ARN from step 4:
{ "Version": "2012-10-17", "Statement": [{ "Sid": "AllowCloudFrontOAC", "Effect": "Allow", "Principal": {"Service": "cloudfront.amazonaws.com"}, "Action": "mediapackagev2:GetObject", "Resource": "<origin-endpoint-ARN>", "Condition": { "StringEquals": { "AWS:SourceArn": "arn:aws:cloudfront::<account>:distribution/<distribution-ID>", "aws:SourceAccount": "<account>" } } }] }This replaces any prior testing policy (e.g., an
aws:SourceIp-scoped dev policy). If the endpoint had no policy before this step, CloudFront will return 403 until this policy is applied — that is expected and correct. Do NOT fall back to a permissive policy to avoid the transient 403. If MediaTailor SSAI is used (Step 7), additionally allowmediatailor.amazonaws.comwith actionmediapackagev2:GetObjectin the same endpoint policy. MediaTailor fetches origin manifests directly from MediaPackage, not through CloudFront. Scope this service-principal grant against cross-service confused-deputy abuse: agents MUST add anaws:SourceAccount(your account id) condition and SHOULD addaws:SourceArn(the playback-configuration ARN), so only your own MediaTailor configurations can exercise it.Configure cache behaviors using the cache policy IDs from step 1:
Default behavior (manifests .m3u8, .mpd): manifest cache policy. Compress=true.
Segment behaviors (.m4s, .cmfv, .cmfa, .ts): segment cache policy. Compress=false.
Set error caching TTL = 1 second for all error codes (403, 404, 500, 502, 503, 504)
Enable Origin Shield (region closest to origin)
Forward all query strings and
User-Agentheader (required for MediaTailor ADS targeting)
Constraint: OAC MUST be configured when CloudFront fronts MediaPackage v2. Without it, the origin endpoint remains publicly accessible, exposing it to DDoS and bypassing the CDN's 1000 RPS protection. Agents MUST NOT leave endpoints with Principal: "*" after adding CloudFront.
Constraint: Cache policies are a prerequisite dependency. The create-cache-policy calls MUST complete and return policy IDs BEFORE calling create-distribution. Do NOT substitute managed policies to avoid this step.
Validation: GET https://{distribution_domain_name}/{manifest_path} returns #EXTM3U with expected variant streams.
Logging: Enable CloudFront standard logging (v2) to S3 for operational visibility. For high-concurrency live events, enable real-time logs to Kinesis Data Streams for seconds-latency debugging of cache behavior and viewer errors.
Startup Sequence
Start upstream first. Poll each resource to its running state before proceeding.
| Order | Action | Poll | Ready state | Notes |
|---|---|---|---|---|
| 1 | start-flow (MediaConnect) | Flow.Status | ACTIVE | Billing starts here |
| 1b | (Router input only) Confirm router I/Os are Active and a route is assigned to the MediaLive-facing output | I/O state / route | Active + route assigned | Content flows only once a route is "taken" to the output |
| 2 | Start source encoder | CloudWatch SourceBitRate > 0 | — | Confirm content flowing |
| 3 | start-channel (MediaLive) | State | RUNNING | Async — poll until RUNNING; large channels take longer |
| 4 | Verify end-to-end | GET manifest URL | #EXTM3U with variants | Check IngressBytes > 0 |
MediaConnect Router startup: When using a MediaConnect Router (MediaConnect router input type), start the router I/Os (Standby→Active) and the MediaLive channel. Content reaches the MediaLive input only once the router I/Os are Active AND a route has been assigned ("taken") to the output feeding that input — there is no separate "enable output" API. Per the AWS setup order, routes may be assigned before or after starting the I/Os.
Shutdown Sequence
Reverse of startup. Poll each resource to its stopped state before proceeding.
| Order | Action | Poll | Stopped state | Notes |
|---|---|---|---|---|
| 1 | stop-channel (MediaLive) | State | IDLE | — |
| 2 | Stop source encoder | — | — | — |
| 3 | stop-flow (MediaConnect) | Flow.Status | STANDBY | Billing stops here |
Lifecycle reminder: A flow left in ACTIVE and a channel left in
RUNNING continue to bill until explicitly stopped. After any non-permanent
event (test runs, recurring linear windows that have a defined off-period,
post-event teardown), confirm both resources are in their stopped state.
For long-lived 24/7 channels, this guidance applies only to the test/staging
copies — production-linear channels are expected to stay running.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server, Needs a command-line tool
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS
- Publisher
- AWS (Official)
- Source
- aws/agent-toolkit-for-aws · skills/specialized-skills/media-services-skills/aws-media-services · commit 0a218f8
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by AWS.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download aws-media-services.zip