Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: 'ResourceExplorer' object has no attribute 'list_resources' #4430

Closed
1 task
fortysev-en opened this issue Feb 9, 2025 · 3 comments
Closed
1 task
Assignees
Labels
bug This issue is a confirmed bug. p3 This is a minor priority issue resource-explorer-2 response-requested Waiting on additional information or feedback.

Comments

@fortysev-en
Copy link

fortysev-en commented Feb 9, 2025

Describe the bug

I'm trying to retrieve resources via the new resource-explorer-2 but none of the methods working. Tried search and list_resources, both have issues with them.

I've an AWSAdministratorAccess role, yet the search gives me unauthorized access error.
While, the list_resources isn't available as well.

I've tried adding below roles to my IAM user and yet the same error.
AWSResourceExplorerFullAccess
AWSResourceExplorerOrganizationsAccess
AWSResourceExplorerReadOnlyAccess

Please let me know how I can get all the resources of any AWS account. I want this to be Global, without specifying the service.

The code:

    client = session.client('resource-explorer-2')
    response = client.list_supported_resource_types()
    for r_type in response['ResourceTypes']:
        query_response = client.list_resources(
                Filters={
                    'FilterString': r_type['ResourceType']
                },
        )

        print(query_response)

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

The list_resources method should return a list of all the resources available.

Current Behavior

Getting invalid authorization error and module not available.

Reproduction Steps

client = session.client('resource-explorer-2')
query_response = client.list_resources(Filters={'FilterString': '*'},)

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.28.26

Environment details (OS name and version, etc.)

Windows 11

@fortysev-en fortysev-en added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Feb 9, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Feb 10, 2025
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @fortysev-en, thanks for reaching out. Could you update to a more recent version of Boto3? According to the changelog, ListResources was made available in 1.35.25.

Regarding the Unauthorized errors, you might need to specify a ViewArn or create a view if you haven't done so.

ViewArn (string) – Specifies the Amazon resource name (ARN) of the view to use for the query. If you don’t specify a value for this parameter, then the operation automatically uses the default view for the Amazon Web Services Region in which you called this operation. If the Region either doesn’t have a default view or if you don’t have permission to use the default view, then the operation fails with a 401 Unauthorized exception.

Please let me know if you have any follow-up questions.

@RyanFitzSimmonsAK RyanFitzSimmonsAK added resource-explorer-2 response-requested Waiting on additional information or feedback. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2025
Copy link

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot removed the response-requested Waiting on additional information or feedback. label Feb 22, 2025
@RyanFitzSimmonsAK RyanFitzSimmonsAK added the response-requested Waiting on additional information or feedback. label Feb 24, 2025
Copy link

github-actions bot commented Mar 6, 2025

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. p3 This is a minor priority issue resource-explorer-2 response-requested Waiting on additional information or feedback.
Projects
None yet
Development

No branches or pull requests

2 participants