This is okay if you are not covered by your spouse’s health plan (you cannot have family coverage). You cannot enroll in the CDHP and contribute to the HSA if you have any other coverage unless the other coverage is a CDHP.
If either spouse has family CDHP coverage, both spouses are treated as having family CDHP coverage. If the spouse’s employer offers a high-deductible plan, both the employee and spouse can enroll and contribute to their individual HSAs. However, the maximum contribution limit for the two of you is combined.