(RESOLVED) AWS CloudShell not accepting ARN for Comprehend Document Classifier?

149 Views Asked by At

I'm configuring a project through CloudShell where I am using it to design an AWS Comprehend Classifier for a college final project. I'm using this guide to be precise. The step that I'm having trouble on is training the Comprehend Document Classifier. I have to list the ARN within the Bucket Access Policy to identify the correct IAM role for training the Classifier and I keep getting this error code when running the following command:

[cloudshell-user@ip-[REDACTED] aws-comprehend]$ aws comprehend create-document-classifier --document-classifier-name FinancialServices --data-access-role-arn arn:aws:iam::[ARN REDACTED]2:policy/BucketAccessPolicy --input-data-config S3Uri=s3://[bucket name]-mailbucket --language-code en

An error occurred (ValidationException) when calling the CreateDocumentClassifier operation: 1 validation error detected: Value 'arn:aws:iam::[ARN REDACTED]:policy/BucketAccessPolicy' at 'dataAccessRoleArn' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+

This issue isn't unreported about but the application and the reason for the Regex error across AWS platforms is sporadic at best. I tried omitting the beginning of the ARN (arn:aws:iam::[REDACTED]:policy/) to no avail, I tried changing the length of the Policy Name as it was not being accepted at the 20 character minimum to no dice, I tried putting quotations around the ARN and that didn't work, and I'm not sure what else to try.

Any help would be greatly appreciated; I'm new to AWS Comprehend and I just don't known what I'm doing wrong. Thanks!

Edit: I didn't realize I was supposed to use my EmailClassifier role ARN instead of the Policy ARN. We are good to go.

0

There are 0 best solutions below