{ "info": { "author": "BohdanPetryshyn", "author_email": null, "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved", "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Typing :: Typed" ], "description": "

Basti CDK

\n \n \"NPM\n \n \n \"PyPI\"\n \n \n \"GitHub\"\n \n

\n Basti CDK is a construct library that allows you to create cost-efficient bastion instances and easily connect to your infrastructure with Basti CLI.\n
\n
\n \ud83d\udcb5 No idle costs. \ud83d\udd11 No SSH keys. \ud83d\udd12 Fully IAM-driven.\n

\n \"Diagram\"\n

\n\n## Table of contents\n\n* [Why Basti?](#why-basti)\n* [How it works](#how-it-works)\n* [Installation](#installation)\n\n * [NPM](#npm)\n * [PyPI](#pypi)\n* [API reference](#api-reference)\n* [Examples](#examples)\n* [Basic usage](#basic-usage)\n\n * [Set up Basti instance](#set-up-basti-instance)\n * [Allow connection to target](#allow-connection-to-target)\n * [Connect to target](#connect-to-target)\n* [Advanced usage](#advanced-usage)\n\n * [Importing existing Basti instance](#importing-existing-basti-instance)\n * [Granting access to use Basti instance](#granting-access-to-use-basti-instance)\n* [License](#license)\n\n
\n\n## Why Basti?\n\nWith [Basti](https://github.com/basti-app/basti), you can securely connect to your RDS/Aurora/Elasticache/EC2 instances in private VPC subnets from a local machine or CI/CD pipeline almost for free!\n\n## How it works\n\n* \ud83c\udff0 Using Basti CDK, you set up a bastion instance in the connection target's VPC.\n* \ud83e\uddd1\u200d\ud83d\udcbb You use [Basti CLI](https://github.com/basti-app/basti) to conveniently connect to your target through the bastion instance.\n* \ud83d\udcb5 Basti takes care of keeping the bastion instance stopped when it's not used to make the solution cost as low as **\u2248 0.01 USD** per hour of connection plus **\u2248 0.80 USD** per month of maintaining the instance in a stopped state.\n* \ud83d\udd12 Security completely relies on AWS Session Manager and IAM policies. The bastion instance is not accessible from the Internet and no SSH keys are used.\n\n## Installation\n\nThe construct is available in multiple languages thanks to [JSII](https://github.com/aws/jsii).\n\n### NPM\n\n```bash\nnpm install basti-cdk\n```\n\n### PyPI\n\n```bash\npip install basti-cdk\n```\n\n## API reference\n\nSee the full API reference [on Construct Hub](https://constructs.dev/packages/basti-cdk).\n\n## Examples\n\nSee [the test CDK apps](https://github.com/basti-app/basti/tree/main/packages/basti-cdk/test/cdk-apps) for working examples of each feature the library provides.\n\n## Basic usage\n\nBasti constructs can be imported from the `basti-cdk` package.\n\n```python\nimport { BastiAccessSecurityGroup, BastiInstance } from 'basti-cdk';\n```\n\n> \ud83d\udca1 RDS instance is used as an example target. You can use Basti to connect to any other AWS resource that supports security groups.\n\n### Set up Basti instance\n\nUse `BastiInstance` construct to create Basti EC2 instance.\n\n```python\nconst bastiInstance = new BastiInstance(\n stack,\n 'BastiInstance',\n {\n vpc,\n\n // Optional. Randomly generated if omitted.\n // Used to name the EC2 instance and other resources.\n // The resulting name will be \"basti-instance-my-bastion\"\n bastiId: 'my-bastion'\n }\n);\n```\n\n### Allow connection to target\n\nUse `BastiAccessSecurityGroup` construct to create a security group for your target. This security group will allow the Basti instance to connect to the target.\n\n```python\n// Create a security group for your target\nconst bastiAccessSecurityGroup = new BastiAccessSecurityGroup(\n stack,\n 'BastiAccessSecurityGroup',\n {\n vpc,\n\n // Optional. Randomly generated if omitted.\n // Used to name the security group and other resources.\n // The resulting name will be \"basti-access-my-target\"\n bastiId: 'my-target'\n }\n);\n\n// Create the target\nconst rdsInstance = new aws_rds.DatabaseInstance(\n stack,\n 'RdsInstance',\n {\n // Unrelated properties are omitted for brevity\n\n vpc,\n port: 5432,\n\n securityGroups: [\n bastiAccessSecurityGroup\n ]\n }\n);\n\n// Allow the Basti instance to connect to the target on the specified port\nbastiAccessSecurityGroup.allowBastiInstanceConnection(\n bastiInstance,\n aws_ec2.Port.tcp(rdsInstance.instanceEndpoint.port)\n);\n```\n\n### Connect to target\n\nWhen the stack is deployed, you can use [Basti CLI](https://github.com/basti-app/basti) to connect to your target.\n\n```sh\nbasti connect\n```\n\n## Advanced usage\n\n### Importing existing Basti instance\n\nWhen sharing a Basti instance across stacks, you can just pass it as a property to the other stack. In case you need to import a Basti instance created in a separate CDK app or not managed by CDK at all, you can use the `BastiInstance.fromBastiId` method. The method returns an `IBastiInstance` object which is sufficient for granting access to a connection target.\n\n```python\n// Most likely, the VPC was created separately as well\nconst vpc = aws_ec2.Vpc.fromLookup(stack, 'Vpc', {\n vpcName: 'existing-vpc-id',\n});\n\nconst bastiInstance = BastiInstance.fromBastiId(\n this,\n 'BastiInstance',\n // The BastiID of the Basti instance you want to import\n 'existing-basti-id',\n vpc\n);\n\n// bastiInstance can now be used to allow access to a connection target\nbastiAccessSecurityGroup.allowBastiInstanceConnection(\n bastiInstance,\n aws_ec2.Port.tcp(1717)\n);\n```\n\n### Granting access to use Basti instance\n\nYou can grant the ability to connect to a Basti instance to other resources (users, roles, etc.) using the `grantBastiCliConnect` method of an existing Basti instance.\n\n```python\nconst bastiInstance = new BastiInstance(/*...*/);\nconst grantee = new aws_iam.Role(/*...*/);\n\nbastiInstance.grantBastiCliConnect(grantee);\n```\n\n## License\n\nUsage is provided under the MIT License. See [LICENSE](https://github.com/basti-app/basti/blob/main/packages/basti-cdk/LICENSE) for the full details.\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "dynamic": null, "home_page": "https://github.com/basti-app/basti/tree/main/packages/basti-cdk", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "basti-cdk", "package_url": "https://pypi.org/project/basti-cdk/", "platform": null, "project_url": "https://pypi.org/project/basti-cdk/", "project_urls": { "Homepage": "https://github.com/basti-app/basti/tree/main/packages/basti-cdk", "Source": "https://github.com/basti-app/basti.git" }, "provides_extra": null, "release_url": "https://pypi.org/project/basti-cdk/1.0.3/", "requires_dist": [ "aws-cdk-lib<3.0.0,>=2.86.0", "constructs<11.0.0,>=10.0.5", "jsii<2.0.0,>=1.87.0", "publication>=0.0.3", "typeguard~=2.13.3" ], "requires_python": "~=3.7", "summary": "Cost-efficient bastion host with a CLI tool for convenient access to your AWS resources", "version": "1.0.3", "yanked": false, "yanked_reason": null }, "last_serial": 22558708, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "blake2b_256": "ad1cf9534ff65d1d5b8b077debda5d314166211a49738b5319820a516105fd64", "md5": "4d6fd74f63a2cca1f9bca509e33844d2", "sha256": "f3c8a975d4a182ca5d93462ed266650181926f5f982c25879c3818b54a868087" }, "downloads": -1, "filename": "basti_cdk-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4d6fd74f63a2cca1f9bca509e33844d2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.7", "size": 157345, "upload_time": "2023-08-19T10:54:07", "upload_time_iso_8601": "2023-08-19T10:54:07.569823Z", "url": "https://files.pythonhosted.org/packages/ad/1c/f9534ff65d1d5b8b077debda5d314166211a49738b5319820a516105fd64/basti_cdk-1.0.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "blake2b_256": "5b2de9dd69dda59d77f8e2c9ee782d0aae7498faecafd5e80fdfa88c2f5f8a0e", "md5": "5a8075ab0f0479f05dff0112eceb6193", "sha256": "6ad2306a8cb1953c1d71db0e6ac5266e0f307ce35d601ba00756a54b0a674ed2" }, "downloads": -1, "filename": "basti-cdk-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5a8075ab0f0479f05dff0112eceb6193", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 159280, "upload_time": "2023-08-19T10:54:11", "upload_time_iso_8601": "2023-08-19T10:54:11.236232Z", "url": "https://files.pythonhosted.org/packages/5b/2d/e9dd69dda59d77f8e2c9ee782d0aae7498faecafd5e80fdfa88c2f5f8a0e/basti-cdk-1.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.0a0": [ { "comment_text": "", "digests": { "blake2b_256": "0421811a061e2a5f17ce87b14b518817091b0437a7d57729bdd2cdffed585957", "md5": "f109e3280bcaf2f956ab1969d65f790b", "sha256": "da8ebdfa772eccb59453032b1a69756f2289791eb3955299bb6ec7c564eeac62" }, "downloads": -1, "filename": "basti_cdk-1.0.0a0-py3-none-any.whl", "has_sig": false, "md5_digest": "f109e3280bcaf2f956ab1969d65f790b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.7", "size": 147046, "upload_time": "2023-07-21T18:40:09", "upload_time_iso_8601": "2023-07-21T18:40:09.572384Z", "url": "https://files.pythonhosted.org/packages/04/21/811a061e2a5f17ce87b14b518817091b0437a7d57729bdd2cdffed585957/basti_cdk-1.0.0a0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "blake2b_256": "4d775bd34c988c6309385168adc633f1fcf3e82d5d10fe88e38f05f6ef6215bd", "md5": "f3d2f9aef3488fc8d1b6d3a9f6972950", "sha256": "d1a2ffeff668c2cf281befb46e0c6139c8e3d38ac66f39518d72be5f9fe2e71b" }, "downloads": -1, "filename": "basti-cdk-1.0.0a0.tar.gz", "has_sig": false, "md5_digest": "f3d2f9aef3488fc8d1b6d3a9f6972950", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 149169, "upload_time": "2023-07-21T18:40:12", "upload_time_iso_8601": "2023-07-21T18:40:12.072236Z", "url": "https://files.pythonhosted.org/packages/4d/77/5bd34c988c6309385168adc633f1fcf3e82d5d10fe88e38f05f6ef6215bd/basti-cdk-1.0.0a0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.0a3": [ { "comment_text": "", "digests": { "blake2b_256": "24aea1534fb7a9ce45e8164d1f0e18364be72f49f2c6cfeee67dfceefc09cf75", "md5": "ae3179bcefe47d04988a0596596b4cf2", "sha256": "8ec687d792341ca232e4124bda6b9d060c1e5e5dc64a006f3da223ce5b41a04c" }, "downloads": -1, "filename": "basti_cdk-1.0.0a3-py3-none-any.whl", "has_sig": false, "md5_digest": "ae3179bcefe47d04988a0596596b4cf2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.7", "size": 151357, "upload_time": "2023-07-23T15:55:46", "upload_time_iso_8601": "2023-07-23T15:55:46.593366Z", "url": "https://files.pythonhosted.org/packages/24/ae/a1534fb7a9ce45e8164d1f0e18364be72f49f2c6cfeee67dfceefc09cf75/basti_cdk-1.0.0a3-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "blake2b_256": "11033e38236f3414e0343c6780438f7b0d83fae7a7abcd39b53ce947c5450672", "md5": "95a315200d2f85c5083636d7b12da8db", "sha256": "f7d83c87ba059f9369902180de1da38cde6fc54dbbdba027b9b913b51dd501a8" }, "downloads": -1, "filename": "basti-cdk-1.0.0a3.tar.gz", "has_sig": false, "md5_digest": "95a315200d2f85c5083636d7b12da8db", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 153407, "upload_time": "2023-07-23T15:55:48", "upload_time_iso_8601": "2023-07-23T15:55:48.049338Z", "url": "https://files.pythonhosted.org/packages/11/03/3e38236f3414e0343c6780438f7b0d83fae7a7abcd39b53ce947c5450672/basti-cdk-1.0.0a3.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.0a4": [ { "comment_text": "", "digests": { "blake2b_256": "aada942e0cd2bb295d9850f5e3456e890335a35dc16b4d7d3848480393c27336", "md5": "c06cfcd989c54e2503915e15e78d3994", "sha256": "faafa9c53449d7cb92ce05c8fe2653004d79f718103d9bf15de7689fa63a7397" }, "downloads": -1, "filename": "basti_cdk-1.0.0a4-py3-none-any.whl", "has_sig": false, "md5_digest": "c06cfcd989c54e2503915e15e78d3994", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.7", "size": 153926, "upload_time": "2023-08-04T21:39:18", "upload_time_iso_8601": "2023-08-04T21:39:18.444594Z", "url": "https://files.pythonhosted.org/packages/aa/da/942e0cd2bb295d9850f5e3456e890335a35dc16b4d7d3848480393c27336/basti_cdk-1.0.0a4-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "blake2b_256": "070dd020d779ef40044c5f78847b3970bdce74de19b51a8abdcb013617e58cec", "md5": "f0d3670819f2cd0a59f4416fb041c42f", "sha256": "ea69b18a9c5ad79015e763820b4044d4308337c5840e622ea131810b4f15e6c9" }, "downloads": -1, "filename": "basti-cdk-1.0.0a4.tar.gz", "has_sig": false, "md5_digest": "f0d3670819f2cd0a59f4416fb041c42f", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 155789, "upload_time": "2023-08-04T21:39:20", "upload_time_iso_8601": "2023-08-04T21:39:20.051269Z", "url": "https://files.pythonhosted.org/packages/07/0d/d020d779ef40044c5f78847b3970bdce74de19b51a8abdcb013617e58cec/basti-cdk-1.0.0a4.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.1": [ { "comment_text": "", "digests": { "blake2b_256": "0ebbb116c612226b1fc0b606738c62ec15bb318029df68563fe8afcb1f3d45a2", "md5": "313de059df2833ea94fcac0a57fcd369", "sha256": "63b049a8e80d4deb48a61510868bc49bc9f7d61b5208a454e3f00ddbd81fb62c" }, "downloads": -1, "filename": "basti_cdk-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "313de059df2833ea94fcac0a57fcd369", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.7", "size": 157458, "upload_time": "2023-08-23T18:16:06", "upload_time_iso_8601": "2023-08-23T18:16:06.794578Z", "url": "https://files.pythonhosted.org/packages/0e/bb/b116c612226b1fc0b606738c62ec15bb318029df68563fe8afcb1f3d45a2/basti_cdk-1.0.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "blake2b_256": "a477c60076c9ce5e443b29fba58cf75788db5eb11156a01bb48d0a895f3b4c35", "md5": "c0d6b52318b4d1987333528c450aba08", "sha256": "9275fbd77bd49cc80c91639951450658fd54d245453fd5179d0ea0655986c520" }, "downloads": -1, "filename": "basti-cdk-1.0.1.tar.gz", "has_sig": false, "md5_digest": "c0d6b52318b4d1987333528c450aba08", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 159355, "upload_time": "2023-08-23T18:16:10", "upload_time_iso_8601": "2023-08-23T18:16:10.020077Z", "url": "https://files.pythonhosted.org/packages/a4/77/c60076c9ce5e443b29fba58cf75788db5eb11156a01bb48d0a895f3b4c35/basti-cdk-1.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.2": [ { "comment_text": "", "digests": { "blake2b_256": "60d2ebda1cc085ae8e5b9bf2c46ac67717d1ff6af010967b8b900164063b9cc0", "md5": "9e106bff3b21a428bbf71bbb30775689", "sha256": "a61d29422597972ad13e40cabede45f81aadf726123d0a354169ff6ff61ceb89" }, "downloads": -1, "filename": "basti_cdk-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "9e106bff3b21a428bbf71bbb30775689", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.7", "size": 157434, "upload_time": "2023-09-09T11:17:55", "upload_time_iso_8601": "2023-09-09T11:17:55.093538Z", "url": "https://files.pythonhosted.org/packages/60/d2/ebda1cc085ae8e5b9bf2c46ac67717d1ff6af010967b8b900164063b9cc0/basti_cdk-1.0.2-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "blake2b_256": "dccead70b0293d91dd29aac6e36a7e5a3f3791d8524346b038564ba01d5c9191", "md5": "f0075b505b54215464d18ab80758c2ba", "sha256": "6147945406f7ee355ba10b41f5f8e7e64eaae610493fce6badeb4d6618d064b3" }, "downloads": -1, "filename": "basti-cdk-1.0.2.tar.gz", "has_sig": false, "md5_digest": "f0075b505b54215464d18ab80758c2ba", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 159362, "upload_time": "2023-09-09T11:17:58", "upload_time_iso_8601": "2023-09-09T11:17:58.782118Z", "url": "https://files.pythonhosted.org/packages/dc/ce/ad70b0293d91dd29aac6e36a7e5a3f3791d8524346b038564ba01d5c9191/basti-cdk-1.0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.3": [ { "comment_text": "", "digests": { "blake2b_256": "69f53711ffcb411961c75532d965ba117e84f3e1114d68f656dae6d55b51ca43", "md5": "5f842be19bd479c450b80948cc100992", "sha256": "bc7ff89db2a4b42a3bf56de3611ecbbb932d52b9cffc589290f318ea269550eb" }, "downloads": -1, "filename": "basti_cdk-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "5f842be19bd479c450b80948cc100992", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.7", "size": 160246, "upload_time": "2024-03-31T10:43:34", "upload_time_iso_8601": "2024-03-31T10:43:34.105472Z", "url": "https://files.pythonhosted.org/packages/69/f5/3711ffcb411961c75532d965ba117e84f3e1114d68f656dae6d55b51ca43/basti_cdk-1.0.3-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "blake2b_256": "af0f21a4c1864fb7b5798143f5c73175f46767f486537b63b9563d37d62cd7fb", "md5": "d36159acabcd984de29ed89cd163e912", "sha256": "e38fca538353bbba5cc98add4ad64b66fb61c445b08cb00cffb6a2df303d5e29" }, "downloads": -1, "filename": "basti-cdk-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d36159acabcd984de29ed89cd163e912", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 162196, "upload_time": "2024-03-31T10:43:36", "upload_time_iso_8601": "2024-03-31T10:43:36.779855Z", "url": "https://files.pythonhosted.org/packages/af/0f/21a4c1864fb7b5798143f5c73175f46767f486537b63b9563d37d62cd7fb/basti-cdk-1.0.3.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "blake2b_256": "69f53711ffcb411961c75532d965ba117e84f3e1114d68f656dae6d55b51ca43", "md5": "5f842be19bd479c450b80948cc100992", "sha256": "bc7ff89db2a4b42a3bf56de3611ecbbb932d52b9cffc589290f318ea269550eb" }, "downloads": -1, "filename": "basti_cdk-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "5f842be19bd479c450b80948cc100992", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": "~=3.7", "size": 160246, "upload_time": "2024-03-31T10:43:34", "upload_time_iso_8601": "2024-03-31T10:43:34.105472Z", "url": "https://files.pythonhosted.org/packages/69/f5/3711ffcb411961c75532d965ba117e84f3e1114d68f656dae6d55b51ca43/basti_cdk-1.0.3-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "blake2b_256": "af0f21a4c1864fb7b5798143f5c73175f46767f486537b63b9563d37d62cd7fb", "md5": "d36159acabcd984de29ed89cd163e912", "sha256": "e38fca538353bbba5cc98add4ad64b66fb61c445b08cb00cffb6a2df303d5e29" }, "downloads": -1, "filename": "basti-cdk-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d36159acabcd984de29ed89cd163e912", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.7", "size": 162196, "upload_time": "2024-03-31T10:43:36", "upload_time_iso_8601": "2024-03-31T10:43:36.779855Z", "url": "https://files.pythonhosted.org/packages/af/0f/21a4c1864fb7b5798143f5c73175f46767f486537b63b9563d37d62cd7fb/basti-cdk-1.0.3.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }