Skip to content
v2.274.0

Experimental

@aws-cdk/aws-mediaconnect-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

Flow L2 construct ​

Defines an AWS Elemental MediaConnect Flow.

Example ​

ts
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],
});
python
# stack: Stack
# security_group: ec2.ISecurityGroup
# subnet: ec2.ISubnet
# role: iam.IRole


vpc_interface = VpcInterface.define(
    vpc_interface_name="my-vpc-interface",
    role=role,
    security_groups=[security_group],
    subnet=subnet
)

flow = Flow(stack, "MyFlow",
    source=SourceConfiguration.rist(
        flow_source_name="vpc-source",
        description="VPC-based source",
        port=5000,
        max_latency=Duration.millis(2000),
        network=NetworkConfiguration.vpc(vpc_interface)
    ),
    vpc_interfaces=[vpc_interface]
)
java
Stack stack;
ISecurityGroup securityGroup;
ISubnet subnet;
IRole role;


VpcInterfaceConfig vpcInterface = VpcInterface.define(VpcInterfaceDefineProps.builder()
        .vpcInterfaceName("my-vpc-interface")
        .role(role)
        .securityGroups(List.of(securityGroup))
        .subnet(subnet)
        .build());

Flow flow = Flow.Builder.create(stack, "MyFlow")
        .source(SourceConfiguration.rist(SourceRist.builder()
                .flowSourceName("vpc-source")
                .description("VPC-based source")
                .port(5000)
                .maxLatency(Duration.millis(2000))
                .network(NetworkConfiguration.vpc(vpcInterface))
                .build()))
        .vpcInterfaces(List.of(vpcInterface))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaConnect.Alpha
Stack stack;
ISecurityGroup securityGroup;
ISubnet subnet;
IRole role;


var vpcInterface = VpcInterface.Define(new VpcInterfaceDefineProps {
    VpcInterfaceName = "my-vpc-interface",
    Role = role,
    SecurityGroups = new [] { securityGroup },
    Subnet = subnet
});

var flow = new Flow(stack, "MyFlow", new FlowProps {
    Source = SourceConfiguration.Rist(new SourceRist {
        FlowSourceName = "vpc-source",
        Description = "VPC-based source",
        Port = 5000,
        MaxLatency = Duration.Millis(2000),
        Network = NetworkConfiguration.Vpc(vpcInterface)
    }),
    VpcInterfaces = new [] { vpcInterface }
});
go
// Install: go get github.com/aws/aws-cdk-go/awsmediaconnectalpha/v2
var stack Stack
var securityGroup ISecurityGroup
var subnet ISubnet
var role IRole


vpcInterface := awsmediaconnectalpha.VpcInterface_Define(&VpcInterfaceDefineProps{
	VpcInterfaceName: jsii.String("my-vpc-interface"),
	Role: role,
	SecurityGroups: []ISecurityGroup{
		securityGroup,
	},
	Subnet: subnet,
})

flow := awsmediaconnectalpha.NewFlow(stack, jsii.String("MyFlow"), &FlowProps{
	Source: awsmediaconnectalpha.SourceConfiguration_Rist(&SourceRist{
		FlowSourceName: jsii.String("vpc-source"),
		Description: jsii.String("VPC-based source"),
		Port: jsii.Number(5000),
		MaxLatency: awscdk.Duration_Millis(jsii.Number(2000)),
		Network: awsmediaconnectalpha.NetworkConfiguration_Vpc(vpcInterface),
	}),
	VpcInterfaces: []VpcInterfaceConfig{
		vpcInterface,
	},
})

Initializer ​

ts
new Flow(scope: Construct, id: string, props: FlowProps)
python
Flow(scope: Construct, id: str, props: FlowProps)
java
new Flow(Construct scope, String id, FlowProps props)
csharp
new Flow(Construct scope, string id, FlowProps props)
go
NewFlow(Scope Construct, Id *string, Props FlowProps)

Construct Props ​

availabilityZonestringavailability_zonestravailabilityZoneStringAvailabilityZonestringAvailabilityZone*string= 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.

encodingConfigEncodingConfigencoding_configEncodingConfigencodingConfigEncodingConfigEncodingConfigEncodingConfigEncodingConfigEncodingConfig= no encoding config; required for…#
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}).

default

Default: no encoding config; required for NDI sources

flowNamestringflow_namestrflowNameStringFlowNamestringFlowName*string= autogenerated#
The name of the flow.
flowSizeFlowSizeflow_sizeFlowSizeflowSizeFlowSizeFlowSizeFlowSizeFlowSizeFlowSize= undefined; when omitted, MediaCo…#
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.

default

Default: undefined; when omitted, MediaConnect applies FlowSize.MEDIUM at deploy time

maintenanceConfigurationMaintenanceWindowmaintenance_configurationMaintenanceWindowmaintenanceConfigurationMaintenanceWindowMaintenanceConfigurationMaintenanceWindowMaintenanceConfigurationMaintenanceWindow= chosen by MediaConnect#
The maintenance window for the flow.
mediaStreamsMediaStream[]media_streamstyping.List[MediaStream]mediaStreamsList<MediaStream>MediaStreamsMediaStream[]MediaStreams*[]MediaStream= 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.

ndiConfigNdiConfigndi_configNdiConfigndiConfigNdiConfigNdiConfigNdiConfigNdiConfigNdiConfig= 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.

The settings for the source that you want to use for the new flow.
sourceFailoverConfigFailoverConfigsource_failover_configFailoverConfigsourceFailoverConfigFailoverConfigSourceFailoverConfigFailoverConfigSourceFailoverConfigFailoverConfig= No source failover configuration…#
The settings for source failover.
default

Default: No source failover configuration applied

sourceMonitoringConfigSourceMonitoringConfigsource_monitoring_configSourceMonitoringConfigsourceMonitoringConfigSourceMonitoringConfigSourceMonitoringConfigSourceMonitoringConfigSourceMonitoringConfigSourceMonitoringConfig= No source monitoring configurati…#
The settings for source monitoring.
default

Default: No source monitoring configuration applied

vpcInterfacesVpcInterfaceConfig[]vpc_interfacestyping.List[VpcInterfaceConfig]vpcInterfacesList<VpcInterfaceConfig>VpcInterfacesVpcInterfaceConfig[]VpcInterfaces*[]VpcInterfaceConfig= No VPC Interface configuration a…#
The VPC Interfaces for this flow.
default

Default: No VPC Interface configuration applied

Properties ​

egressIpstringegress_ipstregressIpStringEgressIpstringEgressIp*stringrequired#
The IP address that the flow uses to send outbound content.
The environment this resource belongs to.
notes

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.

flowArnstringflow_arnstrflowArnStringFlowArnstringFlowArn*stringrequired#
The Amazon Resource Name (ARN) of the flow.
flowAvailabilityZonestringflow_availability_zonestrflowAvailabilityZoneStringFlowAvailabilityZonestringFlowAvailabilityZone*string#
The Availability Zone that the flow was created in.
flowRefFlowReferenceflow_refFlowReferenceflowRefFlowReferenceFlowRefFlowReferenceFlowRefFlowReferencerequired#
A reference to this Flow resource.

Required by the auto-generated IFlowRef interface.

grantsFlowGrantsgrantsFlowGrantsgrantsFlowGrantsGrantsFlowGrantsGrantsFlowGrantsrequired#
Collection of grant methods for this flow.
isFailoverEnabledbooleanis_failover_enabledboolisFailoverEnabledBooleanIsFailoverEnabledboolIsFailoverEnabled*bool#
Failover Configuration for flow.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
sourceArnstringsource_arnstrsourceArnStringSourceArnstringSourceArn*stringrequired#
The Amazon Resource Name (ARN) of the source defined on the flow.
sourceIngestIpstringsource_ingest_ipstrsourceIngestIpStringSourceIngestIpstringSourceIngestIp*stringrequired#
The IP address that the flow listens on for incoming content.
notes

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.

sourceIngestPortstringsource_ingest_portstrsourceIngestPortStringSourceIngestPortstringSourceIngestPort*stringrequired#
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.

sourceIngestUrlstringsource_ingest_urlstrsourceIngestUrlStringSourceIngestUrlstringSourceIngestUrl*stringrequired#
The full ingest URL for the flow source, combining protocol, IP, and port. For example: `srt://203.0.113.10:5000`.
notes

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.

stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.

Methods ​

addOutput(id: string, options: AddFlowOutputOptions): IFlowOutputdef add_output(self, id: str, options: AddFlowOutputOptions) -> IFlowOutputpublic IFlowOutput addOutput(String id, AddFlowOutputOptions options)public IFlowOutput AddOutput(string id, AddFlowOutputOptions options)func AddOutput(Id *string, Options AddFlowOutputOptions) IFlowOutput#
Add an output to this flow.
addVpcInterface(vpc: VpcInterfaceConfig): VpcInterfaceConfigdef add_vpc_interface(self, vpc: VpcInterfaceConfig) -> VpcInterfaceConfigpublic VpcInterfaceConfig addVpcInterface(VpcInterfaceConfig vpc)public VpcInterfaceConfig AddVpcInterface(VpcInterfaceConfig vpc)func AddVpcInterface(Vpc VpcInterfaceConfig) VpcInterfaceConfig#
Add a VPC interface to this flow.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

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.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

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).

