Skip to content

create_agent_runtime async

create_agent_runtime(
    agent_runtime_name: AgentRuntimeName,
    agent_runtime_artifact: AgentRuntimeArtifact,
    role_arn: RoleArn,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    network_configuration: Optional[NetworkConfiguration] = None,
    client_token: Optional[ClientToken] = None,
    description: Optional[Description] = None,
    authorizer_configuration: Optional[AuthorizerConfiguration] = None,
    request_header_configuration: Optional[RequestHeaderConfiguration] = None,
    protocol_configuration: Optional[ProtocolConfiguration] = None,
    lifecycle_configuration: Optional[LifecycleConfiguration] = None,
    environment_variables: Optional[EnvironmentVariablesMap] = None,
    filesystem_configurations: Optional[FilesystemConfigurations] = None,
    capacity_provider_configuration: Optional[CapacityProviderConfiguration] = None,
    tags: Optional[TagsMap] = None,
    platform_version: Optional[PlatformVersion] = None,
) -> CreateAgentRuntimeResponse

Creates an Amazon Bedrock AgentCore Runtime.

Parameters:

  • agent_runtime_name (AgentRuntimeName) –

    The name of the AgentCore Runtime.

  • agent_runtime_artifact (AgentRuntimeArtifact) –

    The artifact of the AgentCore Runtime.

  • role_arn (RoleArn) –

    The IAM role ARN that provides permissions for the AgentCore Runtime.

  • network_configuration (Optional[NetworkConfiguration], default: None ) –

    The network configuration for the AgentCore Runtime.

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

    A unique, case-sensitive identifier to ensure idempotency of the request.

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

    The description of the AgentCore Runtime.

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

    The authorizer configuration for the AgentCore Runtime.

  • request_header_configuration (Optional[RequestHeaderConfiguration], default: None ) –

    Configuration for HTTP request headers that will be passed through to the runtime.

  • lifecycle_configuration (Optional[LifecycleConfiguration], default: None ) –

    The life cycle configuration for the AgentCore Runtime.

  • environment_variables (Optional[EnvironmentVariablesMap], default: None ) –

    Environment variables to set in the AgentCore Runtime environment.

  • filesystem_configurations (Optional[FilesystemConfigurations], default: None ) –

    The filesystem configurations to mount into the AgentCore Runtime. Use filesystem configurations to provide persistent storage to your AgentCore Runtime sessions.

  • capacity_provider_configuration (Optional[CapacityProviderConfiguration], default: None ) –

    The capacity provider configuration for the AgentCore Runtime. Use a capacity provider to run the AgentCore Runtime on the Instances compute type, which provisions Amazon Web Services managed compute in your account.

  • tags (Optional[TagsMap], default: None ) –

    A map of tag keys and values to assign to the agent runtime. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment.

  • platform_version (Optional[PlatformVersion], default: None ) –

    The version of the runtime platform to use for the AgentCore Runtime.

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
async def create_agent_runtime(
    self,
    agent_runtime_name: "capo_bedrock_agentcore_control.types.agent_runtime_name.AgentRuntimeName",
    agent_runtime_artifact: "capo_bedrock_agentcore_control.types.agent_runtime_artifact.AgentRuntimeArtifact",
    role_arn: "capo_bedrock_agentcore_control.types.role_arn.RoleArn",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    network_configuration: Optional[
        "capo_bedrock_agentcore_control.types.network_configuration.NetworkConfiguration"
    ] = None,
    client_token: Optional[
        "capo_bedrock_agentcore_control.types.client_token.ClientToken"
    ] = None,
    description: Optional[
        "capo_bedrock_agentcore_control.types.description.Description"
    ] = None,
    authorizer_configuration: Optional[
        "capo_bedrock_agentcore_control.types.authorizer_configuration.AuthorizerConfiguration"
    ] = None,
    request_header_configuration: Optional[
        "capo_bedrock_agentcore_control.types.request_header_configuration.RequestHeaderConfiguration"
    ] = None,
    protocol_configuration: Optional[
        "capo_bedrock_agentcore_control.types.protocol_configuration.ProtocolConfiguration"
    ] = None,
    lifecycle_configuration: Optional[
        "capo_bedrock_agentcore_control.types.lifecycle_configuration.LifecycleConfiguration"
    ] = None,
    environment_variables: Optional[
        "capo_bedrock_agentcore_control.types.environment_variables_map.EnvironmentVariablesMap"
    ] = None,
    filesystem_configurations: Optional[
        "capo_bedrock_agentcore_control.types.filesystem_configurations.FilesystemConfigurations"
    ] = None,
    capacity_provider_configuration: Optional[
        "capo_bedrock_agentcore_control.types.capacity_provider_configuration.CapacityProviderConfiguration"
    ] = None,
    tags: Optional["capo_bedrock_agentcore_control.types.tags_map.TagsMap"] = None,
    platform_version: Optional[
        "capo_bedrock_agentcore_control.types.platform_version.PlatformVersion"
    ] = None,
) -> "capo_bedrock_agentcore_control.types.create_agent_runtime_response.CreateAgentRuntimeResponse":
    """<p>Creates an Amazon Bedrock AgentCore Runtime.</p>

    Args:
        agent_runtime_name: <p>The name of the AgentCore Runtime.</p>
        agent_runtime_artifact: <p>The artifact of the AgentCore Runtime.</p>
        role_arn: <p>The IAM role ARN that provides permissions for the AgentCore Runtime.</p>
        network_configuration: <p>The network configuration for the AgentCore Runtime.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure idempotency of the request.</p>
        description: <p>The description of the AgentCore Runtime.</p>
        authorizer_configuration: <p>The authorizer configuration for the AgentCore Runtime.</p>
        request_header_configuration: <p>Configuration for HTTP request headers that will be passed through to the runtime.</p>
        lifecycle_configuration: <p>The life cycle configuration for the AgentCore Runtime.</p>
        environment_variables: <p>Environment variables to set in the AgentCore Runtime environment.</p>
        filesystem_configurations: <p>The filesystem configurations to mount into the AgentCore Runtime. Use filesystem configurations to provide persistent storage to your AgentCore Runtime sessions.</p>
        capacity_provider_configuration: <p>The capacity provider configuration for the AgentCore Runtime. Use a capacity provider to run the AgentCore Runtime on the Instances compute type, which provisions Amazon Web Services managed compute in your account.</p>
        tags: <p>A map of tag keys and values to assign to the agent runtime. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment.</p>
        platform_version: <p>The version of the runtime platform to use for the AgentCore Runtime.</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.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_agent_runtime_request.CreateAgentRuntimeRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore_control.types.create_agent_runtime_response.CreateAgentRuntimeResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.create_agent_runtime

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

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

        return capo_bedrock_agentcore_control.types.create_agent_runtime_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateAgentRuntime", redact_input=_redact_input),
    )
    input_: capo_bedrock_agentcore_control.types.create_agent_runtime_request.CreateAgentRuntimeRequest = {
        "agent_runtime_name": agent_runtime_name,
        "agent_runtime_artifact": agent_runtime_artifact,
        "role_arn": role_arn,
    }
    if network_configuration is not None:
        input_["network_configuration"] = network_configuration
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if authorizer_configuration is not None:
        input_["authorizer_configuration"] = authorizer_configuration
    if request_header_configuration is not None:
        input_["request_header_configuration"] = request_header_configuration
    if protocol_configuration is not None:
        input_["protocol_configuration"] = protocol_configuration
    if lifecycle_configuration is not None:
        input_["lifecycle_configuration"] = lifecycle_configuration
    if environment_variables is not None:
        input_["environment_variables"] = environment_variables
    if filesystem_configurations is not None:
        input_["filesystem_configurations"] = filesystem_configurations
    if capacity_provider_configuration is not None:
        input_["capacity_provider_configuration"] = capacity_provider_configuration
    if tags is not None:
        input_["tags"] = tags
    if platform_version is not None:
        input_["platform_version"] = platform_version

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