ec2.describe_instances returns an empty Reservations list

0

I have an ec2 instance running.
If I use the aws cli command "aws ec2 describe-instances" I get this instance.
However when I try boto3 code:

import boto3
    
ec2 = boto3.client('ec2')
response = ec2.describe_instances()
print(response)

I get an empty Reservations list.

Any idea?

Edited by: amirdolev on Apr 20, 2020 1:34 AM

feita há 4 anos1196 visualizações
1 Resposta
0

Problem was that I had a default region defined in the ~/.aws/config file. Since my running instance was in a different region, it was not identified.

respondido há 4 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas