provider/aws: Set the qualifier to an empty string if the parsing fails, to attempt to detect drift
This commit is contained in:
parent
86bf9fde83
commit
0d8a6fb998
|
@ -211,9 +211,10 @@ func resourceAwsLambdaPermissionRead(d *schema.ResourceData, meta interface{}) e
|
||||||
}
|
}
|
||||||
|
|
||||||
qualifier, err := getQualifierFromLambdaAliasOrVersionArn(statement.Resource)
|
qualifier, err := getQualifierFromLambdaAliasOrVersionArn(statement.Resource)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
d.Set("qualifier", qualifier)
|
log.Printf("[ERR] Error getting Lambda Qualifier: %s", err)
|
||||||
}
|
}
|
||||||
|
d.Set("qualifier", qualifier)
|
||||||
|
|
||||||
// Save Lambda function name in the same format
|
// Save Lambda function name in the same format
|
||||||
if strings.HasPrefix(d.Get("function_name").(string), "arn:"+meta.(*AWSClient).partition+":lambda:") {
|
if strings.HasPrefix(d.Get("function_name").(string), "arn:"+meta.(*AWSClient).partition+":lambda:") {
|
||||||
|
|
Loading…
Reference in New Issue