# AWS Region-Specific Information Directory
## Usage
Some information used in CDK Applications differs from one AWS region to
another, such as service principals used in IAM policies, S3 static website
endpoints, ...
### The `RegionInfo` class
The library offers a simple interface to obtain region specific information in
the form of the `RegionInfo` class. This is the preferred way to interact with
the regional information database:
```python
# Get the information for "eu-west-1":
region = region_info.RegionInfo.get("eu-west-1")
# Access attributes:
region.s3_static_website_endpoint
```
The `RegionInfo` layer is built on top of the Low-Level API, which is described
below and can be used to register additional data, including user-defined facts
that are not available through the `RegionInfo` interface.
### Low-Level API
This library offers a primitive database of such information so that CDK
constructs can easily access regional information. The `FactName` class provides
a list of known fact names, which can then be used with the `RegionInfo` to
retrieve a particular value:
```python
static_website = region_info.Fact.find("ap-northeast-1", region_info.FactName.S3_STATIC_WEBSITE_ENDPOINT)
```
## Supplying new or missing information
As new regions are released, it might happen that a particular fact you need is
missing from the library. In such cases, the `Fact.register` method can be used
to inject FactName into the database:
```python
@jsii.implements(region_info.IFact)
class MyFact:
region_info.Fact.register(MyFact())
```
## Overriding incorrect information
In the event information provided by the library is incorrect, it can be
overridden using the same `Fact.register` method demonstrated above, simply
adding an extra boolean argument:
```python
@jsii.implements(region_info.IFact)
class MyFact:
region_info.Fact.register(MyFact(), True)
```
If you happen to have stumbled upon incorrect data built into this library, it
is always a good idea to report your findings in a [GitHub issue](https://github.com/aws/aws-cdk/issues), so we can fix
it for everyone else!
---
This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
Raw data
{
"_id": null,
"home_page": "https://github.com/aws/aws-cdk",
"name": "aws-cdk.region-info",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Amazon Web Services",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/fe/1c/043bb467abff95a56b5b066d7c829ec9d3768f8b099de25a810d2f3ee6c1/aws_cdk_region_info-2.170.0.tar.gz",
"platform": null,
"description": "# AWS Region-Specific Information Directory\n\n## Usage\n\nSome information used in CDK Applications differs from one AWS region to\nanother, such as service principals used in IAM policies, S3 static website\nendpoints, ...\n\n### The `RegionInfo` class\n\nThe library offers a simple interface to obtain region specific information in\nthe form of the `RegionInfo` class. This is the preferred way to interact with\nthe regional information database:\n\n```python\n# Get the information for \"eu-west-1\":\nregion = region_info.RegionInfo.get(\"eu-west-1\")\n\n# Access attributes:\nregion.s3_static_website_endpoint\n```\n\nThe `RegionInfo` layer is built on top of the Low-Level API, which is described\nbelow and can be used to register additional data, including user-defined facts\nthat are not available through the `RegionInfo` interface.\n\n### Low-Level API\n\nThis library offers a primitive database of such information so that CDK\nconstructs can easily access regional information. The `FactName` class provides\na list of known fact names, which can then be used with the `RegionInfo` to\nretrieve a particular value:\n\n```python\nstatic_website = region_info.Fact.find(\"ap-northeast-1\", region_info.FactName.S3_STATIC_WEBSITE_ENDPOINT)\n```\n\n## Supplying new or missing information\n\nAs new regions are released, it might happen that a particular fact you need is\nmissing from the library. In such cases, the `Fact.register` method can be used\nto inject FactName into the database:\n\n```python\n@jsii.implements(region_info.IFact)\nclass MyFact:\n\nregion_info.Fact.register(MyFact())\n```\n\n## Overriding incorrect information\n\nIn the event information provided by the library is incorrect, it can be\noverridden using the same `Fact.register` method demonstrated above, simply\nadding an extra boolean argument:\n\n```python\n@jsii.implements(region_info.IFact)\nclass MyFact:\n\nregion_info.Fact.register(MyFact(), True)\n```\n\nIf you happen to have stumbled upon incorrect data built into this library, it\nis always a good idea to report your findings in a [GitHub issue](https://github.com/aws/aws-cdk/issues), so we can fix\nit for everyone else!\n\n---\n\n\nThis module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "AWS region information, such as service principal names",
"version": "2.170.0",
"project_urls": {
"Homepage": "https://github.com/aws/aws-cdk",
"Source": "https://github.com/aws/aws-cdk.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7aaca1dd8871cac30238cb89759a3245a225a67461604f33354242e9705f207d",
"md5": "d7f64eb8d06897456c11fe9e3d1ee86b",
"sha256": "12e5e75ea22cf4e81b2b954f8ebd57b7c47fbdae978522857cea7b31b89d9963"
},
"downloads": -1,
"filename": "aws_cdk.region_info-2.170.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d7f64eb8d06897456c11fe9e3d1ee86b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 268583,
"upload_time": "2024-11-22T04:42:08",
"upload_time_iso_8601": "2024-11-22T04:42:08.763657Z",
"url": "https://files.pythonhosted.org/packages/7a/ac/a1dd8871cac30238cb89759a3245a225a67461604f33354242e9705f207d/aws_cdk.region_info-2.170.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fe1c043bb467abff95a56b5b066d7c829ec9d3768f8b099de25a810d2f3ee6c1",
"md5": "d9838830ea59bcb52b44fe1160f94372",
"sha256": "9110efc41b7a8aeee1f763c81461227a5085acae99e4d892ae1072cec518db28"
},
"downloads": -1,
"filename": "aws_cdk_region_info-2.170.0.tar.gz",
"has_sig": false,
"md5_digest": "d9838830ea59bcb52b44fe1160f94372",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 270268,
"upload_time": "2024-11-22T04:42:56",
"upload_time_iso_8601": "2024-11-22T04:42:56.152504Z",
"url": "https://files.pythonhosted.org/packages/fe/1c/043bb467abff95a56b5b066d7c829ec9d3768f8b099de25a810d2f3ee6c1/aws_cdk_region_info-2.170.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-22 04:42:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aws",
"github_project": "aws-cdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aws-cdk.region-info"
}