Skip to content

rotate_payment_connector_credentials async

rotate_payment_connector_credentials(
    payment_manager_id: PaymentManagerId,
    payment_connector_id: PaymentConnectorId,
    credentials_to_rotate: CredentialRotationConfig,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> RotatePaymentConnectorCredentialsResponse

Replaces the service-managed credentials of a payment connector with newly issued credentials.

Use this operation only for payment connectors with a provisionMode of QUICK_CREATE. For payment connectors with a provisionMode of MANUAL, call UpdatePaymentCredentialProvider instead after rotating credentials with the payment provider directly.

The rotation finishes before the response is returned, and only one rotation runs at a time for a given payment connector. When it succeeds, the new credential is in effect and the payment connector stays in the READY state. When it fails, an error is returned, the payment connector and its existing credential are left unchanged, and you can retry the request.

Rotation replaces the credential on the connector's credential provider, so every payment connector that uses that provider is affected. Replace any copy of the previous credential that you use outside AgentCore.

Parameters:

  • payment_manager_id (PaymentManagerId) –

    The unique identifier of the parent payment manager.

  • payment_connector_id (PaymentConnectorId) –

    The unique identifier of the payment connector whose credentials you want to rotate.

  • credentials_to_rotate (CredentialRotationConfig) –

    The credentials to rotate. Specify the member that matches the payment connector's type. Each credential that you select is rotated independently.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency.

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
async def rotate_payment_connector_credentials(
    self,
    payment_manager_id: "capo_bedrock_agentcore_control.types.payment_manager_id.PaymentManagerId",
    payment_connector_id: "capo_bedrock_agentcore_control.types.payment_connector_id.PaymentConnectorId",
    credentials_to_rotate: "capo_bedrock_agentcore_control.types.credential_rotation_config.CredentialRotationConfig",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    client_token: Optional[
        "capo_bedrock_agentcore_control.types.client_token.ClientToken"
    ] = None,
) -> "capo_bedrock_agentcore_control.types.rotate_payment_connector_credentials_response.RotatePaymentConnectorCredentialsResponse":
    """<p>Replaces the service-managed credentials of a payment connector with newly issued credentials.</p> <p>Use this operation only for payment connectors with a <code>provisionMode</code> of <code>QUICK_CREATE</code>. For payment connectors with a <code>provisionMode</code> of <code>MANUAL</code>, call <code>UpdatePaymentCredentialProvider</code> instead after rotating credentials with the payment provider directly.</p> <p>The rotation finishes before the response is returned, and only one rotation runs at a time for a given payment connector. When it succeeds, the new credential is in effect and the payment connector stays in the <code>READY</code> state. When it fails, an error is returned, the payment connector and its existing credential are left unchanged, and you can retry the request.</p> <p>Rotation replaces the credential on the connector's credential provider, so every payment connector that uses that provider is affected. Replace any copy of the previous credential that you use outside AgentCore.</p>

    Args:
        payment_manager_id: <p>The unique identifier of the parent payment manager.</p>
        payment_connector_id: <p>The unique identifier of the payment connector whose credentials you want to rotate.</p>
        credentials_to_rotate: <p>The credentials to rotate. Specify the member that matches the payment connector's <code>type</code>. Each credential that you select is rotated independently.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>

    Raises:
        capo_bedrock_agentcore_control.errors.access_denied_exception.AccessDeniedException: <p>This exception is thrown when a request is denied per access permissions</p>
        capo_bedrock_agentcore_control.errors.conflict_exception.ConflictException: <p>This exception is thrown when there is a conflict performing an operation</p>
        capo_bedrock_agentcore_control.errors.internal_server_exception.InternalServerException: <p>This exception is thrown if there was an unexpected error during processing of request</p>
        capo_bedrock_agentcore_control.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource referenced by the operation does not exist</p>
        capo_bedrock_agentcore_control.errors.throttling_exception.ThrottlingException: <p>This exception is thrown when the number of requests exceeds the limit</p>
        capo_bedrock_agentcore_control.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_bedrock_agentcore_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock_agentcore_control.types.rotate_payment_connector_credentials_request.RotatePaymentConnectorCredentialsRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore_control.types.rotate_payment_connector_credentials_response.RotatePaymentConnectorCredentialsResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.rotate_payment_connector_credentials

        (
            output,
            http_response,
        ) = await capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.rotate_payment_connector_credentials.async_rotate_payment_connector_credentials(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RotatePaymentConnectorCredentials")
    )
    input_: capo_bedrock_agentcore_control.types.rotate_payment_connector_credentials_request.RotatePaymentConnectorCredentialsRequest = {
        "payment_manager_id": payment_manager_id,
        "payment_connector_id": payment_connector_id,
        "credentials_to_rotate": credentials_to_rotate,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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