Skip to content

update_gateway async

update_gateway(
    gateway_identifier: GatewayIdentifier,
    name: GatewayName,
    role_arn: RoleArn,
    authorizer_type: AuthorizerType,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    description: Optional[GatewayDescription] = None,
    protocol_type: Optional[GatewayProtocolType] = None,
    protocol_configuration: Optional[GatewayProtocolConfiguration] = None,
    authorizer_configuration: Optional[AuthorizerConfiguration] = None,
    kms_key_arn: Optional[KmsKeyArn] = None,
    custom_transform_configuration: Optional[CustomTransformConfiguration] = None,
    interceptor_configurations: Optional[GatewayInterceptorConfigurations] = None,
    policy_engine_configuration: Optional[GatewayPolicyEngineConfiguration] = None,
    exception_level: Optional[ExceptionLevel] = None,
    waf_configuration: Optional[WafConfiguration] = None,
) -> UpdateGatewayResponse

Updates an existing gateway.

Parameters:

  • gateway_identifier (GatewayIdentifier) –

    The identifier of the gateway to update.

  • name (GatewayName) –

    The name of the gateway. This name must be the same as the one when the gateway was created.

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

    The updated description for the gateway.

  • role_arn (RoleArn) –

    The updated IAM role ARN that provides permissions for the gateway.

  • protocol_type (Optional[GatewayProtocolType], default: None ) –

    The updated protocol type for the gateway.

  • authorizer_type (AuthorizerType) –

    The updated authorizer type for the gateway.

  • authorizer_configuration (Optional[AuthorizerConfiguration], default: None ) –

    The updated authorizer configuration for the gateway.

  • kms_key_arn (Optional[KmsKeyArn], default: None ) –

    The updated ARN of the KMS key used to encrypt the gateway.

  • custom_transform_configuration (Optional[CustomTransformConfiguration], default: None ) –

    The updated custom transformation configuration for the gateway. This configuration defines how the gateway transforms requests and responses.

  • interceptor_configurations (Optional[GatewayInterceptorConfigurations], default: None ) –

    The updated interceptor configurations for the gateway.

  • policy_engine_configuration (Optional[GatewayPolicyEngineConfiguration], default: None ) –

    The updated policy engine configuration for the gateway. A policy engine is a collection of policies that evaluates and authorizes agent tool calls. When associated with a gateway, the policy engine intercepts all agent requests and determines whether to allow or deny each action based on the defined policies.

  • exception_level (Optional[ExceptionLevel], default: None ) –

    The level of detail in error messages returned when invoking the gateway.

    • If the value is DEBUG, granular exception messages are returned to help a user debug the gateway.

    • If the value is omitted, a generic error message is returned to the end user.

  • waf_configuration (Optional[WafConfiguration], default: None ) –

    The updated Amazon Web Services WAF configuration for the gateway.

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
async def update_gateway(
    self,
    gateway_identifier: "capo_bedrock_agentcore_control.types.gateway_identifier.GatewayIdentifier",
    name: "capo_bedrock_agentcore_control.types.gateway_name.GatewayName",
    role_arn: "capo_bedrock_agentcore_control.types.role_arn.RoleArn",
    authorizer_type: "capo_bedrock_agentcore_control.types.authorizer_type.AuthorizerType",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    description: Optional[
        "capo_bedrock_agentcore_control.types.gateway_description.GatewayDescription"
    ] = None,
    protocol_type: Optional[
        "capo_bedrock_agentcore_control.types.gateway_protocol_type.GatewayProtocolType"
    ] = None,
    protocol_configuration: Optional[
        "capo_bedrock_agentcore_control.types.gateway_protocol_configuration.GatewayProtocolConfiguration"
    ] = None,
    authorizer_configuration: Optional[
        "capo_bedrock_agentcore_control.types.authorizer_configuration.AuthorizerConfiguration"
    ] = None,
    kms_key_arn: Optional[
        "capo_bedrock_agentcore_control.types.kms_key_arn.KmsKeyArn"
    ] = None,
    custom_transform_configuration: Optional[
        "capo_bedrock_agentcore_control.types.custom_transform_configuration.CustomTransformConfiguration"
    ] = None,
    interceptor_configurations: Optional[
        "capo_bedrock_agentcore_control.types.gateway_interceptor_configurations.GatewayInterceptorConfigurations"
    ] = None,
    policy_engine_configuration: Optional[
        "capo_bedrock_agentcore_control.types.gateway_policy_engine_configuration.GatewayPolicyEngineConfiguration"
    ] = None,
    exception_level: Optional[
        "capo_bedrock_agentcore_control.types.exception_level.ExceptionLevel"
    ] = None,
    waf_configuration: Optional[
        "capo_bedrock_agentcore_control.types.waf_configuration.WafConfiguration"
    ] = None,
) -> "capo_bedrock_agentcore_control.types.update_gateway_response.UpdateGatewayResponse":
    """<p>Updates an existing gateway.</p>

    Args:
        gateway_identifier: <p>The identifier of the gateway to update.</p>
        name: <p>The name of the gateway. This name must be the same as the one when the gateway was created.</p>
        description: <p>The updated description for the gateway.</p>
        role_arn: <p>The updated IAM role ARN that provides permissions for the gateway.</p>
        protocol_type: <p>The updated protocol type for the gateway.</p>
        authorizer_type: <p>The updated authorizer type for the gateway.</p>
        authorizer_configuration: <p>The updated authorizer configuration for the gateway.</p>
        kms_key_arn: <p>The updated ARN of the KMS key used to encrypt the gateway.</p>
        custom_transform_configuration: <p>The updated custom transformation configuration for the gateway. This configuration defines how the gateway transforms requests and responses.</p>
        interceptor_configurations: <p>The updated interceptor configurations for the gateway.</p>
        policy_engine_configuration: <p>The updated policy engine configuration for the gateway. A policy engine is a collection of policies that evaluates and authorizes agent tool calls. When associated with a gateway, the policy engine intercepts all agent requests and determines whether to allow or deny each action based on the defined policies.</p>
        exception_level: <p>The level of detail in error messages returned when invoking the gateway.</p> <ul> <li> <p>If the value is <code>DEBUG</code>, granular exception messages are returned to help a user debug the gateway.</p> </li> <li> <p>If the value is omitted, a generic error message is returned to the end user.</p> </li> </ul>
        waf_configuration: <p>The updated Amazon Web Services WAF configuration for the gateway.</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_request.UpdateGatewayRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore_control.types.update_gateway_response.UpdateGatewayResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.update_gateway

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

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

        return capo_bedrock_agentcore_control.types.update_gateway_request.redact_sensitive(
            input_
        )

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

        return capo_bedrock_agentcore_control.types.update_gateway_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateGateway",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_bedrock_agentcore_control.types.update_gateway_request.UpdateGatewayRequest = {
        "gateway_identifier": gateway_identifier,
        "name": name,
        "role_arn": role_arn,
        "authorizer_type": authorizer_type,
    }
    if description is not None:
        input_["description"] = description
    if protocol_type is not None:
        input_["protocol_type"] = protocol_type
    if protocol_configuration is not None:
        input_["protocol_configuration"] = protocol_configuration
    if authorizer_configuration is not None:
        input_["authorizer_configuration"] = authorizer_configuration
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn
    if custom_transform_configuration is not None:
        input_["custom_transform_configuration"] = custom_transform_configuration
    if interceptor_configurations is not None:
        input_["interceptor_configurations"] = interceptor_configurations
    if policy_engine_configuration is not None:
        input_["policy_engine_configuration"] = policy_engine_configuration
    if exception_level is not None:
        input_["exception_level"] = exception_level
    if waf_configuration is not None:
        input_["waf_configuration"] = waf_configuration

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