

# Finding and tracking Elastic Beanstalk resources with Amazon Config
<a name="AWSHowTo.config"></a>

[Amazon Config](http://www.amazonaws.cn/config/) provides a detailed view of the configuration of Amazon resources in your Amazon account. You can see how resources are related, get a history of configuration changes, and see how relationships and configurations change over time. You can use Amazon Config to define rules that evaluate resource configurations for data compliance.

Several Elastic Beanstalk resource types are integrated with Amazon Config:
+ Applications
+ Application Versions
+ Environments

The following section shows how to configure Amazon Config to record resources of these types.

For more information about Amazon Config, see the [Amazon Config Developer Guide](https://docs.amazonaws.cn/config/latest/developerguide/). For pricing information, see the [Amazon Config pricing information page](http://www.amazonaws.cn/config/pricing/).

## Setting up Amazon Config
<a name="AWSHowTo.config.setup"></a>

To initially set up Amazon Config, see the following topics in the [Amazon Config Developer Guide](https://docs.amazonaws.cn/config/latest/developerguide/).
+ [Setting up Amazon Config with the Console](https://docs.amazonaws.cn/config/latest/developerguide/gs-console.html)
+ [Setting up Amazon Config with the Amazon CLI](https://docs.amazonaws.cn/config/latest/developerguide/gs-cli.html)

## Configuring Amazon Config to record Elastic Beanstalk resources
<a name="AWSHowTo.config.record"></a>

By default, Amazon Config records configuration changes for all supported types of *regional resources* that it discovers in the region in which your environment is running. You can customize Amazon Config to record changes only for specific resource types, or changes to *global resources*.

For example, you can configure Amazon Config to record changes for Elastic Beanstalk resources and a subset of other Amazon resources that Elastic Beanstalk starts for you. Using the [Amazon Config Console](https://docs.amazonaws.cn/config/latest/developerguide/gs-console.html), you can select Elastic Beanstalk as a resource in the Amazon Config **Settings** page from the **Specific Types** field. From there you can choose to record any of the Elastic Beanstalk resource types: **Application**, **ApplicationVersion**, and **Environment**. 

The following figure shows the Amazon Config **Settings** page, with Elastic Beanstalk resource types that you can choose to record: **Application**, **ApplicationVersion**, and **Environment**.

![\[Amazon Config settings page showing a list of resource types to choose to record\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/images/cc-settings-resource-types.png)


After you select a few resource types, this is how the **Specific types** list appears.

![\[Amazon Config settings page showing selected resource types to record\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/images/cc-settings-resource-types-selected.png)


To learn about *regional* vs. *global* resources, and for the full customization procedure, see [Selecting which Resources Amazon Config Records](https://docs.amazonaws.cn/config/latest/developerguide/select-resources.html).

## Viewing Elastic Beanstalk configuration details in the Amazon Config console
<a name="AWSHowTo.config.viewing"></a>

You can use the Amazon Config console to look for Elastic Beanstalk resources, and get current and historical details about their configurations. The following example shows how to find information about an Elastic Beanstalk environment.

**To find an Elastic Beanstalk environment in the Amazon Config console**

1. Open the [Amazon Config console](https://console.amazonaws.cn/config).

1. Choose **Resources**.

1. On the **Resource inventory** page, choose **Resources**.

1. Open the **Resource type** menu, scroll to **ElasticBeanstalk**, and then choose one or more of the Elastic Beanstalk resource types. 
**Note**  
To view configuration details for other resources that Elastic Beanstalk created for your application, choose additional resource types. For example, you can choose **Instance** under **EC2**.

1. Choose **Look up**. See **2** in the following figure.   
![\[Amazon Config resource inventory page showing a list of resource types to look up\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/images/cc-resources-dropdown.png)

1. Choose a resource ID in the list of resources that Amazon Config displays.  
![\[Amazon Config resource inventory page showing a list of resources\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/images/cc-resources-list.png)

Amazon Config displays configuration details and other information about the resource you selected.

![\[Amazon Config resource details page showing configuration details for an Elastic Beanstalk environment\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/images/cc-resources-resource-details.png)


To see the full details of the recorded configuration, choose **View Details**.

![\[Amazon Config resource details page showing configuration details for an Elastic Beanstalk environment\]](http://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/images/cc-resources-view-details.png)


To learn more ways to find a resource and view information on this page, see [Viewing Amazon Resource Configurations and History](https://docs.amazonaws.cn/config/latest/developerguide/view-manage-resource.html) in the *Amazon Config Developer Guide*.

## Evaluating Elastic Beanstalk resources using Amazon Config rules
<a name="AWSHowTo.config.rules"></a>

You can create Amazon Config rules, which represent the ideal configuration settings for your Elastic Beanstalk resources. You can use predefined *Amazon Managed Config Rules*, or define custom rules. Amazon Config continuously tracks changes to the configuration of your resources to determine whether those changes violate any of the conditions in your rules. The Amazon Config console shows the compliance status of your rules and resources.

If a resource violates a rule and is flagged as *noncompliant*, Amazon Config can alert you using an [Amazon Simple Notification Service (Amazon SNS)](http://www.amazonaws.cn/sns/) topic. To programmatically consume the data in these Amazon Config alerts, use an [Amazon Simple Queue Service (Amazon SQS)](http://www.amazonaws.cn/sqs/) queue as the notification endpoint for the Amazon SNS topic. For example, you might want to write code that starts a workflow when someone modifies your environment's Auto Scaling group configuration.

To learn more about setting up and using rules, see [Evaluating Resources with Amazon Config Rules](https://docs.amazonaws.cn/config/latest/developerguide/evaluate-config.html) in the *Amazon Config Developer Guide*.