Skip to content

delete_role_permissions_boundary

delete_role_permissions_boundary(
    role_name: roleNameType, *, config_overrides: Optional[IAMClientConfig] = None
) -> None

Deletes the permissions boundary for the specified IAM role.

You cannot set the boundary for a service-linked role.

Deleting the permissions boundary for a role might increase its permissions. For example, it might allow anyone who assumes the role to perform all the actions granted in its permissions policies.

Parameters:

  • role_name (roleNameType) –

    The name (friendly name, not ARN) of the IAM role from which you want to remove the permissions boundary.

Raises:

  • NoSuchEntityException –

    The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ServiceFailureException –

    The request processing has failed because of an unknown error, exception or failure.

  • UnmodifiableEntityException –

    The request was rejected because service-linked roles are protected Amazon Web Services resources. Only the service that depends on the service-linked role can modify or delete the role on your behalf. The error message includes the name of the service that depends on this service-linked role. You must request the change through that service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_iam/_services/iam.py
def delete_role_permissions_boundary(
    self,
    role_name: "capo_iam.types.role_name_type.roleNameType",
    *,
    config_overrides: Optional[IAMClientConfig] = None,
) -> None:
    """<p>Deletes the permissions boundary for the specified IAM role. </p> <p>You cannot set the boundary for a service-linked role.</p> <important> <p>Deleting the permissions boundary for a role might increase its permissions. For example, it might allow anyone who assumes the role to perform all the actions granted in its permissions policies.</p> </important>

    Args:
        role_name: <p>The name (friendly name, not ARN) of the IAM role from which you want to remove the permissions boundary.</p>

    Raises:
        capo_iam.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
        capo_iam.errors.service_failure_exception.ServiceFailureException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_iam.errors.unmodifiable_entity_exception.UnmodifiableEntityException: <p>The request was rejected because service-linked roles are protected Amazon Web Services resources. Only the service that depends on the service-linked role can modify or delete the role on your behalf. The error message includes the name of the service that depends on this service-linked role. You must request the change through that service.</p>
        capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iam.types.delete_role_permissions_boundary_request.DeleteRolePermissionsBoundaryRequest]",
    ) -> OperationResponse[None]:
        import capo_iam._operations.aws_identity_management_v20100508.delete_role_permissions_boundary

        output, http_response = (
            capo_iam._operations.aws_identity_management_v20100508.delete_role_permissions_boundary.delete_role_permissions_boundary(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteRolePermissionsBoundary")
    )
    input_: capo_iam.types.delete_role_permissions_boundary_request.DeleteRolePermissionsBoundaryRequest = {
        "role_name": role_name
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output