Use strings.HasPrefix instead of regexp for lambda_permission
This commit is contained in:
parent
763cfcdb1f
commit
8580f58063
|
@ -216,7 +216,7 @@ func resourceAwsLambdaPermissionRead(d *schema.ResourceData, meta interface{}) e
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save Lambda function name in the same format
|
// 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
|
// Strip qualifier off
|
||||||
trimmedArn := strings.TrimSuffix(statement.Resource, ":"+qualifier)
|
trimmedArn := strings.TrimSuffix(statement.Resource, ":"+qualifier)
|
||||||
d.Set("function_name", trimmedArn)
|
d.Set("function_name", trimmedArn)
|
||||||
|
|
Loading…
Reference in New Issue