Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

List all services by User created Resource Tags #29

Open
eKuG opened this issue Feb 11, 2021 · 0 comments
Open

List all services by User created Resource Tags #29

eKuG opened this issue Feb 11, 2021 · 0 comments

Comments

@eKuG
Copy link

eKuG commented Feb 11, 2021

Hey @davfaulk can you also tell me how to list all services by resource tags?
I'm getting this error:
botocore.exceptions.ClientError: An error occurred (AccessDeniedException) when calling the GetTagValues operation: User: arn:aws:sts::678258727640:assumed-role/aws-cost-explorer-report-CostExplorerReportLambdaI-129HLOI5OJI1V/CostExplorerReportLambda is not authorized to perform: tag:GetTagValuesTotal chart

Wrote this piece of code:
def getResourcetags(self): tags = {} restag = boto3.client('resourcegroupstaggingapi', region_name='ap-south-1') response = restag.get_tag_values( PaginationToken='string', Key='string' ) # while 'PaginationToken' in response and response['PaginationToken']: # token = response['PaginationToken'] # response = restag.get_resources(ResourcesPerPage=50, PaginationToken=token) for response in response_iterator: for res in response['tags']: tags[res['Values']] = res return tags

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant