Skip to content

create_gateway_target async

create_gateway_target(
    gateway_identifier: GatewayIdentifier,
    target_configuration: TargetConfiguration,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    name: Optional[TargetName] = None,
    description: Optional[TargetDescription] = None,
    client_token: Optional[ClientToken] = None,
    credential_provider_configurations: Optional[
        CredentialProviderConfigurations
    ] = None,
    metadata_configuration: Optional[MetadataConfiguration] = None,
    private_endpoint: Optional[PrivateEndpoint] = None,
    certificate_configurations: Optional[CertificateConfigurationList] = None,
) -> CreateGatewayTargetResponse

Creates a target for a gateway. A target defines an endpoint that the gateway can connect to.

Parameters:

  • gateway_identifier (GatewayIdentifier) –

    The identifier of the gateway to create a target for.

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

    The name of the gateway target. The name must be unique within the gateway.

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

    The description of the gateway target.

  • 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.

  • target_configuration (TargetConfiguration) –

    The configuration settings for the target, including endpoint information and schema definitions.

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

    The credential provider configurations for the target. These configurations specify how the gateway authenticates with the target endpoint.

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

    Optional configuration for HTTP header and query parameter propagation to and from 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.

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
async def create_gateway_target(
    self,
    gateway_identifier: "capo_bedrock_agentcore_control.types.gateway_identifier.GatewayIdentifier",
    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,
    client_token: Optional[
        "capo_bedrock_agentcore_control.types.client_token.ClientToken"
    ] = 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.create_gateway_target_response.CreateGatewayTargetResponse":
    """<p>Creates a target for a gateway. A target defines an endpoint that the gateway can connect to.</p>

    Args:
        gateway_identifier: <p>The identifier of the gateway to create a target for.</p>
        name: <p>The name of the gateway target. The name must be unique within the gateway.</p>
        description: <p>The description of the gateway target.</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>
        target_configuration: <p>The configuration settings for the target, including endpoint information and schema definitions.</p>
        credential_provider_configurations: <p>The credential provider configurations for the target. These configurations specify how the gateway authenticates with the target endpoint.</p>
        metadata_configuration: <p>Optional configuration for HTTP header and query parameter propagation to and from 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.</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.create_gateway_target_request.CreateGatewayTargetRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore_control.types.create_gateway_target_response.CreateGatewayTargetResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.create_gateway_target

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

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

        return capo_bedrock_agentcore_control.types.create_gateway_target_request.redact_sensitive(
            input_
        )

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

        return capo_bedrock_agentcore_control.types.create_gateway_target_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateGatewayTarget",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_bedrock_agentcore_control.types.create_gateway_target_request.CreateGatewayTargetRequest = {
        "gateway_identifier": gateway_identifier,
        "target_configuration": target_configuration,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    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