Skip to content

associate_mpa_team async

associate_mpa_team(
    action: MpaOperation,
    mpa_team_arn: MpaTeamArn,
    *,
    config_overrides: Optional[AsyncPaymentCryptographyClientConfig] = None,
    requester_comment: Optional[MpaRequesterComment] = None,
) -> AssociateMpaTeamOutput

Associates a Multi-Party Approval (MPA) team with a protected operation. For more information, see Multi-Party Approval in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

Parameters:

  • action (MpaOperation) –

    The protected operation to associate with the MPA team. Currently, the only supported value is IMPORT_ROOT_PUBLIC_KEY_CERTIFICATE.

  • mpa_team_arn (MpaTeamArn) –

    The ARN of the MPA team to associate with the protected operation.

  • requester_comment (Optional[MpaRequesterComment], default: None ) –

    The comment from the requester explaining the reason for the association.

    Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

    This exception is thrown when the caller lacks the necessary IAM permissions to perform the requested operation. Verify that your IAM policy includes the required permissions for the specific Amazon Web Services Payment Cryptography action you're attempting.

  • ConflictException –

    This request can cause an inconsistent state for the resource.

    The requested operation conflicts with the current state of the resource. For example, attempting to delete a key that is currently being used, or trying to create a resource that already exists.

  • InternalServerException –

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

    This indicates a server-side error within the Amazon Web Services Payment Cryptography service. If this error persists, contact support for assistance.

  • ResourceNotFoundException –

    The request was denied due to resource not found.

    The specified key, alias, or other resource does not exist in your account or region. Verify that the resource identifier is correct and that the resource exists in the expected region.

  • ServiceQuotaExceededException –

    This request would cause a service quota to be exceeded.

    You have reached the maximum number of keys, aliases, or other resources allowed in your account. Review your current usage and consider deleting unused resources or requesting a quota increase.

  • ServiceUnavailableException –

    The service cannot complete the request.

    The Amazon Web Services Payment Cryptography service is temporarily unavailable. This is typically a temporary condition - retry your request after a brief delay.

  • ThrottlingException –

    The request was denied due to request throttling.

    You have exceeded the rate limits for Amazon Web Services Payment Cryptography API calls. Implement exponential backoff and retry logic in your application to handle throttling gracefully.

  • ValidationException –

    The request was denied due to an invalid request error.

    One or more parameters in your request are invalid. Check the parameter values, formats, and constraints specified in the API documentation.

  • UnknownServiceError –

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

Source code in docs_src/capo_payment_cryptography/_services/async_payment_cryptography.py
async def associate_mpa_team(
    self,
    action: "capo_payment_cryptography.types.mpa_operation.MpaOperation",
    mpa_team_arn: "capo_payment_cryptography.types.mpa_team_arn.MpaTeamArn",
    *,
    config_overrides: Optional[AsyncPaymentCryptographyClientConfig] = None,
    requester_comment: Optional[
        "capo_payment_cryptography.types.mpa_requester_comment.MpaRequesterComment"
    ] = None,
) -> "capo_payment_cryptography.types.associate_mpa_team_output.AssociateMpaTeamOutput":
    """<p>Associates a Multi-Party Approval (MPA) team with a protected operation. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/mpa.html">Multi-Party Approval</a> in the <i>Amazon Web Services Payment Cryptography User Guide.</i> </p> <p> <b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_DisassociateMpaTeam.html">DisassociateMpaTeam</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetMpaTeamAssociation.html">GetMpaTeamAssociation</a> </p> </li> </ul>

    Args:
        action: <p>The protected operation to associate with the MPA team. Currently, the only supported value is <code>IMPORT_ROOT_PUBLIC_KEY_CERTIFICATE</code>.</p>
        mpa_team_arn: <p>The ARN of the MPA team to associate with the protected operation.</p>
        requester_comment: <p>The comment from the requester explaining the reason for the association.</p> <important> <p>Don't include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.</p> </important>

    Raises:
        capo_payment_cryptography.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p> <p>This exception is thrown when the caller lacks the necessary IAM permissions to perform the requested operation. Verify that your IAM policy includes the required permissions for the specific Amazon Web Services Payment Cryptography action you're attempting.</p>
        capo_payment_cryptography.errors.conflict_exception.ConflictException: <p>This request can cause an inconsistent state for the resource.</p> <p>The requested operation conflicts with the current state of the resource. For example, attempting to delete a key that is currently being used, or trying to create a resource that already exists.</p>
        capo_payment_cryptography.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure.</p> <p>This indicates a server-side error within the Amazon Web Services Payment Cryptography service. If this error persists, contact support for assistance.</p>
        capo_payment_cryptography.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied due to resource not found.</p> <p>The specified key, alias, or other resource does not exist in your account or region. Verify that the resource identifier is correct and that the resource exists in the expected region.</p>
        capo_payment_cryptography.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>This request would cause a service quota to be exceeded.</p> <p>You have reached the maximum number of keys, aliases, or other resources allowed in your account. Review your current usage and consider deleting unused resources or requesting a quota increase.</p>
        capo_payment_cryptography.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p> <p>The Amazon Web Services Payment Cryptography service is temporarily unavailable. This is typically a temporary condition - retry your request after a brief delay.</p>
        capo_payment_cryptography.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p> <p>You have exceeded the rate limits for Amazon Web Services Payment Cryptography API calls. Implement exponential backoff and retry logic in your application to handle throttling gracefully.</p>
        capo_payment_cryptography.errors.validation_exception.ValidationException: <p>The request was denied due to an invalid request error.</p> <p>One or more parameters in your request are invalid. Check the parameter values, formats, and constraints specified in the API documentation.</p>
        capo_payment_cryptography.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_payment_cryptography.types.associate_mpa_team_input.AssociateMpaTeamInput]",
    ) -> AsyncOperationResponse[
        "capo_payment_cryptography.types.associate_mpa_team_output.AssociateMpaTeamOutput"
    ]:
        import capo_payment_cryptography._operations.payment_cryptography_control_plane.associate_mpa_team

        (
            output,
            http_response,
        ) = await capo_payment_cryptography._operations.payment_cryptography_control_plane.associate_mpa_team.async_associate_mpa_team(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_payment_cryptography.types.associate_mpa_team_input.AssociateMpaTeamInput",
    ) -> dict[str, Any]:
        import capo_payment_cryptography.types.associate_mpa_team_input

        return capo_payment_cryptography.types.associate_mpa_team_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("AssociateMpaTeam", redact_input=_redact_input),
    )
    input_: capo_payment_cryptography.types.associate_mpa_team_input.AssociateMpaTeamInput = {
        "action": action,
        "mpa_team_arn": mpa_team_arn,
    }
    if requester_comment is not None:
        input_["requester_comment"] = requester_comment

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