pip install aws-cli in ec2 user-data
See original GitHub issueEnvironment
- pip version: 19.0.1
- Python version: 2.7
- OS: Amazon ECS-Optimized Amazon Linux AMI 2018.03.l (4.14.94-73.73.amzn1.x86_64)
Description This is my ec2 user-data
curl "https://bootstrap.pypa.io/get-pip.py" -o /tmp/get-pip.py
python /tmp/get-pip.py
/usr/local/bin/pip install awscli
/usr/local/bin/aws s3 cp s3://xxxx.xxx ...
it look good at /usr/local/bin/pip install awscli
in /var/log/cloud-init-output.log
file
but there have some problem execute aws cli. it show
Traceback (most recent call last):
File "/usr/local/bin/aws", line 27, in <module>
sys.exit(main())
File "/usr/local/bin/aws", line 23, in main
return awscli.clidriver.main()
File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 59, in main
rc = driver.main()
File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 193, in main
command_table = self._get_command_table()
File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 102, in _get_command_table
self._command_table = self._build_command_table()
File "/usr/local/lib/python2.7/site-packages/awscli/clidriver.py", line 122, in _build_command_table
command_object=self)
File "/usr/local/lib/python2.7/site-packages/botocore/session.py", line 721, in emit
return self._events.emit(event_name, **kwargs)
File "/usr/local/lib/python2.7/site-packages/botocore/hooks.py", line 227, in emit
return self._emit(event_name, kwargs)
File "/usr/local/lib/python2.7/site-packages/botocore/hooks.py", line 360, in _emit
aliased_event_name, kwargs, stop_on_response
File "/usr/local/lib/python2.7/site-packages/botocore/hooks.py", line 210, in _emit
response = handler(**kwargs)
File "/usr/local/lib/python2.7/site-packages/awscli/customizations/sms_voice.py", line 21, in hide_sms_voice
command_table['sms-voice']._UNDOCUMENTED = True
KeyError: 'sms-voice'
and I ssh to ec2 and execute /usr/local/bin/aws
got the same error.
so I try reinstall awscli sudo /usr/local/bin/pip uninstall awscli
and sudo /usr/local/bin/pip install awscli
the new location is /usr/bin/aws
and execute perfectly
Expected behavior
is should run /usr/local/bin/aws s3 cp
copy my file when execute user-data
How to Reproduce add my user-data to run a new ec2
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Unable to install AWS CLI using CloudFormation UserData in ...
AWS CLI is getting installed successfully, except it only gets installed for root user because cloud-init runs under root. From pip ...
Read more >AWS EC2 automation using AWS CLI and User-Data
In this post I will go over the installation and usage of the AWS CLI to deploy EC2 machines, also combined with AWS...
Read more >Install, Update, and Uninstall the AWS CLI version 1 on Linux
Use the pip or pip3 command to install or update the AWS CLI. We recommend that if you use Python version 3 or...
Read more >How to install aws cli on Linux - nixCraft
It is an open-source tool built on the AWS SDL for Python. As a result, you no longer need to use AWS Management...
Read more >How do I set user-data when using the AWS CLI - Server Fault
I'm trying to create a script that will automatically deploy and install an AWS EC2 instance using a bash script ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is this really a pip issue – shouldn’t this be filed with the aws cli project?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.