Change RDS Configuration in Elastic Beanstalk App? - amazon-web-services

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.

Related

How to change database config in AWS Elastic Beanstalk

In my AWS Elastic Beanstalk environment, I need to change the database config to use a different RDS instance.
Does anyone know how to do this at the AWS (SDK) Command line ?
I don`t believe there is a way to change to a different RDS instance using beanstalk command line client.
The way I suggest you manage your database configuration using Elastic Beanstalk is like that:
1) Do not create a database using the Elastic Beanstalk wizard. It is much better to create a separate RDS instance and then connect your Elastic Beanstalk server to it.
2) In your project, you should have a .env file listing all the connection parameters. IMPORTANT: This file should be listed in .gitignore. So while you are coding, you can switch between your dev, stage, and production environment easily.
3) In your AWS console, you should go to Beanstalk instance > Configuration > Software. Then list under Environment properties all the connection parameters using RDS pre-defined parameters.
This way you will have your servers configured and be able to switch between RDS instances in your IDE while coding.

AWS Elastic Beanstalk: Steps to move existing RDS from db.t1.micro to db.t2.small

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.

Elastic Beanstalk Instance keeps deleting Clamscan

I'm using clamscan to check content on my elastic beanstalk instance, however, I'm having an issue where AWS either moves the instance to another IP and then clam scan is suddenly uninstalled. Is there a good way to prevent this from happening?
Thanks.
Alex
If AWS is "moving the instance to a new IP" what is actually happening is that Elastic Beanstalk is deleting your instance and spinning up an entirely new instance. I assume you manually configured ClamAV on your EB EC2 instance via SSH, which is the wrong way to configure EB instances. You even get a warning on the screen when you SSH into the instance telling you not to make any changes to the server because they won't be persisted across EB instances.
You have to use the appropriate methods provided by Elastic Beanstalk to configure your instances so that Elastic Beanstalk knows how to configure new instances when it automatically creates them for you. The method for doing this is documented here.

Multiple elastic beanstalk environment in one ec2 instance

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...

AWS EC2 and Elastic Beanstalk

I am new to AWS and the question may seem very basic. However I need to see if I can find a solution to this.
I have created and launched an EC2 instance first and then created an Elastic Beanstalk instance with a sample application deployed on it. By default, the Elastic Beanstalk attaches "Default Environment" to this instance and I find no way to change this to my EC2 instance. How can I attach my EC2 instance (that I created earlier) to this Elastic Beanstalk instance? I am using Amazon Free Tier to learn.
Thanks a lot for your time and patience.
You cannot add an existing instance into an Elastic Beanstalk configuration.
Under the hood Elastic beanstalk uses Containers and a ton of configuration hooks, files, etc.
An instance is not the same and cannot even be guaranteed to be of matching types (perhaps the instance is CentOS and the Container runs on an ubuntu host).
It's simply not possible.