Use UpdateRole instead.
Modifies only the description of a role. This operation performs the same function as the Description parameter in the UpdateRole operation.
Parameters:
-
role_name
(roleNameType)
–
The name of the role that you want to modify.
-
description
(roleDescriptionType)
–
The new description that you want to apply to the specified role.
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/async_iam.py
| async def update_role_description(
self,
role_name: "capo_iam.types.role_name_type.roleNameType",
description: "capo_iam.types.role_description_type.roleDescriptionType",
*,
config_overrides: Optional[AsyncIAMClientConfig] = None,
) -> (
"capo_iam.types.update_role_description_response.UpdateRoleDescriptionResponse"
):
"""<p>Use <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateRole.html">UpdateRole</a> instead.</p> <p>Modifies only the description of a role. This operation performs the same function as the <code>Description</code> parameter in the <code>UpdateRole</code> operation.</p>
Args:
role_name: <p>The name of the role that you want to modify.</p>
description: <p>The new description that you want to apply to the specified role.</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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_iam.types.update_role_description_request.UpdateRoleDescriptionRequest]",
) -> AsyncOperationResponse[
"capo_iam.types.update_role_description_response.UpdateRoleDescriptionResponse"
]:
import capo_iam._operations.aws_identity_management_v20100508.update_role_description
(
output,
http_response,
) = await capo_iam._operations.aws_identity_management_v20100508.update_role_description.async_update_role_description(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateRoleDescription")
)
input_: capo_iam.types.update_role_description_request.UpdateRoleDescriptionRequest = {
"role_name": role_name,
"description": description,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|