CodeArtifact / Client / put_domain_permissions_policy

put_domain_permissions_policy#

CodeArtifact.Client.put_domain_permissions_policy(**kwargs)#

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

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

See also: AWS API Documentation

Request Syntax

response = client.put_domain_permissions_policy(
    domain='string',
    domainOwner='string',
    policyRevision='string',
    policyDocument='string'
)
Parameters:
  • domain (string) –

    [REQUIRED]

    The name of the domain on which to set the resource policy.

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

  • policyRevision (string) – The current revision of the resource policy to be set. This revision is used for optimistic locking, which prevents others from overwriting your changes to the domain’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 domain.

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