AWSinAction / code

Code of Amazon Web Services in Action, 1st edition
https://www.manning.com/books/amazon-web-services-in-action
MIT License
269 stars 161 forks source link

Chapter 5, p134: can't create elasticbeanstalk application version if region != us-east-1 #8

Open knguyen0105 opened 7 years ago

knguyen0105 commented 7 years ago

Hi,

I config my aws at ap-southeast-2, when I run the command to create an application version

$ aws elasticbeanstalk create-application-version --application-name etherpad --version-label 1.5.2 --source-bundle S3Bucket=awsinaction,S3Key=code/chapter5/etherpad.zip An error occurred (InvalidParameterCombination) when calling the CreateApplicationVersion operation: Unable to download from S3 location (Bucket: awsinaction Key: code/chapter5/etherpad.zip). Reason: The bucket is in this region: us-east-1. Please use this region to retry the request

I tried adding '--region ap-southeast-2' or '--region us-northeast-1' but both didn't work. I'm confused about the error. What do I have to modify to work? Thanks.

michaelwittig commented 7 years ago

You need to use the region us-east-1. The book assumes (and also mentions) that you use this region.

Two possibilities:

run aws configure and set the default region to us-east-1.

Alternatively, you can append --region us-east-1 to every CLI command.

Let me know if it works.

knguyen0105 commented 7 years ago

Sorry that I wasn't being clear. What I meant to ask is how to use the command if my region is ap-southeast-2? Does it mean elasticbeanstalk command lines only work for 'us-east-1'?

As noted above, I tried adding '--region ap-southeast-2' and '--region ap-east-1' but none worked.

michaelwittig commented 7 years ago

Hi! The problem ist that we used us-east-1 as the region for the bucket containing the app. Elastic beanstalk and the s3 bucket must be in the same region. What you could do:

  1. download the etherpad.zip from https://github.com/AWSinAction/code/blob/master/chapter5/etherpad.zip
  2. create a s3 bucket in the region you like to use
  3. upload etherpad.zip
  4. modify S3Bucket and S3Key accordingly in the command