Commit Graph

90 Commits

Author SHA1 Message Date
Peter McIntyre
4f95415cb5 feat(aws-lambda) add S3BatchEvent (#38142)
* add S3BatchEvent

* rename S3BatchEventResponseResultCodes

* linting

* s3VersionId is nullable

* add types for S3BatchHandler

* linting

* refactor S3Batch type names to conform to standard

* linting

* linting
2019-09-24 14:23:29 -07:00
Florin Asăvoaie
1e47cb4c01 aws-lambda: Added NoEcho parameter for CloudFormation Custom Resource Response (#38519)
According to https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html
2019-09-23 10:18:32 -07:00
Peter Juras
d142fa9f9d aws-lambda: Add "domainPrefix" to APIGatewayEventRequestContext (#37038) 2019-07-22 12:28:43 -07:00
Stefan Tertan
1dfeabc9c2 fix: [@types/aws-lambda] add missing props to CognitoUserPoolTriggerEvent (#36753) 2019-07-15 09:42:48 -07:00
Jon Simpkins
83857c2e0f fix: typo in CodePipeline docs (#36831) 2019-07-15 09:41:27 -07:00
Erik Dalén
b9eba8fc8e [aws-lambda] Add missing fields on CognitoUserPoolTriggerEvent (#36668)
See:
https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html#cognito-user-pools-lambda-trigger-syntax-pre-token-generation

The linkParameter doesn't seem to be in the documentation, but it is there on the events.
2019-07-08 13:36:52 -07:00
juancarbonel
41dbba7ad3 Add PreSignUp_ExternalProvider as triggersource for aws-lambda (#35968) 2019-06-06 11:27:34 -07:00
Sterling Camden
462a890272 aws-lambda: uppercase custom in client context (#35562)
* uppercase custom in client context

per the aws docs

```clientContext – (mobile apps) Client context provided to the Lambda invoker by the client application.

client.installation_id

client.app_title

client.app_version_name

client.app_version_code

client.app_package_name

env.platform_version

env.platform

env.make

env.model

env.locale

Custom – Custom values set by the mobile application.```

We have been using the upper case value with no problems so i assume the docs are correct here.

* Update aws-lambda-tests.ts
2019-05-20 10:11:09 -07:00
Simon Garner
8eef7a8374 [aws-lambda] Keys should be optional inside CloudFrontHeaders (#35121)
* [aws-lambda] Keys should be optional inside CloudFrontHeaders

According to the AWS documentation, it is optional to specify a `key` for each header value, but the type declaration is currently requiring this to be specified unnecessarily.

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html#lambda-event-structure-response

> - `key` (optional) is the case-sensitive name of the header as it appears in an HTTP request; for example, `accept` or `host`.
> - If you do not include the header key portion of the key-value pair, Lambda@Edge will automatically insert a header key using the header name that you provide. Regardless of how you've formatted the header name, the header key that is inserted automatically will be formatted with initial capitalization for each part, separated by hyphens (-).
>
>   For example, you can add a header like the following, without a header key: `'content-type': [{ value: 'text/html;charset=UTF-8' }]`. In this example, Lambda@Edge creates the following header key: `Content-Type`.

By making this property optional, one is able to write:

```ts
import { CloudFrontHeaders } from 'aws-lambda';

const headers: CloudFrontHeaders = {
  'content-type': [{ value: 'text/plain '}],
};
```

... instead of having to repeat the header name like:

```ts
import { CloudFrontHeaders } from 'aws-lambda';

const headers: CloudFrontHeaders = {
  'content-type': [{ key: 'content-type', value: 'text/plain '}],
};
```

* Update test

Setting a header without specifying the key should not raise a TypeScript compiler error.

* Revert "Update test"

This reverts commit 088653e362e6f0a152f54e9b5694bb778b072354.

* Add test for AWSLambda.CloudFrontHeaders with and without explicit keys
2019-05-02 10:29:11 -07:00
Simon Buchan
205d663096 Revert "aws-lambda Authorizer response context only allows booleans, numbers and strings (#33437)"
This reverts commit eed96d4372.
2019-04-04 12:02:59 +13:00
Nathan Shively-Sanders
37ea0ae6da
Add missed npm-naming exemptions (#34198)
Previously, I only replaced non-final dt-header exemptions. This commit
fixes that.
2019-03-25 11:11:36 -07:00
Grzegorz Redlicki
3eb866bd83 @types/aws-lambda: There are no types for the communication with Application Load Balancer (#33763)
* Add the additional types for the usage of Application Load Balancer

* Change the long name "Application Load Balancer" to shorter one "ALB"

* Add ALBCallback for the completeness of the communication with the ALB
2019-03-12 10:44:04 -07:00
Nathan Shively-Sanders
363f4d07e5
Merge pull request #33620 from therockstorm/master
Update SQSMessageAttribute in aws-lambda
2019-03-08 15:29:40 -08:00
Richard
eed96d4372 aws-lambda Authorizer response context only allows booleans, numbers and strings (#33437)
* Context only allows booleans, numbers and strings

* add richardcornelissen as contributor
2019-03-06 15:29:48 -08:00
Rocky Warren
57ee130627 Update SQSMessageAttribute in aws-lambda 2019-03-06 08:31:31 -06:00
Roberto Zen
fe9e68da29 fix: connectedAt field must be optional 2019-02-26 15:04:08 +01:00
Loik Gaonach
209ac2ff35 add websocket integration props to APIGatewayEventRequestContext
messageId is nullable on connection events
2019-02-07 11:31:59 +01:00
Declan
480b0531a3 [@types/aws-lambda] Add Amazon Lex events (#32502)
* [aws-lambda] Add types for Amazon Lex events

* fix: Fixed Typo in `AWSLambda.LexDialogActionClose.fulfillmentState`

* fix: removed a blank line
2019-01-28 12:48:38 -08:00
Daniel Cottone
f56373cd3e Adding additional props to custom authorizer event (#31558) 2018-12-20 08:15:40 -08:00
Erik Dalén
8c536fe7db Add handler definitions for codepipeline cloudwatch events 2018-12-13 10:34:16 +01:00
Erik Dalén
0fd1512fdf Rename all cloudwatch codepipeline events to include cloudwatch in name 2018-12-13 10:27:38 +01:00
Erik Dalén
ff933f81c4 Change value of provider key to string 2018-12-13 10:24:45 +01:00
Erik Dalén
c87266f660 Fix typo 2018-12-13 10:03:00 +01:00
Erik Dalén
a056705264 Add CloudWatch events for CodePipeline
Add AWS lambda event type definitions for https://docs.aws.amazon.com/codepipeline/latest/userguide/detect-state-changes-cloudwatch-events.html
2018-12-12 16:33:11 +01:00
Trevor Leach
9fe08c154c Add multiValueHeaders to ProxyResult too 2018-10-30 18:00:00 -07:00
Trevor Leach
ea9eec5238 Merge remote-tracking branch 'upstream/master' into multi-value_headers_and_query_params 2018-10-27 13:50:42 -07:00
Trevor Leach
cf416f6ac0 Merge remote-tracking branch 'upstream/master' into multi-value_headers_and_query_params 2018-10-27 13:33:25 -07:00
Trevor Leach
4547dc6384 multi-valued headers and query string prarameters 2018-10-20 15:00:00 -07:00
James Gregory
656a9a17c8 [aws-lambda] Add Amazon Cognito Migrate User triggers
See:

1. https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-migrate-user.html
2. https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-import-using-lambda.html
2018-10-19 07:19:39 +11:00
Oliver Hookins
24f4e6d721 Add AWS Lambda CloudFront Event origin fields. (#28675)
* Add AWS Lambda CloudFront Event origin fields.

* Add tests for the different kinds of Lambda CloudFrontRequests.
2018-09-13 13:11:40 -07:00
Chris Redekop
49e8daef6a [aws-lambda] Fix challengeMetadata typos in cognito custom challenge (#28834)
* Fix challengeMetadata typos

* Fix type of challengeAnswer
2018-09-13 09:48:08 -07:00
David J. Felix
efe7ba616a [@types/aws-lambda]: Add extractedFields optional field (#27670)
* [@types/aws-lambda]: Add extractedFields optional field

Added an undocumented optional field to a datatype which is sent zipped and base64 encoded. This field is only available if users select certain options when creating a subscription filter.

You can see the field used if you create a subscription filter to elasticsearch and look at the source for the builtin lambda. I couldn't find any documentation for this field except in the terms "fields extracted" [here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html) and found some amazon code referencing it [here](https://github.com/amazon-archives/cloudwatch-logs-subscription-consumer/blob/master/src/test/resources/aws-lambda-log-example.json#L14).

I nearly went insane tracking this down.

* Narrow the type of extracted fields to string:string

* Add test for extracted fields
2018-08-06 11:34:23 -07:00
Daniel Papukchiev
13f8c453e1 [@types/aws-lambda] Add Firehose lambda event and transformation helpers (#27731)
* Add Firehose to aws-lambda

* Add one more link for reference

* Change some interface names, remove irrelevant S3 interface, add special callback

* Fix tests
2018-08-01 11:39:21 -07:00
Louis Larry
1a1c9299a6 update aws-lambda cloudfront (#27407) 2018-07-27 17:21:28 -07:00
Ishaan Malhi
e3727a66d2 [@types/aws-lambda] Add SQS Event Source (#27334)
* feat: Add initial typings

* feat: Add tests for SQS Event Source

* fix: linting fixes
2018-07-20 17:31:00 -07:00
Richard Barker
bf6894a4e5 Fix test 2018-06-22 11:18:02 +10:00
Richard Barker
f9f78a7a9b ClientContext field must be spelt 'custom' so that it is correctly serialized by Java Lambdas. 2018-06-22 11:05:58 +10:00
Jeremy Nagel
1a53ccde52 [BUGFIX] Lambda callbacks support string errors
As per https://docs.aws.amazon.com/apigateway/latest/developerguide/handle-errors-in-lambda-integration.html
2018-05-29 15:32:25 +10:00
Jonathan Jung
26d40427c1 [types/aws-lambda] adds a path attribute to the APIGatewayEventRequestContext 2018-05-21 14:59:14 -07:00
Nick Holloway
ff0c5eb0c0 Add encryption key to Code Pipeline event 2018-05-17 09:35:00 +01:00
Nick Holloway
e818117186 Add definition for AWS Lambda Code Pipeline event 2018-05-15 16:54:58 +01:00
Aneil Mallavarapu
07268c98de Improve coverage of AWS Lambda Statement type (#25304)
* Improve coverage of AWS Lambda Statement type

Allow statements which have either a Principal or a Resource,
instead of requiring Resource.
This permits policies such as described in https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html:

```
{
  Effect: "Allow",
  Principal: "*",
  Action: "*"
}
```
and
```
{
  Effect: "Allow",
  Principal: { "Service": "lambda.amazonaws.com" },
  Action: "sts:AssumeRole"
}
```

* Remove unnecessary additional type

* Add tests for valid/invalid combinations of Resource and Principal in Statement type

This addresses issues raised by @simonbuchanan here:
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25304\#pullrequestreview-115377094
2018-04-26 15:03:40 -07:00
Martin Donath
02ed6f6b49 Added missing field apiKeyId to API Gateway request context (#25195)
* Added missing field `apiKeyId` to API Gateway request context

`$context.identity.apiKeyId`: The API key ID associated with the key-enabled API request.

See the [AWS documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html) and search for `apiKeyId`.

* Added missing tests for new apiKeyId field in aws-lambda typings
2018-04-24 16:06:22 -07:00
Aneil Mallavarapu
a5db46d192 Add missing elements to Policy Statement (#24792)
* Add: NotAction, NotResource, Principal, NotPrincipal
* Implement some of the conditional logic
  - e.g., Action or NotAction is required
  - however, mutual exclusivity is not implemented (hard to do in Typescript)
* Allow >1 statement per PolicyDocument
2018-04-12 12:11:30 -07:00
Simon Buchan
78350168c5 [aws-lambda] Rutime node8.10 support. (#24823)
Bump version to 8.10 to match current runtime, allow returning result promises in handlers.
2018-04-09 10:21:48 -07:00
repl-chris
3a1f68f9c1 Added AWSLambda.KinesisDataStream event type definitions (aws-lambda) 2018-04-05 16:45:08 -06:00
Andrea Ratto
eedb1097a8 Fix creation time attribute in StreamRecord of aws-lambda 2018-03-21 11:15:56 +01:00
David
c9749a4f65 [aws-lambda] Include CloudFrontRequest in CloudFrontRequestResult union type (#23882)
A request is a valid callback result type. See example: https://docs.aws.amazon.com/lambda/latest/dg/lambda-edge.html#lambda-edge-authoring-functions-example-ab-testing
2018-02-26 11:59:10 -08:00
Andy Hanson
45c9246c09 Remove esModuleInterop from tsconfigs (no longer mandatory) 2018-02-14 14:55:13 -08:00
Simon Buchan
50dafbd8e3 Add tests, fix some missed type name normalizations. 2018-02-08 12:39:00 +13:00