# AWS CDK CLI Library
<!--BEGIN STABILITY BANNER-->---
![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
> The APIs of higher level constructs in this module are experimental and under active development.
> They are subject to non-backward compatible changes or removal in any future version. These are
> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
> announced in the release notes. This means that while you may use them, you may need to update
> your source code when upgrading to a newer version of this package.
---
<!--END STABILITY BANNER-->
## ⚠️ Experimental module
This package is highly experimental. Expect frequent API changes and incomplete features.
Known issues include:
* **JavaScript/TypeScript only**\
The jsii packages are currently not in a working state.
* **No useful return values**\
All output is currently printed to stdout/stderr
* **Missing or Broken options**\
Some CLI options might not be available in this package or broken
## Overview
Provides a library to interact with the AWS CDK CLI programmatically from jsii supported languages.
Currently the package includes implementations for:
* `cdk deploy`
* `cdk synth`
* `cdk bootstrap`
* `cdk destroy`
* `cdk list`
## Setup
### AWS CDK app directory
Obtain an `AwsCdkCli` class from an AWS CDK app directory (containing a `cdk.json` file):
```python
cli = AwsCdkCli.from_cdk_app_directory("/path/to/cdk/app")
```
### Cloud Assembly Directory Producer
You can also create `AwsCdkCli` from a class implementing `ICloudAssemblyDirectoryProducer`.
AWS CDK apps might need to be synthesized multiple times with additional context values before they are ready.
The `produce()` method of the `ICloudAssemblyDirectoryProducer` interface provides this multi-pass ability.
It is invoked with the context values of the current iteration and should use these values to synthesize a Cloud Assembly.
The return value is the path to the assembly directory.
A basic implementation would look like this:
```python
@jsii.implements(ICloudAssemblyDirectoryProducer)
class MyProducer:
def produce(self, context):
app = cdk.App(context=context)
stack = cdk.Stack(app)
return app.synth().directory
```
For all features (e.g. lookups) to work correctly, `cdk.App()` must be instantiated with the received `context` values.
Since it is not possible to update the context of an app, it must be created as part of the `produce()` method.
The producer can than be used like this:
```python
cli = AwsCdkCli.from_cloud_assembly_directory_producer(MyProducer())
```
## Commands
### list
```python
# await this asynchronous method call using a language feature
cli.list()
```
### synth
```python
# await this asynchronous method call using a language feature
cli.synth(
stacks=["MyTestStack"]
)
```
### bootstrap
```python
# await this asynchronous method call using a language feature
cli.bootstrap()
```
### deploy
```python
# await this asynchronous method call using a language feature
cli.deploy(
stacks=["MyTestStack"]
)
```
### destroy
```python
# await this asynchronous method call using a language feature
cli.destroy(
stacks=["MyTestStack"]
)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/aws/aws-cdk",
"name": "aws-cdk.cli-lib-alpha",
"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/4f/fc/791c76f8d491ec715b91baec71bb22d5502237af5e188fc9d8a8acda356c/aws_cdk_cli_lib_alpha-2.170.0a0.tar.gz",
"platform": null,
"description": "# AWS CDK CLI Library\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n<!--END STABILITY BANNER-->\n\n## \u26a0\ufe0f Experimental module\n\nThis package is highly experimental. Expect frequent API changes and incomplete features.\nKnown issues include:\n\n* **JavaScript/TypeScript only**\\\n The jsii packages are currently not in a working state.\n* **No useful return values**\\\n All output is currently printed to stdout/stderr\n* **Missing or Broken options**\\\n Some CLI options might not be available in this package or broken\n\n## Overview\n\nProvides a library to interact with the AWS CDK CLI programmatically from jsii supported languages.\nCurrently the package includes implementations for:\n\n* `cdk deploy`\n* `cdk synth`\n* `cdk bootstrap`\n* `cdk destroy`\n* `cdk list`\n\n## Setup\n\n### AWS CDK app directory\n\nObtain an `AwsCdkCli` class from an AWS CDK app directory (containing a `cdk.json` file):\n\n```python\ncli = AwsCdkCli.from_cdk_app_directory(\"/path/to/cdk/app\")\n```\n\n### Cloud Assembly Directory Producer\n\nYou can also create `AwsCdkCli` from a class implementing `ICloudAssemblyDirectoryProducer`.\nAWS CDK apps might need to be synthesized multiple times with additional context values before they are ready.\n\nThe `produce()` method of the `ICloudAssemblyDirectoryProducer` interface provides this multi-pass ability.\nIt is invoked with the context values of the current iteration and should use these values to synthesize a Cloud Assembly.\nThe return value is the path to the assembly directory.\n\nA basic implementation would look like this:\n\n```python\n@jsii.implements(ICloudAssemblyDirectoryProducer)\nclass MyProducer:\n def produce(self, context):\n app = cdk.App(context=context)\n stack = cdk.Stack(app)\n return app.synth().directory\n```\n\nFor all features (e.g. lookups) to work correctly, `cdk.App()` must be instantiated with the received `context` values.\nSince it is not possible to update the context of an app, it must be created as part of the `produce()` method.\n\nThe producer can than be used like this:\n\n```python\ncli = AwsCdkCli.from_cloud_assembly_directory_producer(MyProducer())\n```\n\n## Commands\n\n### list\n\n```python\n# await this asynchronous method call using a language feature\ncli.list()\n```\n\n### synth\n\n```python\n# await this asynchronous method call using a language feature\ncli.synth(\n stacks=[\"MyTestStack\"]\n)\n```\n\n### bootstrap\n\n```python\n# await this asynchronous method call using a language feature\ncli.bootstrap()\n```\n\n### deploy\n\n```python\n# await this asynchronous method call using a language feature\ncli.deploy(\n stacks=[\"MyTestStack\"]\n)\n```\n\n### destroy\n\n```python\n# await this asynchronous method call using a language feature\ncli.destroy(\n stacks=[\"MyTestStack\"]\n)\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "AWS CDK Programmatic CLI library",
"version": "2.170.0a0",
"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": "677473af8b2197e8b99595308ac9494938239037c8b584bc9d6d4a059bd1367e",
"md5": "770dea027be1d977b4fc1903086984b9",
"sha256": "9747560caedaa5340c4352d1dfd4f19a8ed48a37caba6040d8da808a22495039"
},
"downloads": -1,
"filename": "aws_cdk.cli_lib_alpha-2.170.0a0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "770dea027be1d977b4fc1903086984b9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.8",
"size": 5885021,
"upload_time": "2024-11-22T04:42:03",
"upload_time_iso_8601": "2024-11-22T04:42:03.082238Z",
"url": "https://files.pythonhosted.org/packages/67/74/73af8b2197e8b99595308ac9494938239037c8b584bc9d6d4a059bd1367e/aws_cdk.cli_lib_alpha-2.170.0a0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4ffc791c76f8d491ec715b91baec71bb22d5502237af5e188fc9d8a8acda356c",
"md5": "77821edd66ff93c04762fde0e9bd3765",
"sha256": "393d8e67091c8a59db31eae48faa15ce254382291063a12b7a7701274f0a9044"
},
"downloads": -1,
"filename": "aws_cdk_cli_lib_alpha-2.170.0a0.tar.gz",
"has_sig": false,
"md5_digest": "77821edd66ff93c04762fde0e9bd3765",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.8",
"size": 5885035,
"upload_time": "2024-11-22T04:42:47",
"upload_time_iso_8601": "2024-11-22T04:42:47.441114Z",
"url": "https://files.pythonhosted.org/packages/4f/fc/791c76f8d491ec715b91baec71bb22d5502237af5e188fc9d8a8acda356c/aws_cdk_cli_lib_alpha-2.170.0a0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-22 04:42:47",
"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.cli-lib-alpha"
}