Skip to content

update_gateway_target async

update_gateway_target(
    gateway_identifier: GatewayIdentifier,
    target_id: TargetId,
    target_configuration: TargetConfiguration,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    name: Optional[TargetName] = None,
    description: Optional[TargetDescription] = None,
    credential_provider_configurations: Optional[
        CredentialProviderConfigurations
    ] = None,
    metadata_configuration: Optional[MetadataConfiguration] = None,
    private_endpoint: Optional[PrivateEndpoint] = None,
    certificate_configurations: Optional[CertificateConfigurationList] = None,
) -> UpdateGatewayTargetResponse

Updates an existing gateway target.

You cannot update a target that is in a pending authorization state (CREATE_PENDING_AUTH, UPDATE_PENDING_AUTH, or SYNCHRONIZE_PENDING_AUTH). Wait for the authorization to complete or fail before updating the target.

Parameters:

  • gateway_identifier (GatewayIdentifier) –

    The unique identifier of the gateway associated with the target.

  • target_id (TargetId) –

    The unique identifier of the gateway target to update.

  • name (Optional[TargetName], default: None ) –

    The updated name for the gateway target.

  • description (Optional[TargetDescription], default: None ) –

    The updated description for the gateway target.

  • credential_provider_configurations (Optional[CredentialProviderConfigurations], default: None ) –

    The updated credential provider configurations for the gateway target.

  • metadata_configuration (Optional[MetadataConfiguration], default: None ) –

    Configuration for HTTP header and query parameter propagation to the gateway target.

  • private_endpoint (Optional[PrivateEndpoint], default: None ) –

    The private endpoint configuration for the gateway target. Use this to connect the gateway to private resources in your VPC.

  • certificate_configurations (Optional[CertificateConfigurationList], default: None ) –

    The private certificate authority (CA) configurations for the gateway target. Use this to have the gateway trust a private CA when it establishes TLS connections to the target endpoint. Provide each certificate by reference to an Amazon S3 object or an Amazon Web Services Secrets Manager secret. You can specify only one certificate authority configuration in this list. To remove a previously configured certificate authority, omit this field on update.

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
async def update_gateway_target(
    self,
    gateway_identifier: "capo_bedrock_agentcore_control.types.gateway_identifier.GatewayIdentifier",
    target_id: "capo_bedrock_agentcore_control.types.target_id.TargetId",
    target_configuration: "capo_bedrock_agentcore_control.types.target_configuration.TargetConfiguration",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    name: Optional[
        "capo_bedrock_agentcore_control.types.target_name.TargetName"
    ] = None,
    description: Optional[
        "capo_bedrock_agentcore_control.types.target_description.TargetDescription"
    ] = None,
    credential_provider_configurations: Optional[
        "capo_bedrock_agentcore_control.types.credential_provider_configurations.CredentialProviderConfigurations"
    ] = None,
    metadata_configuration: Optional[
        "capo_bedrock_agentcore_control.types.metadata_configuration.MetadataConfiguration"
    ] = None,
    private_endpoint: Optional[
        "capo_bedrock_agentcore_control.types.private_endpoint.PrivateEndpoint"
    ] = None,
    certificate_configurations: Optional[
        "capo_bedrock_agentcore_control.types.certificate_configuration_list.CertificateConfigurationList"
    ] = None,
) -> "capo_bedrock_agentcore_control.types.update_gateway_target_response.UpdateGatewayTargetResponse":
    """<p>Updates an existing gateway target.</p> <p>You cannot update a target that is in a pending authorization state (<code>CREATE_PENDING_AUTH</code>, <code>UPDATE_PENDING_AUTH</code>, or <code>SYNCHRONIZE_PENDING_AUTH</code>). Wait for the authorization to complete or fail before updating the target.</p>

    Args:
        gateway_identifier: <p>The unique identifier of the gateway associated with the target.</p>
        target_id: <p>The unique identifier of the gateway target to update.</p>
        name: <p>The updated name for the gateway target.</p>
        description: <p>The updated description for the gateway target.</p>
        credential_provider_configurations: <p>The updated credential provider configurations for the gateway target.</p>
        metadata_configuration: <p>Configuration for HTTP header and query parameter propagation to the gateway target.</p>
        private_endpoint: <p>The private endpoint configuration for the gateway target. Use this to connect the gateway to private resources in your VPC.</p>
        certificate_configurations: <p>The private certificate authority (CA) configurations for the gateway target. Use this to have the gateway trust a private CA when it establishes TLS connections to the target endpoint. Provide each certificate by reference to an Amazon S3 object or an Amazon Web Services Secrets Manager secret. You can specify only one certificate authority configuration in this list. To remove a previously configured certificate authority, omit this field on update.</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>This exception is thrown when a request is made beyond the service quota</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.update_gateway_target_request.UpdateGatewayTargetRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore_control.types.update_gateway_target_response.UpdateGatewayTargetResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.update_gateway_target

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

    def _redact_input(
        input_: "capo_bedrock_agentcore_control.types.update_gateway_target_request.UpdateGatewayTargetRequest",
    ) -> dict[str, Any]:
        import capo_bedrock_agentcore_control.types.update_gateway_target_request

        return capo_bedrock_agentcore_control.types.update_gateway_target_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_bedrock_agentcore_control.types.update_gateway_target_response.UpdateGatewayTargetResponse",
    ) -> dict[str, Any]:
        import capo_bedrock_agentcore_control.types.update_gateway_target_response

        return capo_bedrock_agentcore_control.types.update_gateway_target_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateGatewayTarget",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_bedrock_agentcore_control.types.update_gateway_target_request.UpdateGatewayTargetRequest = {
        "gateway_identifier": gateway_identifier,
        "target_id": target_id,
        "target_configuration": target_configuration,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if credential_provider_configurations is not None:
        input_["credential_provider_configurations"] = (
            credential_provider_configurations
        )
    if metadata_configuration is not None:
        input_["metadata_configuration"] = metadata_configuration
    if private_endpoint is not None:
        input_["private_endpoint"] = private_endpoint
    if certificate_configurations is not None:
        input_["certificate_configurations"] = certificate_configurations

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