Skip to content

Getting Started

Kenneth Myers edited this page Apr 26, 2023 · 4 revisions

Here are a list of steps to get you started on this project:

  1. Create a local environment (ie. conda with py=3.7) and have at least the requirements defined in requirements.txt.
conda create -n py37 python=3.7 pip
conda install -c anaconda ipykernel
python -m ipykernel install --user --name=py37
conda activate py37
pip install -r requirements.txt

First line creates the environment. Lines 2-3 add the environment as a jupyter kernel. Line 4 activates the kernel and line 5 installs the requirements.

  1. Install AWS CLI v2 which is needed in coming steps.

  2. Create an AWS account if you don't already have one.

  3. Create an IAM user through IAM, not the IAM Identity Center. I originally went through the Identity Center and it was more difficult to work with later. I use the IAM user to create access keys and secrets with scoped out permissions, such as reading and writing to S3 only. I don't believe I enabled MFA for this since this was for an application. See this page for more info direction on making credentials.

    1. After creating an IAM user and generated an access key and secret, see this page about setting environment variables. You can also directly edit ~/.aws/config as follows:
    [default]
    aws_access_key=......
    aws_secret_access_key=......

    With this method, boto3 and CLI commands should be able to able to perform actions assuming you have set the appropriate permissions.

    1. If you created a user through the Identity Center see this page for configuring your aws profile locally, aws configure sso, fill in information.
      1. Login to your profile with the profile you just created, aws sso login --profile [my-profile-name], you'll be taken to a login page where you will have to login with the user you created in step 3, the password, and MFA if you set that up.

After this you should be able to connect from the command line and boto3 using whatever permissions you placed on the user.

Clone this wiki locally