2

I am setting up Bitbucket pipeline for a Wordpress deployment on Elastic Beanstalk.

This error message pops up in line eb init --region AWS_DEFAULT_REGION --platform php-5.5 :

ERROR: ServiceError - '/20200712/$AWS_DEFAULT_REGION/elasticbeanstalk/aws4_request' not a valid key=value pair (missing equal-sign) in Authorization header: 'AWS4-HMAC-SHA256 Credential=$AWS_ACCESS_KEY_ID/20200712/$AWS_DEFAULT_REGION/elasticbeanstalk/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=3d7fef....8383d5'.

Other relevant questions and why it doesn't solve my problem :

  • 1 2 : Don't have /.aws/config in Bitbucket environment
  • 3 : Error message mentioned above

The Bitbucket pipeline till now :

image: tyrellsys/aws-ebcli

pipelines:
  branches:
    master:
      - step:
          script:
            - export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID
            - export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY
            - export AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION
            - export APPLICATION_NAME=$APPLICATION_NAME
            - export ENVIRONMENT_NAME=$ENVIRONMENT_NAME
            - eb init --region ap-southeast-1 --platform php-5.5
            - eb deploy wordpress-beanstalk
Omar Shabab
  • 531
  • 7
  • 16
  • Does this answer your question? [AWS eb init not a valid key=value pair (missing equal-sign)](https://stackoverflow.com/questions/58080154/aws-eb-init-not-a-valid-key-value-pair-missing-equal-sign) – Adiii Jul 12 '20 at 11:27
  • This link 2 in my question. No, it doesn't – Omar Shabab Jul 12 '20 at 11:42
  • 1
    Are you sure that the `$AWS_ACCESS_KEY_ID` and other variables are correct? No extra characters or missing any? Also what version of ebawscli do you use? I ask because platform `php-5.5` is deprecated. – Marcin Jul 12 '20 at 11:57
  • 1
    @Marcin Thanks for the hint. I replaced all the environment variables and the error went away. However, stuck with this new error : InvalidParameterValueError: No Application Version named 'app-eb0c-200713_022145' found. – Omar Shabab Jul 13 '20 at 02:25
  • You can go to EB console and check if it exists or not. Maybe you need to recreate it? Btw, if you don't mind I would like to provide the answer for the posted issue (i.e. key=value pair) for future reference. – Marcin Jul 13 '20 at 02:32
  • The same command, 'eb deploy $ENVIRONMENT_NAME' works from my local machine which is Ubuntu 18.04 and creates new artifact in S3 + deploys with the new application version name. I can deploy a previous application version with no issue in Bitbucket pipelines. But that replaces the old artifact in S3 which I need to keep. – Omar Shabab Jul 13 '20 at 03:07

1 Answers1

1

Based on the comments.

The issue was related to incorrectly set $AWS_ACCESS_KEY_ID, $AWS_SECRET_ACCESS_KEY and $AWS_DEFAULT_REGION.

Fixing the values was the solution to the reported issue with key=value pair (missing equal-sign).

Marcin
  • 215,873
  • 14
  • 235
  • 294