Skip to content

instantiate_sol_network_instance

instantiate_sol_network_instance(
    ns_instance_id: NsInstanceId,
    *,
    config_overrides: Optional[tnbClientConfig] = None,
    dry_run: Optional[bool] = None,
    additional_params_for_ns: Optional[object] = None,
    tags: Optional[TagMap] = None,
) -> InstantiateSolNetworkInstanceOutput

Instantiates a network instance.

A network instance is a single network created in Amazon Web Services TNB that can be deployed and on which life-cycle operations (like terminate, update, and delete) can be performed.

Before you can instantiate a network instance, you have to create a network instance. For more information, see CreateSolNetworkInstance.

Parameters:

  • ns_instance_id (NsInstanceId) –

    ID of the network instance.

  • dry_run (Optional[bool], default: None ) –

    A check for whether you have the required permissions for the action without actually making the request and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • additional_params_for_ns (Optional[object], default: None ) –

    Provides values for the configurable properties.

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

    A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key and an optional value. When you use this API, the tags are only applied to the network operation that is created. These tags are not applied to the network instance. Use tags to search and filter your resources or track your Amazon Web Services costs.

Raises:

Examples:

Instantiate a Sol Network Instance

>>> client.instantiate_sol_network_instance(ns_instance_id='ni-0d5b823eb5c2a9241', tags={'Name': 'Resource'})
Instantiate a Sol Network Instance with Overrides
>>> client.instantiate_sol_network_instance(ns_instance_id='ni-0d5b823eb5c2a9241', additional_params_for_ns={'cidr_block': '10.0.0.0/16', 'availability_zone': 'us-west-2a'})
Source code in docs_src/capo_tnb/_services/tnb.py
def instantiate_sol_network_instance(
    self,
    ns_instance_id: "capo_tnb.types.ns_instance_id.NsInstanceId",
    *,
    config_overrides: Optional[tnbClientConfig] = None,
    dry_run: Optional[bool] = None,
    additional_params_for_ns: Optional[object] = None,
    tags: Optional["capo_tnb.types.tag_map.TagMap"] = None,
) -> "capo_tnb.types.instantiate_sol_network_instance_output.InstantiateSolNetworkInstanceOutput":
    """<p>Instantiates a network instance.</p> <p>A network instance is a single network created in Amazon Web Services TNB that can be deployed and on which life-cycle operations (like terminate, update, and delete) can be performed.</p> <p>Before you can instantiate a network instance, you have to create a network instance. For more information, see <a href="https://docs.aws.amazon.com/tnb/latest/APIReference/API_CreateSolNetworkInstance.html">CreateSolNetworkInstance</a>.</p>

    Args:
        ns_instance_id: <p>ID of the network instance.</p>
        dry_run: <p>A check for whether you have the required permissions for the action without actually making the request and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        additional_params_for_ns: <p>Provides values for the configurable properties.</p>
        tags: <p>A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key and an optional value. When you use this API, the tags are only applied to the network operation that is created. These tags are not applied to the network instance. Use tags to search and filter your resources or track your Amazon Web Services costs.</p>

    Raises:
        capo_tnb.errors.access_denied_exception.AccessDeniedException: <p>Insufficient permissions to make request.</p>
        capo_tnb.errors.internal_server_exception.InternalServerException: <p>Unexpected error occurred. Problem on the server.</p>
        capo_tnb.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource that doesn't exist.</p>
        capo_tnb.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Service quotas have been exceeded.</p>
        capo_tnb.errors.throttling_exception.ThrottlingException: <p>Exception caused by throttling.</p>
        capo_tnb.errors.validation_exception.ValidationException: <p>Unable to process the request because the client provided input failed to satisfy request constraints.</p>
        capo_tnb.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Instantiate a Sol Network Instance

        >>> client.instantiate_sol_network_instance(ns_instance_id='ni-0d5b823eb5c2a9241', tags={'Name': 'Resource'})
        Instantiate a Sol Network Instance with Overrides

        >>> client.instantiate_sol_network_instance(ns_instance_id='ni-0d5b823eb5c2a9241', additional_params_for_ns={'cidr_block': '10.0.0.0/16', 'availability_zone': 'us-west-2a'})
    """

    def _handler(
        req: "OperationRequest[capo_tnb.types.instantiate_sol_network_instance_input.InstantiateSolNetworkInstanceInput]",
    ) -> OperationResponse[
        "capo_tnb.types.instantiate_sol_network_instance_output.InstantiateSolNetworkInstanceOutput"
    ]:
        import capo_tnb._operations.tnb.instantiate_sol_network_instance

        output, http_response = (
            capo_tnb._operations.tnb.instantiate_sol_network_instance.instantiate_sol_network_instance(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_tnb.types.instantiate_sol_network_instance_input.InstantiateSolNetworkInstanceInput",
    ) -> dict[str, Any]:
        import capo_tnb.types.instantiate_sol_network_instance_input

        return (
            capo_tnb.types.instantiate_sol_network_instance_input.redact_sensitive(
                input_
            )
        )

    def _redact_output(
        output: "capo_tnb.types.instantiate_sol_network_instance_output.InstantiateSolNetworkInstanceOutput",
    ) -> dict[str, Any]:
        import capo_tnb.types.instantiate_sol_network_instance_output

        return (
            capo_tnb.types.instantiate_sol_network_instance_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "InstantiateSolNetworkInstance",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_tnb.types.instantiate_sol_network_instance_input.InstantiateSolNetworkInstanceInput = {
        "ns_instance_id": ns_instance_id
    }
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if additional_params_for_ns is not None:
        input_["additional_params_for_ns"] = additional_params_for_ns
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output