CmdID / aws / aws comprehend
aws comprehend put-resource-policy
Attaches a resource-based policy to a custom model. AWS CLI reference
1 example 3 options Its page in the AWS CLI reference
Examples
To attach a resource-based policy
The following put-resource-policy example attaches a resource-based policy to a model so that can be imported by another AWS account. The policy is attached to the model in account 123456789111 and allows account 123456789222 import the model.
aws comprehend put-resource-policy --resource-arn arn:aws:comprehend:us-west-2:123456789111:document-classifier/example-classifier/version/1 --resource-policy '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"comprehend:ImportModel","Resource":"*","Principal":{"AWS":["arn:aws:iam::123456789222:root"]}}]}'Identify--resource-arnThe Amazon Resource Name (ARN) of the custom model to attach the policy to.--resource-policyThe JSON resource-based policy to attach to your custom model.Its output
{
"PolicyRevisionId": "aaa111d069d07afaa2aa3106aEXAMPLE"
}For more information, see Copying custom models between AWS accounts in the Amazon Comprehend Developer Guide.
Options
--policy-revision-idThe revision ID that Amazon Comprehend assigned to the policy that you are updating.--resource-arnThe Amazon Resource Name (ARN) of the custom model to attach the policy to.--resource-policyThe JSON resource-based policy to attach to your custom model.