Skip to content

Instantly share code, notes, and snippets.

@thebeebs
Created May 21, 2020 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebeebs/1402bdec3c39968746542fe32c3bc5ed to your computer and use it in GitHub Desktop.
Save thebeebs/1402bdec3c39968746542fe32c3bc5ed to your computer and use it in GitHub Desktop.
Lambda Injection without a decorator.
public async Task<APIGatewayProxyResponse> FunctionHandlerException(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
{
return await new ChaosWrap<InjectException>().Execute(async () =>
{
var location = await GetCallingIP();
var body = new Dictionary<string, string>
{
{"message", "hello world"},
{"location", location}
};
return new APIGatewayProxyResponse
{
Body = JsonConvert.SerializeObject(body),
StatusCode = 200,
Headers = new Dictionary<string, string> {{"Content-Type", "application/json"}}
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment