You don't need to leave the machine running (and billing) 24/7/365—turning it on for a few hours a day when you're building for it, or testing builds, should be enough.
"Amazon EC2 Mac instances are available for purchase as Dedicated Hosts through On Demand and Savings Plans pricing models. Billing for EC2 Mac instances is per second with a 24-hour minimum allocation period to comply with the Apple macOS Software License Agreement"
There's a minimum charge of 24 hours. macOS's license only permits renting the machine to a single buyer per day, so if you use it for five minutes then turn it off that machine is idle for the rest of the day.
Unlike other EC2 instances, you have to "reserve" a host, and the MAC instances require a minimum of a 24 hour reservation, that you pay for regardless of the instance state.
It can be hard to justify $15.60 every time I want to test some random thing. Not to mention I seem to recall you can't actually cancel a reservation till the 24 hour window is up, so you need to remember to stop it the next day, or automate that action somehow.
"Amazon EC2 Mac instances are available for purchase as Dedicated Hosts through On Demand and Savings Plans pricing models. Billing for EC2 Mac instances is per second with a 24-hour minimum allocation period to comply with the Apple macOS Software License Agreement"