Creates an entitlement (assignment) in account access manager. An entitlement (assignment) grants a principal (IAM Identity Center user or group) permission to assume a specified IAM role in an Amazon Web Services account. This operation is idempotent.
Parameters:
-
application_arn
(ApplicationArn)
–
Specifies the ARN of the application to create the entitlement for.
-
entitlement
(Entitlement)
–
Specifies the entitlement configuration, including the principal and the IAM role to grant access to.
Raises:
Source code in docs_src/capo_account_access/_services/async_account_access.py
| async def create_entitlement(
self,
application_arn: "capo_account_access.types.application_arn.ApplicationArn",
entitlement: "capo_account_access.types.entitlement.Entitlement",
*,
config_overrides: Optional[AsyncAccountAccessClientConfig] = None,
) -> "capo_account_access.types.create_entitlement_response.CreateEntitlementResponse":
"""<p>Creates an entitlement (assignment) in account access manager. An entitlement (assignment) grants a principal (IAM Identity Center user or group) permission to assume a specified IAM role in an Amazon Web Services account. This operation is idempotent.</p>
Args:
application_arn: <p>Specifies the ARN of the application to create the entitlement for.</p>
entitlement: <p>Specifies the entitlement configuration, including the principal and the IAM role to grant access to.</p>
Raises:
capo_account_access.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this operation.</p>
capo_account_access.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
capo_account_access.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred. Try your request again later.</p>
capo_account_access.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist. Verify that the resource identifier is correct and that the resource exists in the current Region.</p>
capo_account_access.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeds a service quota for your account.</p>
capo_account_access.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Try your request again later.</p>
capo_account_access.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service. Check your request parameters and retry the request.</p>
capo_account_access.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_account_access.types.create_entitlement_request.CreateEntitlementRequest]",
) -> AsyncOperationResponse[
"capo_account_access.types.create_entitlement_response.CreateEntitlementResponse"
]:
import capo_account_access._operations.aws_account_access.create_entitlement
(
output,
http_response,
) = await capo_account_access._operations.aws_account_access.create_entitlement.async_create_entitlement(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateEntitlement")
)
input_: capo_account_access.types.create_entitlement_request.CreateEntitlementRequest = {
"application_arn": application_arn,
"entitlement": entitlement,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|