-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
aws_lambda_function.lambda-name: unexpected EOF #2509
Comments
Hi @wips, The "unexpected EOF" feature suggests that either there was a network problem reaching the lambda API or, alternatively, the AWS provider crashed and caused Terraform to lose its connection to the plugin. Unfortunately it's not possible to guess what failed here with the information given. If you saw anything that looks like a crash (stack trace, etc) in the output it would helpful to see that to get an idea of what failed. I understand that you are not able to share full detailed logs, but if you run Terraform with |
Hi @apparentlymart, I found this when investigating #1341.
With this config: resource "aws_security_group" "test" {
vpc_id = "vpc-abcdef"
name = "radek-test"
}
resource "aws_lambda_function" "test" {
filename = "lambda.zip"
function_name = "radek-test"
role = "${aws_iam_role.iam_for_lambda.arn}"
handler = "index.example"
runtime = "nodejs4.3"
vpc_config {
subnet_ids = ["subnet-654321"]
security_group_ids = ["${aws_security_group.test.id}"]
}
}
resource "aws_iam_role_policy" "iam_policy_for_lambda" {
name = "iam_policy_for_lambda_radek"
role = "${aws_iam_role.iam_for_lambda.id}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "arn:aws:logs:*:*:*"
},
{
"Effect": "Allow",
"Action": [
"ec2:CreateNetworkInterface",
"ec2:DescribeNetworkInterfaces",
"ec2:DeleteNetworkInterface"
],
"Resource": [
"*"
]
}
]
}
EOF
}
resource "aws_iam_role" "iam_for_lambda" {
name = "iam_for_lambda_radek"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
}
]
}
EO Running this: echo 'exports.example = (event, context)=>(null)' > index.js && zip lambda.zip index.js
terraform apply -auto-approve Then removing the
I've got the full trace log for (stdout and stderr are mixed i.e. |
The fix for this crash along with properly handling |
This has been released in version 1.35.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Hi there,
When I add or delete
vpc_config
into my lambda settings terraform fails (see the error below). A part of my config related to lambda:Terraform Version
Terraform v0.10.8. This is not the last one, but I can't upgrade terraform on our environments.
Terraform Configuration Files
Debug Output
Panic Output
No
Expected Behavior
VPC config should be deleted
Actual Behavior
Terraform failed with the error above
Steps to Reproduce
terraform apply
Is it a known bug or maybe I'm doing smth wrong?
Unfortunately, I can't provide complete logs and/or debug info at the moment, but still any help is much appreciated.
The text was updated successfully, but these errors were encountered: