class Flow (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.MediaConnect.Alpha.Flow |
Go | github.com/aws/aws-cdk-go/awsmediaconnectalpha/v2#Flow |
Java | software.amazon.awscdk.services.mediaconnect.alpha.Flow |
Python | aws_cdk.aws_mediaconnect_alpha.Flow |
TypeScript (source) | @aws-cdk/aws-mediaconnect-alpha ยป Flow |
Implements
IConstruct, IDependable, IResource, IEnvironment, IFlow, IFlow
Defines an AWS Elemental MediaConnect Flow.
Example
declare const stack: Stack;
declare const securityGroup: ec2.ISecurityGroup;
declare const subnet: ec2.ISubnet;
declare const role: iam.IRole;
const vpcInterface = VpcInterface.define({
vpcInterfaceName: 'my-vpc-interface',
role: role,
securityGroups: [securityGroup],
subnet: subnet,
});
const flow = new Flow(stack, 'MyFlow', {
source: SourceConfiguration.rist({
flowSourceName: 'vpc-source',
description: 'VPC-based source',
port: 5000,
maxLatency: Duration.millis(2000),
network: NetworkConfiguration.vpc(vpcInterface),
}),
vpcInterfaces: [vpcInterface],
});
Initializer
new Flow(scope: Construct, id: string, props: FlowProps)
Parameters
Construct Props
| Name | Type | Description |
|---|---|---|
| source | Source | The settings for the source that you want to use for the new flow. |
| availability | string | The Availability Zone that you want to create the flow in. |
| encoding | Encoding | Encoding configuration applied to the NDI source when transcoding it to a transport stream for downstream distribution. |
| flow | string | The name of the flow. |
| flow | Flow | Determines the processing capacity and feature set of the flow. |
| maintenance? | Maintenance | The maintenance window for the flow. |
| media | Media[] | The media streams that are associated with the flow. |
| ndi | Ndi | Specifies the configuration settings for a flow's NDI source or output. |
| source | Failover | The settings for source failover. |
| source | Source | The settings for source monitoring. |
| vpc | Vpc[] | The VPC Interfaces for this flow. |
source
Type:
Source
The settings for the source that you want to use for the new flow.
availabilityZone?
Type:
string
(optional, default: chosen by MediaConnect)
The Availability Zone that you want to create the flow in.
These options are limited to the Availability Zones within the current AWS Region.
encodingConfig?
Type:
Encoding
(optional, default: no encoding config; required for NDI sources)
Encoding configuration applied to the NDI source when transcoding it to a transport stream for downstream distribution.
Required when the flow source uses the NDI SpeedHQ protocol (see {@link SourceConfiguration.ndi}).
flowName?
Type:
string
(optional, default: autogenerated)
The name of the flow.
flowSize?
Type:
Flow
(optional, default: undefined; when omitted, MediaConnect applies FlowSize.MEDIUM at deploy time)
Determines the processing capacity and feature set of the flow.
Set this optional parameter to LARGE if you want to enable NDI outputs on the flow.
maintenance?
Type:
Maintenance
(optional, default: chosen by MediaConnect)
The maintenance window for the flow.
mediaStreams?
Type:
Media[]
(optional, default: No Media Streams)
The media streams that are associated with the flow.
After you associate a media stream with a source, you can also associate it with outputs on the flow.
ndiConfig?
Type:
Ndi
(optional, default: No NDI Configuration applied)
Specifies the configuration settings for a flow's NDI source or output.
Required when the flow includes an NDI source or output.
sourceFailoverConfig?
Type:
Failover
(optional, default: No source failover configuration applied)
The settings for source failover.
sourceMonitoringConfig?
Type:
Source
(optional, default: No source monitoring configuration applied)
The settings for source monitoring.
vpcInterfaces?
Type:
Vpc[]
(optional, default: No VPC Interface configuration applied)
The VPC Interfaces for this flow.
Use this instead of the FlowVpcInterface construct.
Properties
| Name | Type | Description |
|---|---|---|
| egress | string | The IP address that the flow uses to send outbound content. |
| env | Resource | The environment this resource belongs to. |
| flow | string | The Amazon Resource Name (ARN) of the flow. |
| flow | Flow | A reference to this Flow resource. |
| grants | Flow | Collection of grant methods for this flow. |
| node | Node | The tree node. |
| source | string | The Amazon Resource Name (ARN) of the source defined on the flow. |
| source | string | The IP address that the flow listens on for incoming content. |
| source | string | The port that the flow listens on for incoming content. |
| source | string | The full ingest URL for the flow source, combining protocol, IP, and port. For example: srt://203.0.113.10:5000. |
| stack | Stack | The stack in which this resource is defined. |
| flow | string | The Availability Zone that the flow was created in. |
| is | boolean | Failover Configuration for flow. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
egressIp
Type:
string
The IP address that the flow uses to send outbound content.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
flowArn
Type:
string
The Amazon Resource Name (ARN) of the flow.
flowRef
Type:
Flow
A reference to this Flow resource.
Required by the auto-generated IFlowRef interface.
grants
Type:
Flow
Collection of grant methods for this flow.
node
Type:
Node
The tree node.
sourceArn
Type:
string
The Amazon Resource Name (ARN) of the source defined on the flow.
sourceIngestIp
Type:
string
The IP address that the flow listens on for incoming content.
Available for listener-style source protocols (RTP, RTP-FEC, RIST, SRT listener, Zixi push). Accessing this on SRT caller, entitlement, gateway bridge, router, CDI, JPEG XS, or imported flows throws โ those sources don't expose a listening IP address.
sourceIngestPort
Type:
string
The port that the flow listens on for incoming content.
Available for the same listener-style source protocols as sourceIngestIp.
Accessing this on SRT caller, entitlement, gateway bridge, router, CDI, JPEG XS,
or imported flows throws.
sourceIngestUrl
Type:
string
The full ingest URL for the flow source, combining protocol, IP, and port. For example: srt://203.0.113.10:5000.
Available for listener-style source protocols (RTP, RTP-FEC, RIST, SRT listener, Zixi push) where the flow listens for an upstream sender. Accessing this on SRT caller, entitlement, gateway bridge, router, CDI, JPEG XS, or imported flows throws โ those sources don't expose a single host:port ingest URL.
stack
Type:
Stack
The stack in which this resource is defined.
flowAvailabilityZone?
Type:
string
(optional)
The Availability Zone that the flow was created in.
isFailoverEnabled?
Type:
boolean
(optional)
Failover Configuration for flow.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| add | Add an output to this flow. |
| add | Add a VPC interface to this flow. |
| apply | Override the cross-stack reference strength for this resource. |
| apply | Apply the given removal policy to this resource. |
| metric(metricName, props?) | Create a CloudWatch metric for this flow. |
| metric | Metric for the bitrate of content ingested into the flow. |
| metric | Metric indicating the connection state of the source. |
| metric | Metric for the number of times the source transitioned from connected to disconnected. |
| metric | Metric for the number of packets lost during transit, measured before any error correction takes place. |
| metric | Metric for the current network jitter of the source, measured in milliseconds. |
| metric | Metric for packets that were lost in transit and not recovered by error correction. |
| metric | Metric for the percentage of packets lost during transit, even if they were recovered. |
| metric | Metric for the round-trip time between the source and MediaConnect. Applies only to RIST, Zixi, and SRT sources. |
| metric | Metric indicating which source is selected for ingest when using Failover failover mode. |
| metric | Metric for the total number of packets received by the flow sources. |
| to | Returns a string representation of this construct. |
| with(...mixins) | Applies one or more mixins to this construct. |
| static from | Import an existing Flow from its ARN. |
| static from | Creates a Flow construct that represents an external (imported) Flow. |
addOutput(id, outputConfig)
public addOutput(id: string, outputConfig: OutputConfiguration): IFlowOutput
Parameters
- id
string - outputConfig
OutputConfiguration
Returns
Add an output to this flow.
addVpcInterface(vpc)
public addVpcInterface(vpc: VpcInterfaceConfig): VpcInterfaceConfig
Parameters
Returns
Add a VPC interface to this flow.
applyCrossStackReferenceStrength(strength)
public applyCrossStackReferenceStrength(strength: ReferenceStrength): void
Parameters
- strength
Referenceโ - The reference strength to use for this resource.Strength
Override the cross-stack reference strength for this resource.
When set, any cross-stack reference to this resource will use the specified
mechanism instead of the global default determined by the
@aws-cdk/core:defaultCrossStackReferences context key. This is useful for
selectively weakening specific references to avoid the "deadly embrace" problem
without changing the app-wide default.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
metric(metricName, props?)
public metric(metricName: string, props?: MetricOptions): Metric
Parameters
- metricName
string - props
MetricOptions
Returns
Create a CloudWatch metric for this flow.
metricSourceBitrate(props?)
public metricSourceBitrate(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the bitrate of content ingested into the flow.
Emits the SourceBitRate metric with dimension FlowARN, which aggregates across
all sources on the flow. To narrow to a specific source on a multi-source flow, call
{@link metric} with an additional SourceARN dimension.
metricSourceConnected(props?)
public metricSourceConnected(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric indicating the connection state of the source.
1 for connected, 0 for disconnected. Applies only to Zixi, SRT, and RIST sources.
Emits the SourceConnected metric with dimension FlowARN.
metricSourceDisconnections(props?)
public metricSourceDisconnections(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the number of times the source transitioned from connected to disconnected.
Emits the SourceDisconnections metric with dimension FlowARN.
metricSourceDroppedPackets(props?)
public metricSourceDroppedPackets(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the number of packets lost during transit, measured before any error correction takes place.
Emits the SourceDroppedPackets metric with dimension FlowARN.
metricSourceJitter(props?)
public metricSourceJitter(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the current network jitter of the source, measured in milliseconds.
Emits the SourceJitter metric with dimension FlowARN.
metricSourceNotRecoveredPackets(props?)
public metricSourceNotRecoveredPackets(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for packets that were lost in transit and not recovered by error correction.
Emits the SourceNotRecoveredPackets metric with dimension FlowARN, which aggregates
across all sources on the flow.
metricSourcePacketLossPercent(props?)
public metricSourcePacketLossPercent(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the percentage of packets lost during transit, even if they were recovered.
Emits the SourcePacketLossPercent metric with dimension FlowARN.
metricSourceRoundTripTime(props?)
public metricSourceRoundTripTime(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the round-trip time between the source and MediaConnect. Applies only to RIST, Zixi, and SRT sources.
Emits the SourceRoundTripTime metric with dimension FlowARN.
metricSourceSelected(props?)
public metricSourceSelected(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric indicating which source is selected for ingest when using Failover failover mode.
A value of 1 indicates the source is being used as the input; 0 indicates it is standby.
Emits the SourceSelected metric with dimension FlowARN. To narrow to a specific source,
call {@link metric} with an additional SourceARN dimension.
metricSourceTotalPackets(props?)
public metricSourceTotalPackets(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
Metric for the total number of packets received by the flow sources.
Emits the SourceTotalPackets metric with dimension FlowARN, which aggregates across
all sources on the flow.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
Parameters
- mixins
IMixin
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
static fromFlowArn(scope, id, flowArn)
public static fromFlowArn(scope: Construct, id: string, flowArn: string): IFlow
Parameters
- scope
Construct - id
string - flowArn
string
Returns
Import an existing Flow from its ARN.
Use fromFlowAttributes() instead if you need access to sourceArn or any other
attribute not encoded in the flow ARN.
static fromFlowAttributes(scope, id, attrs)
public static fromFlowAttributes(scope: Construct, id: string, attrs: FlowAttributes): IFlow
Parameters
- scope
Construct - id
string - attrs
FlowAttributes
Returns
Creates a Flow construct that represents an external (imported) Flow.

.NET
Go
Java
Python
TypeScript (