Fact

class aws_cdk.region_info.Fact(*args: Any, **kwargs)

Bases: object

A database of regional information.

ExampleMetadata

infused

Example:

class MyFact(region_info.IFact):

region_info.Fact.register(MyFact())

Attributes

regions = ['af-south-1', 'ap-east-1', 'ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3', 'ap-south-1', 'ap-southeast-1', 'ap-southeast-2', 'ap-southeast-3', 'ca-central-1', 'cn-north-1', 'cn-northwest-1', 'eu-central-1', 'eu-north-1', 'eu-south-1', 'eu-south-2', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'me-south-1', 'sa-east-1', 'us-east-1', 'us-east-2', 'us-gov-east-1', 'us-gov-west-1', 'us-iso-east-1', 'us-iso-west-1', 'us-isob-east-1', 'us-west-1', 'us-west-2']

Static Methods

classmethod find(region, name)

Retrieves a fact from this Fact database.

Parameters
  • region (str) – the name of the region (e.g: us-east-1).

  • name (str) – the name of the fact being looked up (see the FactName class for details).

Return type

Optional[str]

Returns

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

classmethod register(fact, allow_replacing=None)

Registers a new fact in this Fact database.

Parameters
  • fact (IFact) – the new fact to be registered.

  • allow_replacing (Optional[bool]) – whether new facts can replace existing facts or not.

Return type

None

classmethod require_fact(region, name)

Retrieve a fact from the Fact database.

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

Parameters
  • region (str) – the name of the region (e.g: us-east-1).

  • name (str) – the name of the fact being looked up (see the FactName class for details).

Return type

str

classmethod unregister(region, name, value=None)

Removes a fact from the database.

Parameters
  • region (str) – the region for which the fact is to be removed.

  • name (str) – the name of the fact to remove.

  • value (Optional[str]) – the value that should be removed (removal will fail if the value is specified, but does not match the current stored value).

Return type

None