Retrieving feature flags and configuration data in Amazon AppConfig - Amazon AppConfig
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Retrieving feature flags and configuration data in Amazon AppConfig

Your application retrieves feature flags and free form configuration data by establishing a configuration session using the Amazon AppConfig Data service. If you use one of the simplified retrieval methods described in this section, either the Amazon AppConfig Agent Lambda extension or Amazon AppConfig Agent manages a series of API calls and session tokens on your behalf. You configure Amazon AppConfig Agent as a local host and have the agent poll Amazon AppConfig for configuration updates. The agent calls the StartConfigurationSession and GetLatestConfiguration API actions and caches your configuration data locally. To retrieve the data, your application makes an HTTP call to the localhost server. Amazon AppConfig Agent supports several use cases, as described in Simplified retrieval methods.

If you prefer, you can manually call these API actions to retrieve a configuration. The API process works as follows:

Your application establishes a configuration session using the StartConfigurationSession API action. Your session's client then makes periodic calls to GetLatestConfiguration to check for and retrieve the latest data available.

When calling StartConfigurationSession, your code sends identifiers (ID or name) of an Amazon AppConfig application, environment, and configuration profile that the session tracks.

In response, Amazon AppConfig provides an InitialConfigurationToken to be given to the session's client and used the first time it calls GetLatestConfiguration for that session.

When calling GetLatestConfiguration, your client code sends the most recent ConfigurationToken value it has and receives in response:

  • NextPollConfigurationToken: the ConfigurationToken value to use on the next call to GetLatestConfiguration.

  • The configuration: the latest data intended for the session. This may be empty if the client already has the latest version of the configuration.

This section includes the following information.