Skip to content

Releases: floydspace/effect-aws

@effect-aws/[email protected]

17 May 20:07
acf398d
Compare
Choose a tag to compare

Patch Changes

@effect-aws/[email protected]

17 May 20:08
acf398d
Compare
Choose a tag to compare

Patch Changes

@effect-aws/[email protected]

17 May 20:08
acf398d
Compare
Choose a tag to compare

Patch Changes

@effect-aws/[email protected]

17 May 20:07
acf398d
Compare
Choose a tag to compare

Patch Changes

@effect-aws/[email protected]

17 May 20:07
acf398d
Compare
Choose a tag to compare

Minor Changes

  • #167 8e4c246 Thanks @floydspace! - Implement streaming lambda handler

    Usage

    import { LambdaHandler, StreamHandler } from "@effect-aws/lambda";
    import { NodeStream } from "@effect/platform-node";
    import type { LambdaFunctionURLEvent } from "aws-lambda";
    import { Cause, Stream } from "effect";
    import { createGzip } from "node:zlib";
    
    /**
     * Streaming handler that takes a Lambda Function URL event, compresses it using gzip and
     * returns the compressed data as a stream.
     */
    const streamHandler: StreamHandler<
      LambdaFunctionURLEvent,
      never,
      Cause.UnknownException
    > = (event) => {
      return Stream.make(Buffer.from(JSON.stringify(event))).pipe(
        Stream.pipeThroughChannelOrFail(
          NodeStream.fromDuplex(
            () => createGzip(),
            (e) => new Cause.UnknownException(e),
          ),
        ),
      );
    };
    
    export const handler = LambdaHandler.stream(streamHandler);

    Set the lambda function URL InvokeMode to RESPONSE_STREAM:

    MyFunctionUrl:
      Type: AWS::Lambda::Url
      Properties:
        TargetFunctionArn: !Ref StreamingFunction
        AuthType: AWS_IAM
        InvokeMode: RESPONSE_STREAM

    deploy the stack, and then invoke the function URL:

    curl --request GET https://<url>.lambda-url.<Region>.on.aws/ --user $AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY --aws-sigv4 'aws:amz:<Region>:lambda' --output response.gz

@effect-aws/[email protected]

17 May 20:07
acf398d
Compare
Choose a tag to compare

Patch Changes

  • #165 192aad7 Thanks @floydspace! - expose service shape type as alternative of inferring it with Context.Tag.Service

@effect-aws/[email protected]

17 May 20:08
acf398d
Compare
Choose a tag to compare

Patch Changes

  • #165 192aad7 Thanks @floydspace! - expose service shape type as alternative of inferring it with Context.Tag.Service

@effect-aws/[email protected]

17 May 20:08
acf398d
Compare
Choose a tag to compare

Patch Changes

  • #165 192aad7 Thanks @floydspace! - expose service shape type as alternative of inferring it with Context.Tag.Service

@effect-aws/[email protected]

17 May 20:07
acf398d
Compare
Choose a tag to compare

Patch Changes

  • #165 192aad7 Thanks @floydspace! - expose service shape type as alternative of inferring it with Context.Tag.Service

@effect-aws/[email protected]

17 May 20:07
acf398d
Compare
Choose a tag to compare

Patch Changes

  • #165 192aad7 Thanks @floydspace! - expose service shape type as alternative of inferring it with Context.Tag.Service