From 01f868d3e6a90c754ef138263cc93ef1dbc4c55c Mon Sep 17 00:00:00 2001 From: clint shryock Date: Thu, 24 Mar 2016 16:30:21 -0500 Subject: [PATCH] provider/aws: Guard against empty responses from Lambda Permissions --- builtin/providers/aws/resource_aws_lambda_permission.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_lambda_permission.go b/builtin/providers/aws/resource_aws_lambda_permission.go index de300a7ff..584176764 100644 --- a/builtin/providers/aws/resource_aws_lambda_permission.go +++ b/builtin/providers/aws/resource_aws_lambda_permission.go @@ -121,7 +121,11 @@ func resourceAwsLambdaPermissionCreate(d *schema.ResourceData, meta interface{}) return err } - log.Printf("[DEBUG] Created new Lambda permission: %s", *out.Statement) + if out != nil && out.Statement != nil { + log.Printf("[DEBUG] Created new Lambda permission: %s", *out.Statement) + } else { + log.Printf("[DEBUG] Created new Lambda permission, but no Statement was included") + } d.SetId(d.Get("statement_id").(string))