Skip to content

delete_role_association async

delete_role_association(
    target_arn: AmazonResourceName,
    role_type: RoleTypeName,
    principal: PrincipalInput,
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
) -> DeleteRoleAssociationResponse

Removes the association, if it exists, between an IAM principal and an Amazon Redshift system-defined role on Amazon Redshift Serverless with express configuration. This operation is idempotent. If the association doesn't exist, the request still succeeds.

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 (RoleTypeName) –

    The case-sensitive system-defined role to remove the principal from. Valid values are sys:superuser, sys:operator, sys:dba, sys:secadmin, and sys:monitor.

  • principal (PrincipalInput) –

    The IAM role or IAM user to remove from the role type. Specify the ARN used to create the association. The IAM principal doesn't need to exist when you delete the association.

Raises:

Source code in docs_src/capo_redshift_serverless/_services/async_redshift_serverless.py
async def delete_role_association(
    self,
    target_arn: "capo_redshift_serverless.types.amazon_resource_name.AmazonResourceName",
    role_type: "capo_redshift_serverless.types.role_type_name.RoleTypeName",
    principal: "capo_redshift_serverless.types.principal_input.PrincipalInput",
    *,
    config_overrides: Optional[AsyncRedshiftServerlessClientConfig] = None,
) -> "capo_redshift_serverless.types.delete_role_association_response.DeleteRoleAssociationResponse":
    """<p>Removes the association, if it exists, between an IAM principal and an Amazon Redshift system-defined role on Amazon Redshift Serverless with express configuration. This operation is idempotent. If the association doesn't exist, the request still succeeds.</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 remove the principal from. Valid values are <code>sys:superuser</code>, <code>sys:operator</code>, <code>sys:dba</code>, <code>sys:secadmin</code>, and <code>sys:monitor</code>.</p>
        principal: <p>The IAM role or IAM user to remove from the role type. Specify the ARN used to create the association. The IAM principal doesn't need to exist when you delete the association.</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.delete_role_association_request.DeleteRoleAssociationRequest]",
    ) -> AsyncOperationResponse[
        "capo_redshift_serverless.types.delete_role_association_response.DeleteRoleAssociationResponse"
    ]:
        import capo_redshift_serverless._operations.redshift_serverless.delete_role_association

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteRoleAssociation")
    )
    input_: capo_redshift_serverless.types.delete_role_association_request.DeleteRoleAssociationRequest = {
        "target_arn": target_arn,
        "role_type": role_type,
        "principal": principal,
    }

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