:doc:`VPCLattice <../../vpc-lattice>` / Client / create_service_network

**********************
create_service_network
**********************



.. py:method:: VPCLattice.Client.create_service_network(**kwargs)

  

  Creates a service network. A service network is a logical boundary for a collection of services. You can associate services and VPCs with a service network.

   

  For more information, see `Service networks <https://docs.aws.amazon.com/vpc-lattice/latest/ug/service-networks.html>`__ in the *Amazon VPC Lattice User Guide*.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/vpc-lattice-2022-11-30/CreateServiceNetwork>`_  


  **Request Syntax**
  ::

    response = client.create_service_network(
        clientToken='string',
        name='string',
        authType='NONE'|'AWS_IAM',
        tags={
            'string': 'string'
        },
        sharingConfig={
            'enabled': True|False
        }
    )
    
  :type clientToken: string
  :param clientToken: 

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client token and parameters, the retry succeeds without performing any actions. If the parameters aren't identical, the retry fails.

    This field is autopopulated if not provided.

  
  :type name: string
  :param name: **[REQUIRED]** 

    The name of the service network. The name must be unique to the account. The valid characters are a-z, 0-9, and hyphens (-). You can't use a hyphen as the first or last character, or immediately after another hyphen.

    

  
  :type authType: string
  :param authType: 

    The type of IAM policy.

     

    
    * ``NONE``: The resource does not use an IAM policy. This is the default.
     
    * ``AWS_IAM``: The resource uses an IAM policy. When this type is used, auth is enabled and an auth policy is required.
    

    

  
  :type tags: dict
  :param tags: 

    The tags for the service network.

    

  
    - *(string) --* 

      The key of the tag.

       

      Constraints: Tag keys are case-sensitive and accept a maximum of 128 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @ May not begin with ``aws:``.

      

    
      - *(string) --* 

        The value of the tag.

         

        Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters. Valid characters are Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @

        

      


  :type sharingConfig: dict
  :param sharingConfig: 

    Specify if the service network should be enabled for sharing.

    

  
    - **enabled** *(boolean) --* 

      Specifies if the service network is enabled for sharing.

      

    
  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'id': 'string',
          'name': 'string',
          'arn': 'string',
          'sharingConfig': {
              'enabled': True|False
          },
          'authType': 'NONE'|'AWS_IAM'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **id** *(string) --* 

        The ID of the service network.

        
      

      - **name** *(string) --* 

        The name of the service network.

        
      

      - **arn** *(string) --* 

        The Amazon Resource Name (ARN) of the service network.

        
      

      - **sharingConfig** *(dict) --* 

        Specifies if the service network is enabled for sharing.

        
        

        - **enabled** *(boolean) --* 

          Specifies if the service network is enabled for sharing.

          
    
      

      - **authType** *(string) --* 

        The type of IAM policy.

        
  
  **Exceptions**
  
  *   :py:class:`VPCLattice.Client.exceptions.ValidationException`

  
  *   :py:class:`VPCLattice.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`VPCLattice.Client.exceptions.ConflictException`

  
  *   :py:class:`VPCLattice.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`VPCLattice.Client.exceptions.ThrottlingException`

  
  *   :py:class:`VPCLattice.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`VPCLattice.Client.exceptions.InternalServerException`

  