1
#pragma once
2

            
3
#include <memory>
4

            
5
#include "envoy/common/pure.h"
6

            
7
#include "absl/types/optional.h"
8

            
9
namespace Envoy {
10
namespace Extensions {
11
namespace Common {
12
namespace Aws {
13

            
14
/**
15
 * Interface for classes capable of discovering the AWS region from the execution environment.
16
 */
17
class RegionProvider {
18
public:
19
66
  virtual ~RegionProvider() = default;
20

            
21
  /**
22
   * Discover and return the AWS region.
23
   * @return AWS region, or nullopt if unable to discover the region.
24
   */
25
  virtual absl::optional<std::string> getRegion() PURE;
26

            
27
  /**
28
   * Discover and return the AWS region set string.
29
   * @return AWS region, or nullopt if unable to discover the region set.
30
   */
31
  virtual absl::optional<std::string> getRegionSet() PURE;
32
};
33

            
34
using RegionProviderPtr = std::unique_ptr<RegionProvider>;
35
using RegionProviderSharedPtr = std::shared_ptr<RegionProvider>;
36

            
37
} // namespace Aws
38
} // namespace Common
39
} // namespace Extensions
40
} // namespace Envoy