Skip to content

create_browser async

create_browser(
    name: SandboxName,
    network_configuration: BrowserNetworkConfiguration,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    description: Optional[Description] = None,
    execution_role_arn: Optional[RoleArn] = None,
    recording: Optional[RecordingConfig] = None,
    browser_signing: Optional[BrowserSigningConfigInput] = None,
    enterprise_policies: Optional[BrowserEnterprisePolicies] = None,
    certificates: Optional[Certificates] = None,
    filesystem_configurations: Optional[ToolsFileSystemConfigurations] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagsMap] = None,
) -> CreateBrowserResponse

Creates a custom browser.

Parameters:

  • name (SandboxName) –

    The name of the browser. The name must be unique within your account.

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

    The description of the browser.

  • execution_role_arn (Optional[RoleArn], default: None ) –

    The Amazon Resource Name (ARN) of the IAM role that provides permissions for the browser to access Amazon Web Services services.

  • network_configuration (BrowserNetworkConfiguration) –

    The network configuration for the browser. This configuration specifies the network mode for the browser.

  • recording (Optional[RecordingConfig], default: None ) –

    The recording configuration for the browser. When enabled, browser sessions are recorded and stored in the specified Amazon S3 location.

  • browser_signing (Optional[BrowserSigningConfigInput], default: None ) –

    The browser signing configuration that enables cryptographic agent identification using HTTP message signatures for web bot authentication.

  • enterprise_policies (Optional[BrowserEnterprisePolicies], default: None ) –

    A list of enterprise policy files for the browser.

  • certificates (Optional[Certificates], default: None ) –

    A list of certificates to install in the browser.

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

    The file system configurations to mount into the browser. Use these configurations to mount your own Amazon Simple Storage Service (Amazon S3) Files or Amazon Elastic File System (Amazon EFS) access points. Your sessions can then access your data. If you don't specify this field, no file systems are mounted.

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

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request but does not return an error.

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

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

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
async def create_browser(
    self,
    name: "capo_bedrock_agentcore_control.types.sandbox_name.SandboxName",
    network_configuration: "capo_bedrock_agentcore_control.types.browser_network_configuration.BrowserNetworkConfiguration",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    description: Optional[
        "capo_bedrock_agentcore_control.types.description.Description"
    ] = None,
    execution_role_arn: Optional[
        "capo_bedrock_agentcore_control.types.role_arn.RoleArn"
    ] = None,
    recording: Optional[
        "capo_bedrock_agentcore_control.types.recording_config.RecordingConfig"
    ] = None,
    browser_signing: Optional[
        "capo_bedrock_agentcore_control.types.browser_signing_config_input.BrowserSigningConfigInput"
    ] = None,
    enterprise_policies: Optional[
        "capo_bedrock_agentcore_control.types.browser_enterprise_policies.BrowserEnterprisePolicies"
    ] = None,
    certificates: Optional[
        "capo_bedrock_agentcore_control.types.certificates.Certificates"
    ] = None,
    filesystem_configurations: Optional[
        "capo_bedrock_agentcore_control.types.tools_file_system_configurations.ToolsFileSystemConfigurations"
    ] = None,
    client_token: Optional[
        "capo_bedrock_agentcore_control.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_bedrock_agentcore_control.types.tags_map.TagsMap"] = None,
) -> "capo_bedrock_agentcore_control.types.create_browser_response.CreateBrowserResponse":
    """<p>Creates a custom browser.</p>

    Args:
        name: <p>The name of the browser. The name must be unique within your account.</p>
        description: <p>The description of the browser.</p>
        execution_role_arn: <p>The Amazon Resource Name (ARN) of the IAM role that provides permissions for the browser to access Amazon Web Services services.</p>
        network_configuration: <p>The network configuration for the browser. This configuration specifies the network mode for the browser.</p>
        recording: <p>The recording configuration for the browser. When enabled, browser sessions are recorded and stored in the specified Amazon S3 location.</p>
        browser_signing: <p>The browser signing configuration that enables cryptographic agent identification using HTTP message signatures for web bot authentication.</p>
        enterprise_policies: <p>A list of enterprise policy files for the browser.</p>
        certificates: <p>A list of certificates to install in the browser.</p>
        filesystem_configurations: <p>The file system configurations to mount into the browser. Use these configurations to mount your own Amazon Simple Storage Service (Amazon S3) Files or Amazon Elastic File System (Amazon EFS) access points. Your sessions can then access your data. If you don't specify this field, no file systems are mounted.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request but does not return an error.</p>
        tags: <p>A map of tag keys and values to assign to the browser. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment.</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_browser_request.CreateBrowserRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore_control.types.create_browser_response.CreateBrowserResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.create_browser

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

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

        return capo_bedrock_agentcore_control.types.create_browser_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateBrowser", redact_input=_redact_input),
    )
    input_: capo_bedrock_agentcore_control.types.create_browser_request.CreateBrowserRequest = {
        "name": name,
        "network_configuration": network_configuration,
    }
    if description is not None:
        input_["description"] = description
    if execution_role_arn is not None:
        input_["execution_role_arn"] = execution_role_arn
    if recording is not None:
        input_["recording"] = recording
    if browser_signing is not None:
        input_["browser_signing"] = browser_signing
    if enterprise_policies is not None:
        input_["enterprise_policies"] = enterprise_policies
    if certificates is not None:
        input_["certificates"] = certificates
    if filesystem_configurations is not None:
        input_["filesystem_configurations"] = filesystem_configurations
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

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