The current documentation for the aws_lambda_function provider notes that it uses the nodejs runtime by default. At the end ofย next month, October 2016, AWS will be deprecating this runtime.
It may be advisable to change this default to nodejs4.3, AWS' recommendation for node projects on the legacy runtime, before the deprecation takes place.
Thanks for the notice @NotBobTheBuilder !
I actually think we should make the runtime a required field in this case, but I don't mind just updating the default value.
Making it required seems safer, since if Terraform quietly switched someone from Node 0.10 to Node 4.3 their app will likely be broken, e.g. if it contains npm modules that contain native code compiled against 0.10.
Of course, making it required is still a breaking change, but at least a safer breaking change: Terraform will catch it during Validate, and allow the user to explicitly set the value to nodejs before they continue if they wish to keep using it.
We could also use ValidateFunc to let Terraform present its own the deprecation warning for this value, to help folks who might not see this announcement due to doing all of their AWS interactions via Terraform. :grinning:
I'm in favor of either solution, and if the old "nodejs" remains the default, at least clarifying in the docs that the default is deprecated and you probably want "nodejs4.3" :) It seems natural to read the docs, see "oh, Node is the default, that's what I want!" and not realize there are two node platforms and nodejs is the older one that won't work with blueprints and is deprecated.
I had a bit of trouble debugging this when I just set up some fresh lambda resources based on an AWS Blueprint. It wasn't working unclear reasons, until I figured out that the default is "nodejs" but AWS Blueprints are based on "nodejs4.3" and that is recommended.
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.
Most helpful comment
Making it required seems safer, since if Terraform quietly switched someone from Node 0.10 to Node 4.3 their app will likely be broken, e.g. if it contains npm modules that contain native code compiled against 0.10.
Of course, making it required is still a breaking change, but at least a safer breaking change: Terraform will catch it during Validate, and allow the user to explicitly set the value to
nodejsbefore they continue if they wish to keep using it.We could also use
ValidateFuncto let Terraform present its own the deprecation warning for this value, to help folks who might not see this announcement due to doing all of their AWS interactions via Terraform. :grinning: