From 8580f58063d02c81fbd24038b8701384fcbb7562 Mon Sep 17 00:00:00 2001 From: Jake Champlin Date: Mon, 23 Jan 2017 12:34:56 -0500 Subject: [PATCH] Use strings.HasPrefix instead of regexp for lambda_permission --- builtin/providers/aws/resource_aws_lambda_permission.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/providers/aws/resource_aws_lambda_permission.go b/builtin/providers/aws/resource_aws_lambda_permission.go index 625c149f9d..dd21bf4ebc 100644 --- a/builtin/providers/aws/resource_aws_lambda_permission.go +++ b/builtin/providers/aws/resource_aws_lambda_permission.go @@ -216,7 +216,7 @@ func resourceAwsLambdaPermissionRead(d *schema.ResourceData, meta interface{}) e } // Save Lambda function name in the same format - if regexp.MustCompile(`^arn:[\w-]+:lambda:`).MatchString(d.Get("function_name").(string)) { + if strings.HasPrefix(d.Get("function_name").(string), "arn:"+meta.(*AWSClient).partition+":lambda:") { // Strip qualifier off trimmedArn := strings.TrimSuffix(statement.Resource, ":"+qualifier) d.Set("function_name", trimmedArn)