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.

Bridge L2 construct ​

Defines a AWS Elemental MediaConnect Bridge.

Example ​

ts
declare const stack: Stack;

const productionNetwork = GatewayNetwork.define({
  cidrBlock: '192.168.1.0/24',
  name: 'production-network',
});

const gateway = new Gateway(stack, 'MyGateway', {
  gatewayName: 'my-gateway',
  egressCidrBlocks: ['10.0.0.0/16'],
  networks: [productionNetwork],
});

const ingressBridge = new Bridge(stack, 'MyIngressBridge', {
  bridgeName: 'my-ingress-bridge',
  config: BridgeConfiguration.ingress({
    maxBitrate: Bitrate.mbps(10),
    maxOutputs: 2,
    networkSources: [{
      name: 'on-prem-source',
      source: {
        protocol: BridgeProtocol.RTP,
        network: productionNetwork,
        multicastIp: '239.1.1.1',
        port: 5000,
      },
    }],
  }),
  gateway: gateway,
});
python
from aws_cdk.aws_mediaconnect_alpha import BridgeNetworkInput, BridgeNetworkSource
# stack: Stack


production_network = GatewayNetwork.define(
    cidr_block="192.168.1.0/24",
    name="production-network"
)

gateway = Gateway(stack, "MyGateway",
    gateway_name="my-gateway",
    egress_cidr_blocks=["10.0.0.0/16"],
    networks=[production_network]
)

ingress_bridge = Bridge(stack, "MyIngressBridge",
    bridge_name="my-ingress-bridge",
    config=BridgeConfiguration.ingress(
        max_bitrate=Bitrate.mbps(10),
        max_outputs=2,
        network_sources=[BridgeNetworkInput(
            name="on-prem-source",
            source=BridgeNetworkSource(
                protocol=BridgeProtocol.RTP,
                network=production_network,
                multicast_ip="239.1.1.1",
                port=5000
            )
        )]
    ),
    gateway=gateway
)
java
Stack stack;


GatewayNetwork productionNetwork = GatewayNetwork.define(GatewayNetworkDefineProps.builder()
        .cidrBlock("192.168.1.0/24")
        .name("production-network")
        .build());

Gateway gateway = Gateway.Builder.create(stack, "MyGateway")
        .gatewayName("my-gateway")
        .egressCidrBlocks(List.of("10.0.0.0/16"))
        .networks(List.of(productionNetwork))
        .build();

Bridge ingressBridge = Bridge.Builder.create(stack, "MyIngressBridge")
        .bridgeName("my-ingress-bridge")
        .config(BridgeConfiguration.ingress(IngressBridgeConfiguration.builder()
                .maxBitrate(Bitrate.mbps(10))
                .maxOutputs(2)
                .networkSources(List.of(BridgeNetworkInput.builder()
                        .name("on-prem-source")
                        .source(BridgeNetworkSource.builder()
                                .protocol(BridgeProtocol.RTP)
                                .network(productionNetwork)
                                .multicastIp("239.1.1.1")
                                .port(5000)
                                .build())
                        .build()))
                .build()))
        .gateway(gateway)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaConnect.Alpha
Stack stack;


var productionNetwork = GatewayNetwork.Define(new GatewayNetworkDefineProps {
    CidrBlock = "192.168.1.0/24",
    Name = "production-network"
});

var gateway = new Gateway(stack, "MyGateway", new GatewayProps {
    GatewayName = "my-gateway",
    EgressCidrBlocks = new [] { "10.0.0.0/16" },
    Networks = new [] { productionNetwork }
});

var ingressBridge = new Bridge(stack, "MyIngressBridge", new BridgeProps {
    BridgeName = "my-ingress-bridge",
    Config = BridgeConfiguration.Ingress(new IngressBridgeConfiguration {
        MaxBitrate = Bitrate.Mbps(10),
        MaxOutputs = 2,
        NetworkSources = new [] { new BridgeNetworkInput {
            Name = "on-prem-source",
            Source = new BridgeNetworkSource {
                Protocol = BridgeProtocol.RTP,
                Network = productionNetwork,
                MulticastIp = "239.1.1.1",
                Port = 5000
            }
        } }
    }),
    Gateway = gateway
});
go
// Install: go get github.com/aws/aws-cdk-go/awsmediaconnectalpha/v2
var stack Stack


productionNetwork := awsmediaconnectalpha.GatewayNetwork_Define(&GatewayNetworkDefineProps{
	CidrBlock: jsii.String("192.168.1.0/24"),
	Name: jsii.String("production-network"),
})

gateway := awsmediaconnectalpha.NewGateway(stack, jsii.String("MyGateway"), &GatewayProps{
	GatewayName: jsii.String("my-gateway"),
	EgressCidrBlocks: []*string{
		jsii.String("10.0.0.0/16"),
	},
	Networks: []GatewayNetwork{
		productionNetwork,
	},
})

ingressBridge := awsmediaconnectalpha.NewBridge(stack, jsii.String("MyIngressBridge"), &BridgeProps{
	BridgeName: jsii.String("my-ingress-bridge"),
	Config: awsmediaconnectalpha.BridgeConfiguration_Ingress(&IngressBridgeConfiguration{
		MaxBitrate: awscdk.Bitrate_Mbps(jsii.Number(10)),
		MaxOutputs: jsii.Number(2),
		NetworkSources: []BridgeNetworkInput{
			&BridgeNetworkInput{
				Name: jsii.String("on-prem-source"),
				Source: &BridgeNetworkSource{
					Protocol: awsmediaconnectalpha.BridgeProtocol_RTP(),
					Network: productionNetwork,
					MulticastIp: jsii.String("239.1.1.1"),
					Port: jsii.Number(5000),
				},
			},
		},
	}),
	Gateway: gateway,
})

