In the case of non-Abelian gauge theories, instantons classify the principal $SU(N)$ bundles $P$ by means of the second Chern Class $c_2(P)$ (For other gauge groups, we might need additional topological invariants for the classification).
They are self-dual solutions to the Yang-Mills equations but their topological class, i.e. other configurations belonging to the same bundle, are in general not self-dual and not solutions of the equations of motion. The topological term gives a common weight for all these configurations belonging to the same bundle in the path integral.
In the case of U(1) gauge theories over a compact $4-$manifold $\mathcal{M}$, the self-dual fields, although exist in general, but they do not characterize principal bundles, and in addition, both the Maxwell term and the theta term vanish for a pure self dual(anti-self dual) configuration.
However, there can be non-trivial U(1) bundles, thus a topological theta term does give different weights to different bundles in the path integral.
Principal U(1) bundles $Q$ are classified by the first Chern class. Since the first Chern class is represented by an Abelian gauge field, the theta term has the form:
$$\mathcal{L}_{\theta} = \theta \int F \wedge F = \theta \int c_1(Q) \wedge c_1(Q)$$
Thus, for example, The Abelian topological term does not detect an element of the fourth cohomology group $H^4(\mathcal{M})$ which cannot be decomposed as a wedge product of two elements of $H^2(\mathcal{M})$.
Since on a compact manifold the Dirac's quantization condition must be satisfied:
$$\frac{q}{2\pi \hbar} \int_{\sigma} F = m(Z) \in \mathbb{Z} $$
where, $Z$ is two dimensional cycle on $M$. ($m(Z)$ counts the units of flux through the surface of $Z$), then decomposing $F$ as a linear combination of integral two forms, the topological term becomes:
$$(\frac{q}{2\pi \hbar})^2 \int_{\mathcal{M}} F \wedge F = \sum_{i, j = 1}^{b_2} m(Z_i) Q_{ij }m(Z_j)$$
(Please see the following work by Olive (equation (3)).
The integer matrix $Q_{ij}$ is the reciprocal intersection matrix, i.e., its reciprocal counts the number of points of the intersection of the cycles $Z_i$ and $Z_j$.
However, the self-dual fields do enter the Dirac's index, but they do so due to the interaction with the background gravitational field of the manifold $\mathcal{M}$. The index of the Dirac-Weyl operator on a compact $4-$ dimensional manifold is given by:
$$\mathrm{ind}(D_A) = (\frac{q}{2\pi \hbar})^2 \int_{\mathcal{M}} F \wedge F - \frac{\eta}{8} $$
where $\eta$ is Hirzebruch signature which is the difference between the number of Harmonic self dual and Harmonic anti-self dual two forms on $\mathcal{M}$. (Please see Olive and Luis Alvarez-Gaumé.