Christopher Lopez
Christopher Lopez

Reputation: 1

Getting DirectoryIds via boto3 client

Trying to list the SimpleAD in my vpc but keep getting this error I am so fresh to this here is the code I'm trying to run.

import boto3
client = boto3.client ('ds')
response = client.describe_directories(
    DirectoryIds=[
        'string',
    ],
    NextToken='string',
    Limit=123
)
print (response)

Here is the error: botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the DescribeDirectories operation: 1 validation error detected: Value '[string]' at 'directoryIds' failed to satisfy constraint: Member must satisfy constraint: [Member must satisfy regular expression pattern: ^d-[0-9a-f]{10}$]

I'm just starting my adventure with python and aws so all help is really appreciated.

Upvotes: 0

Views: 535

Answers (1)

Coin Graham
Coin Graham

Reputation: 1584

In your code where you have the word 'string' you should put the directory id which will be in the form "d-" followed by 10 alphanumerics. You can find this directory id in the AWS console where you've configured your workspaces' directories.

Upvotes: 0

Related Questions