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

Fails to list ResourceExplorer2Index resource #469

Open
benriou opened this issue Dec 20, 2024 · 1 comment
Open

Fails to list ResourceExplorer2Index resource #469

benriou opened this issue Dec 20, 2024 · 1 comment
Labels
area/resource bug Something isn't working

Comments

@benriou
Copy link

benriou commented Dec 20, 2024

aws-nuke is returning indexes on resource-explorer-2

TRAC[0032] sending AWS request:
    > POST /ListIndexes HTTP/1.1
    > Host: resource-explorer-2.us-west-2.amazonaws.com
    > Authorization: <hidden>
    > Content-Length: 2
    > Content-Type: application/json
    > User-Agent: aws-sdk-go/1.54.20 (go1.21.13; darwin; arm64)
    > X-Amz-Date: 20241220T101013Z
    > X-Amz-Security-Token: <hidden>
    > 

........

TRAC[0032] received AWS response:
    < HTTP/2.0 200 OK
    < Content-Length: 159
    < Content-Type: application/json
    < Date: Fri, 20 Dec 2024 10:10:14 GMT
    < X-Amz-Apigw-Id: DFdVCHK0PHcEfjQ=
    < X-Amzn-Remapped-Content-Length: 159
    < X-Amzn-Remapped-Date: Fri, 20 Dec 2024 10:10:14 GMT
    < X-Amzn-Remapped-X-Amzn-Requestid: 456cd57a-2b08-482c-b3dc-32bd87ebd316
    < X-Amzn-Requestid: 7caca70a-f389-4519-8f86-e86082445f57
    < 
    < {"Indexes":[{"Arn":"arn:aws:resource-explorer-2:eu-central-1:660565237447:index/02724b64-1336-4088-93d4-d3465eae3a50","Region":"eu-central-1","Type":"LOCAL"}]}

and try to delete them

TRAC[0061] match: false component=libnuke handler=Filter type=ResourceExplorer2Index TRAC[0061] filter details component=libnuke handler=Filter prop= type=contains value=circleci TRAC[0061] property: arn:aws:resource-explorer-2:eu-central-1:xxxxxxxxxxx:index/02724b64-1336-4088-93d4-d3465eae3a50 component=libnuke handler=Filter type=ResourceExplorer2Index

Then attempts a deletion as shown :

We can clearely see a difference between the region and the region on the ARN resource.

us-east-2 - ResourceExplorer2Index - arn:aws:resource-explorer-2:eu-central-1:xxxxxxxxxxx:index/02724b64-1336-4088-93d4-d3465eae3a50 - would remove

We can clearely see a difference between the region and the region on the ARN resource.

But retrieve an error, because he mixes up the AWS regions (that should be EU-CENTRAL-1 instead of US-EAST-2).

TRAC[0166] sending AWS request:
    > POST /DeleteIndex HTTP/1.1
    > Host: resource-explorer-2.us-east-2.amazonaws.com
    > Authorization: <hidden>
    > Content-Length: 106
    > Content-Type: application/json
    > User-Agent: aws-sdk-go/1.54.20 (go1.21.13; darwin; arm64)
    > X-Amz-Date: 20241220T095416Z
    > X-Amz-Security-Token: <hidden>
    > 
    > {"Arn":"arn:aws:resource-explorer-2:eu-central-1:xxxxxxxxx:index/02724b64-1336-4088-93d4-d3465eae3a50"} 
TRAC[0167] received AWS response:
    < HTTP/2.0 404 Not Found
    < Content-Length: 71
    < Content-Type: application/json
    < Date: Fri, 20 Dec 2024 09:54:16 GMT
    < X-Amz-Apigw-Id: DFa_VGyEiYcEYcg=
    < X-Amzn-Errortype: ResourceNotFoundException
    < X-Amzn-Remapped-Content-Length: 71
    < X-Amzn-Remapped-Date: Fri, 20 Dec 2024 09:54:15 GMT
    < X-Amzn-Remapped-X-Amzn-Requestid: 0c9a6130-9bfb-4658-a9ae-a9ca02a7855d
    < X-Amzn-Requestid: 631fcb97-9a84-42d3-8e36-db218b76fa71
    < 
    < {"Message":"No index creation history found for account: xxxxxxxxxxxx"} 
TRAC[0167] sending AWS request:
    > POST /ListIndexes HTTP/1.1
    > Host: resource-explorer-2.us-east-2.amazonaws.com
    > Authorization: <hidden>
    > Content-Length: 2
    > Content-Type: application/json
    > User-Agent: aws-sdk-go/1.54.20 (go1.21.13; darwin; arm64)
    > X-Amz-Date: 20241220T095416Z
    > X-Amz-Security-Token: <hidden>
    > 
    > {} 
TRAC[0167] received AWS response:
    < HTTP/2.0 200 OK
    < Content-Length: 159
    < Content-Type: application/json
    < Date: Fri, 20 Dec 2024 09:54:16 GMT
    < X-Amz-Apigw-Id: DFa_YGc7iYcEXDA=
    < X-Amzn-Remapped-Content-Length: 159
    < X-Amzn-Remapped-Date: Fri, 20 Dec 2024 09:54:16 GMT
    < X-Amzn-Remapped-X-Amzn-Requestid: 4707ec1a-ca58-450f-84ce-73cd69a58ac1
    < X-Amzn-Requestid: f5101f22-bde9-4e09-9d5a-58eb4941f4ba
    < 
    < {"Indexes":[{"Arn":"arn:aws:resource-explorer-2:eu-central-1:xxxxxxxxxxx:index/02724b64-1336-4088-93d4-d3465eae3a50","Region":"eu-central-1","Type":"LOCAL"}]} 
us-east-2 - ResourceExplorer2Index - arn:aws:resource-explorer-2:eu-central-1:xxxxxxxxxxx:index/02724b64-1336-4088-93d4-d3465eae3a50 - failed

The possible mismatch between eu-central-1 and us-east-2 is maybe the cause of issue

I don't understand why the API located in us-east-2 returns an index arn located in eu-central-1

https://docs.aws.amazon.com/general/latest/gr/arex.html

resource-explorer-2.eu-central-1.amazonaws.com


@ekristen
Copy link
Owner

Looks like the regional endpoints return all regions for indexes, so we'll need to do an additional filter. Marking this as a bug.

@ekristen ekristen added bug Something isn't working area/resource labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resource bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants