put_resource_policy

RedshiftServerless.Client.put_resource_policy(**kwargs)

Creates or updates a resource policy. Currently, you can use policies to share snapshots across Amazon Web Services accounts.

See also: AWS API Documentation

Request Syntax

response = client.put_resource_policy(
    policy='string',
    resourceArn='string'
)
Parameters
  • policy (string) --

    [REQUIRED]

    The policy to create or update. For example, the following policy grants a user authorization to restore a snapshot.

    "{\"Version\": \"2012-10-17\", \"Statement\" : [{ \"Sid\": \"AllowUserRestoreFromSnapshot\", \"Principal\":{\"AWS\": [\"739247239426\"]}, \"Action\": [\"redshift-serverless:RestoreFromSnapshot\"] , \"Effect\": \"Allow\" }]}"
  • resourceArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the account to create or update a resource policy for.

Return type

dict

Returns

Response Syntax

{
    'resourcePolicy': {
        'policy': 'string',
        'resourceArn': 'string'
    }
}

Response Structure

  • (dict) --

    • resourcePolicy (dict) --

      The policy that was created or updated.

      • policy (string) --

        The resource policy.

      • resourceArn (string) --

        The Amazon Resource Name (ARN) of the policy.

Exceptions

  • RedshiftServerless.Client.exceptions.InternalServerException
  • RedshiftServerless.Client.exceptions.ResourceNotFoundException
  • RedshiftServerless.Client.exceptions.ConflictException
  • RedshiftServerless.Client.exceptions.ValidationException
  • RedshiftServerless.Client.exceptions.ServiceQuotaExceededException