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

Using the New Lambda Image Container causes terraform crash #17081

Closed
dspatoulas opened this issue Jan 12, 2021 · 2 comments · Fixed by #17082
Closed

Using the New Lambda Image Container causes terraform crash #17081

dspatoulas opened this issue Jan 12, 2021 · 2 comments · Fixed by #17082
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/lambda Issues and PRs that pertain to the lambda service.
Milestone

Comments

@dspatoulas
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.13.6

  • provider registry.terraform.io/hashicorp/template v2.2.0
  • provider registry.terraform.io/hashicorp/null v3.0.0
  • provider registry.terraform.io/hashicorp/aws v3.23.0

Affected Resource(s)

  • aws_lambda_function

Terraform Configuration Files

Create a lambda function using the new container Image package type instead of the default Zip package type. Do not set an image_configuration override block for the function.

resource aws_lambda_function {
  ...
  image_uri = "${var.account_id}.dkr.ecr.${var.region}.amazonaws.com/${var.service}:${var.build_hash}"
}

Panic Output

2021-01-11T14:38:43.241-0500 [DEBUG] plugin.terraform-provider-aws_v3.23.0_x5: panic: runtime error: invalid memory address or nil pointer dereference
2021-01-11T14:38:43.241-0500 [DEBUG] plugin.terraform-provider-aws_v3.23.0_x5: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x53d5a82]
2021-01-11T14:38:43.241-0500 [DEBUG] plugin.terraform-provider-aws_v3.23.0_x5: 
2021-01-11T14:38:43.241-0500 [DEBUG] plugin.terraform-provider-aws_v3.23.0_x5: goroutine 13 [running]:
2021-01-11T14:38:43.241-0500 [DEBUG] plugin.terraform-provider-aws_v3.23.0_x5: github.com/terraform-providers/terraform-provider-aws/aws.flattenLambdaImageConfig(...)
2021-01-11T14:38:43.241-0500 [DEBUG] plugin.terraform-provider-aws_v3.23.0_x5: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/resource_aws_lambda_function.go:1309

Expected Behavior

It should deserialize the response from Lambda API correctly.

Actual Behavior

It fails to safely deserialize and access values from the Lambda API response.

Steps to Reproduce

  1. Create a Lambda function resource using Image as the package type, but do not specify an override for the image_configuration.
  2. Attempt to run terraform apply or terraform import, and terraform will crash.
@ghost ghost added bug Addresses a defect in current functionality. service/lambda Issues and PRs that pertain to the lambda service. crash Results from or addresses a Terraform crash or kernel panic. labels Jan 12, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 12, 2021
@anGie44 anGie44 removed the needs-triage Waiting for first response or review from a maintainer. label Jan 12, 2021
@github-actions github-actions bot added this to the v3.28.0 milestone Feb 11, 2021
@ghost
Copy link

ghost commented Feb 12, 2021

This has been released in version 3.28.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 14, 2021

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!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/lambda Issues and PRs that pertain to the lambda service.
Projects
None yet
2 participants