Coder Social home page Coder Social logo

aws-list-resources's People

Contributors

michael-kirchner-at avatar rychard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aws-list-resources's Issues

Thread safety

Hi,
I was looking at the code and it does not look thread safe.
Per boto3 documentation Boto3Docs the client should be initiated outside of the thred.
Unless I'm missing something, here the client is being initialized within the thread L24 making is thread unsafe.

EC2::Host

I tried this and it's very nice, thanks.

The only thing I notice is that it's not listing my EC2 hosts, even though EC2 has the List operation

Any idea?

Cannot list EC2 instance

Hi,

I just tried to use your script to discover ec2 instances, but got empty responses. I don't know if --include-resource-types is case sensitive (Is it?), so I tried both commands:

python aws_list_resources.py --regions us-east-1 --include-resource-types AWS::EC2::instance

python aws_list_resources.py --regions us-east-1 --include-resource-types AWS::EC2::Instance

The results were similar, in both commands:

{
  "_metadata": {
    "account_id": "***",
    "account_principal": "arn:aws:iam::***:user/***",
    "denied_list_operations": {
      "us-east-1": []
    },
    "invocation": "aws_list_resources.py --regions us-east-1 --include-resource-types AWS::EC2::instance",
    "run_timestamp": "20240327125325"
  },
  "regions": {
    "us-east-1": {}
  }
}

botocore.exceptions.InvalidRetryConfigurationError: Cannot provide retry configuration for "mode"

Hi,

I was just trying your script on Ubuntu 20.04, where it fails with a botocore configuration issue:

botocore.exceptions.InvalidRetryConfigurationError: Cannot provide retry configuration for "mode". 
Valid retry configuration options are: 'max_attempts'

More details:

redacteduser@redactedhost:~/redacteddir$ lsb_release -ds
Ubuntu 20.04.5 LTS

redacteduser@redactedhost:~/redacteddir$ which python3
/usr/bin/python3

redacteduser@redactedhost:~/redacteddir$ dpkg -S /usr/bin/python3
python3-minimal: /usr/bin/python3

redacteduser@redactedhost:~/redacteddir$ apt list --installed python3-minimal
Listing... Done
python3-minimal/focal,now 3.8.2-0ubuntu2 amd64 [installed,automatic]

redacteduser@redactedhost:~/redacteddir$ git log -1 | grep ^commit
commit 7a9d46c373b23a1065ae1731474da110f2dcdbf8

redacteduser@redactedhost:~/redacteddir$ /usr/bin/python3 --version
Python 3.8.10

redacteduser@redactedhost:~/redacteddir$ $ pip3 install -r requirements.txt
Requirement already satisfied: boto3 in /home/redacteduser/.local/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (1.4.7)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.10 in /home/redacteduser/.local/lib/python3.8/site-packages (from boto3->-r requirements.txt (line 1)) (0.1.13)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /home/redacteduser/.local/lib/python3.8/site-packages (from boto3->-r requirements.txt (line 1)) (0.10.0)
Requirement already satisfied: botocore<1.8.0,>=1.7.0 in /home/redacteduser/.local/lib/python3.8/site-packages (from boto3->-r requirements.txt (line 1)) (1.7.48)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/lib/python3/dist-packages (from botocore<1.8.0,>=1.7.0->boto3->-r requirements.txt (line 1)) (2.7.3)
Requirement already satisfied: docutils>=0.10 in /home/redacteduser/.local/lib/python3.8/site-packages (from botocore<1.8.0,>=1.7.0->boto3->-r requirements.txt (line 1)) (0.15.2)


redacteduser@redactedhost:~/redacteddir$ python3 ./aws_list_resources.py
Traceback (most recent call last):
  File "./aws_list_resources.py", line 12, in <module>
    boto_config = botocore.config.Config(
  File "/home/redacteduser/.local/lib/python3.8/site-packages/botocore/config.py", line 135, in __init__
    self._validate_retry_configuration(self.retries)
  File "/home/redacteduser/.local/lib/python3.8/site-packages/botocore/config.py", line 181, in _validate_retry_configuration
    raise InvalidRetryConfigurationError(
botocore.exceptions.InvalidRetryConfigurationError: Cannot provide retry configuration for "mode". Valid retry configuration options are: 'max_attempts'

redacteduser@redactedhost:~/redacteddir$ 

(Additional blank lines were added and redactions made as indicated)

Can you recommend how to solve this?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.