aws-cdk-lib.region_info.Fact

class Fact

LanguageType name
.NETAmazon.CDK.RegionInfo.Fact
Gogithub.com/aws/aws-cdk-go/awscdk/v2/regioninfo#Fact
Javasoftware.amazon.awscdk.regioninfo.Fact
Pythonaws_cdk.region_info.Fact
TypeScript (source)aws-cdk-lib » region_info » Fact

A database of regional information.

Example

class MyFact implements regionInfo.IFact {
  public readonly region = 'us-east-1';
  public readonly name = regionInfo.FactName.servicePrincipal('service.amazonaws.com');
  public readonly value = 'the-correct-principal.amazonaws.com';
}

regionInfo.Fact.register(new MyFact(), true /* Allow overriding information */);

Properties

NameTypeDescription
static regionsstring[]

static regions

Type: string[]

Methods

NameDescription
static find(region, name)Retrieves a fact from this Fact database.
static register(fact, allowReplacing?)Registers a new fact in this Fact database.
static requireFact(region, name)Retrieve a fact from the Fact database.
static unregister(region, name, value?)Removes a fact from the database.

static find(region, name)

public static find(region: string, name: string): string

Parameters

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

Returns

  • string

Retrieves a fact from this Fact database.


static register(fact, allowReplacing?)

public static register(fact: IFact, allowReplacing?: boolean): void

Parameters

  • fact IFact — the new fact to be registered.
  • allowReplacing boolean — whether new facts can replace existing facts or not.

Registers a new fact in this Fact database.


static requireFact(region, name)

public static requireFact(region: string, name: string): string

Parameters

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

Returns

  • string

Retrieve a fact from the Fact database.

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


static unregister(region, name, value?)

public static unregister(region: string, name: string, value?: string): void

Parameters

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

Removes a fact from the database.