# Fact

A database of regional information.

- Source: [`region-info/lib/fact.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/region-info/lib/fact.ts#L20)
- Type last changed: v2.104.0 · 2 Nov 2023

## 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

- `names`: string[] (static) — Returns the list of names of registered facts.

  All facts will be present in at least one region.

- `regions`: string[] (static)

## Methods

- `definedFacts(): string[][]` (static) — Return all pairs of (region, factName) that are defined.

- `find(region: string, name: string): string` (static) — Retrieves a fact from this Fact database.

  **Parameters**

  - `region` — the name of the region (e.g: `us-east-1`).
  - `name` — 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` (static) — Registers a new fact in this Fact database.

  **Parameters**

  - `fact` — the new fact to be registered.
  - `allowReplacing` — whether new facts can replace existing facts or not.

- `requireFact(region: string, name: string): string` (static) — Retrieve a fact from the Fact database.

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

  **Parameters**

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

- `unregister(region: string, name: string, value?: string): void` (static) — Removes a fact from the database.

  **Parameters**

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