How Do You Troubleshoot the Error “Could not find suitable distribution for Requirement.parse(‘botocore==2.0.0dev11’)”?

Problem scenario
You try to install the AWS CLI version 2.x

You run this command:

$ sudo python3 setup.py install

You get a message like this:

Processing dependencies for awscli==2.0.7
Searching for botocore==2.0.0dev11
Reading https://pypi.org/simple/botocore/
No local packages or working download links found for botocore==2.0.0dev11
error: Could not find suitable distribution for Requirement.parse(‘botocore==2.0.0dev11’)

What should you do?

How Do You Install Django on a CentOS/RHEL/Fedora server?

Problem scenario
You want to install Django and have it working for browsing from a desktop workstation. You do not want to leverage Django’s API functionality. How do you install and configure Django from scratch?

Prerequisite
pip3 is probably installed. If you are not sure, you could run this: sudo find / -name pip3

You must have pip or pip3 installed.

How Do You Troubleshoot “error occurred (AccessDeniedException) when calling the CreateCluster operation: User: … is not authorized to perform: iam:PassRole on resource:…”?

Problem scenario
You run this command:

aws eks create-cluster –name contint –role-arn arn:aws:iam::12345678910:role/contintrole –resources-vpc-config subnetIds=subnet-a123456,subnet-b77777777,securityGroupIds=sg-2e324234254

You get this error:

An error occurred (AccessDeniedException) when calling the CreateCluster operation: User: arn:aws:iam::12345678910:user/contintuser is not authorized to perform: iam:PassRole on resource: arn:aws:iam::12345678910:role/contintrole

What should you do?

Solution
1. Log into the AWS Console.
2. Go to IAM -Users
3.

How Do You Troubleshoot the AWS CLI Message “An error occurred (AccessDeniedException) when calling the ListClusters operation”?

Problem scenario
You run this command aws eks list-clusters, but you get this message:

“An error occurred (AccessDeniedException) when calling the ListClusters operation: User: arn:aws:iam::12345678910:user/jdoe is not authorized to perform: eks:ListClusters on resource: arn:aws:eks:us-west-1:12345678910:cluster/*”

What should you do?

Solution
1. Go to the AWS Console and log in.
2. Go to IAM -> Users
3.

How Do You Troubleshoot the EKS Error “AccessDeniedException…Clusters operation: Account …is not authorized to use this service”?

Problem scenario
In one region, but not another, you get this error with an “aws eks list-clusters” command:

“An error occurred (AccessDeniedException) when calling the ListClusters operation: Account 12345678910 is not authorized to use this service”

You know that IAM does not require region selection. What is causing this eks error?

Solution
Is your AWS CLI configured to use a region that eks does not support?

How Do You Troubleshoot the Python Error “json.decoder.JSONDecode..”Expecting property name enclosed in double quotes…”?

Problem scenario
You are running a Python program that uses “import json”. You get this error: “json.decoder.JSONDecode..”Expecting property name enclosed in double quotes…” You are not allowed to use bson, but you can use other Python packages. What should you do?

Solution
This solution only works if you can eliminate single quotes in the content to be serialized (or translated into JSON).

How Do You Copy a File into an S3 Bucket using the AWS CLI?

Problem scenario
How do you copy a file from a Linux server with AWS CLI to an S3 bucket?

Solution
Draft a command like this but replace /tmp/good.txt with the path and name of the source file you are copying, and replace “foobar” with the name of the s3 bucket you are copying to (as the destination):

aws s3 cp /tmp/good.txt s3://foobar/

Run the command.