Skip to content

error running script on SA non-prod AWS account #52

@alberttwong

Description

@alberttwong

using SA non-prod AWS account.

(.env) albert.wong@HY32TKWJKC-Albert-Wong ecstats2 % vi config.ini
(.env) albert.wong@HY32TKWJKC-Albert-Wong ecstats2 % python ecstats.py -c ./config.ini
Requesting information for the production nodes
Traceback (most recent call last):
  File "/Users/albert.wong/sandbox/ecstats2/ecstats.py", line 557, in <module>
    main()
    ~~~~^^
  File "/Users/albert.wong/sandbox/ecstats2/ecstats.py", line 553, in main
    process_aws_account(config, section, options.outDir)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/albert.wong/sandbox/ecstats2/ecstats.py", line 501, in process_aws_account
    clusters_info = get_clusters_info(session)
  File "/Users/albert.wong/sandbox/ecstats2/ecstats.py", line 247, in get_clusters_info
    for page in page_iterator:
                ^^^^^^^^^^^^^
  File "/Users/albert.wong/sandbox/ecstats2/.env/lib/python3.14/site-packages/botocore/paginate.py", line 272, in __iter__
    response = self._make_request(current_kwargs)
  File "/Users/albert.wong/sandbox/ecstats2/.env/lib/python3.14/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
  File "/Users/albert.wong/sandbox/ecstats2/.env/lib/python3.14/site-packages/botocore/paginate.py", line 360, in _make_request
    return self._method(**current_kwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/albert.wong/sandbox/ecstats2/.env/lib/python3.14/site-packages/botocore/client.py", line 602, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/albert.wong/sandbox/ecstats2/.env/lib/python3.14/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
  File "/Users/albert.wong/sandbox/ecstats2/.env/lib/python3.14/site-packages/botocore/client.py", line 1078, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId) when calling the DescribeCacheClusters operation: The security token included in the request is invalid.
(.env) albert.wong@HY32TKWJKC-Albert-Wong ecstats2 % aws sts get-caller-identity
{
    "UserId": "AROA2WPTQASDK5BBH2LJ5:albert.wong@redis.com",
    "Account": "735486936198",
    "Arn": "arn:aws:sts::735486936198:assumed-role/AWSReservedSSO_PowerUserAccess_735486936198_36b38f51f0cc8161/albert.wong@redis.com"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions