Skip to content

list_role_associations async

list_role_associations(
    target_arn: AmazonResourceName,
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
    role_type: Optional[RoleTypeName] = None,
) -> ListRoleAssociationsResponse

Returns the role associations on Amazon Redshift Serverless with express configuration, grouped by role type. The response isn't paginated: it contains at most five role types with up to 10 principals each.

Parameters:

  • target_arn (AmazonResourceName) –

    The Amazon Resource Name (ARN) of the default endpoint. Only express-default is supported, and it must be in the same Amazon Web Services account as the caller. The ARN format is arn:aws-partition:redshift-serverless:region:account-id:workgroup/express/express-default, for example arn:aws:redshift-serverless:us-east-1:111122223333:workgroup/express/express-default.

  • role_type (Optional[RoleTypeName], default: None ) –

    The case-sensitive system-defined role to list principals for. Valid values are sys:superuser, sys:operator, sys:dba, sys:secadmin, and sys:monitor. When omitted, returns all existing role associations for the target, grouped by role type.

Raises:

Source code in docs_src/capo_redshift_serverless/_services/async_redshift_serverless.py
async def list_role_associations(
    self,
    target_arn: "capo_redshift_serverless.types.amazon_resource_name.AmazonResourceName",
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
    role_type: Optional[
        "capo_redshift_serverless.types.role_type_name.RoleTypeName"
    ] = None,
) -> "capo_redshift_serverless.types.list_role_associations_response.ListRoleAssociationsResponse":
    """<p>Returns the role associations on Amazon Redshift Serverless with express configuration, grouped by role type. The response isn't paginated: it contains at most five role types with up to 10 principals each.</p>

    Args:
        target_arn: <p>The Amazon Resource Name (ARN) of the default endpoint. Only <code>express-default</code> is supported, and it must be in the same Amazon Web Services account as the caller. The ARN format is <code>arn:aws-partition:redshift-serverless:region:account-id:workgroup/express/express-default</code>, for example <code>arn:aws:redshift-serverless:us-east-1:111122223333:workgroup/express/express-default</code>.</p>
        role_type: <p>The case-sensitive system-defined role to list principals for. Valid values are <code>sys:superuser</code>, <code>sys:operator</code>, <code>sys:dba</code>, <code>sys:secadmin</code>, and <code>sys:monitor</code>. When omitted, returns all existing role associations for the target, grouped by role type.</p>

    Raises:
        capo_redshift_serverless.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_redshift_serverless.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_redshift_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_redshift_serverless.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_redshift_serverless.errors.validation_exception.ValidationException: <p>The input failed to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_redshift_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift_serverless.types.list_role_associations_request.ListRoleAssociationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_redshift_serverless.types.list_role_associations_response.ListRoleAssociationsResponse"
    ]:
        import capo_redshift_serverless._operations.redshift_serverless.list_role_associations

        (
            output,
            http_response,
        ) = await capo_redshift_serverless._operations.redshift_serverless.list_role_associations.async_list_role_associations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRoleAssociations")
    )
    input_: capo_redshift_serverless.types.list_role_associations_request.ListRoleAssociationsRequest = {
        "target_arn": target_arn
    }
    if role_type is not None:
        input_["role_type"] = role_type

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output