miércoles, 7 de agosto de 2024

Install awscli with MacPorts on MacOS BigSur

Install the MacPorts package from the website

https://www.macports.org/install.php


For some ports, your system might require installations of Xcode

xcode-select --install

xcode-select: note: install requested for command line developer tools


xcodebuild -license

xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.



Then go to the terminal and run:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH

Install aws cli:
sudo port install py-awscli


After you install it, you have these notes:
py312-awscli has the following notes:

To make the Python 3.12 version of AWS CLI the one that is run when you execute the commands without a version suffix, e.g. 'aws', run:
port select --set awscli py312-awscli

---

If you use a plugin in your ~/.aws/config, it must be installed. For example, Wasabi for S3 uses the awscli_plugin_endpoint plugin. Just install it:
port install py312-awscli-plugin-endpoint

If your plugin is not in MacPorts, you can install it using the
py312-pip port, for example:
pip-3.12 install --user <plugin-name>
py312-docutils has the following notes:

To make the Python 3.12 version of docutils the one that is run when you execute the commands without a version suffix, e.g. 'rst2man', run:
port select --set docutils py312-docutils
python312 has the following notes:

To make this the default Python or Python 3 (i.e., the version run by the 'python' or 'python3' commands), run one or both of:
sudo port select --set python python312
sudo port select --set python3 python312

-----

Exeute these commands
sudo port select --set awscli py312-awscli

Check your environment variables
env | grep PATH
sudo sh -c "echo "/opt/local/bin" > /etc/paths.d/mac-ports"
sudo sed -i '' -e $'1i\\\n/opt/local/bin' /etc/paths
sudo sed -i '' -e $'2i\\\n/opt/local/sbin' /etc/paths
sudo bash -c "echo 'MANPATH=/opt/local/share/man:\$MANPATH' > /etc/manpaths.d/mac-ports"

Create the Key in AWS IAM. After that you will have the access key id and the secret access key. Configure your key with a profile using the awscli. You can omit the profile.

aws configure --profile yourprofile        

AWS Access Key ID [****************111]: 

AWS Secret Access Key [****************1111]: 

Default region name [None]: us-east-1

Default output format [None]: 



Test the awscli
aws --profile yourprofile ec2 describe-vpcs

No hay comentarios:

Publicar un comentario