class Fact
Language | Type name |
---|---|
.NET | Amazon.CDK.RegionInfo.Fact |
Go | github.com/aws/aws-cdk-go/awscdk/v2/regioninfo#Fact |
Java | software.amazon.awscdk.regioninfo.Fact |
Python | aws_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 = '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
Name | Type | Description |
---|---|---|
static names | string[] | Returns the list of names of registered facts. |
static regions | string[] |
static names
Type:
string[]
Returns the list of names of registered facts.
All facts will be present in at least one region.
static regions
Type:
string[]
Methods
Name | Description |
---|---|
static defined | Return all pairs of (region, factName) that are defined. |
static find(region, name) | Retrieves a fact from this Fact database. |
static register(fact, allowReplacing?) | Registers a new fact in this Fact database. |
static require | Retrieve a fact from the Fact database. |
static unregister(region, name, value?) | Removes a fact from the database. |
Facts()
static definedpublic static definedFacts(): string[][]
Returns
string[][]
Return all pairs of (region, factName) that are defined.
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 theFactName
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.
Fact(region, name)
static requirepublic 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 theFactName
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.