Skip to content

create_network_connector

create_network_connector(
    network_connector_name: NetworkConnectorName,
    subnet_ids: SubnetIdList,
    security_group_ids: SecurityGroupIdList,
    network_connector_role_arn: NetworkConnectorRoleArn,
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    tags: Optional[TagMap] = None,
) -> CreateNetworkConnectorResponse

Creates a network connector that provides a Gen 3 app with access to a virtual private cloud (VPC).

Parameters:

  • network_connector_name (NetworkConnectorName) –

    The name of the network connector.

  • subnet_ids (SubnetIdList) –

    The IDs of the subnets for the network connector. The network connector uses the virtual private cloud (VPC) that the subnets belong to.

  • security_group_ids (SecurityGroupIdList) –

    The IDs of the security groups for the network connector.

  • network_connector_role_arn (NetworkConnectorRoleArn) –

    The Amazon Resource Name (ARN) of the IAM role for the network connector.

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

    The tags to apply to the resource.

Raises:

Source code in docs_src/capo_amplifygen3/_services/amplify_gen3.py
def create_network_connector(
    self,
    network_connector_name: "capo_amplifygen3.types.network_connector_name.NetworkConnectorName",
    subnet_ids: "capo_amplifygen3.types.subnet_id_list.SubnetIdList",
    security_group_ids: "capo_amplifygen3.types.security_group_id_list.SecurityGroupIdList",
    network_connector_role_arn: "capo_amplifygen3.types.network_connector_role_arn.NetworkConnectorRoleArn",
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    tags: Optional["capo_amplifygen3.types.tag_map.TagMap"] = None,
) -> "capo_amplifygen3.types.create_network_connector_response.CreateNetworkConnectorResponse":
    """<p>Creates a network connector that provides a Gen 3 app with access to a virtual private cloud (VPC).</p>

    Args:
        network_connector_name: <p>The name of the network connector.</p>
        subnet_ids: <p>The IDs of the subnets for the network connector. The network connector uses the virtual private cloud (VPC) that the subnets belong to.</p>
        security_group_ids: <p>The IDs of the security groups for the network connector.</p>
        network_connector_role_arn: <p>The Amazon Resource Name (ARN) of the IAM role for the network connector.</p>
        tags: <p>The tags to apply to the resource.</p>

    Raises:
        capo_amplifygen3.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_amplifygen3.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_amplifygen3.errors.internal_server_exception.InternalServerException: <p>An internal error occurred. Retry the request.</p>
        capo_amplifygen3.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota for your account.</p>
        capo_amplifygen3.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate exceeds the allowed limit.</p>
        capo_amplifygen3.errors.validation_exception.ValidationException: <p>The request contains invalid parameters or is otherwise malformed.</p>
        capo_amplifygen3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplifygen3.types.create_network_connector_request.CreateNetworkConnectorRequest]",
    ) -> OperationResponse[
        "capo_amplifygen3.types.create_network_connector_response.CreateNetworkConnectorResponse"
    ]:
        import capo_amplifygen3._operations.omega.create_network_connector

        output, http_response = (
            capo_amplifygen3._operations.omega.create_network_connector.create_network_connector(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateNetworkConnector")
    )
    input_: capo_amplifygen3.types.create_network_connector_request.CreateNetworkConnectorRequest = {
        "network_connector_name": network_connector_name,
        "subnet_ids": subnet_ids,
        "security_group_ids": security_group_ids,
        "network_connector_role_arn": network_connector_role_arn,
    }
    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