An HOA can enforce its rules against homeowners; if the rules require certain types of construction or that materials match, they can enforce that, notwithstanding that you were not the one who put up the shed. HOA rules are binding on all residents in the community.If you'd bought from the former owner in a more typical sale, you might have recourse against the owner; but in a foreclosure situation, you wouldn't have that option. If there are other sheds or similar structures which have not been forced to comply, you might look into why; if it appears that you are being discriminated against in the application of the rule owing to a protected characteristic (e.g. race, sex, religion, age over 40, disability; or in CA, I *think* sexual orientation and national origin are  also protected, but you should check that), then it may be that you have a claim for a form of housing discrimination. But the rules are enforced fairly evenhandedly, you will likely have  to comply.