Fixes #4540 Use shared module snippet to evaluate ec2 credentials