Skip to content

Commit

Permalink
AWS Lambda support for Java 8 (Corretto) and custom runtimes on Amazo…
Browse files Browse the repository at this point in the history
…n Linux 2 (#14663)

* AWS Lambda support for Java 8 (Corretto) and custom runtimes on Amazon Linux 2.

* Simplify aws_lambda_function runtime acceptance tests.

* Update documentation references to latest Lambda Node.js runtime (nodejs12.x).

* Don't attempt to validate EOL runtimes.
  • Loading branch information
bflad authored Aug 18, 2020
2 parents 332d25d + c11f488 commit a62eec8
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 622 deletions.
2 changes: 1 addition & 1 deletion aws/data_source_aws_lambda_layer_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func dataSourceAwsLambdaLayerVersion() *schema.Resource {
"compatible_runtime": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice(validLambdaRuntimes, false),
ValidateFunc: validation.StringInSlice(lambda.Runtime_Values(), false),
ConflictsWith: []string{"version"},
},
"compatible_runtimes": {
Expand Down
26 changes: 1 addition & 25 deletions aws/resource_aws_lambda_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,6 @@ import (

const awsMutexLambdaKey = `aws_lambda_function`

var validLambdaRuntimes = []string{
// lambda.RuntimeNodejs has reached end of life since October 2016 so not included here
lambda.RuntimeDotnetcore10,
lambda.RuntimeDotnetcore20,
lambda.RuntimeDotnetcore21,
lambda.RuntimeDotnetcore31,
lambda.RuntimeGo1X,
lambda.RuntimeJava8,
lambda.RuntimeJava11,
lambda.RuntimeNodejs43,
lambda.RuntimeNodejs43Edge,
lambda.RuntimeNodejs610,
lambda.RuntimeNodejs810,
lambda.RuntimeNodejs10X,
lambda.RuntimeNodejs12X,
lambda.RuntimeProvided,
lambda.RuntimePython27,
lambda.RuntimePython36,
lambda.RuntimePython37,
lambda.RuntimePython38,
lambda.RuntimeRuby25,
lambda.RuntimeRuby27,
}

func resourceAwsLambdaFunction() *schema.Resource {
return &schema.Resource{
Create: resourceAwsLambdaFunctionCreate,
Expand Down Expand Up @@ -166,7 +142,7 @@ func resourceAwsLambdaFunction() *schema.Resource {
"runtime": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice(validLambdaRuntimes, false),
ValidateFunc: validation.StringInSlice(lambda.Runtime_Values(), false),
},
"timeout": {
Type: schema.TypeInt,
Expand Down
Loading

0 comments on commit a62eec8

Please sign in to comment.