Skip to content

get_configuration async

get_configuration(
    application: StringWithLengthBetween1And64,
    environment: StringWithLengthBetween1And64,
    configuration: StringWithLengthBetween1And64,
    client_id: StringWithLengthBetween1And64,
    *,
    config_overrides: Optional[AsyncAppConfigClientConfig] = None,
    client_configuration_version: Optional[Version] = None,
) -> Configuration

(Deprecated) Retrieves the latest deployed configuration.

Note the following important information.

Parameters:

  • application (StringWithLengthBetween1And64) –

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

  • environment (StringWithLengthBetween1And64) –

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

  • configuration (StringWithLengthBetween1And64) –

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

  • client_id (StringWithLengthBetween1And64) –

    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 (Optional[Version], default: None ) –

    The configuration version returned in the most recent GetConfiguration response.

    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.

    For more information about working with configurations, see Retrieving feature flags and configuration data in AppConfig in the AppConfig User Guide.

Raises:

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.

>>> await client.get_configuration(application='example-application', environment='Example-Environment', configuration='Example-Configuration-Profile', client_id='example-id')
Source code in docs_src/capo_appconfig/_services/async_app_config.py
async def get_configuration(
    self,
    application: "capo_appconfig.types.string_with_length_between1_and64.StringWithLengthBetween1And64",
    environment: "capo_appconfig.types.string_with_length_between1_and64.StringWithLengthBetween1And64",
    configuration: "capo_appconfig.types.string_with_length_between1_and64.StringWithLengthBetween1And64",
    client_id: "capo_appconfig.types.string_with_length_between1_and64.StringWithLengthBetween1And64",
    *,
    config_overrides: Optional[AsyncAppConfigClientConfig] = None,
    client_configuration_version: Optional[
        "capo_appconfig.types.version.Version"
    ] = None,
) -> "capo_appconfig.types.configuration.Configuration":
    """<p>(Deprecated) Retrieves the latest deployed configuration.</p> <important> <p>Note the following important information.</p> <ul> <li> <p>This API action is deprecated. Calls to receive configuration data should use the <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_StartConfigurationSession.html">StartConfigurationSession</a> and <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/API_appconfigdata_GetLatestConfiguration.html">GetLatestConfiguration</a> APIs instead. </p> </li> <li> <p> <a>GetConfiguration</a> is a priced call. For more information, see <a href="https://aws.amazon.com/systems-manager/pricing/">Pricing</a>.</p> </li> </ul> </important>

    Args:
        application: <p>The application to get. Specify either the application name or the application ID.</p>
        environment: <p>The environment to get. Specify either the environment name or the environment ID.</p>
        configuration: <p>The configuration to get. Specify either the configuration name or the configuration ID.</p>
        client_id: <p>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. </p>
        client_configuration_version: <p>The configuration version returned in the most recent <a>GetConfiguration</a> response.</p> <important> <p>AppConfig uses the value of the <code>ClientConfigurationVersion</code> parameter to identify the configuration version on your clients. If you don’t send <code>ClientConfigurationVersion</code> with each call to <a>GetConfiguration</a>, your clients receive the current configuration. You are charged each time your clients receive a configuration.</p> <p>To avoid excess charges, we recommend you use the <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/StartConfigurationSession.html">StartConfigurationSession</a> and <a href="https://docs.aws.amazon.com/appconfig/2019-10-09/APIReference/GetLatestConfiguration.html">GetLatestConfiguration</a> APIs, which track the client configuration version on your behalf. If you choose to continue using <a>GetConfiguration</a>, we recommend that you include the <code>ClientConfigurationVersion</code> value with every call to <a>GetConfiguration</a>. The value to use for <code>ClientConfigurationVersion</code> comes from the <code>ConfigurationVersion</code> attribute returned by <a>GetConfiguration</a> when there is new or updated data, and should be saved for subsequent calls to <a>GetConfiguration</a>.</p> </important> <p>For more information about working with configurations, see <a href="http://docs.aws.amazon.com/appconfig/latest/userguide/retrieving-feature-flags.html">Retrieving feature flags and configuration data in AppConfig</a> in the <i>AppConfig User Guide</i>.</p>

    Raises:
        capo_appconfig.errors.bad_request_exception.BadRequestException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_appconfig.errors.internal_server_exception.InternalServerException: <p>There was an internal failure in the AppConfig service.</p>
        capo_appconfig.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_appconfig.errors.UnknownServiceError: The service returned an error code this client does not model.

    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.

        >>> await client.get_configuration(application='example-application', environment='Example-Environment', configuration='Example-Configuration-Profile', client_id='example-id')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appconfig.types.get_configuration_request.GetConfigurationRequest]",
    ) -> AsyncOperationResponse["capo_appconfig.types.configuration.Configuration"]:
        import capo_appconfig._operations.amazon_app_config.get_configuration

        (
            output,
            http_response,
        ) = await capo_appconfig._operations.amazon_app_config.get_configuration.async_get_configuration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_appconfig.types.configuration.Configuration",
    ) -> dict[str, Any]:
        import capo_appconfig.types.configuration

        return capo_appconfig.types.configuration.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetConfiguration", redact_output=_redact_output),
    )
    input_: capo_appconfig.types.get_configuration_request.GetConfigurationRequest = {
        "application": application,
        "environment": environment,
        "configuration": configuration,
        "client_id": client_id,
    }
    if client_configuration_version is not None:
        input_["client_configuration_version"] = client_configuration_version

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output