/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
using System;
using System.Net.Http;
using Amazon.Extensions.NETCore.Setup;
using Microsoft.Extensions.Configuration;
namespace Amazon.Extensions.Configuration.SystemsManager.AppConfig
{
///
///
/// Represents AWS Systems Manager AppConfig variables as an .
///
public class AppConfigConfigurationSource : ISystemsManagerConfigurationSource
{
///
/// AppConfig Application Id.
///
public string ApplicationId { get; set; }
///
/// AppConfig Environment Id.
///
public string EnvironmentId { get; set; }
///
/// AppConfig Configuration Profile Id.
///
public string ConfigProfileId { get; set; }
///
/// used to create an AWS Systems Manager Client />.
///
public AWSOptions AwsOptions { get; set; }
///
public bool Optional { get; set; }
///
public TimeSpan? ReloadAfter { get; set; }
///
/// Indicates to use configured lambda extension HTTP client to retrieve AppConfig data.
///
internal bool UseLambdaExtension { get; set; }
///
/// Used only when integrating with the AWS AppConfig Lambda extension.
///
/// This property allows customizing the HttpClient connecting to the AWS AppConfig Lambda extension. This is useful
/// to instrument the HttpClient for telemetry. For example adding the Amazon.XRay.Recorder.Handlers.System.Net.HttpClientXRayTracingHandler handle for AWS X-Ray tracing.
///
public HttpClient CustomHttpClientForLambdaExtension { get; set; }
///
public Action OnLoadException { get; set; }
///
public IConfigurationProvider Build(IConfigurationBuilder builder)
{
return new SystemsManagerConfigurationProvider(this);
}
}
}