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
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],
});
# 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]
)
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();
// 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 }
});
// 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
Construct Props
availabilityZonestringavailability_zonestravailabilityZoneStringAvailabilityZonestringAvailabilityZone*string= chosen by MediaConnect#These options are limited to the Availability Zones within the current AWS Region.
encodingConfigEncodingConfigencoding_configEncodingConfigencodingConfigEncodingConfigEncodingConfigEncodingConfigEncodingConfigEncodingConfig= no encoding config; required for…#Required when the flow source uses the NDI SpeedHQ protocol (see {@link SourceConfiguration.ndi}).
default
Default: no encoding config; required for NDI sources
flowSizeFlowSizeflow_sizeFlowSizeflowSizeFlowSizeFlowSizeFlowSizeFlowSizeFlowSize= undefined; when omitted, MediaCo…#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#mediaStreamsMediaStream[]media_streamstyping.List[MediaStream]mediaStreamsList<MediaStream>MediaStreamsMediaStream[]MediaStreams*[]MediaStream= No Media Streams#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#Required when the flow includes an NDI source or output.
sourceSourceConfigurationsourceSourceConfigurationsourceSourceConfigurationSourceSourceConfigurationSourceSourceConfigurationrequired#sourceFailoverConfigFailoverConfigsource_failover_configFailoverConfigsourceFailoverConfigFailoverConfigSourceFailoverConfigFailoverConfigSourceFailoverConfigFailoverConfig= No source failover configuration…#default
Default: No source failover configuration applied
sourceMonitoringConfigSourceMonitoringConfigsource_monitoring_configSourceMonitoringConfigsourceMonitoringConfigSourceMonitoringConfigSourceMonitoringConfigSourceMonitoringConfigSourceMonitoringConfigSourceMonitoringConfig= No source monitoring configurati…#default
Default: No source monitoring configuration applied
vpcInterfacesVpcInterfaceConfig[]vpc_interfacestyping.List[VpcInterfaceConfig]vpcInterfacesList<VpcInterfaceConfig>VpcInterfacesVpcInterfaceConfig[]VpcInterfaces*[]VpcInterfaceConfig= No VPC Interface configuration a…#default
Default: No VPC Interface configuration applied
Properties
envResourceEnvironmentenvResourceEnvironmentenvResourceEnvironmentEnvResourceEnvironmentEnvResourceEnvironmentrequired#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.
flowAvailabilityZonestringflow_availability_zonestrflowAvailabilityZoneStringFlowAvailabilityZonestringFlowAvailabilityZone*string#flowRefFlowReferenceflow_refFlowReferenceflowRefFlowReferenceFlowRefFlowReferenceFlowRefFlowReferencerequired#Required by the auto-generated IFlowRef interface.
isFailoverEnabledbooleanis_failover_enabledboolisFailoverEnabledBooleanIsFailoverEnabledboolIsFailoverEnabled*bool#PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#sourceIngestIpstringsource_ingest_ipstrsourceIngestIpStringSourceIngestIpstringSourceIngestIp*stringrequired#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#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#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.
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#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#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)#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)#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#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#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#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#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#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#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#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#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#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#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#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#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#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#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#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#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#with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#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.