fromFlowArn(scope: Construct, id: string, flowArn: string): IFlow@staticmethod def from_flow_arn(scope: Construct, id: str, flow_arn: str) -> IFlowpublic static IFlow fromFlowArn(Construct scope, String id, String flowArn)public static IFlow FromFlowArn(Construct scope, string id, string flowArn)func FromFlowArn(Scope Construct, Id *string, FlowArn *string) IFlowstatic#
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.

fromFlowAttributes(scope: Construct, id: string, attrs: FlowAttributes): IFlow@staticmethod def from_flow_attributes(scope: Construct, id: str, attrs: FlowAttributes) -> IFlowpublic static IFlow fromFlowAttributes(Construct scope, String id, FlowAttributes attrs)public static IFlow FromFlowAttributes(Construct scope, string id, FlowAttributes attrs)func FromFlowAttributes(Scope Construct, Id *string, Attrs FlowAttributes) IFlowstatic#
Creates a Flow construct that represents an external (imported) Flow.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Create a CloudWatch metric for this flow.
metricSourceBitrate(props?: MetricOptions): Metricdef metric_source_bitrate(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourceBitrate(MetricOptions props)public Metric MetricSourceBitrate(MetricOptions? props = null)func MetricSourceBitrate(Props MetricOptions) Metric#
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?: MetricOptions): Metricdef metric_source_connected(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourceConnected(MetricOptions props)public Metric MetricSourceConnected(MetricOptions? props = null)func MetricSourceConnected(Props MetricOptions) Metric#
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?: MetricOptions): Metricdef metric_source_disconnections(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourceDisconnections(MetricOptions props)public Metric MetricSourceDisconnections(MetricOptions? props = null)func MetricSourceDisconnections(Props MetricOptions) Metric#
Metric for the number of times the source transitioned from connected to disconnected.

Emits the SourceDisconnections metric with dimension FlowARN.

metricSourceDroppedPackets(props?: MetricOptions): Metricdef metric_source_dropped_packets(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourceDroppedPackets(MetricOptions props)public Metric MetricSourceDroppedPackets(MetricOptions? props = null)func MetricSourceDroppedPackets(Props MetricOptions) Metric#
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?: MetricOptions): Metricdef metric_source_jitter(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourceJitter(MetricOptions props)public Metric MetricSourceJitter(MetricOptions? props = null)func MetricSourceJitter(Props MetricOptions) Metric#
Metric for the current network jitter of the source, measured in milliseconds.

Emits the SourceJitter metric with dimension FlowARN.

metricSourceNotRecoveredPackets(props?: MetricOptions): Metricdef metric_source_not_recovered_packets(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourceNotRecoveredPackets(MetricOptions props)public Metric MetricSourceNotRecoveredPackets(MetricOptions? props = null)func MetricSourceNotRecoveredPackets(Props MetricOptions) Metric#
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?: MetricOptions): Metricdef metric_source_packet_loss_percent(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourcePacketLossPercent(MetricOptions props)public Metric MetricSourcePacketLossPercent(MetricOptions? props = null)func MetricSourcePacketLossPercent(Props MetricOptions) Metric#
Metric for the percentage of packets lost during transit, even if they were recovered.

Emits the SourcePacketLossPercent metric with dimension FlowARN.

metricSourceRoundTripTime(props?: MetricOptions): Metricdef metric_source_round_trip_time(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourceRoundTripTime(MetricOptions props)public Metric MetricSourceRoundTripTime(MetricOptions? props = null)func MetricSourceRoundTripTime(Props MetricOptions) Metric#
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?: MetricOptions): Metricdef metric_source_selected(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourceSelected(MetricOptions props)public Metric MetricSourceSelected(MetricOptions? props = null)func MetricSourceSelected(Props MetricOptions) Metric#
Metric indicating which source is selected for ingest when using `Failover` failover mode.
notes

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?: MetricOptions): Metricdef metric_source_total_packets(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourceTotalPackets(MetricOptions props)public Metric MetricSourceTotalPackets(MetricOptions? props = null)func MetricSourceTotalPackets(Props MetricOptions) Metric#
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(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
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.