## aws-arch (AWS Architecture)
Library to provide metadata for AWS Services and AWS Resources.
This package generates mappings between [@aws-cdk/cfnspec](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cfnspec) and [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/), and resolves resource metadata between these systems to infer a normalized definition of an `AwsService` and `AwsResource`.
The primary aim of this package is to provide a consistent mechanism for other libraries to retrieve naming and assets associated with CloudFormation resources, and by extension CDK resources.
### Get Started
```sh
yarn add '@aws-prototyping-sdk/aws-arch'
```
```python
import { AwsArchitecture } from "@aws-prototyping-sdk/aws-arch";
const s3Bucket = AwsArchitecture.getResource("AWS::S3::Bucket");
const s3Service = AwsArchitecture.getService(s3Bucket.service);
console.log(s3Bucket);
console.log(s3Service);
```
```js
// => console.log(s3Bucket);
{
"name": "Amazon Simple Storage Service Bucket",
"cfnType": "AWS::S3::Bucket",
"awsAssetName": "Amazon-Simple-Storage-Service_Bucket",
"awsAssetIcon": "resources/Amazon-Simple-Storage-Service_Bucket.png",
"service": "S3"
}
// => console.log(s3Service);
{
"provider": "AWS",
"name": "Amazon Simple Storage Service",
"cfnName": "S3",
"awsAssetIcon": "services/Amazon-Simple-Storage-Service.png",
"awsAssetName": "Amazon-Simple-Storage-Service"
}
```
### Aws Achritecture Icons
Retrieve **category**, **service**, and **resource** [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/).
> Icon methods return relative asset key paths, as most frameworks have the concept of a base path (imagepaths). Use `AwsArchitecture.resolveAssetPath(...)` to get absolute path.
#### Retrieve icon based on CloudFormation Resource Type
**Resource Icon**
```python
const s3Bucket = AwsArchitecture.getResource("AWS::S3::Bucket");
const s3BucketPng = s3Bucket.icon("png"); // => "storage/s3/bucket.png"
const s3BucketSvg = s3Bucket.icon("svg"); // => "storage/s3/bucket.svg"
// Resolve absolute path for icons
AwsArchitecture.resolveAssetPath(s3BucketPng); // => /User/example/.../node_modules/@aws-prototyping-sdk/aws-arc/assets/storage/s3/bucket.png
```
**Service Icon**
```python
const s3Service = AwsArchitecture.getResource("AWS::S3::Bucket").service;
// equivalent to: `AwsArchitecture.getService("S3")`
const s3ServicePng = s3Service.icon("png"); // => "storage/s3/service_icon.png"
const s3ServiceSvg = s3Service.icon("svg"); // => "storage/s3/service_icon.svg"
// Resolve absolute path for icons
AwsArchitecture.resolveAssetPath(s3ServicePng); // => /User/example/.../node_modules/@aws-prototyping-sdk/aws-arc/assets/storage/s3/service_icon.png
```
**Category Icon**
```python
const storageCategory =
AwsArchitecture.getResource("AWS::S3::Bucket").service.category;
// equivalent to: `AwsArchitecture.getCategory("storage")`
const storageCategoryPng = storageCategory.icon("png"); // => "storage/category_icon.png"
const storageCategorySvg = storageCategory.icon("svg"); // => "storage/category_icon.svg"
// Resolve absolute path for icons
AwsArchitecture.resolveAssetPath(storageCategoryPng); // => /User/example/.../node_modules/@aws-prototyping-sdk/aws-arc/assets/storage/category_icon.png
```
### Development
This package auto-generates many types and asset files from external sources,
which are then auto mapped based on common patterns and explict mappings for edge-cases.
The auto-generation is handled by `/scripts` files which can be run via corresponding
package scripts (eg: `npx projen generate:assets` => `/scripts/generate-assets.ts`).
There is an implicit sequential order the scripts must be called in due to dependencies,
which is handled by `npx projen generate` script. The `generate` script is also invoked
prior to `npx projen build` if generated asset directory does not exist.
For local development of packages that depend on `aws-arch` package, you will need to
call `npx projen generate && npx projen compile` (or `npx projen build`) prior to locally
importing this package.
To update [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/), change the url in [ASSET_PACKAGE_ZIP_URL](packages/aws-arch/scripts/generate-assets.ts).
Raw data
{
"_id": null,
"home_page": "https://github.com/aws/aws-prototyping-sdk",
"name": "aws-prototyping-sdk.aws-arch",
"maintainer": "",
"docs_url": null,
"requires_python": "~=3.7",
"maintainer_email": "",
"keywords": "",
"author": "AWS APJ COPE<apj-cope@amazon.com>",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/a2/eb/52e71cb9f41473901358f1095dc1768f901874e891858c5d567c361f27fa/aws_prototyping_sdk.aws_arch-0.19.68.tar.gz",
"platform": null,
"description": "## aws-arch (AWS Architecture)\n\nLibrary to provide metadata for AWS Services and AWS Resources.\n\nThis package generates mappings between [@aws-cdk/cfnspec](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cfnspec) and [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/), and resolves resource metadata between these systems to infer a normalized definition of an `AwsService` and `AwsResource`.\n\nThe primary aim of this package is to provide a consistent mechanism for other libraries to retrieve naming and assets associated with CloudFormation resources, and by extension CDK resources.\n\n### Get Started\n\n```sh\nyarn add '@aws-prototyping-sdk/aws-arch'\n```\n\n```python\nimport { AwsArchitecture } from \"@aws-prototyping-sdk/aws-arch\";\n\nconst s3Bucket = AwsArchitecture.getResource(\"AWS::S3::Bucket\");\nconst s3Service = AwsArchitecture.getService(s3Bucket.service);\n\nconsole.log(s3Bucket);\nconsole.log(s3Service);\n```\n\n```js\n// => console.log(s3Bucket);\n{\n\t\"name\": \"Amazon Simple Storage Service Bucket\",\n\t\"cfnType\": \"AWS::S3::Bucket\",\n\t\"awsAssetName\": \"Amazon-Simple-Storage-Service_Bucket\",\n\t\"awsAssetIcon\": \"resources/Amazon-Simple-Storage-Service_Bucket.png\",\n\t\"service\": \"S3\"\n}\n\n// => console.log(s3Service);\n{\n\t\"provider\": \"AWS\",\n\t\"name\": \"Amazon Simple Storage Service\",\n\t\"cfnName\": \"S3\",\n\t\"awsAssetIcon\": \"services/Amazon-Simple-Storage-Service.png\",\n\t\"awsAssetName\": \"Amazon-Simple-Storage-Service\"\n}\n```\n\n### Aws Achritecture Icons\n\nRetrieve **category**, **service**, and **resource** [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/).\n\n> Icon methods return relative asset key paths, as most frameworks have the concept of a base path (imagepaths). Use `AwsArchitecture.resolveAssetPath(...)` to get absolute path.\n\n#### Retrieve icon based on CloudFormation Resource Type\n\n**Resource Icon**\n\n```python\nconst s3Bucket = AwsArchitecture.getResource(\"AWS::S3::Bucket\");\n\nconst s3BucketPng = s3Bucket.icon(\"png\"); // => \"storage/s3/bucket.png\"\nconst s3BucketSvg = s3Bucket.icon(\"svg\"); // => \"storage/s3/bucket.svg\"\n\n// Resolve absolute path for icons\nAwsArchitecture.resolveAssetPath(s3BucketPng); // => /User/example/.../node_modules/@aws-prototyping-sdk/aws-arc/assets/storage/s3/bucket.png\n```\n\n**Service Icon**\n\n```python\nconst s3Service = AwsArchitecture.getResource(\"AWS::S3::Bucket\").service;\n// equivalent to: `AwsArchitecture.getService(\"S3\")`\n\nconst s3ServicePng = s3Service.icon(\"png\"); // => \"storage/s3/service_icon.png\"\nconst s3ServiceSvg = s3Service.icon(\"svg\"); // => \"storage/s3/service_icon.svg\"\n\n// Resolve absolute path for icons\nAwsArchitecture.resolveAssetPath(s3ServicePng); // => /User/example/.../node_modules/@aws-prototyping-sdk/aws-arc/assets/storage/s3/service_icon.png\n```\n\n**Category Icon**\n\n```python\nconst storageCategory =\n AwsArchitecture.getResource(\"AWS::S3::Bucket\").service.category;\n// equivalent to: `AwsArchitecture.getCategory(\"storage\")`\n\nconst storageCategoryPng = storageCategory.icon(\"png\"); // => \"storage/category_icon.png\"\nconst storageCategorySvg = storageCategory.icon(\"svg\"); // => \"storage/category_icon.svg\"\n\n// Resolve absolute path for icons\nAwsArchitecture.resolveAssetPath(storageCategoryPng); // => /User/example/.../node_modules/@aws-prototyping-sdk/aws-arc/assets/storage/category_icon.png\n```\n\n### Development\n\nThis package auto-generates many types and asset files from external sources,\nwhich are then auto mapped based on common patterns and explict mappings for edge-cases.\n\nThe auto-generation is handled by `/scripts` files which can be run via corresponding\npackage scripts (eg: `npx projen generate:assets` => `/scripts/generate-assets.ts`).\n\nThere is an implicit sequential order the scripts must be called in due to dependencies,\nwhich is handled by `npx projen generate` script. The `generate` script is also invoked\nprior to `npx projen build` if generated asset directory does not exist.\n\nFor local development of packages that depend on `aws-arch` package, you will need to\ncall `npx projen generate && npx projen compile` (or `npx projen build`) prior to locally\nimporting this package.\n\nTo update [AWS Architecture Icons](https://aws.amazon.com/architecture/icons/), change the url in [ASSET_PACKAGE_ZIP_URL](packages/aws-arch/scripts/generate-assets.ts).\n\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "@aws-prototyping-sdk/aws-arch",
"version": "0.19.68",
"project_urls": {
"Homepage": "https://github.com/aws/aws-prototyping-sdk",
"Source": "https://github.com/aws/aws-prototyping-sdk"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "436b3640afcf64c2d45782100a8a2a48311a075a4f831930bbd1180014d918f8",
"md5": "e15771c0e7a4a4b31264a81d66004120",
"sha256": "6af5af6e3d6e926476c2f4f2e5d8f37a03024778bcc666838db83aee09193c77"
},
"downloads": -1,
"filename": "aws_prototyping_sdk.aws_arch-0.19.68-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e15771c0e7a4a4b31264a81d66004120",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.7",
"size": 19329128,
"upload_time": "2023-08-24T23:16:07",
"upload_time_iso_8601": "2023-08-24T23:16:07.278158Z",
"url": "https://files.pythonhosted.org/packages/43/6b/3640afcf64c2d45782100a8a2a48311a075a4f831930bbd1180014d918f8/aws_prototyping_sdk.aws_arch-0.19.68-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a2eb52e71cb9f41473901358f1095dc1768f901874e891858c5d567c361f27fa",
"md5": "c5357e60ddb9a258c1d9c0bcf1572d3a",
"sha256": "508beccff44b628e73bd450ad7a23c9f7424ad167d3d20d5919a7004b4fc2f7d"
},
"downloads": -1,
"filename": "aws_prototyping_sdk.aws_arch-0.19.68.tar.gz",
"has_sig": false,
"md5_digest": "c5357e60ddb9a258c1d9c0bcf1572d3a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.7",
"size": 19331786,
"upload_time": "2023-08-24T23:16:10",
"upload_time_iso_8601": "2023-08-24T23:16:10.661314Z",
"url": "https://files.pythonhosted.org/packages/a2/eb/52e71cb9f41473901358f1095dc1768f901874e891858c5d567c361f27fa/aws_prototyping_sdk.aws_arch-0.19.68.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-24 23:16:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aws",
"github_project": "aws-prototyping-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aws-prototyping-sdk.aws-arch"
}