SummaryThis article focuses on a distributed optimization problem under an undirectd and connected network affected by DoS attacks. First, new event‐triggered mechanisms are developed to schedule the communication between agents. Then, an event‐based resilient distributed optimization algorithm that removes the requirement of continuous communication in the existing results is designed to achieve consensus optimization. Assisted by the design of regulator equations and the algebraic graph theory, it proves that the proposed algorithm is exponentially convergent. Moreover, Zeno behavior can be excluded by reductio ad absurdum. The simulation results validate that the proposed algorithm is effective.