AWS CodeBuild environment variables for versioning?

Reference to environment variables vended by CodeBuild for consumption is listed here:

For build number related information, you can use CODEBUILD_BUILD_ID or CODEBUILD_BUILD_ARN. For the source related information, depending on how the build was triggered and what the input parameters to the build were (e.g. if you've specified source version while starting your build -- reference), you can additionally use CODEBUILD_SOURCE_VERSION or CODEBUILD_SOURCE_REPO_URL environment variables.

CodeBuild documentation is not yet updated with the detailed information of these updated environment variables.


Amazon has very recently added a BuildNumber environment variable.

According to

CODEBUILD_BUILD_NUMBER: The current build number for the project.