> ## Documentation Index
> Fetch the complete documentation index at: https://cloudanix.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Ensure Enhanced Health Reporting Is Enabled For Elastic Beanstalk Environments

### More Info:

Ensure that the Enhanced Health Reporting feature is enabled for all Amazon Elastic Beanstalk (EB) environments provisioned in your AWS account.

### Risk Level

Medium

### Address

Operational Maturity, Reliability

### Compliance Standards

HIPAA

### Triage and Remediation

<Tabs>
  <Tab title="Remediation">
    ### Remediation

    <AccordionGroup>
      <Accordion title="Using Console" defaultOpen="true">
        To remediate the misconfiguration "Ensure Enhanced Health Reporting Is Enabled For Elastic Beanstalk Environments" for AWS using the AWS console, please follow the below steps:

        1. Log in to the AWS Management Console.

        2. Go to the Elastic Beanstalk console.

        3. Select the desired environment for which you want to enable enhanced health reporting.

        4. In the left navigation pane, click on "Configuration".

        5. Scroll down to the "Monitoring" section and click on "Edit".

        6. In the "Health reporting" section, select "Enhanced" from the drop-down menu.

        7. Click on "Apply" to save the changes.

        8. Verify that the enhanced health reporting is enabled by checking the "Health" tab in the Elastic Beanstalk console.

        Once these steps are completed, the misconfiguration "Ensure Enhanced Health Reporting Is Enabled For Elastic Beanstalk Environments" will be remediated for the selected Elastic Beanstalk environment in AWS.

        #
      </Accordion>

      <Accordion title="Using CLI">
        To remediate the misconfiguration "Ensure Enhanced Health Reporting Is Enabled For Elastic Beanstalk Environments" in AWS using AWS CLI, follow the below steps:

        1. Open the AWS CLI and run the following command to enable enhanced health reporting for Elastic Beanstalk environments:

        ```
        aws elasticbeanstalk update-environment --environment-name <environment-name> --option-settings Namespace=aws:elasticbeanstalk:healthreporting:system,OptionName=SystemType,Value=enhanced
        ```

        Replace `<environment-name>` with the name of the Elastic Beanstalk environment for which you want to enable enhanced health reporting.

        2. Once the command is executed successfully, the enhanced health reporting feature will be enabled for the Elastic Beanstalk environment.

        3. You can verify the status of enhanced health reporting by running the following command:

        ```
        aws elasticbeanstalk describe-environments --environment-names <environment-name> --query "Environments[*].OptionSettings[?OptionName=='HealthType'].Value" --output text
        ```

        Replace `<environment-name>` with the name of the Elastic Beanstalk environment for which you want to verify the status of enhanced health reporting.

        4. If the output of the above command is "enhanced", then enhanced health reporting is enabled for the Elastic Beanstalk environment.

        By following the above steps, you can successfully remediate the misconfiguration "Ensure Enhanced Health Reporting Is Enabled For Elastic Beanstalk Environments" in AWS using AWS CLI.
      </Accordion>

      <Accordion title="Using Python">
        To remediate the misconfiguration "Ensure Enhanced Health Reporting Is Enabled For Elastic Beanstalk Environments" in AWS using Python, you can follow the below steps:

        1. Open the AWS Management Console and navigate to Elastic Beanstalk.

        2. Select the Elastic Beanstalk environment for which you want to enable Enhanced Health Reporting.

        3. Click on the Configuration tab and then select the Health reporting option.

        4. In the Health reporting section, select the Enhanced option.

        5. Click on the Save button to save the changes.

        6. Use the AWS SDK for Python (Boto3) to enable Enhanced Health Reporting for Elastic Beanstalk environments programmatically.

        7. Install the Boto3 library by running the following command in your command prompt or terminal:

        ```
        pip install boto3
        ```

        8. Create a Python script and import the Boto3 library.

        ```python theme={null}
        import boto3
        ```

        9. Create an Elastic Beanstalk client using the Boto3 library.

        ```python theme={null}
        eb_client = boto3.client('elasticbeanstalk')
        ```

        10. Use the `update_environment` method to update the environment with the Enhanced Health Reporting enabled.

        ```python theme={null}
        eb_client.update_environment(
            ApplicationName='your-application-name',
            EnvironmentName='your-environment-name',
            OptionSettings=[
                {
                    'Namespace': 'aws:elasticbeanstalk:healthreporting:system',
                    'OptionName': 'SystemType',
                    'Value': 'enhanced'
                }
            ]
        )
        ```

        11. Replace the `your-application-name` and `your-environment-name` with your actual application name and environment name.

        12. Run the Python script to enable Enhanced Health Reporting for the Elastic Beanstalk environment.

        After following these steps, Enhanced Health Reporting will be enabled for the Elastic Beanstalk environment in AWS.
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>

### Additional Reading:

* [https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced.html](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced.html)
