Skip to content
v2.273.0

Fact Class ​

A database of regional information.

Example ​

ts
class MyFact implements regionInfo.IFact {
  public readonly region = 'bermuda-triangle-1';
  public readonly name = regionInfo.FactName.S3_STATIC_WEBSITE_ENDPOINT;
  public readonly value = 's3-website.bermuda-triangle-1.nowhere.com';
}

regionInfo.Fact.register(new MyFact());

Properties ​

namesstring[]namestyping.List[str]namesList<String>Namesstring[]Names*[]*stringrequiredstatic#
Returns the list of names of registered facts.

All facts will be present in at least one region.

regionsstring[]regionstyping.List[str]regionsList<String>Regionsstring[]Regions*[]*stringrequiredstatic#

Methods ​

definedFacts(): string[][]@staticmethod def defined_facts() -> typing.List[typing.List[str]]public static List<List<String>> definedFacts()public static string[][] DefinedFacts()func DefinedFacts() *[]*[]*stringstatic#
Return all pairs of (region, factName) that are defined.
find(region: string, name: string): string@staticmethod def find(region: str, name: str) -> strpublic static String find(String region, String name)public static string Find(string region, string name)func Find(Region *string, Name *string) *stringstatic#
Retrieves a fact from this Fact database.
2 parameters · returns

Parameters

  • regionregionregionregionRegion — the name of the region (e.g: us-east-1).
  • namenamenamenameName — the name of the fact being looked up (see the FactName class for details).

Returns: the fact value if it is known, and undefined otherwise.

register(fact: IFact, allowReplacing?: boolean): void@staticmethod def register(fact: IFact, allow_replacing: typing.Optional[bool] = None) -> Nonepublic static void register(IFact fact, Boolean allowReplacing)public static void Register(IFact fact, bool? allowReplacing = null)func Register(Fact IFact, AllowReplacing *bool)static#
Registers a new fact in this Fact database.
2 parameters

Parameters

  • factfactfactfactFact — the new fact to be registered.
  • allowReplacingallow_replacingallowReplacingallowReplacingAllowReplacing — whether new facts can replace existing facts or not.
requireFact(region: string, name: string): string@staticmethod def require_fact(region: str, name: str) -> strpublic static String requireFact(String region, String name)public static string RequireFact(string region, string name)func RequireFact(Region *string, Name *string) *stringstatic#
Retrieve a fact from the Fact database.

(retrieval will fail if the specified region or fact name does not exist.)

2 parameters

Parameters

  • regionregionregionregionRegion — the name of the region (e.g: us-east-1).
  • namenamenamenameName — the name of the fact being looked up (see the FactName class for details).
unregister(region: string, name: string, value?: string): void@staticmethod def unregister(region: str, name: str, value: typing.Optional[str] = None) -> Nonepublic static void unregister(String region, String name, String value)public static void Unregister(string region, string name, string? value = null)func Unregister(Region *string, Name *string, Value *string)static#
Removes a fact from the database.
3 parameters

Parameters

  • regionregionregionregionRegion — the region for which the fact is to be removed.
  • namenamenamenameName — the name of the fact to remove.
  • valuevaluevaluevalueValue — the value that should be removed (removal will fail if the value is specified, but does not match the current stored value).