0

I have two similar domains on aws. Here is the setup for both of them.

  1. Running static file on S3 buckets(React)
  2. Running Elastic Beanstalk for backend (Django)

The thing is I have created Domain "A" for testing and ended up using "awsebcli" for setting up and deploying the files. Everything looks great on Domain "A."

The problem is that every time I am trying to deploy the same files to Domain "B", it ends up being in Domain "A."

How can I map "awsebcli" to use Domain "B"? What am I missing?

A) I tried to run "eb init" again thinking it might give me an option to select the domain

B) I ran "eb create" again and thought the cli maybe was mapped using ssh, so I created a new ssh but still no luck.

Here is my config.yml file

enter image description here

Asim Mahar
  • 800
  • 1
  • 6
  • 13
  • what exactly do you mean by 'domain'? are these separate applications in elastic beanstalk, or separate environments, or neither? – danimal Apr 12 '19 at 10:31
  • Domain A = "exampleA.com." Domain B = "exampleB.com." So yes that would make it two completely separate elastic beanstalk instances with two their own two environments. I had created Domain A only for testing.. – Asim Mahar Apr 12 '19 at 12:08
  • can you provide your `.elasticbeanstalk/config.yml` file? – danimal Apr 12 '19 at 14:37
  • 1
    and what commands exactly are you using from `eb`? – danimal Apr 12 '19 at 14:38
  • 1
    @AsimMahar, by domains, do you mean "environments"? If so, please note that `eb deploy` takes in environment name as a positional argument. So you can do `eb deploy DOMAIN_A`, to deploy to domain A and `eb deploy DOMAIN_B` to deploy to domain B. – progfan Apr 12 '19 at 19:27
  • @danimal I have added the `config.yml` image to the question. For the commands, I pretty much follow the [create deploy python django from aws](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html) documentation, and end up using pretty much all the `eb` commands from there such as `eb init`, `eb create`, `eb deploy` etc – Asim Mahar Apr 12 '19 at 20:59
  • @progfan hmmm...I am under impressions that `environments` reside under a domain. So each domain will have its multiple environments. For instance, Domain "A" could have multiple EB environments. I haven't tried the `eb deploy DOMAIN_A` but looks like I am basically trying to understand how is my `awsebcli` mapped to the EB console, where I could check my logs etc... if that makes sense...oh boy – Asim Mahar Apr 12 '19 at 21:08
  • 1
    Understood. When you `eb init`, you tie source code in PWD with exactly one EB application. If you want to work with another EB application, you have to go to another directory and run `eb init` there – progfan Apr 12 '19 at 22:22
  • Hey guys thank you so much for trying to work on this with me. Turns out I finally figured out I basically had two different aws accounts(with two different accounts), and when I created the initial `eb` profile it saved the `key_id` and `access_key` for it which would always create my environemtns on Domain A. But here is what helped me soloved this: https://stackoverflow.com/questions/29190202/how-to-change-the-aws-account-using-the-elastic-beanstalk-cli/29222254 – Asim Mahar Apr 12 '19 at 22:56

0 Answers0