Do you think that is why he attacked me?
He most likely attacked you because he's an adult male amazon full of raging hormones. Its also possible that he's had years to make a habit of that behavior. Male yellow napes that have been poorly socialized can be absolute hell during hormonal periods. I'd be careful even using a stick to get him to step up. I have a couple males that when at the height of amazon crazy will run or jump off a stick to latch onto whatever body part they can get to first. I've found that its best if you see an amazon on a tirade to just leave them. Sometimes it takes hours, but wait until they have calmed to the point of looking fluffed and sleepy before trying to interact with them. Some of these guys will even then go straight into the stiff legged, flared and flashing tail and pupils again.
If it were me with this bird, I'd recognize that #1 this is an adult male yellow nape and so periods of potentially extreme aggression are to be expected during the spring(now) and summer). #2 realize that this bird is a rehome and likely was not properly socialized. He could be a very difficult bird to get him to calm down. Don't feel disappointed or like you have to rehome him if he never acts super friendly toward you. You did a good deed by taking in a difficult bird. Make the bird happy and let that be enough. If you can work in some socialization and make friends, then so much the better.
Make sure he has a clean cage, nice toys. I'd get him a different cage that is big enough that you don't feel guilty if he has to spend time in there because of aggression issues. Rotate through lots of wood toys. Frankly, I'd continue just walking up to his closed cage and handing him treats multiple times a day. Male amazons can be possessive about their food bowls, so I'd tend to try staying on the opposite side of the cage away from the bowls for maximum likelihood of peaceful interaction. When you finally get to the point of being able to hand him treats and walk up to the cage without him flying into a rage, you can try handing him treats through the open cage door. When you can do that without aggression, I'd start moving him away from the cage. Probably best to keep this bird below chest level. Lots of people say birds don't have height dominance but having an adult male amazon above your head where you can't control him as well and where he can jump down at you is not in your favor.
You might want to see if he is in fact stick trained. Many older amazons are already stick trained and will handle it surprisingly well. If he is stick trained, you might be able to step him up onto a stick and take him to a different room away from the cage and work with him, or just let him hang out on a chest level gym. He might be surprisingly calm and friendly when away from his territory. Just be careful trying to handle him with a stick. Like I said at the top, many enraged male amazons will just rush down the stick and latch onto your hand or jump from stick to your face.