Skip to content

create_network_settings async

create_network_settings(
    vpc_id: VpcId,
    subnet_ids: SubnetIdList,
    security_group_ids: SecurityGroupIdList,
    *,
    config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = None,
    tags: Optional[TagList] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateNetworkSettingsResponse

Creates a network settings resource that can be associated with a web portal. Once associated with a web portal, network settings define how streaming instances will connect with your specified VPC.

Parameters:

  • vpc_id (VpcId) –

    The VPC that streaming instances will connect to.

  • subnet_ids (SubnetIdList) –

    The subnets in which network interfaces are created to connect streaming instances to your VPC. At least two of these subnets must be in different availability zones.

  • security_group_ids (SecurityGroupIdList) –

    One or more security groups used to control access from streaming instances to your VPC.

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

    The tags to add to the network settings resource. A tag is a key-value pair.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.

    If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.

Raises:

Source code in docs_src/capo_workspaces_web/_services/async_work_spaces_web.py
async def create_network_settings(
    self,
    vpc_id: "capo_workspaces_web.types.vpc_id.VpcId",
    subnet_ids: "capo_workspaces_web.types.subnet_id_list.SubnetIdList",
    security_group_ids: "capo_workspaces_web.types.security_group_id_list.SecurityGroupIdList",
    *,
    config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = None,
    tags: Optional["capo_workspaces_web.types.tag_list.TagList"] = None,
    client_token: Optional[
        "capo_workspaces_web.types.client_token.ClientToken"
    ] = None,
) -> "capo_workspaces_web.types.create_network_settings_response.CreateNetworkSettingsResponse":
    """<p>Creates a network settings resource that can be associated with a web portal. Once associated with a web portal, network settings define how streaming instances will connect with your specified VPC. </p>

    Args:
        vpc_id: <p>The VPC that streaming instances will connect to.</p>
        subnet_ids: <p>The subnets in which network interfaces are created to connect streaming instances to your VPC. At least two of these subnets must be in different availability zones.</p>
        security_group_ids: <p>One or more security groups used to control access from streaming instances to your VPC.</p>
        tags: <p>The tags to add to the network settings resource. A tag is a key-value pair.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request. </p> <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>

    Raises:
        capo_workspaces_web.errors.access_denied_exception.AccessDeniedException: <p>Access is denied.</p>
        capo_workspaces_web.errors.conflict_exception.ConflictException: <p>There is a conflict.</p>
        capo_workspaces_web.errors.internal_server_exception.InternalServerException: <p>There is an internal server error.</p>
        capo_workspaces_web.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded.</p>
        capo_workspaces_web.errors.throttling_exception.ThrottlingException: <p>There is a throttling error.</p>
        capo_workspaces_web.errors.validation_exception.ValidationException: <p>There is a validation error.</p>
        capo_workspaces_web.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workspaces_web.types.create_network_settings_request.CreateNetworkSettingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_workspaces_web.types.create_network_settings_response.CreateNetworkSettingsResponse"
    ]:
        import capo_workspaces_web._operations.aws_ermine_control_plane_service.create_network_settings

        (
            output,
            http_response,
        ) = await capo_workspaces_web._operations.aws_ermine_control_plane_service.create_network_settings.async_create_network_settings(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_workspaces_web.types.create_network_settings_request.CreateNetworkSettingsRequest",
    ) -> dict[str, Any]:
        import capo_workspaces_web.types.create_network_settings_request

        return capo_workspaces_web.types.create_network_settings_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateNetworkSettings", redact_input=_redact_input),
    )
    input_: capo_workspaces_web.types.create_network_settings_request.CreateNetworkSettingsRequest = {
        "vpc_id": vpc_id,
        "subnet_ids": subnet_ids,
        "security_group_ids": security_group_ids,
    }
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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