:doc:`AppConfig <../../appconfig>` / Client / update_environment

******************
update_environment
******************



.. py:method:: AppConfig.Client.update_environment(**kwargs)

  

  Updates an environment.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/appconfig-2019-10-09/UpdateEnvironment>`_  


  **Request Syntax**
  ::

    response = client.update_environment(
        ApplicationId='string',
        EnvironmentId='string',
        Name='string',
        Description='string',
        Monitors=[
            {
                'AlarmArn': 'string',
                'AlarmRoleArn': 'string'
            },
        ]
    )
    
  :type ApplicationId: string
  :param ApplicationId: **[REQUIRED]** 

    The application ID.

    

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

    The environment ID.

    

  
  :type Name: string
  :param Name: 

    The name of the environment.

    

  
  :type Description: string
  :param Description: 

    A description of the environment.

    

  
  :type Monitors: list
  :param Monitors: 

    Amazon CloudWatch alarms to monitor during the deployment process.

    

  
    - *(dict) --* 

      Amazon CloudWatch alarms to monitor during the deployment process.

      

    
      - **AlarmArn** *(string) --* **[REQUIRED]** 

        Amazon Resource Name (ARN) of the Amazon CloudWatch alarm.

        

      
      - **AlarmRoleArn** *(string) --* 

        ARN of an Identity and Access Management (IAM) role for AppConfig to monitor ``AlarmArn``.

        

      
    

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

    
    ::

      {
          'ApplicationId': 'string',
          'Id': 'string',
          'Name': 'string',
          'Description': 'string',
          'State': 'READY_FOR_DEPLOYMENT'|'DEPLOYING'|'ROLLING_BACK'|'ROLLED_BACK'|'REVERTED',
          'Monitors': [
              {
                  'AlarmArn': 'string',
                  'AlarmRoleArn': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ApplicationId** *(string) --* 

        The application ID.

        
      

      - **Id** *(string) --* 

        The environment ID.

        
      

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

        The name of the environment.

        
      

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

        The description of the environment.

        
      

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

        The state of the environment. An environment can be in one of the following states: ``READY_FOR_DEPLOYMENT``, ``DEPLOYING``, ``ROLLING_BACK``, or ``ROLLED_BACK``

        
      

      - **Monitors** *(list) --* 

        Amazon CloudWatch alarms monitored during the deployment.

        
        

        - *(dict) --* 

          Amazon CloudWatch alarms to monitor during the deployment process.

          
          

          - **AlarmArn** *(string) --* 

            Amazon Resource Name (ARN) of the Amazon CloudWatch alarm.

            
          

          - **AlarmRoleArn** *(string) --* 

            ARN of an Identity and Access Management (IAM) role for AppConfig to monitor ``AlarmArn``.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`AppConfig.Client.exceptions.BadRequestException`

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

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

  

  **Examples**

  The following update-environment example updates an environment's description.
  ::

    response = client.update_environment(
        ApplicationId='339ohji',
        Description='An environment for examples.',
        EnvironmentId='54j1r29',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ApplicationId': '339ohji',
        'Description': 'An environment for examples.',
        'Id': '54j1r29',
        'Name': 'Example-Environment',
        'State': 'ROLLED_BACK',
        'ResponseMetadata': {
            '...': '...',
        },
    }

  