mardi 6 janvier 2015

AWS Django EB Deployment Config File

First of all, I was not able to install EB 3.X tools, I had SSL_Socket issues which I was not able to resolve after two days, therefore I went with an older version:



eb --version
AWS Elastic Beanstalk Command Line Interface v2.6.4


Anyhow, I have setup my Elastic Beanstalk environment and followed the tutorial online, however with my own little Django app.


I would like to deploy my application to my EB with my RDS Database, which I created via the AWS console in the browser.


This is what happens:



[bs@debian-gohan:]~/htdocs/vhosts/prepage $ git aws.push
Updating the AWS Elastic Beanstalk environment prepage-env...
Environment update initiated successfully.


However, the console dashboard shows me an error:



The configuration file .ebextensions/.config in application version git-c4223692a920aeae2cbe7403b618971f1bfcc61a-1420581186610 contains invalid YAML or JSON. YAML exception: while parsing a block collection in "<reader>", line 7, column 5: - namespace: aws:elasticbeanstal ... ^ expected <block end>, but found Key in "<reader>", line 8, column 5: option_name: WSGIPath ^ , JSON exception: Unexpected character (c) at position 0.. Update the configuration file.


In addition to:



[bs@debian-gohan:]~/htdocs/vhosts/prepage $ eb update
If you udpate your environment, your RDS DB Instance will be deleted and you will lose your data.
Update environment? [y/n]: y
warning: Namespace "aws:rds:dbinstance", Option name "DBUser"
Changes to option DBUser settings will not take effect immediately. Your RDS instance will be replaced and your new settings will take effect then.
error: Namespace "aws:rds:dbinstance", Option name "DBPassword"
Missing value for required parameter: AWSEBDBPassword


My config file looks like this:



container_commands:
01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true

option_settings:
- namespace: aws:elasticbeanstalk:container:python
option_name: WSGIPath
value: prepage/wsgi.py
- option_name: DJANGO_SETTINGS_MODULE
value: prepage.settings
- option_name: DBUser
value: username
- option_name: DBPassword
value: pass


If I do a status:



[bs@debian-gohan:]~/htdocs/vhosts/prepage $ eb status --verbose
Retrieving status of environment "prepage-env".
URL : <HIDDEN-ID>.elasticbeanstalk.com
Status : Ready
Health : Green
Environment Name: prepage-env
Environment ID : <HIDDEN ID>
Environment Tier: WebServer::Standard::1.0
Solution Stack : 64bit Amazon Linux 2014.09 v1.0.9 running Python 2.7
Version Label : Sample Application
Date Created : 2015-01-05 23:52:19
Date Updated : 2015-01-06 21:13:01
Description :
InvalidParameterValue. Access Denied to API Version: API20120423


I am not sure what the problem is, does it start with the fact, that I am using an older version of the eb tools ?





Aucun commentaire:

Enregistrer un commentaire