provider/aws: Set the qualifier to an empty string if the parsing fails, to attempt to detect drift

This commit is contained in:
clint shryock 2017-02-09 10:39:20 -06:00
parent 86bf9fde83
commit 0d8a6fb998
1 changed files with 3 additions and 2 deletions

View File

@ -211,9 +211,10 @@ func resourceAwsLambdaPermissionRead(d *schema.ResourceData, meta interface{}) e
}
qualifier, err := getQualifierFromLambdaAliasOrVersionArn(statement.Resource)
if err == nil {
d.Set("qualifier", qualifier)
if err != nil {
log.Printf("[ERR] Error getting Lambda Qualifier: %s", err)
}
d.Set("qualifier", qualifier)
// Save Lambda function name in the same format
if strings.HasPrefix(d.Get("function_name").(string), "arn:"+meta.(*AWSClient).partition+":lambda:") {