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 on get_group_id for identitystore client #3796

Closed
orsifacundo opened this issue Jul 25, 2023 · 3 comments
Closed

Error on get_group_id for identitystore client #3796

orsifacundo opened this issue Jul 25, 2023 · 3 comments
Assignees
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. identitystore response-requested Waiting on additional information or feedback.

Comments

@orsifacundo
Copy link

Describe the bug

When using the get_group_id function for the identitystore client there is no way I can make it work and always gives me a ClientError

According to the documentation the following syntax is expected:

response = client.get_group_id(
    IdentityStoreId='string',
    AlternateIdentifier={
        'ExternalId': {
            'Issuer': 'string',
            'Id': 'string'
        },
        'UniqueAttribute': {
            'AttributePath': 'string',
            'AttributeValue': {...}|[...]|123|123.4|'string'|True|None
        }
    }
)

So either UniqueAttribute or ExternalId is ti be used for AlternateIdentifier.

Expected Behavior

Obtain the GroupId:

{
'GroupId': 'string',
'IdentityStoreId': 'string'
}

Current Behavior

getting the error:

{
  "errorMessage": "An error occurred (UnknownOperationException) when calling the GetGroupId operation: ",
  "errorType": "ClientError",
  "requestId": "f3d824a4-d34c-461a-8d3f-xxxxxxxxxxx",
  "stackTrace": [
    "  File \"/var/task/index.py\", line 299, in lambda_handler\n    test()\n",
    "  File \"/var/task/index.py\", line 280, in test\n    result=client.get_group_id(\n",
    "  File \"/var/runtime/botocore/client.py\", line 530, in _api_call\n    return self._make_api_call(operation_name, kwargs)\n",
    "  File \"/var/runtime/botocore/client.py\", line 960, in _make_api_call\n    raise error_class(parsed_response, operation_name)\n"
  ]
}

Reproduction Steps

Using the following code:

    client = boto3.client('identitystore')
    
    result=client.get_group_id(
        IdentityStoreId="d-xxxxxxxxxx",
        AlternateIdentifier={
            'UniqueAttribute': {
                'AttributePath': 'displayName',
                'AttributeValue': 'GROUP_NAME'
            }
        }
        )
        
    print(result)

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.26.90

Environment details (OS name and version, etc.)

Lambda

@orsifacundo orsifacundo added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Jul 25, 2023
@orsifacundo orsifacundo changed the title (short issue description) Error on get_group_id for identitystore client Jul 25, 2023
@tim-finnigan tim-finnigan self-assigned this Jul 27, 2023
@tim-finnigan
Copy link
Contributor

Hi @orsifacundo thanks for reaching out. Please refer to this troubleshooting guide for Boto3 issues on Lambda: https://repost.aws/knowledge-center/lambda-python-runtime-errors

I can confirm that the following snippet is working on Boto3 1.28.11:

import boto3

client = boto3.client('identitystore')

result = client.get_group_id(
    IdentityStoreId="d-xxxxxxxxxxx",
    AlternateIdentifier={
        'UniqueAttribute': {
            'AttributePath': 'displayName',
            'AttributeValue': 'test-group'
        }
    }
)

Per the troubleshooting guided linked above, you may need to install a Lambda layer in order to use the latest version of Boto3. (For a list of recent versions you can refer to the CHANGELOG).

To verify your Boto3/Botocore versions you can use the following snippet:

import boto3
import botocore
print(boto3.__version__)
print(botocore.__version__)

Additionally you can adding boto3.set_stream_logger('') to your script to view your debug logs which should provide more insight into the issue. If you're still encountering this issue after following the steps above, please share those logs (with any sensitive info redacted) for us to investigate further.

@tim-finnigan tim-finnigan added response-requested Waiting on additional information or feedback. identitystore and removed bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Jul 27, 2023
@github-actions
Copy link

github-actions bot commented Aug 2, 2023

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 added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Aug 2, 2023
@orsifacundo
Copy link
Author

Hi Tim, yeah it totally worked adding a layer with the latest boto3 (1.28.18). Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. identitystore response-requested Waiting on additional information or feedback.
Projects
None yet
Development

No branches or pull requests

2 participants