Missing AWS Dependency - amazon-web-services

i had a case where i need to configure an AWS structure similar to the architecture that is described in this article, is but this article is old, when i followed the steps i couldn't pass the step at which i run the script "vip_monitor.sh".
so be specific, at the step 5 by running the script i got the following error
Can't open /etc/profile.d/aws-apitools-common.sh
that shell script doesn't exist in the whole machine, how to solve this issue?
Thanks in advance

You will have to set api tools manually.
Ubuntu makes their own AMI's for Amazon, and they don't build the apitools into the images.
You can use official ubuntu documentation to fix these:
Install ec2 api tools
sudo apt-add-repository ppa:awstools-dev/awstools
sudo apt-get update
sudo apt-get install ec2-api-tools

actually i installed the ec2-api-tools J.Parashar instructed, and when i ran the script vip_monitor.sh it gave me the same error so i just took the missing script aws-apitools-common.sh file from an Amazon Linux instance and paste it at the path /etc/profile.d/ and then changed the mode to the script to executable chmod +x aws-apitools-common.sh and ran the script 'vip_monitor.sh'.
if you had the error :Unexpected operator run the script with bash ./vip_monitor.sh

Related

rsync command not found while rsync already installed

I'm new to AWS and pipelines in general.
I was trying to deploy a Next.js app to EC2 AWS (ubuntu) using bitbucket pipeline. However, the pipeline failed due to bash: rsync: command not found.
pipeline failed due to rsync command not found
I've googled for a few days and tried some solutions, yet none of them helped me to fix my pipeline issue. I've checked the rsync on my remote machine and it's already installed. I've also tried to re-install it a few times.
rsync is already installed on the remote machine
I've also re-checked my repository SSH keys both private (the one from .pem file) and public key (the one from my remote machine .ssh / authorized_key) so i am 100% sure there is no mistake in this part.
As for the host address, I'm using Public IPv4 address from my AWS Instance.
For the repository variables, I've checked and am sure there is nothing wrong with it as well after I compared it with the one on the pipeline file.
my bitbucket repository variables
here is my pipeline file
As for your note, I've tried using the --rsync-path=/usr/bin/rsync, but nothing changed.
I would really appreciate it if there is someone who could help me understand why this is happening and fix this issue.
I've found out that my pipeline is the one that caused the issue, i've separated get-apt updates and get-apt install -y rsync (get updates step) with deploy newest version step.
So the solution is just to merge get update step to deploy step.
- apt-get update -y # update apt
- apt-get install -y rsync # install rsync
- apt-cache search rsync # check if apt can find rsync
- rsync -avzrut --delete-delay --exclude='.git' . $SSH_USER#$SSH_HOST_DEV:$SSH_PATH

How do I permanently install an apt package in Google Cloud Shell?

I tried to install a package with apt-get cloud shell once but the next day it was gone. I saw another stackoverflow here. But it was out of date (I think). Please help.
As you can see from the link #DazWilkin has provided, the only directory where Cloud Shell persists your file is at $HOME directory. Anything installed with apt will not persist when the instance provisioned in Cloud Shell shuts down.
There's a solution for this problem. The script $HOME/.customize_environment runs everytime you boot up Cloud Shell. It is already running as root and there you can run apt to install the packages you want.
Example, as per doc:
#!/bin/sh
apt-get update
apt-get -y install erlang
Update: There seems to be an issue where .customize_environment is not working. It's been confirmed by a Google Engineer and it's currently being fixed.

Unable to install AWS SAM Cli on Mac

I am trying to install AWS SAM Cli on my Mac because I am trying to learn the AWS services. But I have installed the AWS cli successful using bundle. But when I tried to install the AWS SAM Cli as well. But it is not working. This is what I have done so far.
Run this command
pip install --user aws-sam-cli
Everything went fine.
Then I opened and edited the ~/.bash_profile. This is the content of the .bash_profile
export PATH=/Applications/MAMP/bin/php/php7.2.7/bin:$PATH
# Find your Python User Base path (where Python --user will install packages/scripts)
$ USER_BASE_PATH=$(python -m site --user-base)
# Update your preferred shell configuration
-- Standard bash --> ~/.bash_profile
-- ZSH --> ~/.zshrc
export PATH=$PATH:$USER_BASE_PATH/bin
Then I closed the terminal and run sam --version.
It is saying command not found. What is wrong with my installation?
The now recommended way to install SAM CLI is to use brew and honestly it's way better, saves you a lot of headaches, like the one you're facing now. See these instructions for details.

AWS cli installation on Mac with anaconda python

I am installing aws cli on Mac. Previously I installed anaconda to control my python versions. So I installed python using conda. Now I want to install aws cli.
By using pip:
pip3 install awscli --upgrade --user
The installation was successful. However, when I run
aws --version
It told me that aws command was not found.
I again tried to add it to the command line path. But I could not find where it was installed.
When I run
which python
It gave me
/anaconda/bin/python
People say this might not be the real folder and it is true I could not find aws cli under it either.
I then run
ls -al /anaconda/bin/python
It gives
lrwxr-xr-x 1 mac staff 9 Aug 15 20:14 /anaconda/bin/python -> python3.6
I dont understand the path at all.
How could I find where my aws cli installed?
I ran into the same issue and eventually found the awscli command in ~/.local/bin. Just add /Users/<username>/.local/bin to your $PATH.
You can do this by editing ~/.bash_profile, which probably already has these lines in it:
# added by Anaconda3 4.4.0 installer
export PATH="/Users/<username>/anaconda/bin:$PATH"
You could make another copy of this line but replace the anaconda path with the new one, but I just updated the existing path since the two are related:
# added by Anaconda3 4.4.0 installer
export PATH="/Users/<username>/.local/bin:/Users/<username>/anaconda/bin:$PATH"
I solved the problem by using conda to install awscli.
conda install -c conda-forge awscli
worked so far. It seems that pip install does not work for conda installed python... Is this conclusion true?
If it's installing and then saying "command not found" it probably just means that the executable it has installed is not referenced in the operating systems PATH environment variable.
Here is how to add the downloaded executable to PATH: https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html#awscli-install-osx-path
Here is the AWS docs to troubleshoot the issue: https://docs.aws.amazon.com/cli/latest/userguide/troubleshooting.html
I encountered an identical situation.
I solved this by adding the location of the awscli command to the file...
/etc/paths
The location to my awscli command was where others had found it...
~/.local/bin
From my home directory in Mac OS X Terminal, I entered a quick nano command to edit the /etc/paths file...
sudo nano /etc/paths
#For those who don't know...
#sudo is to get admin access
#nano is quick and dirty file editor.
# /etc/paths is the file you want to edit.
I entered my password, then I just added the awscli command location at the end of the file...
/Users/UpAndAtThem/.local/bin
Yours might be be...
/Users/your_username_here/.local/bin
Still in Nano editor to exit and save: Hit control+X > Hit Y > Hit Enter.
Here's a quick video...
https://youtu.be/htb_HTwtgmk
Good luck!

error in running `pip install aws cli`: "could not find a version that satisfies the requirement cli"

I'm on a Windows based machine using GitBash for my shell. When I run, pip install aws cli, I get the following message:
Could not find a version that satisfies the requirement cli (from versions: ) No matching distribution found for cli
I Googled the error, and many responses indicate that it's can be the result of a package that's not contained in pypi, etc. (Pip install-couldn't find a version that satisfies the requirement).
However, since I'm following the video here: http://course.fast.ai/lessons/aws.html at 4:13, and it worked for the instructor, I'm not sure what I'm missing - can someone help me understand this (including any helpful troubleshooting commands to identify the source of the issue?)
I'm new to AWS and also bash so I apologize if this is a relatively elementary question.
Thanks in advance!
-Ryan
The command should be:
pip install awscli
You need to remove the space between 'aws' and 'cli'.
Try these commands
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
then
pip install awscli