Bitrate

class aws_cdk.Bitrate(*args: Any, **kwargs)

Bases: object

Represents a bitrate value.

The amount can be specified either as a literal value (e.g: 10) which cannot be negative, or as an unresolved number token.

When the amount is passed as a token, unit conversion is not possible.

ExampleMetadata:

infused

Example:

# stack: Stack
# network_interface: RouterNetworkInterface


input = RouterInput(stack, "FailoverInput",
    router_input_name="failover-input",
    maximum_bitrate=Bitrate.mbps(10),
    routing_scope=RoutingScope.REGIONAL,
    tier=RouterInputTier.INPUT_50,
    configuration=RouterInputConfiguration.failover(
        network_interface=network_interface,
        protocols=[
            RouterInputProtocol.rist(
                port=5000,
                recovery_latency=Duration.millis(1000)
            ),
            RouterInputProtocol.rist(
                port=5002,  # Must not be consecutive with primary port
                recovery_latency=Duration.millis(1000)
            )
        ],
        source_priority=SourcePriorityConfig.primary_secondary(PrimarySource.FIRST_SOURCE)
    )
)

Methods

is_unresolved()

Checks if bitrate is a token or a resolvable object.

Return type:

bool

to_bps()

Return the total number of bits per second.

Return type:

Union[int, float]

to_gbps()

Return the total number of gigabits per second.

Return type:

Union[int, float]

to_kbps()

Return the total number of kilobits per second.

Return type:

Union[int, float]

to_mbps()

Return the total number of megabits per second.

Return type:

Union[int, float]

Static Methods

classmethod bps(amount)

Create a Bitrate representing an amount of bits per second.

Parameters:

amount (Union[int, float]) – the amount of bits per second.

Return type:

Bitrate

classmethod gbps(amount)

Create a Bitrate representing an amount of gigabits per second.

Parameters:

amount (Union[int, float]) – the amount of gigabits per second.

Return type:

Bitrate

classmethod kbps(amount)

Create a Bitrate representing an amount of kilobits per second.

Parameters:

amount (Union[int, float]) – the amount of kilobits per second.

Return type:

Bitrate

classmethod mbps(amount)

Create a Bitrate representing an amount of megabits per second.

Parameters:

amount (Union[int, float]) – the amount of megabits per second.

Return type:

Bitrate