:doc:`ElasticBeanstalk <../../elasticbeanstalk>` / Client / rebuild_environment

*******************
rebuild_environment
*******************



.. py:method:: ElasticBeanstalk.Client.rebuild_environment(**kwargs)

  

  Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.) for a specified environment and forces a restart.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/elasticbeanstalk-2010-12-01/RebuildEnvironment>`_  


  **Request Syntax**
  ::

    response = client.rebuild_environment(
        EnvironmentId='string',
        EnvironmentName='string'
    )
    
  :type EnvironmentId: string
  :param EnvironmentId: 

    The ID of the environment to rebuild.

     

    Condition: You must specify either this or an EnvironmentName, or both. If you do not specify either, AWS Elastic Beanstalk returns ``MissingRequiredParameter`` error.

    

  
  :type EnvironmentName: string
  :param EnvironmentName: 

    The name of the environment to rebuild.

     

    Condition: You must specify either this or an EnvironmentId, or both. If you do not specify either, AWS Elastic Beanstalk returns ``MissingRequiredParameter`` error.

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`ElasticBeanstalk.Client.exceptions.InsufficientPrivilegesException`

  

  **Examples**

  The following operation terminates and recreates the resources in an environment named my-env:
  ::

    response = client.rebuild_environment(
        EnvironmentName='my-env',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  