I am using boto3's interface for AWS Comprehend for sentiment analysis.
I have an issue with the 'DataAccessRoleArn' parameter. What kind of value is inserted in this? I am requesting for the format of it or some sample.
I am using boto3's interface for AWS Comprehend for sentiment analysis.
I have an issue with the 'DataAccessRoleArn' parameter. What kind of value is inserted in this? I am requesting for the format of it or some sample.
I'm answering to provide a more complete reference.
From the boto3 docs on Comprehend, the DataAccessRoleArn
is a string described as:
DataAccessRoleArn (string) --
[REQUIRED]The Amazon Resource Name (ARN) of the AWS Identity and Management (IAM) role that grants Amazon Comprehend read access to your input data.
From the AWS IAM ARNs reference, ARNs are of the form:
arn:partition:service:region:account:resource
For IAM roles, this usually are of the form:
arn:aws:iam::123456789012:role/<role name>
where `region` is left blank for IAM resources
and `123456789012` is the AWS account ID
To get your ARN, you can simply login to your IAM console, and open the page of the role that includes the Comprehend policy. Here's a screenshot (taken from the AWS docs):
Or, if you are using AWS CLI, you can also use the get-role command to get information about an IAM role (including the ARN):
$ aws iam get-role --role-name Test-Role
{
"Role": {
"Description": "Test Role",
...
"Arn": "arn:aws:iam::123456789012:role/Test-Role"
}
}
For DataAccessRoleArn you should add the arn of iam role you want to assign. You can find the arn in IAM page inside roles and after selecting the role you will find the role arn.
The format of the role arn is:
arn:aws:iam::<account_number>:role/<role_name>
Adding to above answer yes it requires ARN of the IAM role that grants Amazon Comprehend read access to your input data.
But the ARN should be in below format with account number and which is not an unique id:
arn:aws:iam::<account number>:role/<role_name>