I have an AWS Codebuild Project that is connected to a VPC. Now I’m trying to understand how can I get the availability zone of codebuild build during execution time. Is this possible?
Question posted in Amazon Web Sevices
The official Amazon Web Services documentation can be found here.
The official Amazon Web Services documentation can be found here.
2
Answers
It turns out there is an Environment Variable, CODEBUILD_VPC_AZ, that holds this value.
Based on AWS documentation there are two environment variables having the AWS Region where the build is running (
AWS_DEFAULT_REGION
andAWS_REGION
). I don’t think there is any possibility to get the actual availability zone.But is there something specific that you want to achieve by knowing the availability zone? Maybe we can provide a solution to that.