elastic-beanstalk

Elastic Beanstalk connect to RDS from shell SSH

北城余情 提交于 2019-12-02 20:55:48
I have a python application on an Elastic Beanstalk EC2 instance which is connected to an PostgreSQL RDS. My application works fine and uses the environment variables that are set by Elastic Beanstalk to connect with the database: os.environ['RDS_DB_NAME'] os.environ['RDS_USERNAME'] os.environ['RDS_PASSWORD'] os.environ['RDS_HOSTNAME'] os.environ['RDS_PORT'] However, this doesn't work when I login on the EC2 instance with SSH. The RDS environment variables are not set. Since my application works in the browser, I think it cannot be the security groups. I've also tried to access the variables

Python on the AWS Beanstalk. How to snapshot custom logs?

隐身守侯 提交于 2019-12-02 20:49:57
I'm developing python application which works on aws beanstalk environment. For error handling and debugging proposes I write logs to custom lof file on the directory /var/logs/. What should I do in order to have ability snapshot logs from Elastic beanstalk management console? Expanding on Vadim911 (and my own comment), I solved the problem using a config file in .ebextensions . Here is the python code: import logging logging.basicConfig(filename='/opt/python/log/my.log', level=logging.DEBUG) Here is the .ebextensions config file code: files: "/opt/python/log/my.log" : mode: "000666" owner:

Specific git branches for aws elastic beanstalk environments

我与影子孤独终老i 提交于 2019-12-02 19:32:48
Here is my current scenario. I am using AWS Elasticbeanstalk along with the eb cli 3.x tools for deployment. I have created 2 environments (development and production). and one branch in my git repo for each environment (i.e. master , production) I have created .ebextensions and .elasticbeanstalk folders in my git repo the .ebextensions folder has config files that are specific to each environment (e.g. setups, files changes, environment variables . . etc) I wish to work on each environment in its own git branch. My difficulty if i have to deploy to development env, it gets really simple //

AWS Elastic Beanstalk logging with python (django)

坚强是说给别人听的谎言 提交于 2019-12-02 18:13:46
How do you manage your application logs in AWS elastic beanstalk? I mean you write you application logs to which file? I'm using the following Logging configuration in my development environment but this doesn't work when I deploy in AWS. Thanks in advance! DEBUG_LOG_DIR = BASE_DIR + "/django_debug.log" LOGGING = { 'version': 1, 'disable_existing_loggers': True, # How to format the output 'formatters': { 'standard': { 'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", 'datefmt' : "%d/%b/%Y %H:%M:%S" }, }, # Log handlers (where to go) 'handlers': { 'null': { 'level':

What are the default security groups created when I set up AWS EB for the first time?

我的梦境 提交于 2019-12-02 17:39:34
I'm puzzled by the role played by several groups that seem to have been added automatically to my list of AWS security groups, connected in what I gather is the default configuration, and wonder how they work (and what about them it is safe to change). Specifically there are three that are mysterious: launch-wizard-1 which has an inbound rule SSH, TCP, 22, 0.0.0.0/0. default described as "default VPC security group" which has an inbound rule for all traffic and all ports that uses itself as a source. default_elb_... described as "ELB created security group used when no security group is

Elastic Beanstalk Single Container Docker - use awslogs logging driver

痞子三分冷 提交于 2019-12-02 17:15:33
I'm running a single Docker container on Elastic Beanstalk using its Single Container Docker Configuration , and trying to send the application stdout to CloudWatch using the awslogs logging driver . EB looks for a Dockerrun.aws.json file for the configuration of the container, but as far as I can see doesn't have an option to use awslogs as the container's logging driver (or add any other flags to the docker run command for that matter). I've tried hacking into the docker run command using the answer provided here , by adding a file .ebextensions/01-commands.config with content: commands: add

Best way to deploy play2 app using Amazon Beanstalk

倾然丶 夕夏残阳落幕 提交于 2019-12-02 16:52:17
I found fragmented instructions here and some other places about deploying Play2 app on amazon ec2. But did not find any neat way to deploy using Beanstalk. Play is a nice framework and AWS beanstalk is one of the most popular services then why is there no official instruction to do this? Has anyone found any better solution? bobc Deploying a Play2 app on elastic beanstalk is now easy with Docker Containers in combination with sbt's experimental docker feature . In build.sbt specify the exposed docker ports: dockerExposedPorts in Docker := Seq(9000) You should automate the following steps, but

Setting up Django on AWS Elastic Beanstalk: WSGIPath not found

倖福魔咒の 提交于 2019-12-02 16:39:37
I've been trying for several days now to set up Django under Amazon Web Services' Elastic Beanstalk. I think the problem I'm hitting is this one: ERROR - Your WSGIPath refers to a file that does not exist. I followed the tutorial here and all goes well until the end of Step 6, but I can't for the life of me get anything to display other than the generic Elastic Beanstalk page from Step 5, #2. When I run ./manage.py runserver on my local machine, everything works as it should, but I can't get that page to deploy. I first tried with a small Django site I wrote myself. It didn't work, so I

AWS EC2 Auto Scaling Groups: I get Min and Max, but what's Desired instances limit for?

荒凉一梦 提交于 2019-12-02 16:35:23
When you setup an Auto Scaling groups in AWS EC2 Min and Max bounds seem to make sense: The minimum number of instances to scale down to based on policies The maximum number of instances to scale up to based on policies However, I've never been able to wrap my head around what the heck Desired is intended to affect. I've always just set Desired equal to Min , because generally, I want to pay Amazon the minimum tithe possible, and unless you need an instance to handle load it should be at the Min number of instances. I know if you use ElasticBeanstalk and set a Min to 1 and Max to 2 it sets a

What is the difference between Elastic Beanstalk and CloudFormation for a .NET project?

左心房为你撑大大i 提交于 2019-12-02 15:39:18
I have developed a .NET MVC application and have started playing around with AWS and deploying it via the Visual Studio Toolkit. I have successfully deployed the application using the Elastic Beanstalk option in the toolkit. As I was going over the tutorials for deploying .NET apps to AWS with the toolkit, I noticed there are tutorials for deploying with both Elastic Beanstalk and CloudFormation . What is the difference between these two? From what I can tell, it seems like they both essentially are doing the same thing - making it easier to deploy your application to the AWS cloud (setting up