Initializer ​

ts
new Bridge(scope: Construct, id: string, props: BridgeProps)
python
Bridge(scope: Construct, id: str, props: BridgeProps)
java
new Bridge(Construct scope, String id, BridgeProps props)
csharp
new Bridge(Construct scope, string id, BridgeProps props)
go
NewBridge(Scope Construct, Id *string, Props BridgeProps)

Construct Props ​

bridgeNameoptionalstringbridge_nameoptionalstrbridgeNameoptionalStringBridgeNameoptionalstringBridgeNameoptional*string= autogenerated#
The name of the bridge.

Cannot be modified after the bridge is created.

The bridge configuration specifying ingress or egress settings.
gatewayIGatewaygatewayIGatewaygatewayIGatewayGatewayIGatewayGatewayIGatewayrequired#
The gateway that the bridge is associated with.
sourceFailoverConfigoptionalBridgeFailoverConfigsource_failover_configoptionalBridgeFailoverConfigsourceFailoverConfigoptionalBridgeFailoverConfigSourceFailoverConfigoptionalBridgeFailoverConfigSourceFailoverConfigoptionalBridgeFailoverConfig#
The source failover configuration for the bridge.

Default: No failover configuration

Properties ​

bridgeArnstringbridge_arnstrbridgeArnStringBridgeArnstringBridgeArn*stringrequired#
The Amazon Resource Name (ARN) of the bridge.
bridgeNamestringbridge_namestrbridgeNameStringBridgeNamestringBridgeName*stringrequired#
The name of the bridge.
bridgeRefBridgeReferencebridge_refBridgeReferencebridgeRefBridgeReferenceBridgeRefBridgeReferenceBridgeRefBridgeReferencerequired#
A reference to this Bridge resource.
bridgeStatemay be undefinedstringbridge_statemay be undefinedstrbridgeStatemay be undefinedStringBridgeStatemay be undefinedstringBridgeStatemay be undefined*string#
The current state of the bridge.
bridgeTypeBridgeTypebridge_typeBridgeTypebridgeTypeBridgeTypeBridgeTypeBridgeTypeBridgeTypeBridgeTyperequired#
The type of bridge (ingress or egress).
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.

isFailoverEnabledmay be undefinedbooleanis_failover_enabledmay be undefinedboolisFailoverEnabledmay be undefinedBooleanIsFailoverEnabledmay be undefinedboolIsFailoverEnabledmay be undefined*bool#
Failover Configuration for Bridge.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.

Methods ​

addOutput(id: string, networkOutput: BridgeNetworkOutput): IBridgeOutputdef add_output(self, id: str, network_output: BridgeNetworkOutput) -> IBridgeOutputpublic IBridgeOutput addOutput(String id, BridgeNetworkOutput networkOutput)public IBridgeOutput AddOutput(string id, BridgeNetworkOutput networkOutput)func AddOutput(Id *string, NetworkOutput BridgeNetworkOutput) IBridgeOutput#
Add a network output to this bridge (for egress bridges only).
2 parameters

Parameters

  • ididididId — Construct id for the new BridgeOutput.
  • networkOutputnetwork_outputnetworkOutputnetworkOutputNetworkOutput — The named output to add.
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).

fromBridgeArn(scope: Construct, id: string, bridgeArn: string): IBridge@staticmethod def from_bridge_arn(scope: Construct, id: str, bridge_arn: str) -> IBridgepublic static IBridge fromBridgeArn(Construct scope, String id, String bridgeArn)public static IBridge FromBridgeArn(Construct scope, string id, string bridgeArn)func FromBridgeArn(Scope Construct, Id *string, BridgeArn *string) IBridgestatic#
Import an existing Bridge from its ARN.

Use fromBridgeAttributes() instead if you need access to bridgeName, bridgeType (required for addOutput()), or isFailoverEnabled.

fromBridgeAttributes(scope: Construct, id: string, attrs: BridgeAttributes): IBridge@staticmethod def from_bridge_attributes(scope: Construct, id: str, attrs: BridgeAttributes) -> IBridgepublic static IBridge fromBridgeAttributes(Construct scope, String id, BridgeAttributes attrs)public static IBridge FromBridgeAttributes(Construct scope, string id, BridgeAttributes attrs)func FromBridgeAttributes(Scope Construct, Id *string, Attrs BridgeAttributes) IBridgestatic#
Creates a Bridge construct that represents an external (imported) Bridge.
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 bridge.
metricFailoverSwitches(props?: MetricOptions): Metricdef metric_failover_switches(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricFailoverSwitches(MetricOptions props)public Metric MetricFailoverSwitches(MetricOptions? props = null)func MetricFailoverSwitches(Props MetricOptions) Metric#
Metric for the total number of times the bridge switches between sources when using the `FAILOVER` failover mode.
metricSourceBitrate(bridgeSourceName: string, props?: MetricOptions): Metricdef metric_source_bitrate(self, bridge_source_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourceBitrate(String bridgeSourceName, MetricOptions props)public Metric MetricSourceBitrate(string bridgeSourceName, MetricOptions? props = null)func MetricSourceBitrate(BridgeSourceName *string, Props MetricOptions) Metric#
Metric for the bitrate of a specific bridge source.
metricSourcePacketLossPercent(bridgeSourceName: string, props?: MetricOptions): Metricdef metric_source_packet_loss_percent(self, bridge_source_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSourcePacketLossPercent(String bridgeSourceName, MetricOptions props)public Metric MetricSourcePacketLossPercent(string bridgeSourceName, MetricOptions? props = null)func MetricSourcePacketLossPercent(BridgeSourceName *string, Props MetricOptions) Metric#
Metric for the percentage of packets lost on a specific bridge source.
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.