I am using aws elastic beanstalk to host my django application. We need to setup dev, stage and Prod environment of the application. But whenever I am using eb create command, it is also launching a new ec2 instance for the new environment.
Is it possible to set up multiple elastic beanstalk Environment in single ec2 instance. Also if I want to host a WordPress website in one of these instance can I do so by ssh logging into your the system and putting website in public web directory ?
If you can host your application within a docker container then you can use Multicontainer Docker Environment and run multiple docker containers on the same environment.
Read about multi-container docker environments in ElasticBeanstalk here:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_ecs.html
No.
Elastic Beanstalk create EC2 instances per environment. U can have single instance or elastic instance setups.
Yes you can SSH onto an EB Instance.
No you can't expect your changes to remain. The message when you SSH onto the EB Instance says as much.
Its a managed service for you.
The concept of having your EB Elastic destroys your capability for baking the EC2 instance it makes.
Use your GIT repository to put the Wordpress site on the EB and use a Database to pre-define it.. however you'll have state and media issues to overcome...
Related
I am using AWS ECS to automatically deploy my server in a docker container to my EC2 instance, the only problem is I have to use an elastic load balancer (ELB). This is a for a school project but it also uses a Telegram bot so I needed a HTTPS endpoint to receive updates from Telegram. An ELB is completely overkill for this and is also costing me more than I would like considering everything else is under the free tier that I am using. Does anyone know how to set up automatic deployment of a docker container to EC2 without an ELB/ECS OR does anyone know if it is possible to SSH to an EC2 instance during a build since that could possibly be a solution of how to run a deployment script on the instance automatically from the build. Thanks!
You dont need ECS.to run Docker. I have run Docker containers from an EC2 userdata script, so that is does a docker run command at launch. Works great.
I'm new to AWS and having a web server environment on elastic beanstalk with EC2 (t1.micro) with RDS (db.t1.micro). Now the db.t1.micro instance is deprecated, no more new instance can be created and no support in near future.
I would be helpful if anybody refers me steps to do create the t2 clone of the machine and switch over (Or) how to handle the depreciation of the instance.
Change Instance Type: You can change the Instance type by following the AWS documentation here
Next, Creating RDS instance in the Elastic Beanstalk environment is not ideal for production environments, because the lifecycle of the database instance is tied to the lifecycle of your application's environment. Hence it is always recommended to create RDS instance outside of the Elastic Beanstalk environment and configure your Elastic Beanstalk application to connect it on launch, which will provide the benefits of performing blue/green deployments, and tear down your Beanstalk environment without affecting the database instance. Refer to the documentation here to know more information.
For now, if you would like to modify the RDS instance type, you can do so by going to the RDS section in Configuration tab.
I have created a new Elastic Beanstalk environment with the source of the "db.t1.micro" snapshot, within the VPC. This helped me to launch the clone. Once this is done I have to swap the cname with the t1 and t2 setup. The new instance is up and running with t2 configuration.
I am having trouble installing a specific dependency in my elastic beanstalk environment via a .config file in the .ebextensions directory.
Are there any issues caused by instead installing it directly onto the instance via "eb ssh"? If my application was auto-scaled or if I wanted to change the instance type, will the dependency be missing from these new instance(s)?
There will be issues when the application get's auto-scaled. An EC2 instance provisioned by Elastic Beanstalk has the following MOTD:
This EC2 instance is managed by AWS Elastic Beanstalk. Changes made via SSH
WILL BE LOST if the instance is replaced by auto-scaling. For more information
on customizing your Elastic Beanstalk environment, see our documentation here:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html
Use the custom container approach suggested if you're aiming to create a highly customized beanstalk environment.
I have setup php environment on elastic beanstalk and uploading code through eb deploy command. EC2 instance is created by auto-scaling group and I can connect it using putty. I want to install wurfl on ec2, I want to know :
1) if I install wurfl on current running ec2 instance, will it get installed on other instance created by auto-scale group ?
2) if not, then how can I install wurfl on beanstalk
No, do not modify your Elastic Beanstalk instances manually. It will not replicate to another (existing/new) instances.
If you want to customize your instances, you can create .ebextensions scripts. Please take a look into http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html.
I want to change my RDS Instance that is connected to my Elastic Beanstalk Application, from a db.t1.micro to a db.m1.small. If I go to my Elastic Beanstalk Application and go to "Configuration", I can only see the current settings, but I'm unable to change them.
I then went into the Console -> RDS -> Instances, and updated my Instance from the RDS Menu, and set it as a db.m1.small. On RDS it now says that it's an db.m1.small, however on the Elastic Beanstalk Configuration Page, it still says that the application is running a db.t1.micro instance.
So a few questions:
Did I upgrade my instance in the "correct" way? Or is there another way I'm suppose to configure my RDS Instance that is set up with my Elastic Beanstalk App?
Any ideas why the different pages are saying different configurations?
If RDS console says that the RDS instance type is m1.small then it has been changed to m1.small. The two pages are showing different values because beanstalk provisioned a t1.micro instance instance for you and hence thinks you have a t1.micro db instance. If you rebuild your environment then the new environment should have the same configuration and hence a t1.micro instance.
Changing it via the RDS console does not change the configuration on Beanstalk, hence you see different values.
However if the RDS instance was created via Beanstalk then the correct way to update your db instance type would be using Elastic Beanstalk option settings.
You can make the change using AWS CLI if not using the console.
http://docs.aws.amazon.com/cli/latest/reference/
Just run the following command:
aws elasticbeanstalk --update-environment --environment-name <your-env-name> --option-settings Namespace=aws:rds:dbinstance,OptionName=DBInstanceClass,Value=db.m1.small
Try the above command.
More information on update-environment via aws cli:
http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/update-environment.html
Read more about option settings and ebextensions here.