Say I have a Codepipeline Pipeline with 4 stages and each stage takes 5 seconds to run.
According to the CodeBuild pricing page:
Build Duration is calculated in minutes, from the time you submit your build until your build is terminated, rounded up to the nearest minute.
So for my above example, my total time for running my Pipeline is around 20 seconds. But due to rounding up to the nearest minute of each build, would I be billed for 4 build minutes?
This is rounding up results in being charged 12 times more than if there was no rounding!
Is this interpretation of how CodeBuild pricing works accurate?
If so, would looking to reduce the number of short builds and squash them into larger builds be a good idea?
Yes, you would be billed 1 minute per build so 4 build minutes.
You could definitely combine certain builds together, mainly because build specification allows you to easily handle multiple phases, and it seems it was designed specifically for this purpose, to combine various build steps into a single build.