• Function

    directHelloHandler

    Sample AWS Lambda handler for direct invocation through AWS Lambda APIs or console. No API Gateway or EventBridge trigger; invoked directly via aws lambda invoke or through the Serverless Framework. Accepts a JSON event with optional name field and returns a greeting response with metadata.

    Returns

    Greeting response with message and metadata

    Example

    // AWS CLI direct invocation

    // aws lambda invoke --function-name my-function --payload '{"name":"Bayu"}' response.json
    const response = await directHelloHandler(
    { name: 'Bayu' },
    context
    );
    // { message: 'Hello, Bayu!', requestId: 'xxx', timestamp: '...', input: {...} }

    Example

    // Invocation without name (uses default)

    const response = await directHelloHandler({}, context);
    // { message: 'Hello, world!', requestId: 'xxx', timestamp: '...', input: {...} }

    Author

    Bayu Dwiyan Satria

    Since

    1.0.0

    See

    Parameters

    • Optional event: DirectHelloEvent = {}

      Direct invocation event payload (optional name, defaults to {})

    • context: Context

      Lambda invocation context

    Returns Promise<DirectHelloResponse>

Generated using TypeDoc