:doc:`MigrationHubRefactorSpaces <../../migration-hub-refactor-spaces>` / Client / create_environment

******************
create_environment
******************



.. py:method:: MigrationHubRefactorSpaces.Client.create_environment(**kwargs)

  

  Creates an Amazon Web Services Migration Hub Refactor Spaces environment. The caller owns the environment resource, and all Refactor Spaces applications, services, and routes created within the environment. They are referred to as the *environment owner*. The environment owner has cross-account visibility and control of Refactor Spaces resources that are added to the environment by other accounts that the environment is shared with.

   

  When creating an environment with a `CreateEnvironment\:NetworkFabricType <https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateEnvironment.html#migrationhubrefactorspaces-CreateEnvironment-request-NetworkFabricType>`__ of ``TRANSIT_GATEWAY``, Refactor Spaces provisions a transit gateway to enable services in VPCs to communicate directly across accounts. If `CreateEnvironment\:NetworkFabricType <https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateEnvironment.html#migrationhubrefactorspaces-CreateEnvironment-request-NetworkFabricType>`__ is ``NONE``, Refactor Spaces does not create a transit gateway and you must use your network infrastructure to route traffic to services with private URL endpoints.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/migration-hub-refactor-spaces-2021-10-26/CreateEnvironment>`_  


  **Request Syntax**
  ::

    response = client.create_environment(
        ClientToken='string',
        Description='string',
        Name='string',
        NetworkFabricType='TRANSIT_GATEWAY'|'NONE',
        Tags={
            'string': 'string'
        }
    )
    
  :type ClientToken: string
  :param ClientToken: 

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

    This field is autopopulated if not provided.

  
  :type Description: string
  :param Description: 

    The description of the environment.

    

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

    The name of the environment.

    

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

    The network fabric type of the environment.

    

  
  :type Tags: dict
  :param Tags: 

    The tags to assign to the environment. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key-value pair.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'Arn': 'string',
          'CreatedTime': datetime(2015, 1, 1),
          'Description': 'string',
          'EnvironmentId': 'string',
          'LastUpdatedTime': datetime(2015, 1, 1),
          'Name': 'string',
          'NetworkFabricType': 'TRANSIT_GATEWAY'|'NONE',
          'OwnerAccountId': 'string',
          'State': 'CREATING'|'ACTIVE'|'DELETING'|'FAILED',
          'Tags': {
              'string': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Arn** *(string) --* 

        The Amazon Resource Name (ARN) of the environment.

        
      

      - **CreatedTime** *(datetime) --* 

        A timestamp that indicates when the environment is created.

        
      

      - **Description** *(string) --* 

        A description of the environment.

        
      

      - **EnvironmentId** *(string) --* 

        The unique identifier of the environment.

        
      

      - **LastUpdatedTime** *(datetime) --* 

        A timestamp that indicates when the environment was last updated.

        
      

      - **Name** *(string) --* 

        The name of the environment.

        
      

      - **NetworkFabricType** *(string) --* 

        The network fabric type of the environment.

        
      

      - **OwnerAccountId** *(string) --* 

        The Amazon Web Services account ID of environment owner.

        
      

      - **State** *(string) --* 

        The current state of the environment.

        
      

      - **Tags** *(dict) --* 

        The tags assigned to the created environment. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key-value pair..

        
        

        - *(string) --* 
          

          - *(string) --* 
    
  
  
  **Exceptions**
  
  *   :py:class:`MigrationHubRefactorSpaces.Client.exceptions.ResourceNotFoundException`

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

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

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

  
  *   :py:class:`MigrationHubRefactorSpaces.Client.exceptions.ValidationException`

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

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

  