If I make a pencil and give it to someone, and they use it to draw a picture that they sell for $10m, they haven't ripped me off. They've added a lot of value to that pencil. I haven't lost anything. They haven't "profited from my work". They've done something pretty amazing using a tool I created. Good for them. FOSS is the same. The idea that people are taking FOSS code and building billion dollar companies with it…
I think the analogy would work better as: You make a pencil. Someone takes your pencil, and puts it in a really nice box with some other pencils. People use those pencils to draw a $10 million picture. The box maker uses contracts to ensure they get a 10% cut of that picture sale. Actual pencil makers gets no cut. I can see why this would annoy pencil makers, no matter how nice the box is, or how much effort they put…
Not quite, because what you're paying for in AWS for instance is not just the nice box (and AWS glue like IAM), but abstracting away all the annoying hardware stuff you'd have to deal with yourself if you went box-free.
Particularly, it's a lot easier to scale hard up and down (and thus better align your infrastructure spending with the actual demand) in the cloud than it is with on-prem hardware. So cloud providers are billing for that convenience and flexibility because maintaining all that hardware and providing the glue between the services becomes their problem.
I'm not really AWS's biggest fan (I go full self-hosted on my personal projects and when I must use AWS for work I'm careful to avoid vendor lock-in), but neither do I think it's fair to characterize them as just putting pencils in a box.