Skip to content

list_event_source_mappings

list_event_source_mappings(
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
    event_source_arn: Optional[Arn] = None,
    function_name: Optional[NamespacedFunctionName] = None,
    marker: Optional[String] = None,
    max_items: Optional[MaxListItems] = None,
) -> ListEventSourceMappingsResponse

Lists event source mappings. Specify an EventSourceArn to show only event source mappings for a single event source.

Parameters:

  • event_source_arn (Optional[Arn], default: None ) –

    The Amazon Resource Name (ARN) of the event source.

    • Amazon Kinesis – The ARN of the data stream or a stream consumer.

    • Amazon DynamoDB Streams – The ARN of the stream.

    • Amazon Simple Queue Service – The ARN of the queue.

    • Amazon Managed Streaming for Apache Kafka – The ARN of the cluster or the ARN of the VPC connection (for cross-account event source mappings).

    • Amazon MQ – The ARN of the broker.

    • Amazon DocumentDB – The ARN of the DocumentDB change stream.

  • function_name (Optional[NamespacedFunctionName], default: None ) –

    The name or ARN of the Lambda function.

    Name formats

    • Function name – MyFunction.

    • Function ARN – arn:aws:lambda:us-west-2:123456789012:function:MyFunction.

    • Version or Alias ARN – arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD.

    • Partial ARN – 123456789012:function:MyFunction.

    The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.

  • marker (Optional[String], default: None ) –

    A pagination token returned by a previous call.

  • max_items (Optional[MaxListItems], default: None ) –

    The maximum number of event source mappings to return. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher.

Raises:

Examples:

To list the event source mappings for a function The following example returns a list of the event source mappings for a function named my-function.

>>> client.list_event_source_mappings(function_name='my-function')
Source code in docs_src/capo_lambda/_services/_lambda.py
def list_event_source_mappings(
    self,
    *,
    config_overrides: Optional[LambdaClientConfig] = None,
    event_source_arn: Optional["capo_lambda.types.arn.Arn"] = None,
    function_name: Optional[
        "capo_lambda.types.namespaced_function_name.NamespacedFunctionName"
    ] = None,
    marker: Optional["capo_lambda.types.string.String"] = None,
    max_items: Optional["capo_lambda.types.max_list_items.MaxListItems"] = None,
) -> "capo_lambda.types.list_event_source_mappings_response.ListEventSourceMappingsResponse":
    """<p>Lists event source mappings. Specify an <code>EventSourceArn</code> to show only event source mappings for a single event source.</p>

    Args:
        event_source_arn: <p>The Amazon Resource Name (ARN) of the event source.</p> <ul> <li> <p> <b>Amazon Kinesis</b> – The ARN of the data stream or a stream consumer.</p> </li> <li> <p> <b>Amazon DynamoDB Streams</b> – The ARN of the stream.</p> </li> <li> <p> <b>Amazon Simple Queue Service</b> – The ARN of the queue.</p> </li> <li> <p> <b>Amazon Managed Streaming for Apache Kafka</b> – The ARN of the cluster or the ARN of the VPC connection (for <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc">cross-account event source mappings</a>).</p> </li> <li> <p> <b>Amazon MQ</b> – The ARN of the broker.</p> </li> <li> <p> <b>Amazon DocumentDB</b> – The ARN of the DocumentDB change stream.</p> </li> </ul>
        function_name: <p>The name or ARN of the Lambda function.</p> <p class="title"> <b>Name formats</b> </p> <ul> <li> <p> <b>Function name</b> – <code>MyFunction</code>.</p> </li> <li> <p> <b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction</code>.</p> </li> <li> <p> <b>Version or Alias ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD</code>.</p> </li> <li> <p> <b>Partial ARN</b> – <code>123456789012:function:MyFunction</code>.</p> </li> </ul> <p>The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length.</p>
        marker: <p>A pagination token returned by a previous call.</p>
        max_items: <p>The maximum number of event source mappings to return. Note that ListEventSourceMappings returns a maximum of 100 items in each response, even if you set the number higher.</p>

    Raises:
        capo_lambda.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid.</p>
        capo_lambda.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
        capo_lambda.errors.service_exception.ServiceException: <p>The Lambda service encountered an internal error.</p>
        capo_lambda.errors.too_many_requests_exception.TooManyRequestsException: <p>The request throughput limit was exceeded. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests">Lambda quotas</a>.</p>
        capo_lambda.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To list the event source mappings for a function
        The following example returns a list of the event source mappings for a function named my-function.

        >>> client.list_event_source_mappings(function_name='my-function')
    """

    def _handler(
        req: "OperationRequest[capo_lambda.types.list_event_source_mappings_request.ListEventSourceMappingsRequest]",
    ) -> OperationResponse[
        "capo_lambda.types.list_event_source_mappings_response.ListEventSourceMappingsResponse"
    ]:
        import capo_lambda._operations.aws_gir_api_service.list_event_source_mappings

        output, http_response = (
            capo_lambda._operations.aws_gir_api_service.list_event_source_mappings.list_event_source_mappings(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListEventSourceMappings")
    )
    input_: capo_lambda.types.list_event_source_mappings_request.ListEventSourceMappingsRequest = {}
    if event_source_arn is not None:
        input_["event_source_arn"] = event_source_arn
    if function_name is not None:
        input_["function_name"] = function_name
    if marker is not None:
        input_["marker"] = marker
    if max_items is not None:
        input_["max_items"] = max_items

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output