I have the following script that runs at the end of codebuild on AWS. It creates a new application version successfully and I want it to automatically update the environment to deploy the new application version. The command describe-application-versions
returns empty, and the command update-environment
starts an update, but it quickly fails with the error InvalidParameterValue: Not a valid Base64 function
. I've double-checked that the environment variables are being set correctly, and I can call both commands fine from my own terminal. Is this maybe a credentials error? I would expect to see a permissions error if that were the case.
if [ -z $APPLICATION ];
then echo "No beanstalk application specified";
else aws elasticbeanstalk create-application-version --application-name $APPLICATION --version-label $VER_LBL --source-bundle S3Bucket=$DEPLOYPATH,S3Key=builds/$APPLICATION/$VER_LBL --region $REGION;
if [ -z $ENVIRONMENT ];
then echo "No beanstalk environment specified";
else
aws elasticbeanstalk describe-application-versions --application-name $APPLICATION --version-labels $VER_LBL --region $REGION
aws elasticbeanstalk update-environment --application-name $APPLICATION --environment-name $ENVIRONMENT --version-label $VER_LBL --region $REGION;
fi
fi