Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: Deprecated aws_lambda_function nodejs runtime in favor of nodejs4.3 #9724

Merged
merged 3 commits into from
Dec 16, 2016

Conversation

Ninir
Copy link
Contributor

@Ninir Ninir commented Oct 30, 2016

This aims to fix #8348, which is about deprecating nodejs in favor of nodejs4.3 since it will reach end of life in a few hours. (Reference: http://docs.aws.amazon.com/fr_fr/lambda/latest/dg/nodejs-prog-model-using-old-runtime.html)

Excerpt:

Given the upcoming end of life for this version, you will no longer be able to create new functions using this version on October 2016

As you could read in the related issue, this is a breaking change since the runtime attribute is now required.
This enforces that the runtime is set and to the appropriate version, which should not be nodejs anymore.

Also, this fixes some mixed whitespaces (tabs and spaces) in the related tests. Tell me if you want a separate PR :)

Note: At the time of this PR creation, the nodejs is not yet deprecated (will check in a few hours)

@stack72
Copy link
Contributor

stack72 commented Oct 31, 2016

Hi @Ninir

Thanks for the PR here - this is a good way of handling it :) I would love to see a set of tests that validates the nodejs version to show that nodejs throws an error rather than 4.3

Thanks

Paul

@Ninir
Copy link
Contributor Author

Ninir commented Nov 17, 2016

Hi @stack72

Just added required tests as asked. The ExpectError was the missing part in all of this...
Please note that at the moment, it is still possible to create NodeJS functions using 0.10. Can't tell why since it should not according to the documentation... :-/

$ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSLambdaFunction_runtimeValidation_'         
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/11/17 15:07:12 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSLambdaFunction_runtimeValidation_ -timeout 120m
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_noRuntime
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_noRuntime (0.01s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_nodeJs
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_nodeJs (0.01s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_nodeJs43
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_nodeJs43 (37.02s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_python27
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_python27 (35.18s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_java8
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_java8 (39.71s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    111.964s

@stack72
Copy link
Contributor

stack72 commented Dec 5, 2016

Hi @Ninir

Is this ready to be merged yet - i.e has the version been deprecated?

Paul

@Ninir
Copy link
Contributor Author

Ninir commented Dec 5, 2016

Hi @stack72
Even though the documentation says the opposite, you can still create Node0.10 functions. (just tried it in eu-west-1).
Not sure how to get the appropriate information from AWS there. Will try to contact an AWS architect about that.

@stack72
Copy link
Contributor

stack72 commented Dec 16, 2016

@Ninir looks like the deprecation finally happened

this is us-east-1

screen shot 2016-12-16 at 11 52 27

this is eu-west-1

screen shot 2016-12-16 at 11 53 10

I wonder if the API rejects it too?

Paul

@Ninir
Copy link
Contributor Author

Ninir commented Dec 16, 2016

Checking it right now Paul :)

@stack72
Copy link
Contributor

stack72 commented Dec 16, 2016

Tests all pass here for me @Ninir so if we can confirm that the runtime has finally been deprecated, then we can merge this

% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSLambdaFunction_runtimeValidation_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/12/16 11:56:28 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSLambdaFunction_runtimeValidation_ -timeout 120m
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_noRuntime
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_noRuntime (0.01s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_nodeJs
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_nodeJs (0.01s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_nodeJs43
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_nodeJs43 (50.80s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_python27
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_python27 (54.57s)
=== RUN   TestAccAWSLambdaFunction_runtimeValidation_java8
--- PASS: TestAccAWSLambdaFunction_runtimeValidation_java8 (50.87s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	156.294s

@Ninir
Copy link
Contributor Author

Ninir commented Dec 16, 2016

The API still allows it... Created it, no issues, and the console show "nodejs" (but it is not selectable as you showed in the console). 😢
However, it indicates using a warning that the user should migrate as soon as possible!

@stack72
Copy link
Contributor

stack72 commented Dec 16, 2016

ok, we should make the behaviour that of the console - that's the right case here IMO

@stack72 stack72 merged commit f96e45b into hashicorp:master Dec 16, 2016
@Ninir Ninir deleted the lambda_nodejs_deprecation branch December 16, 2016 13:53
@catsby
Copy link
Contributor

catsby commented Dec 16, 2016

Unfortunately this has broken any Lambda function test that relies on the default value. The above test runs only ran a subset of the tests. I'm fixing that in #10791

@ghost
Copy link

ghost commented Apr 18, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS Lambda Function runtime default will be deprecated soon
3 participants