putProjectPolicy

This operation applies only to Amazon Rekognition Custom Labels.

Attaches a project policy to a Amazon Rekognition Custom Labels project in a trusting AWS account. A project policy specifies that a trusted AWS account can copy a model version from a trusting AWS account to a project in the trusted AWS account. To copy a model version you use the CopyProjectVersion operation. Only applies to Custom Labels projects.

For more information about the format of a project policy document, see Attaching a project policy (SDK) in the Amazon Rekognition Custom Labels Developer Guide.

The response from PutProjectPolicy is a revision ID for the project policy. You can attach multiple project policies to a project. You can also update an existing project policy by specifying the policy revision ID of the existing policy.

To remove a project policy from a project, call DeleteProjectPolicy. To get a list of project policies attached to a project, call ListProjectPolicies.

You copy a model version by calling CopyProjectVersion.

This operation requires permissions to perform the rekognition:PutProjectPolicy action.

Samples


fun main() { 
   //sampleStart 
   // This operation attaches a project policy to a Amazon Rekognition Custom Labels project in a trusting
// AWS account.
val resp = rekognitionClient.putProjectPolicy {
    projectArn = "arn:aws:rekognition:us-east-1:111122223333:project/my-sdk-project/1656557051929"
    policyName = "SamplePolicy"
    policyRevisionId = "0123456789abcdef"
    policyDocument = "'{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"ALLOW\",\"Principal\":{\"AWS\":\"principal\"},\"Action\":\"rekognition:CopyProjectVersion\",\"Resource\":\"arn:aws:rekognition:us-east-1:123456789012:project/my-sdk-project/version/DestinationVersionName/1627045542080\"}]}'"
} 
   //sampleEnd
}