put_repository_permissions_policy

put_repository_permissions_policy(**kwargs)

Sets the resource policy on a repository that specifies permissions to access it.

When you call PutRepositoryPermissionsPolicy , the resource policy on the repository is ignored when evaluting permissions. This ensures that the owner of a repository cannot lock themselves out of the repository, which would prevent them from being able to update the resource policy.

See also: AWS API Documentation

Request Syntax

response = client.put_repository_permissions_policy(
    domain='string',
    domainOwner='string',
    repository='string',
    policyRevision='string',
    policyDocument='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain containing the repository to set the resource policy on.

  • domainOwner (string) -- The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository to set the resource policy on.

  • policyRevision (string) -- Sets the revision of the resource policy that specifies permissions to access the repository. This revision is used for optimistic locking, which prevents others from overwriting your changes to the repository's resource policy.
  • policyDocument (string) --

    [REQUIRED]

    A valid displayable JSON Aspen policy string to be set as the access control resource policy on the provided repository.

Return type

dict

Returns

Response Syntax

{
    'policy': {
        'resourceArn': 'string',
        'revision': 'string',
        'document': 'string'
    }
}

Response Structure

  • (dict) --

    • policy (dict) --

      The resource policy that was set after processing the request.

      • resourceArn (string) --

        The ARN of the resource associated with the resource policy

      • revision (string) --

        The current revision of the resource policy.

      • document (string) --

        The resource policy formatted in JSON.

Exceptions

  • CodeArtifact.Client.exceptions.AccessDeniedException
  • CodeArtifact.Client.exceptions.ConflictException
  • CodeArtifact.Client.exceptions.InternalServerException
  • CodeArtifact.Client.exceptions.ResourceNotFoundException
  • CodeArtifact.Client.exceptions.ServiceQuotaExceededException
  • CodeArtifact.Client.exceptions.ThrottlingException
  • CodeArtifact.Client.exceptions.ValidationException