:doc:`MediaConnect <../../mediaconnect>` / Client / update_flow_source

******************
update_flow_source
******************



.. py:method:: MediaConnect.Client.update_flow_source(**kwargs)

  

  Updates the source of a flow.

   

  .. note::

    

    Because ``UpdateFlowSources`` and ``UpdateFlow`` are separate operations, you can't change both the source type AND the flow size in a single request.

     

    
    * If you have a ``MEDIUM`` flow and you want to change the flow source to NDI®: 

      
      * First, use the ``UpdateFlow`` operation to upgrade the flow size to ``LARGE``.
       
      * After that, you can then use the ``UpdateFlowSource`` operation to configure the NDI source.
      

    
     
    * If you're switching from an NDI source to a transport stream (TS) source and want to downgrade the flow size: 

      
      * First, use the ``UpdateFlowSource`` operation to change the flow source type.
       
      * After that, you can then use the ``UpdateFlow`` operation to downgrade the flow size to ``MEDIUM``.
      

    
    

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/mediaconnect-2018-11-14/UpdateFlowSource>`_  


  **Request Syntax**
  ::

    response = client.update_flow_source(
        Decryption={
            'Algorithm': 'aes128'|'aes192'|'aes256',
            'ConstantInitializationVector': 'string',
            'DeviceId': 'string',
            'KeyType': 'speke'|'static-key'|'srt-password',
            'Region': 'string',
            'ResourceId': 'string',
            'RoleArn': 'string',
            'SecretArn': 'string',
            'Url': 'string'
        },
        Description='string',
        EntitlementArn='string',
        FlowArn='string',
        IngestPort=123,
        MaxBitrate=123,
        MaxLatency=123,
        MaxSyncBuffer=123,
        MediaStreamSourceConfigurations=[
            {
                'EncodingName': 'jxsv'|'raw'|'smpte291'|'pcm',
                'InputConfigurations': [
                    {
                        'InputPort': 123,
                        'Interface': {
                            'Name': 'string'
                        }
                    },
                ],
                'MediaStreamName': 'string'
            },
        ],
        MinLatency=123,
        Protocol='zixi-push'|'rtp-fec'|'rtp'|'zixi-pull'|'rist'|'st2110-jpegxs'|'cdi'|'srt-listener'|'srt-caller'|'fujitsu-qos'|'udp'|'ndi-speed-hq',
        SenderControlPort=123,
        SenderIpAddress='string',
        SourceArn='string',
        SourceListenerAddress='string',
        SourceListenerPort=123,
        StreamId='string',
        VpcInterfaceName='string',
        WhitelistCidr='string',
        GatewayBridgeSource={
            'BridgeArn': 'string',
            'VpcInterfaceAttachment': {
                'VpcInterfaceName': 'string'
            }
        },
        NdiSourceSettings={
            'SourceName': 'string'
        },
        RouterIntegrationState='ENABLED'|'DISABLED',
        RouterIntegrationTransitDecryption={
            'EncryptionKeyType': 'SECRETS_MANAGER'|'AUTOMATIC',
            'EncryptionKeyConfiguration': {
                'SecretsManager': {
                    'SecretArn': 'string',
                    'RoleArn': 'string'
                },
                'Automatic': {}
                
            }
        }
    )
    
  :type Decryption: dict
  :param Decryption: 

    The type of encryption that is used on the content ingested from the source.

    

  
    - **Algorithm** *(string) --* 

      The type of algorithm that is used for the encryption (such as aes128, aes192, or aes256).

      

    
    - **ConstantInitializationVector** *(string) --* 

      A 128-bit, 16-byte hex value represented by a 32-character string, to be used with the key for encrypting content. This parameter is not valid for static key encryption.

      

    
    - **DeviceId** *(string) --* 

      The value of one of the devices that you configured with your digital rights management (DRM) platform key provider. This parameter is required for SPEKE encryption and is not valid for static key encryption.

      

    
    - **KeyType** *(string) --* 

      The type of key that is used for the encryption. If no keyType is provided, the service will use the default setting (static-key).

      

    
    - **Region** *(string) --* 

      The Amazon Web Services Region that the API Gateway proxy endpoint was created in. This parameter is required for SPEKE encryption and is not valid for static key encryption.

      

    
    - **ResourceId** *(string) --* 

      An identifier for the content. The service sends this value to the key server to identify the current endpoint. The resource ID is also known as the content ID. This parameter is required for SPEKE encryption and is not valid for static key encryption.

      

    
    - **RoleArn** *(string) --* 

      The ARN of the role that you created during setup (when you set up MediaConnect as a trusted entity).

      

    
    - **SecretArn** *(string) --* 

      The ARN of the secret that you created in Secrets Manager to store the encryption key. This parameter is required for static key encryption and is not valid for SPEKE encryption.

      

    
    - **Url** *(string) --* 

      The URL from the API Gateway proxy that you set up to talk to your key server. This parameter is required for SPEKE encryption and is not valid for static key encryption.

      

    
  
  :type Description: string
  :param Description: 

    A description of the source. This description is not visible outside of the current Amazon Web Services account.

    

  
  :type EntitlementArn: string
  :param EntitlementArn: 

    The Amazon Resource Name (ARN) of the entitlement that allows you to subscribe to the flow. The entitlement is set by the content originator, and the ARN is generated as part of the originator's flow.

    

  
  :type FlowArn: string
  :param FlowArn: **[REQUIRED]** 

    The ARN of the flow that you want to update.

    

  
  :type IngestPort: integer
  :param IngestPort: 

    The port that the flow listens on for incoming content. If the protocol of the source is Zixi, the port must be set to 2088.

    

  
  :type MaxBitrate: integer
  :param MaxBitrate: 

    The maximum bitrate for RIST, RTP, and RTP-FEC streams.

    

  
  :type MaxLatency: integer
  :param MaxLatency: 

    The maximum latency in milliseconds. This parameter applies only to RIST-based and Zixi-based streams.

    

  
  :type MaxSyncBuffer: integer
  :param MaxSyncBuffer: 

    The size of the buffer (in milliseconds) to use to sync incoming source data.

    

  
  :type MediaStreamSourceConfigurations: list
  :param MediaStreamSourceConfigurations: 

    The media stream that is associated with the source, and the parameters for that association.

    

  
    - *(dict) --* 

      The media stream that you want to associate with the source, and the parameters for that association.

      

    
      - **EncodingName** *(string) --* **[REQUIRED]** 

        The format that was used to encode the data. For ancillary data streams, set the encoding name to smpte291. For audio streams, set the encoding name to pcm. For video, 2110 streams, set the encoding name to raw. For video, JPEG XS streams, set the encoding name to jxsv.

        

      
      - **InputConfigurations** *(list) --* 

        The media streams that you want to associate with the source.

        

      
        - *(dict) --* 

          The transport parameters that you want to associate with an incoming media stream.

          

        
          - **InputPort** *(integer) --* **[REQUIRED]** 

            The port that you want the flow to listen on for an incoming media stream.

            

          
          - **Interface** *(dict) --* **[REQUIRED]** 

            The VPC interface that you want to use for the incoming media stream.

            

          
            - **Name** *(string) --* **[REQUIRED]** 

              The name of the VPC interface.

              

            
          
        
    
      - **MediaStreamName** *(string) --* **[REQUIRED]** 

        The name of the media stream.

        

      
    

  :type MinLatency: integer
  :param MinLatency: 

    The minimum latency in milliseconds for SRT-based streams. In streams that use the SRT protocol, this value that you set on your MediaConnect source or output represents the minimal potential latency of that connection. The latency of the stream is set to the highest number between the sender’s minimum latency and the receiver’s minimum latency.

    

  
  :type Protocol: string
  :param Protocol: 

    The protocol that the source uses to deliver the content to MediaConnect.

     

    .. note::

      

      Elemental MediaConnect no longer supports the Fujitsu QoS protocol. This reference is maintained for legacy purposes only.

      

    

  
  :type SenderControlPort: integer
  :param SenderControlPort: 

    The port that the flow uses to send outbound requests to initiate connection with the sender.

    

  
  :type SenderIpAddress: string
  :param SenderIpAddress: 

    The IP address that the flow communicates with to initiate connection with the sender.

    

  
  :type SourceArn: string
  :param SourceArn: **[REQUIRED]** 

    The ARN of the source that you want to update.

    

  
  :type SourceListenerAddress: string
  :param SourceListenerAddress: 

    The source IP or domain name for SRT-caller protocol.

    

  
  :type SourceListenerPort: integer
  :param SourceListenerPort: 

    Source port for SRT-caller protocol.

    

  
  :type StreamId: string
  :param StreamId: 

    The stream ID that you want to use for this transport. This parameter applies only to Zixi and SRT caller-based streams.

    

  
  :type VpcInterfaceName: string
  :param VpcInterfaceName: 

    The name of the VPC interface that you want to send your output to.

    

  
  :type WhitelistCidr: string
  :param WhitelistCidr: 

    The range of IP addresses that are allowed to contribute content to your source. Format the IP addresses as a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.

    

  
  :type GatewayBridgeSource: dict
  :param GatewayBridgeSource: 

    The source configuration for cloud flows receiving a stream from a bridge.

    

  
    - **BridgeArn** *(string) --* 

      The ARN of the bridge feeding this flow.

      

    
    - **VpcInterfaceAttachment** *(dict) --* 

      The name of the VPC interface attachment to use for this bridge source.

      

    
      - **VpcInterfaceName** *(string) --* 

        The name of the VPC interface to use for this resource.

        

      
    
  
  :type NdiSourceSettings: dict
  :param NdiSourceSettings: 

    The settings for the NDI source. This includes the exact name of the upstream NDI sender that you want to connect to your source.

    

  
    - **SourceName** *(string) --* 

      The exact name of an existing NDI sender that's registered with your discovery server. If included, the format of this name must be ``MACHINENAME (ProgramName)``.

      

    
  
  :type RouterIntegrationState: string
  :param RouterIntegrationState: 

    Indicates whether to enable or disable router integration for this flow source.

    

  
  :type RouterIntegrationTransitDecryption: dict
  :param RouterIntegrationTransitDecryption: 

    The encryption configuration for the flow source when router integration is enabled.

    

  
    - **EncryptionKeyType** *(string) --* 

      The type of encryption key to use for flow transit encryption.

      

    
    - **EncryptionKeyConfiguration** *(dict) --* **[REQUIRED]** 

      The configuration details for the encryption key.

      .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``SecretsManager``, ``Automatic``. 

    
      - **SecretsManager** *(dict) --* 

        The configuration settings for transit encryption using Secrets Manager, including the secret ARN and role ARN.

        

      
        - **SecretArn** *(string) --* **[REQUIRED]** 

          The ARN of the Secrets Manager secret used for transit encryption.

          

        
        - **RoleArn** *(string) --* **[REQUIRED]** 

          The ARN of the IAM role assumed by MediaConnect to access the Secrets Manager secret.

          

        
      
      - **Automatic** *(dict) --* 

        Configuration settings for automatic encryption key management, where MediaConnect handles key creation and rotation.

        

      
      
    
  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'FlowArn': 'string',
          'Source': {
              'DataTransferSubscriberFeePercent': 123,
              'Decryption': {
                  'Algorithm': 'aes128'|'aes192'|'aes256',
                  'ConstantInitializationVector': 'string',
                  'DeviceId': 'string',
                  'KeyType': 'speke'|'static-key'|'srt-password',
                  'Region': 'string',
                  'ResourceId': 'string',
                  'RoleArn': 'string',
                  'SecretArn': 'string',
                  'Url': 'string'
              },
              'Description': 'string',
              'EntitlementArn': 'string',
              'IngestIp': 'string',
              'IngestPort': 123,
              'MediaStreamSourceConfigurations': [
                  {
                      'EncodingName': 'jxsv'|'raw'|'smpte291'|'pcm',
                      'InputConfigurations': [
                          {
                              'InputIp': 'string',
                              'InputPort': 123,
                              'Interface': {
                                  'Name': 'string'
                              }
                          },
                      ],
                      'MediaStreamName': 'string'
                  },
              ],
              'Name': 'string',
              'SenderControlPort': 123,
              'SenderIpAddress': 'string',
              'SourceArn': 'string',
              'Transport': {
                  'CidrAllowList': [
                      'string',
                  ],
                  'MaxBitrate': 123,
                  'MaxLatency': 123,
                  'MaxSyncBuffer': 123,
                  'MinLatency': 123,
                  'Protocol': 'zixi-push'|'rtp-fec'|'rtp'|'zixi-pull'|'rist'|'st2110-jpegxs'|'cdi'|'srt-listener'|'srt-caller'|'fujitsu-qos'|'udp'|'ndi-speed-hq',
                  'RemoteId': 'string',
                  'SenderControlPort': 123,
                  'SenderIpAddress': 'string',
                  'SmoothingLatency': 123,
                  'SourceListenerAddress': 'string',
                  'SourceListenerPort': 123,
                  'StreamId': 'string',
                  'NdiSpeedHqQuality': 123,
                  'NdiProgramName': 'string',
                  'NdiSourceSettings': {
                      'SourceName': 'string'
                  }
              },
              'VpcInterfaceName': 'string',
              'WhitelistCidr': 'string',
              'GatewayBridgeSource': {
                  'BridgeArn': 'string',
                  'VpcInterfaceAttachment': {
                      'VpcInterfaceName': 'string'
                  }
              },
              'PeerIpAddress': 'string',
              'RouterIntegrationState': 'ENABLED'|'DISABLED',
              'RouterIntegrationTransitDecryption': {
                  'EncryptionKeyType': 'SECRETS_MANAGER'|'AUTOMATIC',
                  'EncryptionKeyConfiguration': {
                      'SecretsManager': {
                          'SecretArn': 'string',
                          'RoleArn': 'string'
                      },
                      'Automatic': {}
                  }
              },
              'ConnectedRouterOutputArn': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **FlowArn** *(string) --* 

        The ARN of the flow that you updated.

        
      

      - **Source** *(dict) --* 

        The details of the sources that are assigned to the flow.

        
        

        - **DataTransferSubscriberFeePercent** *(integer) --* 

          Percentage from 0-100 of the data transfer cost to be billed to the subscriber.

          
        

        - **Decryption** *(dict) --* 

          The type of encryption that is used on the content ingested from this source.

          
          

          - **Algorithm** *(string) --* 

            The type of algorithm that is used for the encryption (such as aes128, aes192, or aes256).

            
          

          - **ConstantInitializationVector** *(string) --* 

            A 128-bit, 16-byte hex value represented by a 32-character string, to be used with the key for encrypting content. This parameter is not valid for static key encryption.

            
          

          - **DeviceId** *(string) --* 

            The value of one of the devices that you configured with your digital rights management (DRM) platform key provider. This parameter is required for SPEKE encryption and is not valid for static key encryption.

            
          

          - **KeyType** *(string) --* 

            The type of key that is used for the encryption. If no keyType is provided, the service will use the default setting (static-key).

            
          

          - **Region** *(string) --* 

            The Amazon Web Services Region that the API Gateway proxy endpoint was created in. This parameter is required for SPEKE encryption and is not valid for static key encryption.

            
          

          - **ResourceId** *(string) --* 

            An identifier for the content. The service sends this value to the key server to identify the current endpoint. The resource ID is also known as the content ID. This parameter is required for SPEKE encryption and is not valid for static key encryption.

            
          

          - **RoleArn** *(string) --* 

            The ARN of the role that you created during setup (when you set up MediaConnect as a trusted entity).

            
          

          - **SecretArn** *(string) --* 

            The ARN of the secret that you created in Secrets Manager to store the encryption key. This parameter is required for static key encryption and is not valid for SPEKE encryption.

            
          

          - **Url** *(string) --* 

            The URL from the API Gateway proxy that you set up to talk to your key server. This parameter is required for SPEKE encryption and is not valid for static key encryption.

            
      
        

        - **Description** *(string) --* 

          A description for the source. This value is not used or seen outside of the current MediaConnect account.

          
        

        - **EntitlementArn** *(string) --* 

          The ARN of the entitlement that allows you to subscribe to content that comes from another Amazon Web Services account. The entitlement is set by the content originator and the ARN is generated as part of the originator's flow.

          
        

        - **IngestIp** *(string) --* 

          The IP address that the flow will be listening on for incoming content.

          
        

        - **IngestPort** *(integer) --* 

          The port that the flow will be listening on for incoming content.

          
        

        - **MediaStreamSourceConfigurations** *(list) --* 

          The media streams that are associated with the source, and the parameters for those associations.

          
          

          - *(dict) --* 

            The media stream that is associated with the source, and the parameters for that association.

            
            

            - **EncodingName** *(string) --* 

              The format that was used to encode the data. For ancillary data streams, set the encoding name to smpte291. For audio streams, set the encoding name to pcm. For video, 2110 streams, set the encoding name to raw. For video, JPEG XS streams, set the encoding name to jxsv.

              
            

            - **InputConfigurations** *(list) --* 

              The media streams that you want to associate with the source.

              
              

              - *(dict) --* 

                The transport parameters that are associated with an incoming media stream.

                
                

                - **InputIp** *(string) --* 

                  The IP address that the flow listens on for incoming content for a media stream.

                  
                

                - **InputPort** *(integer) --* 

                  The port that the flow listens on for an incoming media stream.

                  
                

                - **Interface** *(dict) --* 

                  The VPC interface where the media stream comes in from.

                  
                  

                  - **Name** *(string) --* 

                    The name of the VPC interface.

                    
              
            
          
            

            - **MediaStreamName** *(string) --* 

              A name that helps you distinguish one media stream from another.

              
        
      
        

        - **Name** *(string) --* 

          The name of the source.

          
        

        - **SenderControlPort** *(integer) --* 

          The IP address that the flow communicates with to initiate connection with the sender.

          
        

        - **SenderIpAddress** *(string) --* 

          The port that the flow uses to send outbound requests to initiate connection with the sender.

          
        

        - **SourceArn** *(string) --* 

          The ARN of the source.

          
        

        - **Transport** *(dict) --* 

          Attributes related to the transport stream that are used in the source.

          
          

          - **CidrAllowList** *(list) --* 

            The range of IP addresses that should be allowed to initiate output requests to this flow. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16

            
            

            - *(string) --* 
        
          

          - **MaxBitrate** *(integer) --* 

            The smoothing max bitrate (in bps) for RIST, RTP, and RTP-FEC streams.

            
          

          - **MaxLatency** *(integer) --* 

            The maximum latency in milliseconds. This parameter applies only to RIST-based and Zixi-based streams.

            
          

          - **MaxSyncBuffer** *(integer) --* 

            The size of the buffer (in milliseconds) to use to sync incoming source data.

            
          

          - **MinLatency** *(integer) --* 

            The minimum latency in milliseconds for SRT-based streams. In streams that use the SRT protocol, this value that you set on your MediaConnect source or output represents the minimal potential latency of that connection. The latency of the stream is set to the highest number between the sender’s minimum latency and the receiver’s minimum latency.

            
          

          - **Protocol** *(string) --* 

            The protocol that is used by the source or output.

             

            .. note::

              

              Elemental MediaConnect no longer supports the Fujitsu QoS protocol. This reference is maintained for legacy purposes only.

              

            
          

          - **RemoteId** *(string) --* 

            The remote ID for the Zixi-pull stream.

            
          

          - **SenderControlPort** *(integer) --* 

            The port that the flow uses to send outbound requests to initiate connection with the sender.

            
          

          - **SenderIpAddress** *(string) --* 

            The IP address that the flow communicates with to initiate connection with the sender.

            
          

          - **SmoothingLatency** *(integer) --* 

            The smoothing latency in milliseconds for RIST, RTP, and RTP-FEC streams.

            
          

          - **SourceListenerAddress** *(string) --* 

            Source IP or domain name for SRT-caller protocol.

            
          

          - **SourceListenerPort** *(integer) --* 

            Source port for SRT-caller protocol.

            
          

          - **StreamId** *(string) --* 

            The stream ID that you want to use for this transport. This parameter applies only to Zixi and SRT caller-based streams.

            
          

          - **NdiSpeedHqQuality** *(integer) --* 

            A quality setting for the NDI Speed HQ encoder.

            
          

          - **NdiProgramName** *(string) --* 

            A suffix for the name of the NDI® sender that the flow creates. If a custom name isn't specified, MediaConnect uses the output name.

            
          

          - **NdiSourceSettings** *(dict) --* 

            The settings for the NDI source. This includes the exact name of the upstream NDI sender that you want to connect to your source.

            
            

            - **SourceName** *(string) --* 

              The exact name of an existing NDI sender that's registered with your discovery server. If included, the format of this name must be ``MACHINENAME (ProgramName)``.

              
        
      
        

        - **VpcInterfaceName** *(string) --* 

          The name of the VPC interface that is used for this source.

          
        

        - **WhitelistCidr** *(string) --* 

          The range of IP addresses that should be allowed to contribute content to your source. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.

          
        

        - **GatewayBridgeSource** *(dict) --* 

          The source configuration for cloud flows receiving a stream from a bridge.

          
          

          - **BridgeArn** *(string) --* 

            The ARN of the bridge feeding this flow.

            
          

          - **VpcInterfaceAttachment** *(dict) --* 

            The name of the VPC interface attachment to use for this bridge source.

            
            

            - **VpcInterfaceName** *(string) --* 

              The name of the VPC interface to use for this resource.

              
        
      
        

        - **PeerIpAddress** *(string) --* 

          The IP address of the device that is currently sending content to this source.

           

          .. note::

            

            
            * For sources that use protocols where you specify the origin (such as SRT Caller), this value matches the configured origin address.
             
            * For sources that use listener protocols (such as SRT Listener or RTP), this value shows the address of the connected sender.
             
            * Peer IP addresses aren't available for entitlements and CDI/ST2110 sources.
             
            * The peer IP address might not be visible for flows that haven't been started yet, or flows that were started before May 2025. In these cases, restart your flow to see the peer IP address.
            

            

          
        

        - **RouterIntegrationState** *(string) --* 

          Indicates if router integration is enabled or disabled on the flow source.

          
        

        - **RouterIntegrationTransitDecryption** *(dict) --* 

          The decryption configuration for the flow source when router integration is enabled.

          
          

          - **EncryptionKeyType** *(string) --* 

            The type of encryption key to use for flow transit encryption.

            
          

          - **EncryptionKeyConfiguration** *(dict) --* 

            The configuration details for the encryption key.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``SecretsManager``, ``Automatic``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


          
            

            - **SecretsManager** *(dict) --* 

              The configuration settings for transit encryption using Secrets Manager, including the secret ARN and role ARN.

              
              

              - **SecretArn** *(string) --* 

                The ARN of the Secrets Manager secret used for transit encryption.

                
              

              - **RoleArn** *(string) --* 

                The ARN of the IAM role assumed by MediaConnect to access the Secrets Manager secret.

                
          
            

            - **Automatic** *(dict) --* 

              Configuration settings for automatic encryption key management, where MediaConnect handles key creation and rotation.

              
          
        
      
        

        - **ConnectedRouterOutputArn** *(string) --* 

          The ARN of the router output that's currently connected to this source.

          
    
  
  **Exceptions**
  
  *   :py:class:`MediaConnect.Client.exceptions.BadRequestException`

  
  *   :py:class:`MediaConnect.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`MediaConnect.Client.exceptions.ForbiddenException`

  
  *   :py:class:`MediaConnect.Client.exceptions.InternalServerErrorException`

  
  *   :py:class:`MediaConnect.Client.exceptions.NotFoundException`

  
  *   :py:class:`MediaConnect.Client.exceptions.ServiceUnavailableException`

  