AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
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.
This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginPutProjectPolicy and EndPutProjectPolicy.
Namespace: Amazon.Rekognition
Assembly: AWSSDK.Rekognition.dll
Version: 3.x.y.z
public virtual Task<PutProjectPolicyResponse> PutProjectPolicyAsync( PutProjectPolicyRequest request, CancellationToken cancellationToken )
Container for the necessary parameters to execute the PutProjectPolicy service method.
A cancellation token that can be used by other objects or threads to receive notice of cancellation.
Exception | Condition |
---|---|
AccessDeniedException | You are not authorized to perform the action. |
InternalServerErrorException | Amazon Rekognition experienced a service issue. Try your call again. |
InvalidParameterException | Input parameter violated a constraint. Validate your parameter before calling the API operation again. |
InvalidPolicyRevisionIdException | The supplied revision id for the project policy is invalid. |
LimitExceededException | An Amazon Rekognition service limit was exceeded. For example, if you start too many jobs concurrently, subsequent calls to start operations (ex: StartLabelDetection) will raise a LimitExceededException exception (HTTP status code: 400) until the number of concurrently running jobs is below the Amazon Rekognition service limit. |
MalformedPolicyDocumentException | The format of the project policy document that you supplied to PutProjectPolicy is incorrect. |
ProvisionedThroughputExceededException | The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition. |
ResourceAlreadyExistsException | A resource with the specified ID already exists. |
ResourceNotFoundException | The resource specified in the request cannot be found. |
ServiceQuotaExceededException | The size of the collection exceeds the allowed limit. For more information, see Guidelines and quotas in Amazon Rekognition in the Amazon Rekognition Developer Guide. |
ThrottlingException | Amazon Rekognition is temporarily unable to process the request. Try your call again. |
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer