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

aws/resource_aws_lambda_function: imageConfig can be null #17359

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws/resource_aws_lambda_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@ func expandLambdaFileSystemConfigs(fscMaps []interface{}) []*lambda.FileSystemCo
func flattenLambdaImageConfig(response *lambda.ImageConfigResponse) []map[string]interface{} {
settings := make(map[string]interface{})

if response == nil || response.Error != nil {
if response == nil || response.Error != nil || response.ImageConfig == nil {
return nil
}

Expand Down
6 changes: 6 additions & 0 deletions aws/resource_aws_lambda_function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3140,3 +3140,9 @@ resource "aws_lambda_function" "test" {
}
`, rName, runtime))
}

func TestFlattenLambdaImageConfigShouldNotFailWithEmptyImageConfig(t *testing.T) {
t.Parallel()
response := lambda.ImageConfigResponse{}
flattenLambdaImageConfig(&response)
}