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

***************
get_environment
***************



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

  

  Retrieves information about an environment. An environment is a deployment group of AppConfig applications, such as applications in a ``Production`` environment or in an ``EU_Region`` environment. Each configuration deployment targets an environment. You can enable one or more Amazon CloudWatch alarms for an environment. If an alarm is triggered during a deployment, AppConfig roles back the configuration.

  

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


  **Request Syntax**
  ::

    response = client.get_environment(
        ApplicationId='string',
        EnvironmentId='string'
    )
    
  :type ApplicationId: string
  :param ApplicationId: **[REQUIRED]** 

    The ID of the application that includes the environment you want to get.

    

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

    The ID of the environment that you want to get.

    

  
  
  :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.ResourceNotFoundException`

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

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

  

  **Examples**

  The following get-environment example returns the details and state of the specified environment.
  ::

    response = client.get_environment(
        ApplicationId='339ohji',
        EnvironmentId='54j1r29',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ApplicationId': '339ohji',
        'Id': '54j1r29',
        'Name': 'Example-Environment',
        'State': 'READY_FOR_DEPLOYMENT',
        'ResponseMetadata': {
            '...': '...',
        },
    }

  