Skip to content

Commit

Permalink
service/lambda: Adds update to AWS Lambda
Browse files Browse the repository at this point in the history
AWS Lambda

You can now develop your Lambda functions using Node.js 4.3.2, in
addition to Node.js 0.10.4. In addition to the leveraging new features
in Node.js 4.3 such as ES6 support, functions written in Node.js 4.3 can
use standard Node.js callback conventions to specify error or return
values for the function execution. Today, returning values from a lambda
function requires using specific methods within the Lambda context
object. To learn more about implementing callbacks within Lambda
functions, see our documentation
(http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html#nodejs-prog-model-handler-callback).

The SDK release adds support for setting the function runtime as
nodejs4.3, as well as updating function configuration to set the
runtime.
  • Loading branch information
xibz committed Apr 7, 2016
1 parent ccc14be commit b2dae6c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
14 changes: 12 additions & 2 deletions models/apis/lambda/2015-03-31/api-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
{"shape":"ServiceException"},
{"shape":"InvalidParameterValueException"},
{"shape":"ResourceConflictException"},
{"shape":"TooManyRequestsException"}
{"shape":"TooManyRequestsException"},
{"shape":"ResourceNotFoundException"}
]
},
"CreateFunction":{
Expand Down Expand Up @@ -429,6 +430,7 @@
"Principal":{"shape":"Principal"},
"SourceArn":{"shape":"Arn"},
"SourceAccount":{"shape":"SourceOwner"},
"EventSourceToken":{"shape":"EventSourceToken"},
"Qualifier":{
"shape":"Qualifier",
"location":"querystring",
Expand Down Expand Up @@ -654,6 +656,12 @@
"LATEST"
]
},
"EventSourceToken":{
"type":"string",
"max":256,
"min":0,
"pattern":"[a-zA-Z0-9._\\-]+"
},
"FunctionArn":{
"type":"string",
"pattern":"arn:aws:lambda:[a-z]{2}-[a-z]+-\\d{1}:\\d{12}:function:[a-zA-Z0-9-_]+(:(\\$LATEST|[a-zA-Z0-9-_]+))?"
Expand Down Expand Up @@ -1149,6 +1157,7 @@
"type":"string",
"enum":[
"nodejs",
"nodejs4.3",
"java8",
"python2.7"
]
Expand Down Expand Up @@ -1303,7 +1312,8 @@
"Description":{"shape":"Description"},
"Timeout":{"shape":"Timeout"},
"MemorySize":{"shape":"MemorySize"},
"VpcConfig":{"shape":"VpcConfig"}
"VpcConfig":{"shape":"VpcConfig"},
"Runtime":{"shape":"Runtime"}
}
},
"Version":{
Expand Down
9 changes: 8 additions & 1 deletion models/apis/lambda/2015-03-31/docs-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@
"CreateEventSourceMappingRequest$StartingPosition": "<p>The position in the stream where AWS Lambda should start reading. For more information, go to <a href=\"http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetShardIterator.html#Kinesis-GetShardIterator-request-ShardIteratorType\">ShardIteratorType</a> in the <i>Amazon Kinesis API Reference</i>. </p>"
}
},
"EventSourceToken": {
"base": null,
"refs": {
"AddPermissionRequest$EventSourceToken": null
}
},
"FunctionArn": {
"base": null,
"refs": {
Expand Down Expand Up @@ -494,7 +500,8 @@
"base": null,
"refs": {
"CreateFunctionRequest$Runtime": "<p>The runtime environment for the Lambda function you are uploading. </p>",
"FunctionConfiguration$Runtime": "<p>The runtime environment for the Lambda function.</p>"
"FunctionConfiguration$Runtime": "<p>The runtime environment for the Lambda function.</p>",
"UpdateFunctionConfigurationRequest$Runtime": null
}
},
"S3Bucket": {
Expand Down
6 changes: 6 additions & 0 deletions service/lambda/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,8 @@ type AddPermissionInput struct {
// permission for all AWS Lambda actions.
Action *string `type:"string" required:"true"`

EventSourceToken *string `type:"string"`

// Name of the Lambda function whose resource policy you are updating by adding
// a new permission.
//
Expand Down Expand Up @@ -2175,6 +2177,8 @@ type UpdateFunctionConfigurationInput struct {
// it executes your function.
Role *string `type:"string"`

Runtime *string `type:"string" enum:"Runtime"`

// The function execution time at which AWS Lambda should terminate the function.
// Because the execution time has cost implications, we recommend you set this
// value based on your expected execution time. The default is 3 seconds.
Expand Down Expand Up @@ -2272,6 +2276,8 @@ const (
// @enum Runtime
RuntimeNodejs = "nodejs"
// @enum Runtime
RuntimeNodejs43 = "nodejs4.3"
// @enum Runtime
RuntimeJava8 = "java8"
// @enum Runtime
RuntimePython27 = "python2.7"
Expand Down
16 changes: 9 additions & 7 deletions service/lambda/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ func ExampleLambda_AddPermission() {
svc := lambda.New(session.New())

params := &lambda.AddPermissionInput{
Action: aws.String("Action"), // Required
FunctionName: aws.String("FunctionName"), // Required
Principal: aws.String("Principal"), // Required
StatementId: aws.String("StatementId"), // Required
Qualifier: aws.String("Qualifier"),
SourceAccount: aws.String("SourceOwner"),
SourceArn: aws.String("Arn"),
Action: aws.String("Action"), // Required
FunctionName: aws.String("FunctionName"), // Required
Principal: aws.String("Principal"), // Required
StatementId: aws.String("StatementId"), // Required
EventSourceToken: aws.String("EventSourceToken"),
Qualifier: aws.String("Qualifier"),
SourceAccount: aws.String("SourceOwner"),
SourceArn: aws.String("Arn"),
}
resp, err := svc.AddPermission(params)

Expand Down Expand Up @@ -533,6 +534,7 @@ func ExampleLambda_UpdateFunctionConfiguration() {
Handler: aws.String("Handler"),
MemorySize: aws.Int64(1),
Role: aws.String("RoleArn"),
Runtime: aws.String("Runtime"),
Timeout: aws.Int64(1),
VpcConfig: &lambda.VpcConfig{
SecurityGroupIds: []*string{
Expand Down

0 comments on commit b2dae6c

Please sign in to comment.