AppConfigData

Table of Contents

Client

class AppConfigData.Client

A low-level client representing AWS AppConfig Data

AppConfig Data provides the data plane APIs your application uses to retrieve configuration data. Here's how it works:

Your application retrieves configuration data by first establishing a configuration session using the AppConfig Data 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 the following information:

  • Identifiers (ID or name) of an AppConfig application, environment, and configuration profile that the session tracks.
  • (Optional) The minimum amount of time the session's client must wait between calls to GetLatestConfiguration .

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

Warning

This token should only be used once in your first call to GetLatestConfiguration . You must use the new token in the GetLatestConfiguration response ( NextPollConfigurationToken ) in each subsequent call to GetLatestConfiguration .

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 .
  • NextPollIntervalInSeconds : the duration the client should wait before making its next call to GetLatestConfiguration . This duration may vary over the course of the session, so it should be used instead of the value sent on the StartConfigurationSession call.
  • The configuration: the latest data intended for the session. This may be empty if the client already has the latest version of the configuration.

Warning

The InitialConfigurationToken and NextPollConfigurationToken should only be used once. To support long poll use cases, the tokens are valid for up to 24 hours. If a GetLatestConfiguration call uses an expired token, the system returns BadRequestException .

For more information and to view example CLI commands that show how to retrieve a configuration using the AppConfig Data StartConfigurationSession and GetLatestConfiguration API actions, see Retrieving the configuration in the AppConfig User Guide .

import boto3

client = boto3.client('appconfigdata')

These are the available methods:

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
close()

Closes underlying endpoint connections.

get_latest_configuration(**kwargs)

Retrieves the latest deployed configuration. This API may return empty configuration data if the client already has the latest version. For more information about this API action and to view example CLI commands that show how to use it with the StartConfigurationSession API action, see Retrieving the configuration in the AppConfig User Guide .

Warning

Note the following important information.

  • Each configuration token is only valid for one call to GetLatestConfiguration . The GetLatestConfiguration response includes a NextPollConfigurationToken that should always replace the token used for the just-completed call in preparation for the next one.
  • GetLatestConfiguration is a priced call. For more information, see Pricing.

See also: AWS API Documentation

Request Syntax

response = client.get_latest_configuration(
    ConfigurationToken='string'
)
Parameters
ConfigurationToken (string) --

[REQUIRED]

Token describing the current state of the configuration session. To obtain a token, first call the StartConfigurationSession API. Note that every call to GetLatestConfiguration will return a new ConfigurationToken ( NextPollConfigurationToken in the response) and must be provided to subsequent GetLatestConfiguration API calls.

Warning

This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a GetLatestConfiguration call uses an expired token, the system returns BadRequestException .

Return type
dict
Returns
Response Syntax
{
    'NextPollConfigurationToken': 'string',
    'NextPollIntervalInSeconds': 123,
    'ContentType': 'string',
    'Configuration': StreamingBody(),
    'VersionLabel': 'string'
}

Response Structure

  • (dict) --
    • NextPollConfigurationToken (string) --

      The latest token describing the current state of the configuration session. This must be provided to the next call to GetLatestConfiguration.

      Warning

      This token should only be used once. To support long poll use cases, the token is valid for up to 24 hours. If a GetLatestConfiguration call uses an expired token, the system returns BadRequestException .

    • NextPollIntervalInSeconds (integer) --

      The amount of time the client should wait before polling for configuration updates again. Use RequiredMinimumPollIntervalInSeconds to set the desired poll interval.

    • ContentType (string) --

      A standard MIME type describing the format of the configuration content.

    • Configuration (StreamingBody) --

      The data of the configuration. This may be empty if the client already has the latest version of configuration.

    • VersionLabel (string) --

      The user-defined label for the AppConfig hosted configuration version. This attribute doesn't apply if the configuration is not from an AppConfig hosted configuration version. If the client already has the latest version of the configuration data, this value is empty.

Exceptions

  • AppConfigData.Client.exceptions.ThrottlingException
  • AppConfigData.Client.exceptions.ResourceNotFoundException
  • AppConfigData.Client.exceptions.BadRequestException
  • AppConfigData.Client.exceptions.InternalServerException
get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
start_configuration_session(**kwargs)

Starts a configuration session used to retrieve a deployed configuration. For more information about this API action and to view example CLI commands that show how to use it with the GetLatestConfiguration API action, see Retrieving the configuration in the AppConfig User Guide .

See also: AWS API Documentation

Request Syntax

response = client.start_configuration_session(
    ApplicationIdentifier='string',
    EnvironmentIdentifier='string',
    ConfigurationProfileIdentifier='string',
    RequiredMinimumPollIntervalInSeconds=123
)
Parameters
  • ApplicationIdentifier (string) --

    [REQUIRED]

    The application ID or the application name.

  • EnvironmentIdentifier (string) --

    [REQUIRED]

    The environment ID or the environment name.

  • ConfigurationProfileIdentifier (string) --

    [REQUIRED]

    The configuration profile ID or the configuration profile name.

  • RequiredMinimumPollIntervalInSeconds (integer) -- Sets a constraint on a session. If you specify a value of, for example, 60 seconds, then the client that established the session can't call GetLatestConfiguration more frequently than every 60 seconds.
Return type

dict

Returns

Response Syntax

{
    'InitialConfigurationToken': 'string'
}

Response Structure

  • (dict) --

    • InitialConfigurationToken (string) --

      Token encapsulating state about the configuration session. Provide this token to the GetLatestConfiguration API to retrieve configuration data.

      Warning

      This token should only be used once in your first call to GetLatestConfiguration . You must use the new token in the GetLatestConfiguration response ( NextPollConfigurationToken ) in each subsequent call to GetLatestConfiguration .

      The InitialConfigurationToken and NextPollConfigurationToken should only be used once. To support long poll use cases, the tokens are valid for up to 24 hours. If a GetLatestConfiguration call uses an expired token, the system returns BadRequestException .

Exceptions

  • AppConfigData.Client.exceptions.ThrottlingException
  • AppConfigData.Client.exceptions.ResourceNotFoundException
  • AppConfigData.Client.exceptions.BadRequestException
  • AppConfigData.Client.exceptions.InternalServerException

Paginators

The available paginators are: