AWS::MediaConnect::Flow
The AWS::MediaConnect::Flow resource defines a connection between one or more video sources and one or more outputs. For each flow, you specify the transport protocol to use, encryption information, and details for any outputs or entitlements that you want. AWS Elemental MediaConnect returns an ingest endpoint where you can send your live video as a single unicast stream. The service replicates and distributes the video to every output that you specify, whether inside or outside the AWS Cloud. You can also set up entitlements on a flow to allow other AWS accounts to access your content.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::MediaConnect::Flow", "Properties" : { "AvailabilityZone" :
String
, "Maintenance" :Maintenance
, "MediaStreams" :[ MediaStream, ... ]
, "Name" :String
, "Source" :Source
, "SourceFailoverConfig" :FailoverConfig
, "SourceMonitoringConfig" :SourceMonitoringConfig
, "VpcInterfaces" :[ VpcInterface, ... ]
} }
YAML
Type: AWS::MediaConnect::Flow Properties: AvailabilityZone:
String
Maintenance:Maintenance
MediaStreams:- MediaStream
Name:String
Source:Source
SourceFailoverConfig:FailoverConfig
SourceMonitoringConfig:SourceMonitoringConfig
VpcInterfaces:- VpcInterface
Properties
AvailabilityZone
-
The Availability Zone that you want to create the flow in. These options are limited to the Availability Zones within the current AWS Region.
Required: No
Type: String
Update requires: Replacement
Maintenance
-
The maintenance settings you want to use for the flow.
Required: No
Type: Maintenance
Update requires: No interruption
MediaStreams
-
The media streams associated with the flow. You can associate any of these media streams with sources and outputs on the flow.
Required: No
Type: Array of MediaStream
Update requires: No interruption
Name
-
The name of the flow.
Required: Yes
Type: String
Update requires: Replacement
Source
-
The settings for the source that you want to use for the new flow.
Required: Yes
Type: Source
Update requires: No interruption
SourceFailoverConfig
-
The settings for source failover.
Required: No
Type: FailoverConfig
Update requires: No interruption
SourceMonitoringConfig
-
The settings for source monitoring.
Required: No
Type: SourceMonitoringConfig
Update requires: No interruption
VpcInterfaces
-
The VPC interfaces that you added to this flow.
Required: No
Type: Array of VpcInterface
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns the flow ARN. For example:
{ "Ref":
"arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BasketballGame"
}
For more information about using the Ref
function, see Ref
.
Fn::GetAtt
The Fn::GetAtt
intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt
intrinsic function, see Fn::GetAtt
.
EgressIp
-
The outgoing IP address that MediaConnect uses to send video from the flow.
FlowArn
-
The Amazon Resource Name (ARN) of the flow.
FlowAvailabilityZone
-
The Availability Zone that the flow was created in. These options are limited to the Availability Zones within the current AWS Region.
Source.IngestIp
-
The IP address that the flow listens on for incoming content.
Source.SourceArn
-
The ARN of the source.
Source.SourceIngestPort
-
The port that the flow listens on for incoming content. If the protocol of the source is Zixi, the port must be set to 2088.
Examples
Enabling thumbnails
This example demonstrates a flow that sets the thumbnail state to
ENABLED
. You can verify the thumbnail state using the
DescribeFlow
API operation.
JSON
{ "Parameters": { "Name": { "Type": "String" } }, "Resources": { "TestFlow": { "Type": "AWS::MediaConnect::Flow", "Properties": { "Name": { "Ref": "Name" }, "Source": { "Name": "testSource", "Protocol": "rtp", "IngestPort": 1234, "Description": "CFN test Source", "WhitelistCidr": "0.0.0.0/0" }, "Maintenance": { "MaintenanceDay": "Tuesday", "MaintenanceStartHour": "02:00" }, "SourceMonitoringConfig": { "ThumbnailState": "ENABLED" } } } }, "Outputs": { "FlowArn": { "Value": { "Ref": "TestFlow" } } } }
YAML
Parameters: Name: Type: String Resources: TestFlow: Type: AWS::MediaConnect::Flow Properties: Name: !Ref Name Source: Name: testSource Protocol: rtp IngestPort: 1234 Description: CFN test Source WhitelistCidr: 0.0.0.0/0 Maintenance: MaintenanceDay: Tuesday MaintenanceStartHour: 02:00 SourceMonitoringConfig: ThumbnailState: ENABLED Outputs: FlowArn: Value: !Ref TestFlow
Disabling thumbnails
This example demonstrates a flow that sets the thumbnail state to
DISABLED
. You can verify the thumbnail state using the
DescribeFlow
API operation.
JSON
{ "Parameters": { "Name": { "Type": "String" } }, "Resources": { "TestFlow": { "Type": "AWS::MediaConnect::Flow", "Properties": { "Name": { "Ref": "Name" }, "Source": { "Name": "testSource", "Protocol": "rtp", "IngestPort": 1234, "Description": "CFN test Source", "WhitelistCidr": "0.0.0.0/0" }, "Maintenance": { "MaintenanceDay": "Tuesday", "MaintenanceStartHour": "02:00" }, "SourceMonitoringConfig": { "ThumbnailState": "DISABLED" } } } }, "Outputs": { "FlowArn": { "Value": { "Ref": "TestFlow" } } } }
YAML
Parameters: Name: Type: String Resources: TestFlow: Type: AWS::MediaConnect::Flow Properties: Name: !Ref Name Source: Name: testSource Protocol: rtp IngestPort: 1234 Description: CFN test Source WhitelistCidr: 0.0.0.0/0 Maintenance: MaintenanceDay: Tuesday MaintenanceStartHour: 02:00 SourceMonitoringConfig: ThumbnailState: DISABLED Outputs: FlowArn: Value: !Ref TestFlow
Setting a thumbnail state to None
If you don't specify a thumbnail state, it affects new and existing flows differently. Here's how it works in each scenario.
Creating a flow
When you create a new flow without specifying a thumbnail state, no state has been
set yet. After you create your flow in this way, the DescribeFlow
API
operation shows the thumbnail state as NONE
.
Updating an existing flow
When you update an existing flow and remove its thumbnail state (previously set to
either ENABLED
or DISABLED
), you're altering a previously
set state. In this case, the state doesn't become NONE
. Instead, it
defaults to DISABLED
. This happens because after you've specified a
state for an existing flow, it can't revert to NONE
. The
NONE
state only applies when no state has been set before. After you
update your flow in this way, the DescribeFlow
API operation shows the
thumbnail state as DISABLED
, not NONE
.
JSON
{ "Parameters": { "Name": { "Type": "String" } }, "Resources": { "TestFlow": { "Type": "AWS::MediaConnect::Flow", "Properties": { "Name": { "Ref": "Name" }, "Source": { "Name": "testSource", "Protocol": "rtp", "IngestPort": 1234, "Description": "CFN test Source", "WhitelistCidr": "0.0.0.0/0" }, "Maintenance": { "MaintenanceDay": "Tuesday", "MaintenanceStartHour": "02:00" } } } }, "Outputs": { "FlowArn": { "Value": { "Ref": "TestFlow" } } } }
YAML
Parameters: Name: Type: String Resources: TestFlow: Type: AWS::MediaConnect::Flow Properties: Name: !Ref Name Source: Name: testSource Protocol: rtp IngestPort: 1234 Description: CFN test Source WhitelistCidr: 0.0.0.0/0 Maintenance: MaintenanceDay: Tuesday MaintenanceStartHour: 02:00 Outputs: FlowArn: Value: !Ref TestFlow