GetConfiguration - AWS AppConfig

GetConfiguration

Retrieves the latest deployed configuration.

Important

Note the following important information.

  • This API action has been deprecated. Calls to receive configuration data should use the StartConfigurationSession and GetLatestConfiguration APIs instead.

  • GetConfiguration is a priced call. For more information, see Pricing.

  • AWS AppConfig uses the value of the ClientConfigurationVersion parameter to identify the configuration version on your clients. If you don’t send ClientConfigurationVersion with each call to GetConfiguration, your clients receive the current configuration. You are charged each time your clients receive a configuration.

    To avoid excess charges, we recommend you use the StartConfigurationSession and GetLatestConfiguration APIs, which track the client configuration version on your behalf. If you choose to continue using GetConfiguration, we recommend that you include the ClientConfigurationVersion value with every call to GetConfiguration. The value to use for ClientConfigurationVersion comes from the ConfigurationVersion attribute returned by GetConfiguration when there is new or updated data, and should be saved for subsequent calls to GetConfiguration.

Request Syntax

GET /applications/Application/environments/Environment/configurations/Configuration?client_configuration_version=ClientConfigurationVersion&client_id=ClientId HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

Application

The application to get. Specify either the application name or the application ID.

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: Yes

ClientConfigurationVersion

The configuration version returned in the most recent GetConfiguration response.

Important

AWS AppConfig uses the value of the ClientConfigurationVersion parameter to identify the configuration version on your clients. If you don’t send ClientConfigurationVersion with each call to GetConfiguration, your clients receive the current configuration. You are charged each time your clients receive a configuration.

To avoid excess charges, we recommend that you include the ClientConfigurationVersion value with every call to GetConfiguration. This value must be saved on your client. Subsequent calls to GetConfiguration must pass this value by using the ClientConfigurationVersion parameter.

For more information about working with configurations, see Retrieving the Configuration in the AWS AppConfig User Guide.

Length Constraints: Minimum length of 1. Maximum length of 1024.

ClientId

The clientId parameter in the following command is a unique, user-specified ID to identify the client for the configuration. This ID enables AWS AppConfig to deploy the configuration in intervals, as defined in the deployment strategy.

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: Yes

Configuration

The configuration to get. Specify either the configuration name or the configuration ID.

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: Yes

Environment

The environment to get. Specify either the environment name or the environment ID.

Length Constraints: Minimum length of 1. Maximum length of 64.

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 Configuration-Version: ConfigurationVersion Content-Type: ContentType Content

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The response returns the following HTTP headers.

ConfigurationVersion

The configuration version.

Length Constraints: Minimum length of 1. Maximum length of 1024.

ContentType

A standard MIME type describing the format of the configuration content. For more information, see Content-Type.

The response returns the following as the HTTP body.

Content

The content of the configuration or the configuration data.

Important

The Content attribute only contains data if the system finds new or updated configuration data. If there is no new or updated data and ClientConfigurationVersion matches the version of the current configuration, AWS AppConfig returns a 204 No Content HTTP response code and the Content value will be empty.

Errors

For information about the errors that are common to all actions, see Common Errors.

BadRequestException

The input fails to satisfy the constraints specified by an AWS service.

HTTP Status Code: 400

InternalServerException

There was an internal failure in the AWS AppConfig service.

HTTP Status Code: 500

ResourceNotFoundException

The requested resource could not be found.

HTTP Status Code: 404

Examples

Example

This example illustrates one usage of GetConfiguration.

Sample Request

GET /applications/test-application/environments/Example-Environment/configurations/Example-Configuration-Profile?client_id=test-id HTTP/1.1 Host: appconfig.us-east-1.amazonaws.com Accept-Encoding: identity User-Agent: aws-cli/2.2.4 Python/3.8.8 Linux/5.4.134-73.228.amzn2int.x86_64 exe/x86_64.amzn.2 prompt/off command/appconfig.get-configuration X-Amz-Date: 20210917T215745Z Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20210917/us-east-1/appconfig/aws4_request, SignedHeaders=host;x-amz-date, Signature=39c3b3042cd2aEXAMPLE

Sample Response

{ "ConfigurationVersion": "1", "ContentType": "application/octet-stream" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: