Trouble installing AWS Elastic Beanstalk Command Line tool packages - amazon-web-services

I'm having trouble installing AWS Elastic Beanstalk command line tool and I don't understand why. I've downloaded the package from AWS and followed the instruction carefully. Following is the installation instruction:
== Installation
Once you have downloaded the CLI package:
1) Unzip this archive to a location of your choosing.
Eb is located in the "eb" directory. The complete CLI reference
for more advanced scenarios can be found in the "api" directory.
To add eb files to your path:
Linux/Mac OS X (Bash shell):
export PATH=$PATH:<path to eb>
Windows:
set PATH=<path to eb>;%PATH%
I'm using Mac OS X so I've used export PATH=$PATH:. For the path to eb, I've just copied the file into the terminal, which resulted export PATH=$PATH:/Users/lydia/Downloads/ElasticBeanstalk/eb/macosx/python2.7/eb. I'm not sure what I'm missing and I can't deploy without downloading eb command line first.

Remove the eb at the end so it's just
/Users/lydia/Downloads/ElasticBeanstalk/eb/macosx/python2.7/
this worked for me although i can only get it to work if i export the CLI into the specific website folder i am working on see my question here https://askubuntu.com/questions/428417/aws-elastic-beanstalk-command-line-tool-setup

Fix that worked for me (if you installed python using brew) is remove python via
brew uninstall --force python
and then install it again from https://www.python.org/downloads/.
Then just follow the instructions from AWS.

You only add directories to your $PATH. Is ~/Downloads/ElasticBeanstalk/eb/macosx/python2.7/eb a directory? Or is it the actual command?

Related

How to fix Error: pg_config executable not found on Elastic Beanstalk permanently

I have a Django project that works with PostgreSQL on Elastic Beanstalk.
I have found the next error when deploying:
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source.
Please add the directory containing pg_config to the $PATH or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
I followed psycopg2 on elastic beanstalk - can't deploy app to solve it and it worked! BUT after a while Amazon seems to update my virtual env and the error returns so I have to go back and do the same stuff over and over again.
I also have tried configuring the database instance directly from the Elastic Beanstalk panel but nothing changes.
The database is on RDS and I think it's important to say that when I manually install psycopg2 on my instance and re-deploy everything works fine, I even have made a couple of deploys after that and the problems is not there but it is after a while.
I really want to know how to solve it once for all. Thanks in advance.
It is trying to do is build the postgres drivers from source.
You can deal with this several different ways. For example, you can choose to install the drivers from a binary package instead of building them from source.
in your requirements.txt, replace
psycopg2==2.8.5
with
psycopg2-binary==2.8.5
If, you do insist on building it from source when you deploy to Beanstalk, you will need to use platform hooks to pre-install the dependencies that are needed to compile it. The AL2 instances are pretty bare-bone, so you will need to do roughly the following:
add directory structure .platform/hooks/prebuild
in prebuild, create a script, something like '10_install_dependencies.sh'
at the top of the script you will need #!/usr/bin/sh
Use this script to add needed dependencies. For example, for the posgres development libs you will want
sudo yum install -y <yum-packahe-that-you-need>
You may also end up having to install other development libs needed to build psycopg...

command not found when trying to deploy to AWS Elastic Beanstack

When trying to set up AWS Elastic Beanstack for my Django project following this tutorial:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html
once I get to running
eb create django-env
I get this error:
warning: CRLF will be replaced by LF in .gitignore.
The file will have its original line endings in your working directory.
Creating application version archive "app-2f30-181013_230403".
ERROR: CommandError - An error occurred while handling git command.
Error code: 1 Error: C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: basename: command not found
C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 7: sed: command not found
C:\Program Files\Git\mingw64/libexec/git-core\git-submodule: line 18: .: git-sh-setup: file not found
Any ideas what the issue is here? is AWS Elastic Beanstack unusable from Windows?
You have a Windows path and program compatibility problem.
The EB CLI works just fine on Windows. I use it almost everyday on many corporate systems for different customers. This assumes that everything is installed and setup correctly.
1) Make sure that you have installed the Windows native version of Git. Install from this location:
Downlading Git
2) Make sure that the Windows native version of Git is before Mingw in your Windows search path. Otherwise the wrong program will be loaded and then all the Mingw environment and dependencies will mess everything up.
3) Make sure that the latest version of EB CLI is installed (do this last). Follow these steps to repair your current installation. Depending on what you have setup, just installing EB CLI may be enough.
Install Python, pip, and the EB CLI on Windows

can't add flasfka package path in Mac

I need to use Kafka with flask-socketIO for a project. So I decided to use flasfka app that does push/pull to Kafka through http.
Following the instruction, I added FLASFKA_CONFIG path in environment
export FLASFKA_CONFIG=/etc/flasfka.conf.py
But when I run flasfka-serve to start flasfka, I get error
flasfka-serve: command not found
I even added the above export command in my .bash_profile file and restarted the terminal but I am still getting the error.
Looks like the documentation is WRONG.
It says
pip install kafka
instead it should be
pip install flasfka

How do I access the AWS PHP SDK on EC2?

I have gotten to know that the AWS SDK comes with the default operating system installed on AWS EC2 when provisioned via Elastic Beanstalk.
I would like to know if I can access the PHP version of the SDK.
Or does it need to be installed separately.
Thank you.
You have to Install it using phar or composer , Please Refer AWS Documentation for this:
To use Composer with the AWS SDK for PHP:
Open a terminal window and navigate to the directory where your
project is stored. Composer is installed on a per-project basis.
Download and install Composer in your project directory. If you have
curl installed, you can use the following command:
curl -sS https://getcomposer.org/installer | php
Create a file at the root level of your project called composer.json
and add the following dependency for the AWS PHP SDK:
{
"require": {
"aws/aws-sdk-php": "2.*"
}
}
Install the dependencies by running Composer's install command:
php composer.phar install
This will create a vendor directory in your project with the required libraries and an autoloader script used to load them for your project.
Require Composer's autoloader by adding the following line to your
code's bootstrap process (typically in index.php):
require '/path/to/sdk/vendor/autoload.php';
Your code is now ready to use the AWS SDK for PHP!

AWS CLI not working on Mac OSX Yosemite: "-bash: aws: command not found"

I've successfully downloaded the AWS CLI using PIP onto Mac OSX Yosemite. I'm running Python version 2.7.
I can see the AWS executable in /Library/Frameworks/Python.framework/Versions/2.7/bin.
But when I try to run
aws help
in my Terminal to test that the AWS CLI works, I get
-bash: aws: command not found
Why isn't this working?
/Library/Frameworks/Python.framework/Versions/2.7/bin will need to be in your path. In your ~/.profile file (create one if necessary) add a line like:
export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH"
Open a new Terminal window and it should work.