Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . appconfig ]

get-configuration

Description

Retrieves the latest deployed configuration.

Warning

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 .
  • 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 .

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  get-configuration
--application <value>
--environment <value>
--configuration <value>
--client-id <value>
[--client-configuration-version <value>]
<outfile>

Options

--application (string)

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

--environment (string)

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

--configuration (string)

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

--client-id (string)

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

--client-configuration-version (string)

The configuration version returned in the most recent GetConfiguration response.

Warning

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 AppConfig User Guide .

outfile (string) Filename where the content will be saved

See 'aws help' for descriptions of global parameters.

Examples

To retrieve configuration details

The following get-configuration example returns the configuration details of the example application. On subsequent calls to get-configuration use the client-configuration-version parameter to only update the configuration of your application if the version has changed. Only updating the configuration when the version has changed avoids excess charges incurred by calling get-configuration.

aws appconfig get-configuration \
    --application "example-application" \
    --environment "Example-Environment" \
    --configuration "Example-Configuration-Profile" \
    --client-id "test-id" \
    configuration-output-file

Contents of configuration-output-file:

{ "Name": "ExampleApplication", "Id": ExampleID, "Rank": 7 }

Output:

{
    "ConfigurationVersion": "1",
    "ContentType": "application/json"
}

For more information, see Step 6: Receiving the configuration in the AWS AppConfig User Guide.

Output

Content -> (blob)

The content of the configuration or the configuration data.

Warning

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, AppConfig returns a 204 No Content HTTP response code and the Content value will be empty.

ConfigurationVersion -> (string)

The configuration version.

ContentType -> (string)

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