# packages

pkgId: 5218b2c19bd1e2b0854c5d9df37723610937ef11733f8adeeaac509a588fca17
name: python-auto-coder-help
arch: noarch
version: 0.1.200
epoch: 0
release: 1
summary: Development documents and examples for auto-coder
url: https://pypi.org/project/auto-coder/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-auto-coder-0.1.200-1.src.rpm
location_href: Packages/python-auto-coder-help-0.1.200-1.noarch.rpm
checksum_type: sha256
description:
  *Latest News* 🔥
  - [2024/09] Release Auto-Coder 0.1.163
  - [2024/08] Release Auto-Coder 0.1.143
  - [2024/07] Release Auto-Coder 0.1.115
  - [2024/06] Release Auto-Coder 0.1.82
  - [2024/05] Release Auto-Coder 0.1.73
  - [2024/04] Release Auto-Coder 0.1.46
  - [2024/03] Release Auto-Coder 0.1.25


pkgId: 86c840fe791ec5dd1e7519a21914666a25f61cc5b09703b50ef13f17dc2a7098
name: python-auto-coder-web-help
arch: noarch
version: 0.1.14
epoch: 0
release: 1
summary: Development documents and examples for auto-coder-web
url: https://pypi.org/project/auto-coder-web/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-auto-coder-web-0.1.14-1.src.rpm
location_href: Packages/python-auto-coder-web-help-0.1.14-1.noarch.rpm
checksum_type: sha256
description:
  ```
  pip install auto_coder_web
  ```



  ```
  cd <project_dir>
  auto-coder.web
  ```



  http://localhost:8007

  开始你的编程！


  > 使用 docker 时，需要你的项目已经是一个被 auto-coder.chat 初始化过的项目。
  > 或者启动后，在界面 Terminal 中执行 `auto-coder init --source_dir .` 初始化项目。


  ```shell
  docker run  \
    --name auto-coder-web \
    -e BASE_URL=https://api.deepseek.com/v1 \
    -e API_KEY=$MODEL_DEEPSEEK_TOKEN \
    -e MODEL=deepseek-chat \
    -p 8006:8006 \
    -p 8007:8007 \
    -p 8265:8265 \
    -v <你的项目>:/app/work \
    -v <你的日志目录>:/app/logs \
    allwefantasy/auto-coder-web
  ```

  打开浏览器

  http://localhost:8007

  开始你的编程！


pkgId: 9c7cb2b1a6aa31f33487578ff7fbf030191f8026d4dab86fe124804329d50d03
name: python-auto-prep-help
arch: noarch
version: 0.1.1
epoch: 0
release: 1
summary: Development documents and examples for auto-prep
url: https://github.com/Pawlo77/AutoPrep.git
rpm_license: GPLv3
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-auto-prep-0.1.1-1.src.rpm
location_href: Packages/python-auto-prep-help-0.1.1-1.noarch.rpm
checksum_type: sha256
description:
  Auto-Prep is an automated data preprocessing and analysis pipeline that generates comprehensive LaTeX reports. It handles common preprocessing tasks, creates insightful visualizations, and documents the entire process in a professional PDF report. It focuses on tabluar data, supporting numerous explainable AI models. Focusing on their interpretability and ease of use, it includes subsections for each model, explaining their strengths and weaknesses and providing examples of their usage.



  - Automated data cleaning and preprocessing
  - Intelligent feature type detection
  - Advanced categorical encoding with rare category handling
  - Comprehensive exploratory data analysis (EDA)
  - Automated visualization generation
  - Professional LaTeX report generation
  - Modular and extensible design
  - Support for numerous explainable AI models
  - Explainability
  - Examples of usage





  1. Make sure you have Poetry installed:

  ```bash
  curl -sSL https://install.python-poetry.org | python3 -
  ```

  2. Clone the repository:

  ```bash
  git clone https://github.com/yourusername/auto-prep.git
  cd auto-prep
  ```

  3. Install dependencies:

  ```bash
  poetry install
  ```

  4. Activate the virtual environment:

  ```bash
  poetry shell
  ```

  5. Run the example usage:

  ```bash
  python example_usage.py
  ```



  The pipeline generates the following output structure:

  reports/
  ├── analysis_report.pdf # Main LaTeX report
  └── figures/ # Generated visualizations
  ├── correlation_matrix.png
  ├── missing_values.png
  └── dist_.png # Distribution plots for numeric features



  The generated report includes:
  1. Title page and table of contents
  2. Data Overview
     - Dataset structure
     - Feature characteristics
  3. Exploratory Data Analysis
     - Distribution plots
     - Correlation matrix
     - Missing value analysis
  4. Model Performance
     - Accuracy metrics
     - Model details



  This project is licensed under the MIT License - see the LICENSE file for details.



  - Paweł Pozorski - [GitHub](https://github.com/pozorski)



  - Inspired by the need for automated preprocessing and reporting in data science workflows
  - Built with modern Python tools and best practices



  1. Poetry is used for dependency management and virtual environment. Following functions are implemented:
  - `poetry install` - install dependencies
  - `poetry shell` - activate virtual environment
  - `poetry run format` - format code
  - `poetry run lint` - lint code
  - `poetry run check` - check code
  - `poetry run test` - run tests
  - `poetry run pre-commit install` - install pre-commit hooks
  - `poetry run pre-commit run --all-files` - run pre-commit hooks


pkgId: 165d5f5c982b45368f232b4db03b5ac22918be9fd70d111eb68f8c1cd9059d07
name: python-auto-round-help
arch: noarch
version: 0.4.3
epoch: 0
release: 1
summary: Development documents and examples for auto-round
url: https://github.com/intel/auto-round
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-auto-round-0.4.3-1.src.rpm
location_href: Packages/python-auto-round-help-0.4.3-1.noarch.rpm
checksum_type: sha256
description:
  <h3> Advanced Quantization Algorithm for LLMs</h3>
  [![python](https://img.shields.io/badge/python-3.9%2B-blue)](https://github.com/intel/auto-round)
  [![version](https://img.shields.io/badge/release-0.4.3-green)](https://github.com/intel/auto-round)


pkgId: f98172f9328db04f446213c0256484ff0cf909165e7d04c394486de0442efbac
name: python-auto-uncertainties-help
arch: noarch
version: 0.6.2
epoch: 0
release: 1
summary: Development documents and examples for auto-uncertainties
url: https://pypi.org/project/auto-uncertainties/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-auto-uncertainties-0.6.2-1.src.rpm
location_href: Packages/python-auto-uncertainties-help-0.6.2-1.noarch.rpm
checksum_type: sha256
description:
  AutoUncertainties is a package that makes handling linear uncertainty propagation for scientific applications
  straightforward and automatic using auto-differentiation.

  * View the [full documentation here](https://autouncertainties.readthedocs.io/en/latest/).



  - [x] Scalars
  - [x] Arrays, with support for most NumPy ufuncs and functions
  - [ ] Pandas Extension Type (see [here](https://pandas.pydata.org/docs/reference/api/pandas.api.extensions.ExtensionDtype.html))



  For array support:

  * `jax`
  * `jaxlib`
  * `numpy`



  To install, simply run:

  ```
  pip install auto_uncertainties
  ```



  To build the documentation locally, clone the repository, create a virtual Python environment
  (if desired), and run the following commands within the repository directory:

  ```bash
  pip install auto_uncertainties[docs]
  sphinx-build docs/source docs/build
  ```

  Once built, the docs can be found under the `docs/build` subdirectory.



  * Creating a scalar `Uncertainty` variable is relatively simple:

    ```python
    >>> from auto_uncertainties import Uncertainty
    >>> value = 1.0
    >>> error = 0.1
    >>> u = Uncertainty(value, error)
    >>> u
    1 +/- 0.1
    ```

    As is creating a `numpy` array of Uncertainties:

    ```python
    >>> from auto_uncertainties import Uncertainty
    >>> import numpy as np
    >>> value = np.linspace(start=0, stop=10, num=5)
    >>> error = np.ones_like(value)*0.1
    >>> u = Uncertainty(value, error)
    ```

    - (though, they are actually different classes!)

      ```python
      >>> from auto_uncertainties import Uncertainty
      >>> value = 1.0
      >>> error = 0.1
      >>> u = Uncertainty(value, error)
      >>> type(u)
      <class 'auto_uncertainties.uncertainty.uncertainty_containers.ScalarUncertainty'>
      ```

      ```python
      >>> from auto_uncertainties import Uncertainty
      >>> import numpy as np
      >>> value = np.linspace(start=0, stop=10, num=5)
      >>> error = np.ones_like(value)*0.1
      >>> u = Uncertainty(value, error)
      >>> type(u)
      <class 'auto_uncertainties.uncertainty.uncertainty_containers.VectorUncertainty'>
      ```

  * Scalar uncertainties implement all mathematical and logical
    [dunder methods](https://docs.python.org/3/reference/datamodel.html#object.__repr__>) explicitly using linear
    uncertainty propagation.

    ```python
    >>> from auto_uncertainties import Uncertainty
    >>> u = Uncertainty(10.0, 3.0)
    >>> v = Uncertainty(20.0, 4.0)
    >>> u + v
    30 +/- 5
    ```

  * Array uncertainties implement a large subset of the numpy ufuncs and methods using `jax.grad` or
    `jax.jacfwd`, depending on the output shape.

    ```python
    >>> from auto_uncertainties import Uncertainty
    >>> import numpy as np
    >>> value = np.linspace(start=0, stop=10, num=5)
    >>> error = np.ones_like(value)*0.1
    >>> u = Uncertainty(value, error)
    >>> np.exp(u)
    [1 +/- 0.1, 12.1825 +/- 1.21825, 148.413 +/- 14.8413, 1808.04 +/- 180.804, 22026.5 +/- 2202.65]
    >>> np.sum(u)
    25 +/- 0.223607
    >>> u.sum()
    25 +/- 0.223607
    >>> np.sqrt(np.sum(error**2))
    0.223606797749979
    ```

  * The central value, uncertainty, and relative error are available as attributes:

    ```python
    >>> from auto_uncertainties import Uncertainty
    >>> u = Uncertainty(10.0, 3.0)
    >>> u.value
    10.0
    >>> u.error
    3.0
    >>> u.rel
    0.3
    ```

  * To strip central values and uncertainty from arbitrary variables, accessor functions `nominal_values`
    and `std_devs` are provided:

    ```python
    >>> from auto_uncertainties import nominal_values, std_devs
    >>> u = Uncertainty(10.0, 3.0)
    >>> v = 5.0
    >>> nominal_values(u)
    10.0
    >>> std_devs(u)
    3.0
    >>> nominal_values(v)
    5.0
    >>> std_devs(v)
    0.0
    ```

  * Displayed values are automatically rounded according to the Particle Data Group standard.
    This can be turned off using `set_display_rounding`:

    ```python
    >>> from auto_uncertainties import set_display_rounding
    >>> set_display_rounding(False)
    >>> from auto_uncertainties import Uncertainty
    >>> import numpy as np
    >>> value = np.linspace(start=0, stop=10, num=5)
    >>> error = np.ones_like(value)*0.1
    >>> u = Uncertainty(value, error)
    >>> np.sum(u)
    25 +/- 0.223607
    ```

  * If `numpy.array` is called on an `Uncertainty` object, it will automatically get cast down to a numpy array (and lose
    uncertainty information!), and emit a warning. To make this an error, use `set_downcast_error`:

    ```python
    >>> from auto_uncertainties import set_downcast_error
    >>> set_downcast_error(True)
    >>> from auto_uncertainties import Uncertainty
    >>> import numpy as np
    >>> value = np.linspace(start=0, stop=10, num=5)
    >>> error = np.ones_like(value)*0.1
    >>> u = Uncertainty(value, error)
    >>> np.array(u)
    Traceback (most recent call last):
        ...
    auto_uncertainties.exceptions.DowncastError: The uncertainty is stripped when downcasting to ndarray.
    ```



  The class structure of `Uncertainty`, and the `numpy` ufunc implementation is heavily inspired by the
  excellent package [Pint](https://github.com/hgrecco/pint).


pkgId: a1cf0d64862557d521ed11f5dfe7c90fe8e2a3539546d7ec76bbfb40e05258a0
name: python-autoansign-help
arch: noarch
version: 0.0.2
epoch: 0
release: 1
summary: Development documents and examples for autoansign
url: https://github.com/MobileAutoFlow/autoansign
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autoansign-0.0.2-1.src.rpm
location_href: Packages/python-autoansign-help-0.0.2-1.noarch.rpm
checksum_type: sha256
description:
  基于[airtest_mobileauto](https://pypi.org/project/airtest-mobileauto)的安卓自动化任务脚本

  ![GitHub forks](https://img.shields.io/github/forks/MobileAutoFlow/autoansign?color=60c5ba&style=for-the-badge)![GitHub stars](https://img.shields.io/github/stars/MobileAutoFlow/autoansign?color=ffd700&style=for-the-badge)



  * 本脚本基于分辨率`960x540`, dpi`160`的安卓模拟器开发
  * dpi或者分辨率不同很容易识别失败。
  * 有的模拟器打开特定APP会闪退

  安装

  ```
  python -m pip install autoansign --upgrade
  ```



  * `web_url`,直接打开特定url,实现签到, **适配任意的安卓设备**
  * 将url存储到`web_url.txt`,下面是我常用的url
  ```
  none
  ```


  * *注: 本脚本于via-5.9.0测试通过, 需开启桌面模式、全屏、浏览器标识(windows/chrome),其他浏览器自行替换图片资源*
  * 只能在境内的模拟器/容器内执行, 这些网站在不同地区显示的内容不同.
  * `web_ablesci`, [科研通](https://www.ablesci.com/)每日签到
  * `web_muchong`, [小木虫](https://muchong.com/bbs/)每日签到


  * `app_alicloud`, 阿里云盘每日签到(横屏版960x540)





  * 创建`tag.txt`则开启领取`tag.py`中定义的礼包

  ```
  python run.py config.win.yaml
  ```

  我的配置文件 `config.win.yaml`
  ```
  mynode: 10
  MuMudir: 'D:\Program Files\Netease\MuMu Player 12\shell'
  MuMu_Instance:
    10: "0"
  LINK_dict:
    10: Android:///127.0.0.1:16384
  figdir: assets
  logfile:
    10: result.ce.txt
  prefix: "autotask"
  ```




  [![Star History Chart](https://api.star-history.com/svg?repos=MobileAutoFlow/autoansign&type=Date)](https://star-history.com/#MobileAutoFlow/autoansign&Date)


pkgId: 9144de6617205f5e09fa4a9d9f881560f274de0601b03c959559c02edb808626
name: python-autochat-help
arch: noarch
version: 0.3.8
epoch: 0
release: 1
summary: Development documents and examples for autochat
url: https://github.com/benderv/autochat
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autochat-0.3.8-1.src.rpm
location_href: Packages/python-autochat-help-0.3.8-1.noarch.rpm
checksum_type: sha256
description:
  AutoChat is an assistant library, to make it easy to create interactive agents.
  It supports OpenAI/Anthropic and can run on top of any other LLM.

  - **Autochat Class**: Conversation wrapper to store instruction, context and messages histories.
  - **Message Class**: Message wrapper to handle format/parsing automatically.
  - **Function Calls**: Capability to handle function calls within the conversation, allowing complex interactions and responses.
  - **Template System**: A straightforward text-based template system for defining the behavior of the chatbot, making it easy to customize its responses and actions.



  To install the package, you can use pip:

  ```bash
  pip install autochat
  ```

  Please note that this package requires Python 3.6 or later.



  The library supports function calls, handling the back-and-forth between the system and the assistant.

  ```python
  from autochat import Autochat, Message
  import requests

  def search_top_result(query: str):
      response = requests.get(f"https://google.com/search?q={query}")
      return response.text

  classifierGPT = Autochat(instruction="You are a helpful assistant that can search the web for information")
  classifierGPT.add_function(search_top_result)

  text = "since when is the lastest iphone available?"
  for message in classifierGPT.run_conversation(text):
      print(message.to_markdown())








  ```



  ```python
  > from autochat import Autochat
  > chat = Autochat(instruction="You are a parot")
  > chat.ask('Hi my name is Bob')

  > chat.ask('Can you tell me my name?')

  ```



  We provide a simple template system for defining the behavior of the chatbot, using markdown-like syntax.

  ```

  You are a parrot


  Hi my name is Bob


  Hi my name is Bob, hi my name is Bob!


  Can you tell me my name?


  Your name is Bob, your name is Bob!
  ```

  You can then load the template file using the `from_template` method:

  ```python
  parrotGPT = Autochat.from_template("./parrot_template.txt")
  ```

  The template system also supports function calls. Check out the [examples/demo_label.py](examples/demo_label.py) for a complete example.



  Default provider is openai.

  Anthropic:

  ```python
  chat = Autochat(provider="anthropic")
  ```



  The `AUTOCHAT_MODEL` environment variable specifies the model to use. If not set, it defaults to "gpt-4-turbo".

  ```bash
  export AUTOCHAT_MODEL="gpt-4-turbo"
  export OPENAI_API_KEY=<your-key>
  ```

  or with anthropic

  ```bash
  export AUTOCHAT_MODEL="claude-3-opus"
  export ANTHROPIC_API_KEY=<your-key>
  ```

  Use `AUTOCHAT_HOST` to use alternative provider (openai, anthropic, openpipe, llama_cpp, ...)



  If you encounter any issues or have questions, please file an issue on the GitHub project page.



  This project is licensed under the terms of the MIT license.


pkgId: 01deeb0895e96b61313cd635a95a0e88ad4b34976cd737868aa32cd53eba35ba
name: python-autoclr-help
arch: noarch
version: 1.0.0
epoch: 0
release: 1
summary: Development documents and examples for autoclr
url: https://pypi.org/project/autoclr/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autoclr-1.0.0-1.src.rpm
location_href: Packages/python-autoclr-help-1.0.0-1.noarch.rpm
checksum_type: sha256
description:
  <h1 align="center">
      autoclr
  </h1>
  <p align="center">
      Automatic loader for pythonnet(coreclr)
  </p>
  <br/>

  <div align="center">
      <img src="https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue" />
      <br>
      <a href="https://github.com/somehitDev/autoclr/blob/main/LICENSE">
          <img src="https://img.shields.io/github/license/somehitDev/autoclr.svg" alt="MIT License" />
      </a>
      <a href="https://pypi.org/project/autoclr/">
          <img src="https://img.shields.io/pypi/v/autoclr" alt="pypi" />
      </a>
  </div>
  <br/><br/>



  - python 3.7 or higher
  - tested on

  |           OS          | Tested | Pass |          Issue         |
  | --------------------- | ------ | ---- | ---------------------- |
  | Mac 13(Sequoia)       |   ✅   |  ✅  |                        |
  | Windows 10(ARM64/UTM) |   ✅   |  ❎  | binary not working     |
  | Linux(Ubuntu/ARM)     |   ✅   |  ✅  | arm64, aarch64 support |

  <br><br>



  ```zsh
  python -m pip install autoclr
  ```

  ```zsh
  python -m pip install git+https://github.com/somehitDev/autoclr.git
  ```

  <br><br>


  ```python
  from autoclr import load


  load("default", **params)

  load("system", **params)

  load("online", **params)
  ```
  - default
    - call pythonnet.load coreclr and parameters.
  - system
    - get dotnet_root from system installed dotnet.
    - if not installed, raise error.
  - online
    - extract archive downloaded from dotnet official site and load clr.
  - offline
    - not available not.

  <br><br>


  - See [CHANGELOG.md](https://github.com/somehitDev/autoclr/blob/main/CHANGELOG.md)


pkgId: 6589b67a6f406d59d590ebe848299261fb2c57b79f63f8c271e18d5ff763e644
name: python-autoevals-help
arch: noarch
version: 0.0.111
epoch: 0
release: 1
summary: Development documents and examples for autoevals
url: https://www.braintrustdata.com
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autoevals-0.0.111-1.src.rpm
location_href: Packages/python-autoevals-help-0.0.111-1.noarch.rpm
checksum_type: sha256
description:
  Autoevals is a tool to quickly and easily evaluate AI model outputs.

  It bundles together a variety of automatic evaluation methods including:

  - LLM-as-a-Judge
  - Heuristic (e.g. Levenshtein distance)
  - Statistical (e.g. BLEU)

  Autoevals is developed by the team at [Braintrust](https://braintrust.dev/).

  Autoevals uses model-graded evaluation for a variety of subjective tasks including fact checking,
  safety, and more. Many of these evaluations are adapted from OpenAI's excellent [evals](https://github.com/openai/evals)
  project but are implemented so you can flexibly run them on individual examples, tweak the prompts, and debug
  their outputs.

  You can also create your own model-graded evaluations with Autoevals. It's easy to add custom prompts, parse outputs,
  and manage exceptions.



  Autoevals is distributed as a [Python library on PyPI](https://pypi.org/project/autoevals/) and
  [Node.js library on NPM](https://www.npmjs.com/package/autoevals).



  ```bash
  pip install autoevals
  ```



  ```bash
  npm install autoevals
  ```



  Use Autoevals to model-grade an example LLM completion using the [factuality prompt](templates/factuality.yaml).
  By default, Autoevals uses your `OPENAI_API_KEY` environment variable to authenticate with OpenAI's API.



  ```python
  from autoevals.llm import *


  evaluator = Factuality()


  input = "Which country has the highest population?"
  output = "People's Republic of China"
  expected = "China"

  result = evaluator(output, expected, input=input)


  print(f"Factuality score: {result.score}")
  print(f"Factuality metadata: {result.metadata['rationale']}")
  ```



  If you need to use a custom OpenAI client, you can initialize the library with a custom client.

  ```python
  import openai
  from autoevals import init
  from autoevals.oai import LLMClient

  openai_client = openai.OpenAI(base_url="https://api.openai.com/v1/")

  class CustomClient(LLMClient):
      openai=openai_client  # you can also pass in openai module and we will instantiate it for you
      embed = openai.embeddings.create
      moderation = openai.moderations.create
      RateLimitError = openai.RateLimitError

      def complete(self, **kwargs):
          
          return self.openai.chat.completions.create(**kwargs)


  client = init(client=CustomClient)
  ```

  If you only need to use a custom client for a specific evaluator, you can pass in the client to the evaluator.

  ```python
  evaluator = Factuality(client=CustomClient)
  ```



  ```javascript
  import { Factuality } from "autoevals";

  (async () => {
    const input = "Which country has the highest population?";
    const output = "People's Republic of China";
    const expected = "China";

    const result = await Factuality({ output, expected, input });
    console.log(`Factuality score: ${result.score}`);
    console.log(`Factuality metadata: ${result.metadata.rationale}`);
  })();
  ```



  Once you grade an output using Autoevals, it's convenient to use [Braintrust](https://www.braintrust.dev/docs/libs/python) to log and compare your evaluation results.



  ```python
  from autoevals.llm import *
  import braintrust


  evaluator = Factuality()


  input = "Which country has the highest population?"
  output = "People's Republic of China"
  expected = "China"


  experiment = braintrust.init(
      project="Autoevals", api_key="YOUR_BRAINTRUST_API_KEY"
  )


  with experiment.start_span() as span:
      result = evaluator(output, expected, input=input)

      
      print(f"Factuality score: {result.score}")
      print(f"Factuality metadata: {result.metadata['rationale']}")

      span.log(
          inputs={"query": input},
          output=output,
          expected=expected,
          scores={
              "factuality": result.score,
          },
          metadata={
              "factuality": result.metadata,
          },
      )

  print(experiment.summarize())
  ```



  Create a file named `example.eval.js` (it must end with `.eval.js` or `.eval.js`):

  ```javascript
  import { Eval } from "braintrust";
  import { Factuality } from "autoevals";

  Eval("Autoevals", {
    data: () => [
      {
        input: "Which country has the highest population?",
        expected: "China",
      },
    ],
    task: () => "People's Republic of China",
    scores: [Factuality],
  });
  ```

  Then, run

  ```bash
  npx braintrust run example.eval.js
  ```





  - Battle
  - ClosedQA
  - Humor
  - Factuality
  - Moderation
  - Security
  - Summarization
  - SQL
  - Translation
  - Fine-tuned binary classifiers



  - Context precision
  - Context relevancy
  - Context recall
  - Context entities recall
  - Faithfullness
  - Answer relevance
  - Answer semantic similarity
  - Answer correctness
  - Aspect critique



  - Semantic list contains
  - JSON validity



  - Embedding similarity
  - BERTScore



  - Levenshtein distance
  - Exact match
  - Numeric difference
  - JSON diff
  - Jaccard distance



  - BLEU
  - ROUGE
  - METEOR



  Autoevals supports custom evaluation prompts for model-graded evaluation. To use them, simply pass in a prompt and scoring mechanism:



  ```python
  from autoevals import LLMClassifier


  prompt_prefix = """
  You are a technical project manager who helps software engineers generate better titles for their GitHub issues.
  You will look at the issue description, and pick which of two titles better describes it.

  I'm going to provide you with the issue description, and two possible titles.

  Issue Description: {{input}}

  1: {{output}}
  2: {{expected}}
  """




  output_scores = {"1": 1, "2": 0}

  evaluator = LLMClassifier(
      name="TitleQuality",
      prompt_template=prompt_prefix,
      choice_scores=output_scores,
      use_cot=True,
  )


  page_content = """
  As suggested by Nicolo, we should standardize the error responses coming from GoTrue, postgres, and realtime (and any other/future APIs) so that it's better DX when writing a client,
  We can make this change on the servers themselves, but since postgrest and gotrue are fully/partially external may be harder to change, it might be an option to transform the errors within the client libraries/supabase-js, could be messy?
  Nicolo also dropped this as a reference: http://spec.openapis.org/oas/v3.0.3#openapi-specification"""
  output = (
      "Standardize error responses from GoTrue, Postgres, and Realtime APIs for better DX"
  )
  expected = "Standardize Error Responses across APIs"

  response = evaluator(output, expected, input=page_content)

  print(f"Score: {response.score}")
  print(f"Metadata: {response.metadata}")
  ```



  ```javascript
  import { LLMClassifierFromTemplate } from "autoevals";

  (async () => {
    const promptTemplate = `You are a technical project manager who helps software engineers generate better titles for their GitHub issues.
  You will look at the issue description, and pick which of two titles better describes it.

  I'm going to provide you with the issue description, and two possible titles.

  Issue Description: {{input}}

  1: {{output}}
  2: {{expected}}`;

    const choiceScores = { 1: 1, 2: 0 };

    const evaluator =
      LLMClassifierFromTemplate <
      { input: string } >
      {
        name: "TitleQuality",
        promptTemplate,
        choiceScores,
        useCoT: true,
      };

    const input = `As suggested by Nicolo, we should standardize the error responses coming from GoTrue, postgres, and realtime (and any other/future APIs) so that it's better DX when writing a client,
  We can make this change on the servers themselves, but since postgrest and gotrue are fully/partially external may be harder to change, it might be an option to transform the errors within the client libraries/supabase-js, could be messy?
  Nicolo also dropped this as a reference: http://spec.openapis.org/oas/v3.0.3#openapi-specification`;
    const output = `Standardize error responses from GoTrue, Postgres, and Realtime APIs for better DX`;
    const expected = `Standardize Error Responses across APIs`;

    const response = await evaluator({ input, output, expected });

    console.log("Score", response.score);
    console.log("Metadata", response.metadata);
  })();
  ```



  You can also create your own scoring functions that do not use LLMs. For example, to test whether the word `'banana'`
  is in the output, you can use the following:



  ```python
  from autoevals import Score


  def banana_scorer(output, expected, input):
      return Score(name="banana_scorer", score=1 if "banana" in output else 0)


  input = "What is 1 banana + 2 bananas?"
  output = "3"
  expected = "3 bananas"

  result = banana_scorer(output, expected, input)

  print(f"Banana score: {result.score}")
  ```



  ```javascript
  import { Score } from "autoevals";

  const bananaScorer = ({
    output,
    expected,
    input,
  }: {
    output: string;
    expected: string;
    input: string;
  }): Score => {
    return { name: "banana_scorer", score: output.includes("banana") ? 1 : 0 };
  };

  (async () => {
    const input = "What is 1 banana + 2 bananas?";
    const output = "3";
    const expected = "3 bananas";

    const result = bananaScorer({ output, expected, input });
    console.log(`Banana score: ${result.score}`);
  })();
  ```



  There is nothing particularly novel about the evaluation methods in this library. They are all well-known and well-documented. However, there are a few things that are particularly difficult when evaluating in practice:

  - Normalizing metrics between 0 and 1 is tough. For example, check out the calculation in [number.py](/py/autoevals/number.py) to see how it's done for numeric differences.
  - Parsing the outputs on model-graded evaluations is also challenging. There are frameworks that do this, but it's hard to
    debug one output at a time, propagate errors, and tweak the prompts. Autoevals makes these tasks easy.
  - Collecting metrics behind a uniform interface makes it easy to swap out evaluation methods and compare them. Prior to Autoevals, we couldn't find an open source library where you can simply pass in `input`, `output`, and `expected` values through a bunch of different evaluation methods.



  The full docs are available [here](https://www.braintrust.dev/docs/reference/autoevals).


pkgId: e4d385725500d6ec1358275345238595bbecf53c60843ae74b73efca20a21f42
name: python-autogen-agentchat-help
arch: noarch
version: 0.2.40
epoch: 0
release: 1
summary: Development documents and examples for autogen-agentchat
url: https://github.com/microsoft/autogen
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autogen-agentchat-0.2.40-1.src.rpm
location_href: Packages/python-autogen-agentchat-help-0.2.40-1.noarch.rpm
checksum_type: sha256
description:
  <a name="readme-top"></a>


  <div align="center">

  <img src="https://microsoft.github.io/autogen/0.2/img/ag.svg" alt="AutoGen Logo" width="100">

  ![Python Version](https://img.shields.io/badge/3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue) [![PyPI - Version](https://img.shields.io/pypi/v/autogen-agentchat)](https://pypi.org/project/autogen-agentchat/)
  [![NuGet version](https://badge.fury.io/nu/AutoGen.Core.svg)](https://badge.fury.io/nu/AutoGen.Core)

  [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40pyautogen)](https://twitter.com/pyautogen)

  </div>



  AutoGen is an open-source programming framework for building AI agents and facilitating cooperation among multiple agents to solve tasks. AutoGen aims to streamline the development and research of agentic AI, much like PyTorch does for Deep Learning. It offers features such as agents capable of interacting with each other, facilitates the use of various large language models (LLMs) and tool use support, autonomous and human-in-the-loop workflows, and multi-agent conversation patterns.

  > [!IMPORTANT]
  > In order to better align with a new multi-packaging structure we have coming very soon, AutoGen is now available on PyPi as [`autogen-agentchat`](https://pypi.org/project/autogen-agentchat/) as of version `0.2.36`. This is the official package for the AutoGen project.


  > [!NOTE]
  > *Note for contributors and users*</b>: [microsoft/autogen](https://aka.ms/autogen-gh) is the original repository of AutoGen project and it is under active development and maintenance under MIT license. We welcome contributions from developers and organizations worldwide. Our goal is to foster a collaborative and inclusive community where diverse perspectives and expertise can drive innovation and enhance the project's capabilities. We acknowledge the invaluable contributions from our existing contributors, as listed in [contributors.md](./CONTRIBUTORS.md). Whether you are an individual contributor or represent an organization, we invite you to join us in shaping the future of this project. For further information please also see [Microsoft open-source contributing guidelines](https://github.com/microsoft/autogen?tab=readme-ov-file#contributing).
  >
  > -_Maintainers (Sept 6th, 2024)_


  ![AutoGen Overview](https://github.com/microsoft/autogen/blob/0.2/website/static/img/autogen_agentchat.png)

  - AutoGen enables building next-gen LLM applications based on [multi-agent conversations](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat) with minimal effort. It simplifies the orchestration, automation, and optimization of a complex LLM workflow. It maximizes the performance of LLM models and overcomes their weaknesses.
  - It supports [diverse conversation patterns](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat#supporting-diverse-conversation-patterns) for complex workflows. With customizable and conversable agents, developers can use AutoGen to build a wide range of conversation patterns concerning conversation autonomy,
    the number of agents, and agent conversation topology.
  - It provides a collection of working systems with different complexities. These systems span a [wide range of applications](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat#diverse-applications-implemented-with-autogen) from various domains and complexities. This demonstrates how AutoGen can easily support diverse conversation patterns.
  - AutoGen provides [enhanced LLM inference](https://microsoft.github.io/autogen/docs/Use-Cases/enhanced_inference#api-unification). It offers utilities like API unification and caching, and advanced usage patterns, such as error handling, multi-config inference, context programming, etc.

  AutoGen was created out of collaborative [research](https://microsoft.github.io/autogen/docs/Research) from Microsoft, Penn State University, and the University of Washington.

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>




  <details>

  <summary>Expand</summary>

  :fire: June 6, 2024: WIRED publishes a new article on AutoGen: [Chatbot Teamwork Makes the AI Dream Work](https://www.wired.com/story/chatbot-teamwork-makes-the-ai-dream-work/) based on interview with [Adam Fourney](https://github.com/afourney).

  :fire: June 4th, 2024: Microsoft Research Forum publishes new update and video on [AutoGen and Complex Tasks](https://www.microsoft.com/en-us/research/video/autogen-update-complex-tasks-and-agents/) presented by [Adam Fourney](https://github.com/afourney).

  :fire: May 29, 2024: DeepLearning.ai launched a new short course [AI Agentic Design Patterns with AutoGen](https://www.deeplearning.ai/short-courses/ai-agentic-design-patterns-with-autogen), made in collaboration with Microsoft and Penn State University, and taught by AutoGen creators [Chi Wang](https://github.com/sonichi) and [Qingyun Wu](https://github.com/qingyun-wu).

  :fire: May 24, 2024: Foundation Capital published an article on [Forbes: The Promise of Multi-Agent AI](https://www.forbes.com/sites/joannechen/2024/05/24/the-promise-of-multi-agent-ai/?sh=2c1e4f454d97) and a video [AI in the Real World Episode 2: Exploring Multi-Agent AI and AutoGen with Chi Wang](https://www.youtube.com/watch?v=RLwyXRVvlNk).

  :fire: May 13, 2024: [The Economist](https://www.economist.com/science-and-technology/2024/05/13/todays-ai-models-are-impressive-teams-of-them-will-be-formidable) published an article about multi-agent systems (MAS) following a January 2024 interview with [Chi Wang](https://github.com/sonichi).

  :fire: May 11, 2024: [AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation](https://openreview.net/pdf?id=uAjxFFing2) received the best paper award at the [ICLR 2024 LLM Agents Workshop](https://llmagents.github.io/).

  :fire: Apr 26, 2024: [AutoGen.NET](https://microsoft.github.io/autogen-for-net/) is available for .NET developers! Thanks [XiaoYun Zhang](https://www.linkedin.com/in/xiaoyun-zhang-1b531013a/)

  :fire: Apr 17, 2024: Andrew Ng cited AutoGen in [The Batch newsletter](https://www.deeplearning.ai/the-batch/issue-245/) and [What's next for AI agentic workflows](https://youtu.be/sal78ACtGTc?si=JduUzN_1kDnMq0vF) at Sequoia Capital's AI Ascent (Mar 26).

  :fire: Mar 3, 2024: What's new in AutoGen? 📰[Blog](https://microsoft.github.io/autogen/blog/2024/03/03/AutoGen-Update); 📺[Youtube](https://www.youtube.com/watch?v=j_mtwQiaLGU).

  :fire: Mar 1, 2024: the first AutoGen multi-agent experiment on the challenging [GAIA](https://huggingface.co/spaces/gaia-benchmark/leaderboard) benchmark achieved the No. 1 accuracy in all the three levels.

  <!-- :tada: Jan 30, 2024: AutoGen is highlighted by Peter Lee in Microsoft Research Forum [Keynote](https://t.co/nUBSjPDjqD). -->

  :tada: Dec 31, 2023: [AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework](https://arxiv.org/abs/2308.08155) is selected by [TheSequence: My Five Favorite AI Papers of 2023](https://thesequence.substack.com/p/my-five-favorite-ai-papers-of-2023).

  <!-- :fire: Nov 24: pyautogen [v0.2](https://github.com/microsoft/autogen/releases/tag/v0.2.0) is released with many updates and new features compared to v0.1.1. It switches to using openai-python v1. Please read the [migration guide](https://microsoft.github.io/autogen/docs/Installation#python). -->

  <!-- :fire: Nov 11: OpenAI's Assistants are available in AutoGen and interoperatable with other AutoGen agents! Checkout our [blogpost](https://microsoft.github.io/autogen/blog/2023/11/13/OAI-assistants) for details and examples. -->

  :tada: Nov 8, 2023: AutoGen is selected into [Open100: Top 100 Open Source achievements](https://www.benchcouncil.org/evaluation/opencs/annual.html) 35 days after spinoff from [FLAML](https://github.com/microsoft/FLAML).

  <!-- :tada: Nov 6, 2023: AutoGen is mentioned by Satya Nadella in a [fireside chat](https://youtu.be/0pLBvgYtv6U). -->

  <!-- :tada: Nov 1, 2023: AutoGen is the top trending repo on GitHub in October 2023. -->

  <!-- :tada: Oct 03, 2023: AutoGen spins off from [FLAML](https://github.com/microsoft/FLAML) on GitHub. -->

  <!-- :tada: Aug 16: Paper about AutoGen on [arxiv](https://arxiv.org/abs/2308.08155). -->

  :tada: Mar 29, 2023: AutoGen is first created in [FLAML](https://github.com/microsoft/FLAML).

  <!--
  :fire: FLAML is highlighted in OpenAI's [cookbook](https://github.com/openai/openai-cookbook#related-resources-from-around-the-web).

  :fire: [autogen](https://microsoft.github.io/autogen/) is released with support for ChatGPT and GPT-4, based on [Cost-Effective Hyperparameter Optimization for Large Language Model Generation Inference](https://arxiv.org/abs/2303.04673).

  :fire: FLAML supports Code-First AutoML & Tuning – Private Preview in [Microsoft Fabric Data Science](https://learn.microsoft.com/en-us/fabric/data-science/). -->

  </details>



  To see what we are working on and what we plan to work on, please check our
  [Roadmap Issues](https://aka.ms/autogen-roadmap).

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>


  The easiest way to start playing is
  1. Click below to use the GitHub Codespace

      [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/autogen?quickstart=1)

   2. Copy OAI_CONFIG_LIST_sample to ./notebook folder, name to OAI_CONFIG_LIST, and set the correct configuration.
   3. Start playing with the notebooks!

  *NOTE*: OAI_CONFIG_LIST_sample lists GPT-4 as the default model, as this represents our current recommendation, and is known to work well with AutoGen. If you use a model other than GPT-4, you may need to revise various system prompts (especially if using weaker models like GPT-3.5-turbo). Moreover, if you use models other than those hosted by OpenAI or Azure, you may incur additional risks related to alignment and safety. Proceed with caution if updating this default.

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>




  Find detailed instructions for users [here](https://microsoft.github.io/autogen/docs/installation/Docker#step-1-install-docker), and for developers [here](https://microsoft.github.io/autogen/docs/Contribute#docker-for-development).



  AutoGen requires **Python version >= 3.8, < 3.13**. It can be installed from pip:

  ```bash
  pip install autogen-agentchat~=0.2
  ```

  Minimal dependencies are installed without extra options. You can install extra options based on the feature you need.

  <!-- For example, use the following to install the dependencies needed by the [`blendsearch`](https://microsoft.github.io/FLAML/docs/Use-Cases/Tune-User-Defined-Function#blendsearch-economical-hyperparameter-optimization-with-blended-search-strategy) option.
  ```bash
  pip install "autogen-agentchat[blendsearch]~=0.2"
  ``` -->

  Find more options in [Installation](https://microsoft.github.io/autogen/docs/Installation#option-2-install-autogen-locally-using-virtual-environment).

  <!-- Each of the [`notebook examples`](https://github.com/microsoft/autogen/tree/main/notebook) may require a specific option to be installed. -->

  Even if you are installing and running AutoGen locally outside of docker, the recommendation and default behavior of agents is to perform [code execution](https://microsoft.github.io/autogen/docs/FAQ/#code-execution) in docker. Find more instructions and how to change the default behaviour [here](https://microsoft.github.io/autogen/docs/Installation#code-execution-with-docker-(default)).

  For LLM inference configurations, check the [FAQs](https://microsoft.github.io/autogen/docs/FAQ#set-your-api-endpoints).

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>



  Autogen enables the next-gen LLM applications with a generic [multi-agent conversation](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat) framework. It offers customizable and conversable agents that integrate LLMs, tools, and humans.
  By automating chat among multiple capable agents, one can easily make them collectively perform tasks autonomously or with human feedback, including tasks that require using tools via code.

  Features of this use case include:

  - **Multi-agent conversations**: AutoGen agents can communicate with each other to solve tasks. This allows for more complex and sophisticated applications than would be possible with a single LLM.
  - **Customization**: AutoGen agents can be customized to meet the specific needs of an application. This includes the ability to choose the LLMs to use, the types of human input to allow, and the tools to employ.
  - **Human participation**: AutoGen seamlessly allows human participation. This means that humans can provide input and feedback to the agents as needed.

  For [example](https://github.com/microsoft/autogen/blob/0.2/test/twoagent.py),

  ```python
  from autogen import AssistantAgent, UserProxyAgent, config_list_from_json



  config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST")

  assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})
  user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding", "use_docker": False}) # IMPORTANT: set to True to run code in docker, recommended
  user_proxy.initiate_chat(assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")

  ```

  This example can be run with

  ```python
  python test/twoagent.py
  ```

  After the repo is cloned.
  The figure below shows an example conversation flow with AutoGen.
  ![Agent Chat Example](https://github.com/microsoft/autogen/blob/0.2/website/static/img/chat_example.png)

  Alternatively, the [sample code](https://github.com/microsoft/autogen/blob/0.2/samples/simple_chat.py) here allows a user to chat with an AutoGen agent in ChatGPT style.
  Please find more [code examples](https://microsoft.github.io/autogen/docs/Examples#automated-multi-agent-chat) for this feature.

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>



  Autogen also helps maximize the utility out of the expensive LLMs such as ChatGPT and GPT-4. It offers [enhanced LLM inference](https://microsoft.github.io/autogen/docs/Use-Cases/enhanced_inference#api-unification) with powerful functionalities like caching, error handling, multi-config inference and templating.

  <!-- For example, you can optimize generations by LLM with your own tuning data, success metrics, and budgets.

  ```python

  config, analysis = autogen.Completion.tune(
      data=tune_data,
      metric="success",
      mode="max",
      eval_func=eval_func,
      inference_budget=0.05,
      optimization_budget=3,
      num_samples=-1,
  )

  response = autogen.Completion.create(context=test_instance, **config)
  ```

  Please find more [code examples](https://microsoft.github.io/autogen/docs/Examples#tune-gpt-models) for this feature. -->

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>



  You can find detailed documentation about AutoGen [here](https://microsoft.github.io/autogen/).

  In addition, you can find:

  - [Research](https://microsoft.github.io/autogen/docs/Research), [blogposts](https://microsoft.github.io/autogen/blog) around AutoGen, and [Transparency FAQs](https://github.com/microsoft/autogen/blob/0.2/TRANSPARENCY_FAQS.md)

  - [Contributing guide](https://microsoft.github.io/autogen/docs/Contribute)

  - [Roadmap](https://github.com/orgs/microsoft/projects/989/views/3)

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>



  [AutoGen Studio](https://www.microsoft.com/en-us/research/publication/autogen-studio-a-no-code-developer-tool-for-building-and-debugging-multi-agent-systems/)

  ```
  @inproceedings{dibia2024studio,
        title={AutoGen Studio: A No-Code Developer Tool for Building and Debugging Multi-Agent Systems},
        author={Victor Dibia and Jingya Chen and Gagan Bansal and Suff Syed and Adam Fourney and Erkang (Eric) Zhu and Chi Wang and Saleema Amershi},
        year={2024},
        booktitle={Pre-Print}
  }
  ```

  [AutoGen](https://aka.ms/autogen-pdf)

  ```
  @inproceedings{wu2023autogen,
        title={AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework},
        author={Qingyun Wu and Gagan Bansal and Jieyu Zhang and Yiran Wu and Beibin Li and Erkang Zhu and Li Jiang and Xiaoyun Zhang and Shaokun Zhang and Jiale Liu and Ahmed Hassan Awadallah and Ryen W White and Doug Burger and Chi Wang},
        year={2024},
        booktitle={COLM},
  }
  ```

  [EcoOptiGen](https://arxiv.org/abs/2303.04673)

  ```
  @inproceedings{wang2023EcoOptiGen,
      title={Cost-Effective Hyperparameter Optimization for Large Language Model Generation Inference},
      author={Chi Wang and Susan Xueqing Liu and Ahmed H. Awadallah},
      year={2023},
      booktitle={AutoML'23},
  }
  ```

  [MathChat](https://arxiv.org/abs/2306.01337)

  ```
  @inproceedings{wu2023empirical,
      title={An Empirical Study on Challenging Math Problem Solving with GPT-4},
      author={Yiran Wu and Feiran Jia and Shaokun Zhang and Hangyu Li and Erkang Zhu and Yue Wang and Yin Tat Lee and Richard Peng and Qingyun Wu and Chi Wang},
      year={2023},
      booktitle={ArXiv preprint arXiv:2306.01337},
  }
  ```

  [AgentOptimizer](https://arxiv.org/pdf/2402.11359)

  ```
  @article{zhang2024training,
    title={Training Language Model Agents without Modifying Language Models},
    author={Zhang, Shaokun and Zhang, Jieyu and Liu, Jiale and Song, Linxin and Wang, Chi and Krishna, Ranjay and Wu, Qingyun},
    journal={ICML'24},
    year={2024}
  }
  ```

  [StateFlow](https://arxiv.org/abs/2403.11322)
  ```
  @article{wu2024stateflow,
    title={StateFlow: Enhancing LLM Task-Solving through State-Driven Workflows},
    author={Wu, Yiran and Yue, Tianwei and Zhang, Shaokun and Wang, Chi and Wu, Qingyun},
    journal={arXiv preprint arXiv:2403.11322},
    year={2024}
  }
  ```

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>



  This project welcomes contributions and suggestions. Most contributions require you to agree to a
  Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
  the rights to use your contribution. For details, visit <https://cla.opensource.microsoft.com>.

  If you are new to GitHub, [here](https://opensource.guide/how-to-contribute/#how-to-submit-a-contribution) is a detailed help source on getting involved with development on GitHub.

  When you submit a pull request, a CLA bot will automatically determine whether you need to provide
  a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
  provided by the bot. You will only need to do this once across all repos using our CLA.

  This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
  For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
  contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>


  <a href="https://github.com/microsoft/autogen/graphs/contributors">
    <img src="https://contrib.rocks/image?repo=microsoft/autogen&max=204" />
  </a>

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>



  Microsoft and any contributors grant you a license to the Microsoft documentation and other content
  in this repository under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode),
  see the [LICENSE](LICENSE) file, and grant you a license to any code in the repository under the [MIT License](https://opensource.org/licenses/MIT), see the
  [LICENSE-CODE](LICENSE-CODE) file.

  Microsoft, Windows, Microsoft Azure, and/or other Microsoft products and services referenced in the documentation
  may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries.
  The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks.
  Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.

  Privacy information can be found at https://go.microsoft.com/fwlink/?LinkId=521839

  Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents,
  or trademarks, whether by implication, estoppel, or otherwise.

  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
    <a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
      ↑ Back to Top ↑
    </a>
  </p>


pkgId: 9d9c36612f05f0bb344e07067908146315f9a8bf3d7a7b468385a2c3788358f6
name: python-autogenstudio-help
arch: noarch
version: 0.1.5
epoch: 0
release: 1
summary: Development documents and examples for autogenstudio
url: https://github.com/microsoft/autogen
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autogenstudio-0.1.5-1.src.rpm
location_href: Packages/python-autogenstudio-help-0.1.5-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI version](https://badge.fury.io/py/autogenstudio.svg)](https://badge.fury.io/py/autogenstudio)
  [![Downloads](https://static.pepy.tech/badge/autogenstudio/week)](https://pepy.tech/project/autogenstudio)

  ![ARA](./docs/ara_stockprices.png)

  AutoGen Studio is an AutoGen-powered AI app (user interface) to help you rapidly prototype AI agents, enhance them with skills, compose them into workflows and interact with them to accomplish tasks. It is built on top of the [AutoGen](https://microsoft.github.io/autogen) framework, which is a toolkit for building AI agents.

  Code for AutoGen Studio is on GitHub at [microsoft/autogen](https://github.com/microsoft/autogen/tree/main/samples/apps/autogen-studio)

  > **Note**: AutoGen Studio is meant to help you rapidly prototype multi-agent workflows and demonstrate an example of end user interfaces built with AutoGen. It is not meant to be a production-ready app.

  > [!WARNING]
  > AutoGen Studio is currently under active development and we are iterating quickly. Kindly consider that we may introduce breaking changes in the releases during the upcoming weeks, and also the `README` might be outdated. Please see the AutoGen Studio [docs](https://microsoft.github.io/autogen/docs/autogen-studio/getting-started) page for the most up-to-date information.

  **Updates**

  > April 17: AutoGen Studio database layer is now rewritten to use [SQLModel](https://sqlmodel.tiangolo.com/) (Pydantic + SQLAlchemy). This provides entity linking (skills, models, agents and workflows are linked via association tables) and supports multiple [database backend dialects](https://docs.sqlalchemy.org/en/20/dialects/) supported in SQLAlchemy (SQLite, PostgreSQL, MySQL, Oracle, Microsoft SQL Server). The backend database can be specified a `--database-uri` argument when running the application. For example, `autogenstudio ui --database-uri sqlite:///database.sqlite` for SQLite and `autogenstudio ui --database-uri postgresql+psycopg://user:password@localhost/dbname` for PostgreSQL.

  > March 12: Default directory for AutoGen Studio is now /home/<user>/.autogenstudio. You can also specify this directory using the `--appdir` argument when running the application. For example, `autogenstudio ui --appdir /path/to/folder`. This will store the database and other files in the specified directory e.g. `/path/to/folder/database.sqlite`. `.env` files in that directory will be used to set environment variables for the app.

  Project Structure:

  - _autogenstudio/_ code for the backend classes and web api (FastAPI)
  - _frontend/_ code for the webui, built with Gatsby and TailwindCSS



  There are two ways to install AutoGen Studio - from PyPi or from source. We **recommend installing from PyPi** unless you plan to modify the source code.

  1.  **Install from PyPi**

      We recommend using a virtual environment (e.g., conda) to avoid conflicts with existing Python packages. With Python 3.10 or newer active in your virtual environment, use pip to install AutoGen Studio:

      ```bash
      pip install autogenstudio
      ```

  2.  **Install from Source**

      > Note: This approach requires some familiarity with building interfaces in React.

      If you prefer to install from source, ensure you have Python 3.10+ and Node.js (version above 14.15.0) installed. Here's how you get started:

      - Clone the AutoGen Studio repository and install its Python dependencies:

        ```bash
        pip install -e .
        ```

      - Navigate to the `samples/apps/autogen-studio/frontend` directory, install dependencies, and build the UI:

        ```bash
        npm install -g gatsby-cli
        npm install --global yarn
        cd frontend
        yarn install
        yarn build
        ```

  For Windows users, to build the frontend, you may need alternative commands to build the frontend.

  ```bash

    gatsby clean && rmdir /s /q ..\\autogenstudio\\web\\ui 2>nul & (set \"PREFIX_PATH_VALUE=\" || ver>nul) && gatsby build --prefix-paths && xcopy /E /I /Y public ..\\autogenstudio\\web\\ui

  ```



  Once installed, run the web UI by entering the following in your terminal:

  ```bash
  autogenstudio ui --port 8081
  ```

  This will start the application on the specified port. Open your web browser and go to `http://localhost:8081/` to begin using AutoGen Studio.

  AutoGen Studio also takes several parameters to customize the application:

  - `--host <host>` argument to specify the host address. By default, it is set to `localhost`. Y
  - `--appdir <appdir>` argument to specify the directory where the app files (e.g., database and generated user files) are stored. By default, it is set to the a `.autogenstudio` directory in the user's home directory.
  - `--port <port>` argument to specify the port number. By default, it is set to `8080`.
  - `--reload` argument to enable auto-reloading of the server when changes are made to the code. By default, it is set to `False`.
  - `--database-uri` argument to specify the database URI. Example values include `sqlite:///database.sqlite` for SQLite and `postgresql+psycopg://user:password@localhost/dbname` for PostgreSQL. If this is not specified, the database URIL defaults to a `database.sqlite` file in the `--appdir` directory.

  Now that you have AutoGen Studio installed and running, you are ready to explore its capabilities, including defining and modifying agent workflows, interacting with agents and sessions, and expanding agent skills.



  We welcome contributions to AutoGen Studio. We recommend the following general steps to contribute to the project:

  - Review the overall AutoGen project [contribution guide](https://github.com/microsoft/autogen?tab=readme-ov-file#contributing)
  - Please review the AutoGen Studio [roadmap](https://github.com/microsoft/autogen/issues/737) to get a sense of the current priorities for the project. Help is appreciated especially with Studio issues tagged with `help-wanted`
  - Please initiate a discussion on the roadmap issue or a new issue to discuss your proposed contribution.
  - Please review the autogenstudio dev branch here [dev branch](https://github.com/microsoft/autogen/tree/autogenstudio) and use as a base for your contribution. This way, your contribution will be aligned with the latest changes in the AutoGen Studio project.
  - Submit a pull request with your contribution!
  - If you are modifying AutoGen Studio, it has its own devcontainer. See instructions in `.devcontainer/README.md` to use it
  - Please use the tag `studio` for any issues, questions, and PRs related to Studio



  Please refer to the AutoGen Studio [FAQs](https://microsoft.github.io/autogen/docs/autogen-studio/faqs) page for more information.



  AutoGen Studio is Based on the [AutoGen](https://microsoft.github.io/autogen) project. It was adapted from a research prototype built in October 2023 (original credits: Gagan Bansal, Adam Fourney, Victor Dibia, Piali Choudhury, Saleema Amershi, Ahmed Awadallah, Chi Wang).


pkgId: 7c69ddbf36f5f095e72bfcc1e5a361aed6e1a50d6c1266e996ef19032f345c98
name: python-autogluon.cloud-help
arch: noarch
version: 0.4.1
epoch: 0
release: 1
summary: Development documents and examples for autogluon.cloud
url: https://github.com/autogluon/autogluon-cloud
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autogluon.cloud-0.4.1-1.src.rpm
location_href: Packages/python-autogluon.cloud-help-0.4.1-1.noarch.rpm
checksum_type: sha256
description:
  <div align="left">
    <img src="https://user-images.githubusercontent.com/16392542/77208906-224aa500-6aba-11ea-96bd-e81806074030.png" width="350">
  </div>



  [![Continuous Integration](https://github.com/autogluon/autogluon-cloud/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/autogluon/autogluon-cloud/actions/workflows/continuous_integration.yml)

  [AutoGluon-Cloud Documentation](https://auto.gluon.ai/cloud/stable/index.html) | [AutoGluon Documentation](https://auto.gluon.ai)

  AutoGluon-Cloud aims to provide user tools to train, fine-tune and deploy [AutoGluon](https://auto.gluon.ai/stable/index.html) backed models on the cloud. With just a few lines of codes, users could train a model and perform inference on the cloud without worrying about MLOps details such as resource management.

  Currently, AutoGluon-Cloud supports [AWS SageMaker](https://aws.amazon.com/sagemaker/) as the cloud backend.


  ```bash
  pip install -U pip
  pip install -U setuptools wheel
  pip install autogluon.cloud
  ```


  ```python

  from autogluon.cloud import TabularCloudPredictor
  import pandas as pd
  train_data = pd.read_csv("https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv")
  test_data = pd.read_csv("https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv")
  test_data.drop(columns=['class'], inplace=True)
  predictor_init_args = {"label": "class"}  # init args you would pass to AG TabularPredictor
  predictor_fit_args = {"train_data": train_data, "time_limit": 120}  # fit args you would pass to AG TabularPredictor
  cloud_predictor = TabularCloudPredictor(cloud_output_path='YOUR_S3_BUCKET_PATH')
  cloud_predictor.fit(predictor_init_args=predictor_init_args, predictor_fit_args=predictor_fit_args)
  cloud_predictor.deploy()
  result = cloud_predictor.predict_real_time(test_data)
  cloud_predictor.cleanup_deployment()

  result = cloud_predictor.predict(test_data)
  ```


pkgId: 6fcd53de31c20fc1c069b910284ddc418086123fe9e2acdcb0005ebd5922e1e8
name: python-autograms-help
arch: noarch
version: 0.5.1
epoch: 0
release: 1
summary: Development documents and examples for autograms
url: https://github.com/autograms/autograms
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autograms-0.5.1-1.src.rpm
location_href: Packages/python-autograms-help-0.5.1-1.noarch.rpm
checksum_type: sha256
description:
  - **Continuously Running Programs**: AutoGRAMS lets you write chatbots as Python programs that maintain their state across interactions. Each user input resumes the program exactly where it left off, enabling highly dynamic, context-aware conversations.
  - **Save and Resume Program State**: Serialize the program’s entire state, including call stack, variables, and control flow. Reload it later to continue the program (and conversation) from its exact state.
  - **Dynamic Control Flow**: Use advanced constructs like `GOTO` to move between different parts of your program that represent different states of your chatbot. This allows complex, non-linear dialogue paths that adapt dynamically to user inputs and decisions.
  - **LLM-Driven Decisions**: Integrate decision-making powered by LLMs to dynamically guide conversations based on user input, enabling sophisticated branching of the program
  - **Memory Management**: AutoGRAMS automatically manages memory, ensuring that variables and conversation history persist across turns.
  - **Visualize Conversation Flow**: Compile detailed graphs of your chatbot’s states and logic, helping you design, debug, and understand the flow of conversation at a glance.
  AutoGRAMS accomplishes many of these behaviors using a special @autograms_function decorator that enables non-standard python functionality such as saving and loading the state of a program mid-execution and jumping to a predefined location in the code.
  The full documentation and tutorials are available in our [web docs](https://autograms.github.io/autograms).

  You can install AutoGRAMS via pip:
  ```
  pip install autograms
  ```
  If you make local modifications, you can install them with:
  ```
  git clone https://github.com/autograms/autograms.git
  cd autograms
  pip install .
  ```
  To visualize AutoGRAMS graphs, install Graphviz. On Linux:
  ```
  sudo apt install graphviz
  ```
  Python >=3.9 is required. If you plan to use OpenAI models or other LLM APIs, ensure you set up the necessary dependencies and keys.

  AutoGRAMS makes it easy to build structured, stateful chatbots. To get started with a recruiter chatbot demo, you can set an open ai api key with:
  export OPENAI_API_KEY=<your key>
  and then you can run:
  ```
  python run_autogram.py --api_key_file api_keys.json --example_name recruiter
  ```
  This will launch an interactive chatbot in the terminal, simulating a virtual recruiter.

  AutoGRAMS includes tools to visualize the conversational flow as an interactive graph. For example, you can generate visualizations for the recruiter chatbot with:
  ```
  python visualize_autogram.py --example_name recruiter --save_folder recruiter_graph
  ```
  This will create both a static and interactive graph in the specified folder. You can explore the chatbot flow and decision points by clicking on nodes in the interactive graph.

  Explore the `/examples` folder for more sample autograms. Each example demonstrates different capabilities of AutoGRAMS, from simple branching dialogues to complex, stateful agents.
  To run a demo:
  ```
  python run_autogram.py --api_key_file api_keys.json --example_name <example_name>
  ```
  Replace `<example_name>` with the desired example (e.g., `simple_example`, `fraction_tutor`, `general_tutor`, or `recruiter`).

  If you use this work in research, please cite the following paper:
  ```
  @article{krause2024autograms,
    title={AutoGRAMS: Autonomous Graphical Agent Modeling Software},
    author={Krause, Ben and Chen, Lucia and Kahembwe, Emmanuel},
    journal={arXiv preprint arXiv:2407.10049},
    year={2024}
  }
  ```


pkgId: fc758ea0b989a60fd800150335439780d7bae947de0fa0bcfa9e7814adbd0190
name: python-autohack-help
arch: noarch
version: 0.140
epoch: 0
release: 1
summary: Development documents and examples for autohack
url: https://github.com/sudouser2010/autohack
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autohack-0.140-1.src.rpm
location_href: Packages/python-autohack-help-0.140-1.noarch.rpm
checksum_type: sha256
description:
  * note the professional version is being beta tested.





  * [Install Docker](https://docs.docker.com/engine/install/)


  * Create AutoHack Docker container
    ```
    docker run -it --net=host -v ${PWD}/portal:/root/portal hdizzle/autohack
    ```
    Command above does the following:
    * creates Docker container based on the [AutoHack image](https://registry.hub.docker.com/r/hdizzle/autohack)
    * mounts a folder named `portal` in current directory
      * this allows us to persist the AutoHack results once the <br>container is destroyed
    * allows us to access the terminal of the AutoHack container


  * Run AutoHack
    ```
    autohack -i <some ip address>
    ```


pkgId: 415280337f0a0cf7bde6273f5cb9755b44de17a49b28a082b0cd8c6ce2753ff2
name: python-automatic-time-lapse-creator-help
arch: noarch
version: 1.0.3
epoch: 0
release: 1
summary: Development documents and examples for automatic-time-lapse-creator
url: https://pypi.org/project/automatic-time-lapse-creator/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-automatic-time-lapse-creator-1.0.3-1.src.rpm
location_href: Packages/python-automatic-time-lapse-creator-help-1.0.3-1.noarch.rpm
checksum_type: sha256
description:
  > ### A Python package for extracting images from a web cam url and converting these images into a timelapse. The process is intended to be automatic, so the only parameters that need to be provided are:
  > - the image resourse url/urls pointing to an image *(not video!)*
  > - the path on your computer where the images will be stored *(default is os.getcwd())*
  > - the location of the city (or coordinates) for which the daylight will be calculated *(default is Sofia, Bulgaria)*



  > ### Libraries used in the program:
  > - Astral (https://astral.readthedocs.io/en/latest/) - to get the
  sunrise and sunset time of the day for a specific geolocation
  > - OpenCV-Python (https://pypi.org/project/opencv-python/) - to
  read/resize the jpeg files and build a time lapse mp4 video
  > - Requests - builtin module used to retrieve the image from the url
  > - Logging - the builtin python looging tool for creating comprehensive
  logs of the program execution
  > - Pytest, unittest.mock - testing and mocking objects in isolation

  > ### Main flow and automation:
  > When the execution of the TimeLapseCreator object starts, it will check if it's daylight at the provided location. Daylight is calculated automatically using the Astral library so there will be few or no images collected during the night. After the collection of images finishes for the day the VideoManager creates a video from the collected images for each of the provided sources and deletes all the images for the day. In case of an interruption of the collection of images during the day (for example: power outage - the program stops and then it's started again), the video will still be created but the daily images won't be deleted. In this case you can inspect them and create a video manually from the pictures that are worth it.
  > During the night the program will not collect any images - they will be collected when there is daylight - the smart power of the Astral library ;)

  > ### Known issues
  > - Images are randomly saved into folders: [#5](https://github.com/kokoeverest/Automatic-time-lapse-creator/issues/5) "Cache doesn't work as expected"

  > ### A valid scenario for creating a TimeLapseCreator for webcams in Bulgaria:
  > ***Note that no location is provided in the examples, so the TimeLapseCreator will be instantiated for the default location: Sofia, Bulgaria.***
  ```python
  from automatic_time_lapse_creator.time_lapse_creator import TimeLapseCreator
  from automatic_time_lapse_creator.source import Source


  borovets_source = Source(
      "markudjik", "https://media.borovets-bg.com/cams/channel?channel=31"
  )
  pleven_hut_source = Source(
      "plevenhut", "https://meter.ac/gs/nodes/N160/snap.jpg?1705436803718"
  )

  sources_list: list[Source] = [borovets_source, pleven_hut_source]



  bulgaria_webcams = TimeLapseCreator(sources_list)



  bulgaria_webcams = TimeLapseCreator()
  bulgaria_webcams.add_sources(sources_list)



  pleven_hut_webcam = TimeLapseCreator(pleven_hut_source)

  Traceback...:
  ...in validate_collection
      raise InvalidCollectionException(
  src.automatic_time_lapse_creator.common.exceptions.InvalidCollectionException: Only list, tuple or set collections are allowed!


  bulgaria_webcams.execute()
  ```

  > An invalid scenario will be:
  ```python

  sample_source_with_empty_url = Source("fake", "https://empty.url")

  invalid_source_list = [sample_source_with_empty_url]

  invalid_url_creator = TimeLapseCreator(invalid_source_list)

  invalid_url_creator.execute()
  ```

  > Should you have any questions, bug reports or recommendations, feel free to open an issue on
   the [Issues page](https://github.com/kokoeverest/Automatic-time-lapse-creator/issues)


pkgId: 67cfd62e9e4f258db46ae097847f5bd2d2be3311f8161926acbb34995805fe74
name: python-automatic-time-lapse-creator-help
arch: noarch
version: 1.1.0
epoch: 0
release: 1
summary: Development documents and examples for automatic-time-lapse-creator
url: https://pypi.org/project/automatic-time-lapse-creator/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-automatic-time-lapse-creator-1.1.0-1.src.rpm
location_href: Packages/python-automatic-time-lapse-creator-help-1.1.0-1.noarch.rpm
checksum_type: sha256
description:
  > ### A Python package for extracting images from a web cam url and converting these images into a timelapse. The process is intended to be automatic, so the only parameters that need to be provided are:
  > - the image resourse url/urls pointing to an image *(not video!)*
  > - the path on your computer where the images will be stored *(default is os.getcwd())*
  > - the location of the city for which the daylight will be calculated *(default is Sofia, Bulgaria)*



  > ### Libraries used in the program:
  > - Astral (https://astral.readthedocs.io/en/latest/) - to get the
  sunrise and sunset time of the day for a specific geolocation
  > - OpenCV-Python (https://pypi.org/project/opencv-python/) - to
  read/resize the jpeg files and build a time lapse mp4 video
  > - Requests - builtin module used to retrieve the image from the url
  > - Logging - the builtin python looging tool for creating comprehensive
  logs of the program execution
  > - Pytest, unittest.mock - testing and mocking objects in isolation


  The latest release is available for installation via pip:
  ```pip install automatic-time-lapse-creator```

  The latest releases under development are available on the TestPyPi web page:
  [TestPyPi/automatic-time-lapse-creator](https://test.pypi.org/project/automatic-time-lapse-creator/#history)
  and can be installed via pip:
  ```pip install -i https://test.pypi.org/simple/ automatic-time-lapse-creator=='the_version_you_want'```

  > ### Main flow and automation:
  > When the execution of the TimeLapseCreator object starts, it will check if it's daylight at the provided location. Daylight is calculated automatically using the Astral library so there will be few or no images collected during the night. After the collection of images finishes for the day the VideoManager creates a video from the collected images for each of the provided sources and deletes all the images for the day. In case of an interruption of the collection of images during the day (for example: power outage - the program stops and then it's started again), the video will still be created but the daily images won't be deleted. In this case you can inspect them and create a video manually from the pictures that are worth it.
  > During the night the program will not collect any images - they will be collected when there is daylight - the smart power of the Astral library ;)

  > ### Known issues
  > - Images are randomly saved into folders: [#5](https://github.com/kokoeverest/Automatic-time-lapse-creator/issues/5) "Cache doesn't work as expected"

  > ### Examples:
  > ### A valid scenario for creating a TimeLapseCreator for webcams in Bulgaria:
  > ***Note that no location is provided in the examples, so the TimeLapseCreator will be instantiated for the default location: Sofia, Bulgaria.***
  ```python
  from automatic_time_lapse_creator.time_lapse_creator import TimeLapseCreator
  from automatic_time_lapse_creator.source import Source


  borovets_source = Source(
      "markudjik", "https://media.borovets-bg.com/cams/channel?channel=31"
  )
  pleven_hut_source = Source(
      "plevenhut", "https://meter.ac/gs/nodes/N160/snap.jpg?1705436803718"
  )

  sources_list: list[Source] = [borovets_source, pleven_hut_source]



  bulgaria_webcams = TimeLapseCreator(sources_list)



  bulgaria_webcams = TimeLapseCreator()
  bulgaria_webcams.add_sources(sources_list)



  pleven_hut_webcam = TimeLapseCreator(pleven_hut_source)

  Traceback...:
  ...in validate_collection
      raise InvalidCollectionException(
  src.automatic_time_lapse_creator.common.exceptions.InvalidCollectionException: Only list, tuple or set collections are allowed!


  bulgaria_webcams.execute()
  ```

  > An invalid scenario will be:
  ```python

  sample_source_with_empty_url = Source("fake", "https://empty.url")

  invalid_source_list = [sample_source_with_empty_url]

  invalid_url_creator = TimeLapseCreator(invalid_source_list)

  invalid_url_creator.execute()
  ```

  > Should you have any questions, bug reports or recommendations, feel free to open an issue on
   the [Issues page](https://github.com/kokoeverest/Automatic-time-lapse-creator/issues)


pkgId: ca2eef9b69b95c576245f9f9b7d0a104d5423bdbf63a8f02149410deae4f8e4e
name: python-autoplex-help
arch: noarch
version: 0.1.0
epoch: 0
release: 1
summary: Development documents and examples for autoplex
url: https://pypi.org/project/autoplex/
rpm_license: GPL-3.0 license
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autoplex-0.1.0-1.src.rpm
location_href: Packages/python-autoplex-help-0.1.0-1.noarch.rpm
checksum_type: sha256
description:
  [![Testing Linux](https://github.com/JaGeo/autoplex/actions/workflows/python-package.yml/badge.svg)](https://github.com/JaGeo/autoplex/actions/workflows/python-package.yml) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/autoatml/autoplex/main.svg)](https://results.pre-commit.ci/latest/github/autoatml/autoplex/main) [![DOI](https://zenodo.org/badge/671124251.svg)](https://doi.org/10.5281/zenodo.14105049) ![supported python versions](https://img.shields.io/pypi/pyversions/autoplex) [![PyPI version](https://badge.fury.io/py/autoplex.svg)](https://badge.fury.io/py/autoplex)

  <img src="docs/_static/autoplex_logo.png" width="66%">

  <div style="border: 1px solid #2e3191; padding: 5px; position: relative;">
      <div style="background-color: #2e3191; color: #ffffff; padding: 0px; position: absolute; top: 0; left: 0; right: 0; text-align: center;">
          <strong>Disclaimer</strong>
      </div>
  <br>

  `autoplex` is still under very active development and is only suitable for expert users as not all of the documentation is in place. This will change until end of November 2024.
  </div>

  <br>

  `autoplex` is a software for generating and benchmarking machine learning (ML)-based interatomic potentials. The aim of `autoplex` is to provide a fully automated solution for creating high-quality ML potentials. The software is interfaced to multiple different ML potential fitting frameworks and to the atomate2 and ase environments for efficient high-throughput computations. The vision of this project is to allow a wide community of researchers to create accurate and reliable ML potentials for materials simulations.

  `autoplex` is developed jointly by two research groups at BAM Berlin and the University of Oxford.

  `autoplex` is an evolving project and **contributions are very welcome**! To ensure that the code remains of high quality, please raise a pull request for any contributions, which will be reviewed before integration into the main branch of the code. Initially, [@JaGeo](https://github.com/JaGeo) will handle the reviews.



  You can find the `autoplex` documentation [here](https://autoatml.github.io/autoplex/index.html)!
  The documentation also contains tutorials that teach you how to use `autoplex` for different use cases for the RSS and phonon workflows and individual modules therein.



  We expect the general user of `autoplex` to be familiar with the [Materials Project](https://github.com/materialsproject) framework software tools and related
  packages for (high-throughput) workflow submission and management.
  This involves the following software packages:
  - [pymatgen](https://github.com/materialsproject/pymatgen) for input and output handling of computational materials science software,
  - [atomate2](https://github.com/materialsproject/atomate2) for providing a library of pre-defined computational materials science workflows,
  - [jobflow](https://github.com/materialsproject/jobflow) for processes, job and workflow handling,
  - [jobflow-remote](https://github.com/Matgenix/jobflow-remote) or [FireWorks](https://github.com/materialsproject/fireworks) for workflow and database (MongoDB) management,
  - [MongoDB](https://www.mongodb.com/) as the database (we recommend installing the MongoDB community edition). More help regarding the MongoDB installation can be found [here](https://materialsproject.github.io/fireworks/installation.html#install-mongodb).

  All of these software tools provide documentation and tutorials. Please take your time and check everything out!



  To set up the mandatory prerequisites for using `autoplex,` please follow the [installation guide of atomate2](https://materialsproject.github.io/atomate2/user/install.html).

  After setting up `atomate2`, make sure to add `VASP_INCAR_UPDATES: {"NPAR": number}` in your `~/atomate2/config/atomate2.yaml` file.
  Set a number that is a divisor of the number of tasks you use for the VASP calculations.





  Before the installation, please make sure that you are using one of the supported Python versions (see [pyproject.toml](https://github.com/autoatml/autoplex/blob/main/pyproject.toml))



  Please install `autoplex` using
  ```
  pip install autoplex[strict]
  ```
  This will install all the Python packages and dependencies needed for MLIP fits.

  Additionally, to fit and validate `ACEpotentials`, one also needs to install Julia, as `autoplex` relies on [ACEpotentials](https://acesuit.github.io/ACEpotentials.jl/dev/gettingstarted/installation/), which supports fitting of linear ACE. Currently, no Python package exists for the same.
  Please run the following commands to enable the `ACEpotentials` fitting options and further functionality.

  Install Julia v1.9.2

  ```bash
  curl -fsSL https://install.julialang.org | sh -s -- default-channel 1.9.2
  ```

  Once installed in the terminal, run the following commands to get Julia ACEpotentials dependencies.

  ```bash
  julia -e 'using Pkg; Pkg.Registry.add("General"); Pkg.Registry.add(Pkg.Registry.RegistrySpec(url="https://github.com/ACEsuit/ACEregistry")); Pkg.add(Pkg.PackageSpec(;name="ACEpotentials", version="0.6.7")); Pkg.add("DataFrames"); Pkg.add("CSV")'
  ```



  Additionally, `buildcell` as a part of `AIRSS` needs to be installed if one wants to use the RSS functionality:

  ```bash
  curl -O https://www.mtg.msm.cam.ac.uk/files/airss-0.9.3.tgz; tar -xf airss-0.9.3.tgz; rm airss-0.9.3.tgz; cd airss; make ; make install ; make neat; cd ..
  ```



  You only need to install LAMMPS, if you want to use J-ACE as your MLIP.
  Recipe for compiling lammps-ace including the download of the `libpace.tar.gz` file:

  ```
  git clone -b stable_29Aug2024_update1 https://github.com/lammps/lammps.git
  cd lammps
  mkdir build
  cd build
  wget -O libpace.tar.gz https://github.com/wcwitt/lammps-user-pace/archive/main.tar.gz

  cmake  -C ../cmake/presets/clang.cmake -D BUILD_SHARED_LIBS=on -D BUILD_MPI=yes \
  -DMLIAP_ENABLE_PYTHON=yes -D PKG_PYTHON=on -D PKG_KOKKOS=yes -D Kokkos_ARCH_ZEN3=yes \
  -D PKG_PHONON=yes -D PKG_MOLECULE=yes -D PKG_MANYBODY=yes \
  -D Kokkos_ENABLE_OPENMP=yes -D BUILD_OMP=yes -D LAMMPS_EXCEPTIONS=yes \
  -D PKG_ML-PACE=yes -D PACELIB_MD5=$(md5sum libpace.tar.gz | awk '{print $1}') \
  -D CMAKE_INSTALL_PREFIX=$LAMMPS_INSTALL -D CMAKE_EXE_LINKER_FLAGS:STRING="-lgfortran" \
  ../cmake

  make -j 16
  make install-python
  ```

  $LAMMPS_INSTALL is the conda environment for installing the lammps-python interface.
  Use `BUILD_MPI=yes` to enable MPI for parallelization.

  After the installation is completed, enter the following commands in the Python environment.
  If you get the same output, it means the installation was successful.

  ```python
  from lammps import lammps; lmp = lammps()
  ```
  ```bash
  LAMMPS (29 Aug 2024 - Update 1)
  OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98)
    using 1 OpenMP thread(s) per MPI task
  >>>
  ```
  It is very important to have it compiled with Python (`-D PKG_PYTHON=on`) and
  LIB PACE flags (`-D PACELIB_MD5=$(md5sum libpace.tar.gz | awk '{print $1}')`).



  A short guide to contributing to autoplex can be found [here](https://autoatml.github.io/autoplex/dev/contributing.html). Additional information for developers can be found [here](https://autoatml.github.io/autoplex/dev/dev_install.html).



  We currently have two different types of automation workflows available:

  * Workflow to use random-structure searches for the systematic construction of interatomic potentials. The implementation automates ideas from the following articles: [*Phys. Rev. Lett.* **120**, 156001 (2018)](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.120.156001) and [*npj Comput. Mater.* **5**, 99 (2019)](https://www.nature.com/articles/s41524-019-0236-6).
  * Workflow to train accurate interatomic potentials for harmonic phonon properties. The implementation automates the ideas from the following article: [*J. Chem. Phys.* **153**, 044104 (2020)](https://pubs.aip.org/aip/jcp/article/153/4/044104/1056348/Combining-phonon-accuracy-with-high).


pkgId: 726b4988e789931fa1052aac7d9de2718de6299ff67112fddbcbc74d8173cadb
name: python-autosubmitconfigparser-help
arch: noarch
version: 1.0.76
epoch: 0
release: 1
summary: Development documents and examples for autosubmitconfigparser
url: https://earth.bsc.es/gitlab/ces/autosubmit4-config-parser.git
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autosubmitconfigparser-1.0.76-1.src.rpm
location_href: Packages/python-autosubmitconfigparser-help-1.0.76-1.noarch.rpm
checksum_type: sha256
description:
  Simple library that allows to read the data of an Autosubmit experiment.



  ```python

  from autosubmitconfigparser.config.configcommon import AutosubmitConfig
  import os

  expid = "a01y"
  as_conf = AutosubmitConfig("a01y")

  as_conf.reload(True)


  as_conf.experiment_data

  as_conf.jobs_data

  as_conf.platforms_data

  parameters = as_conf.deep_parameters_export(as_conf.experiment_data)


  with open("as_sample.txt", "w") as f:
      f.write("This is a sample text with a placeholder %DEFAULT.EXPID%")


  with open("as_sample_parsed.txt", "w") as f:
      f.write(as_conf.parse_placeholders(open("as_sample.txt","r").read(), parameters))



  with open("as_sample.txt", "r") as f:
      print(f.read())

  with open("as_sample_parsed.txt", "r") as f:
      print(f.read())






  os.remove("as_sample.txt")
  os.remove("as_sample_parsed.txt")
  ```


pkgId: f73b4e2ff75eac7df5dac51a991eb5439fb85b22eeb84bd5ae19fa2dd8689d30
name: python-autoverse-cli-help
arch: noarch
version: 0.10.0
epoch: 0
release: 1
summary: Development documents and examples for autoverse-cli
description: The new implementation of the Autoverse CLI
url: https://pypi.org/project/autoverse-cli/
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autoverse-cli-0.10.0-1.src.rpm
location_href: Packages/python-autoverse-cli-help-0.10.0-1.noarch.rpm
checksum_type: sha256
rpm_license:
  # End-User License Agreement (EULA) of the Autonoma AutoVerse CLI  This End-User License Agreement ("EULA") is a legal agreement between you and Autonoma, Inc.  ## License Grant  Autonoma, Inc. hereby grants you a personal, non-transferable, non-exclusive licence to use the AutoVerse software in accordance with the terms of this EULA agreement.  ## Limitation of Liability The software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, express or implied. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in action of contract, tort or otherwise, arising from, out of or in connection with the software or the use of the software.  ### You are NOT permitted to:  - Edit, alter, modify, adapt, translate or otherwise change the whole or any part of the Software nor permit the whole or any part of the Software to be combined with or become incorporated in any other software, nor decompile, disassemble or reverse engineer the Software or attempt to do any such things - Reproduce, copy, distribute, resell or otherwise use the Software for any commercial purpose - Allow any third party to use the Software on behalf of or for the benefit of any third party - Use the Software in any way which breaches any applicable local, national or international law use the Software for any purpose that Autonoma, Inc. considers is a breach of this EULA agreement Intellectual Property and Ownership  Autonoma, Inc. shall at all times retain ownership of the Software as originally downloaded by you and all subsequent downloads of the Software by you. The Software (and the copyright, and other intellectual property rights of whatever nature in the Software, including any modifications made thereto) are and shall remain the property of Autonoma, Inc.  Autonoma, Inc. reserves the right to grant licences to use the Software to third parties.  ## Termination  This EULA agreement is effective from the date you first use the Software and shall continue until terminated. You may terminate it at any time upon written notice to Autonoma, Inc.  It will also terminate immediately if you fail to comply with any term of this EULA agreement. Upon such termination, the licenses granted by this EULA agreement will immediately terminate and you agree to stop all access and use of the Software. The provisions that by their nature continue and survive will survive any termination of this EULA agreement.  ## Governing Law  This EULA agreement, and any dispute arising out of or in connection with this EULA agreement, shall be governed by and construed in accordance with the laws of the USA.


pkgId: 0db08a8c50b8b7dccdee495bbb0b6231662170a1bfa357cca89a35105f68bad9
name: python-autowsgr-help
arch: noarch
version: 1.3.0
epoch: 0
release: 1
summary: Development documents and examples for autowsgr
url: https://pypi.org/project/autowsgr/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-autowsgr-1.3.0-1.src.rpm
location_href: Packages/python-autowsgr-help-1.3.0-1.noarch.rpm
checksum_type: sha256
description:
  <div align=center>
  <img src="https://raw.githubusercontent.com/OpenWSGR/AutoWSGR/main/.assets/logo.png">
  </div>



  ![](https://img.shields.io/github/repo-size/OpenWSGR/AutoWSGR) ![](https://img.shields.io/pypi/v/autowsgr) ![](https://img.shields.io/pypi/dm/autowsgr) ![](https://img.shields.io/github/issues/OpenWSGR/AutoWSGR) ![MIT licensed](https://img.shields.io/badge/license-MIT-brightgreen.svg)

  用 python 与 c++ 实现的 战舰少女R 的自动化流水线 & 数据统计一体化脚本, 提供 `WSGR` 游戏级别接口以及部分图像和原子操作接口.



  **访问用户文档：**[https://docs-autowsgr.notion.site](https://docs-autowsgr.notion.site)




  欢迎有一定python基础的同学加入开发，共同完善这个项目。您可以实现新的功能，也可以改进现有功能，或者修复bug。如果您有好的想法，也可以提出issue或加qq群讨论。开发前请仔细阅读 [贡献指南](CONTRIBUTING.md) 和[用户文档](https://docs-autowsgr.notion.site)。

  注意： 开发者请**不要从pypi安装autowsgr**，改为 [本地模式](https://docs-autowsgr.notion.site/2-AutoWSGR-efeb69811b544604b944d5b5727317a4) 安装。



  <a href="https://github.com/OpenWSGR/AutoWSGR/graphs/contributors">
    <img src="https://contrib.rocks/image?repo=OpenWSGR/AutoWSGR" />
  </a>



  [![Star History Chart](https://api.star-history.com/svg?repos=OpenWSGR/AutoWSGR&type=Date)](https://star-history.com/#OpenWSGR/AutoWSGR&Date)


pkgId: e40b2e624865ce511182453232deca29377e465b6646c61e89578f96cb04b67d
name: python-avahiplatform-help
arch: noarch
version: 0.0.17
epoch: 0
release: 1
summary: Development documents and examples for avahiplatform
url: https://github.com/avahi-org/avahiplatform
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-avahiplatform-0.0.17-1.src.rpm
location_href: Packages/python-avahiplatform-help-0.0.17-1.noarch.rpm
checksum_type: sha256
description:
  chatbot = avahiplatform.chatbot()
  chatbot.initialize_instance(system_prompt="You are a python developer, you only answer queries related to python only, if you get any other queries, then please say I don't know")
  chatbot_response = chatbot.chat(user_input="Create me a function to add 2 numbers")
  print(f"chatbot_response: {chatbot_response}")
  chatbot_response = chatbot.chat(user_input="What is avahi?")
  print(f"chatbot_response: {chatbot_response}")

  chatbot_history = chatbot.get_history()
  print(chatbot_history)


pkgId: 08b6275691a154eb6dbe57e5af57d76c0a97a7c8799623f3190f19547e628ab5
name: python-availsim4-help
arch: noarch
version: 2.2
epoch: 0
release: 1
summary: Development documents and examples for availsim4
url: https://gitlab.cern.ch/availsim4/availsim4
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-availsim4-2.2-1.src.rpm
location_href: Packages/python-availsim4-help-2.2-1.noarch.rpm
checksum_type: sha256
description:
  Availsim 4 is a software to predict reliability and availability of modern particle accelerators and the related
  technical systems. It is based on a Monte Carlo Discrete Event Simulation algorithm and allows for advanced availability
  and reliability statistics.



  Python >=3.7 with external dependencies; the requirements are listed in `pyproject.toml` file and grouped into 4
  options: graphs, quasi-mc, test, dev. See the user guide for details on how to use them.



  The default installation process does not feature optional dependencies for visualization and optimized sampling options. To make those available, make sure to follow the instriuctions for installation of optional elements listed below.

  AvailSim4 can be installed as whole Python project by clonning this repository or as a Python package through a package manager. Below you can find instructions for both possibilities.



  Use the package manager pip to install AvailSim4.

  ```pip install availsim4```

  To install all optional dependencies, follow the instructions provided in sections below and then use the following command:

  ```pip install 'availsim4[graphs, quasi-mc, test]'```

  The optional groups of dependencies are `graphs`, `quasi-mc` and `test`:

  - `graphs` enables the `GRAPHS` exporter to produce graphs of the components. Additional pre-requirements described below.
  - `quasi-mc` installs the QmcPy library for some optimized sampling features. Additional pre-requirements described below.
  - `test` adds dependencies required to run the test suite (not related to standard use of the framework).

  You can also select groups of dependencies, for instance `[graphs, quasi-mc]` to only use a selected subset of the optional dependencies.



  To clone and set up the Python project:

  - Clone the project from <https://gitlab.cern.ch/availsim4/availsim4core> and enter the projects directory.
  - Optionally, create a dedicated virtual environment (`python -m venv env` will create an environment named `env`).
  - Trigger an editable installation with setuptools from the local directory using `pip install -e '.[quasi-mc, graphs, test]'`. You can modify the list in the brackets to select only desired groups of dependencies.



  To generate a diagram of the architecture tree, AvailSim4 relies on PyGraphviz package and Graphviz tool. For more information and OS-specific installation guide, please refer to the Graphviz webpage: <https://graphviz.org/download/> and PyGraphviz: <https://pygraphviz.github.io/documentation/stable/install.html>.

  General instructions:

  - **Linux**: install Graphviz through your system package manager and then make sure to install PyGraphviz with `pip`: `apt-get update`, `apt-get install libgraphviz-dev`, `pip install pygraphviz`.
  - **Windows**: Graphviz installation wizard can be downloaded manually from the website. Then proceed to install PyGraphviz with `pip` or `conda`. Make sure that `dot` program's plugins are configured by running `dot -c` command in your environment. May also require Microsoft C++ Build Tools.
  - **MacOS**: you can install Graphviz using Homebrew package manager by running command `brew install graphviz` and then `pip install pygraphviz`.



  The external library used for Quasi-Monte Carlo requires Windows users to install Microsoft Visual C++ 14.0 or greater. It can be downloaded from "Microsoft C++ Build Tools": <https://visualstudio.microsoft.com/visual-cpp-build-tools/>, this requirement is needed to use the Quasi-Monte-Carlo algorithm. CERN's Windows users might prefer to use SWAN notebooks which are running on Linux machines.



  To run AvailSim4 from a command line, you can use the following:

  ```bash
  availsim4 [-h]
    --system SYSTEM
    --simulation SIMULATION
    --output_folder OUTPUT_FOLDER
    [--sensitivity_analysis SENSITIVITYANALYSIS]
    [--HTCondor]
    [--HTCondor_extra_argument OPTIONAL_EXTRA_ARGUMENT]
    [--nb_processes NB_PROCESS]
    [--children_logic PYTHON_FILE]
  ```

  Example call starting one of the end-to-end tests manually:

  ```bash
  python availsim4.py --system availsim4core/test/E2E/input/convergence/convergence_test_system.xlsx --simulation availsim4core/test/E2E/input/convergence/N1000_simulation.xlsx --output_folder output/E2E_example/
  ```

  You can see the results after the execution finishes in the `output/E2E_example` directory.

  Alternatively, Availsim4 can be used as a module from within Python scripts or notebooks:

  ```python
  import availsim4core.main


  availsim4core.main.start(path_simulation = 'path/simulation/file.xlsx',
              path_system = 'path/system/file.xlsx',
              output_folder = 'path/output/folder/',
              path_sensitivity_analysis="",
              HTCondor=False,
              nb_processes=1)
  ```

  A notebook, [notebook_example_availsim4.ipynb](notebook_example_availsim4.ipynb), provides more examples of how to use the
  framework as a module. It shows basic steps that can be performed with AvailSim4. To use it, you can clone the entire
  project or download the file separately -- to use with AvailSim4 already installed in your Python environment.

  Support features for running AvailSim4 on the HTCondor grid are described in the user guide.



  A user guide is provided in the [user guide](doc/user_guide/user_guide.md). It lists all functionalities of the AvailSim4, along with options and relevant descritions.

  For developers wishing to contribute to the code, a dedicated [developer guide](doc/user_guide/developer_guide.md) is being created to provide useful explanations of general implementation concepts and gather all development-specific aspects of the project, such as chosen coding conventions and other decisions - to support coherent approach in the long run.



  Contributions through pull requests to the project are welcome. For changes, please open an issue detailing the matter to discuss the scope.

  This project requires contributors to agree to Developer Certificate of Origin (DCO) by adding a dedicated `Signed-off-by:` line to all commits. Please use `git commit –signoff` in order to automate this. All merge requests must include a signature in the form: `Signed-off-by: Firstname Lastname <email.address@domain.org>`.



  Copyright © CERN 2021. Released under the [GPL 3.0 only license](LICENSE). All rights not expressly granted are reserved.

rpm_license:
  GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007  Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.  Preamble  The GNU General Public License is a free, copyleft license for software and other kinds of works.  The licenses for most software and other practical works are designed to take away your freedom to share and change the works.  By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.  We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors.  You can apply it to your programs, too.  When we speak of free software, we are referring to freedom, not price.  Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.  To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights.  Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.  For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received.  You must make sure that they, too, receive or can get the source code.  And you must show them these terms so they know their rights.  Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.  For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software.  For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.  Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so.  This is fundamentally incompatible with the aim of protecting users' freedom to change the software.  The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable.  Therefore, we have designed this version of the GPL to prohibit the practice for those products.  If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.  Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary.  To prevent this, the GPL assures that patents cannot be used to render the program non-free.  The precise terms and conditions for copying, distribution and modification follow.  TERMS AND CONDITIONS  0. Definitions.  "This License" refers to version 3 of the GNU General Public License.  "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.  "The Program" refers to any copyrightable work licensed under this License.  Each licensee is addressed as "you".  "Licensees" and "recipients" may be individuals or organizations.  To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy.  The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.  A "covered work" means either the unmodified Program or a work based on the Program.  To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy.  Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.  To "convey" a work means any kind of propagation that enables other parties to make or receive copies.  Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.  An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License.  If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.  1. Source Code.  The "source code" for a work means the preferred form of the work for making modifications to it.  "Object code" means any non-source form of a work.  A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.  The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form.  A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.  The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities.  However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work.  For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.  The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.  The Corresponding Source for a work in source code form is that same work.  2. Basic Permissions.  All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met.  This License explicitly affirms your unlimited permission to run the unmodified Program.  The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work.  This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.  You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force.  You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright.  Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.  Conveying under any other circumstances is permitted solely under the conditions stated below.  Sublicensing is not allowed; section 10 makes it unnecessary.  3. Protecting Users' Legal Rights From Anti-Circumvention Law.  No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.  When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.  4. Conveying Verbatim Copies.  You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.  You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.  5. Conveying Modified Source Versions.  You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:  a) The work must carry prominent notices stating that you modified it, and giving a relevant date.  b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7.  This requirement modifies the requirement in section 4 to "keep intact all notices".  c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy.  This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged.  This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.  d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.  A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit.  Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.  6. Conveying Non-Source Forms.  You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:  a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.  b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.  c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source.  This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.  d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge.  You need not require recipients to copy the Corresponding Source along with the object code.  If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source.  Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.  e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.  A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.  A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling.  In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage.  For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product.  A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.  "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source.  The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.  If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information.  But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).  The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed.  Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.  Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.  7. Additional Terms.  "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law.  If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.  When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it.  (Additional permissions may be written to require their own removal in certain cases when you modify the work.)  You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.  Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:  a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or  b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or  c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or  d) Limiting the use for publicity purposes of names of licensors or authors of the material; or  e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or  f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.  All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10.  If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term.  If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.  If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.  Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.  8. Termination.  You may not propagate or modify a covered work except as expressly provided under this License.  Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).  However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.  Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.  Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License.  If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.  9. Acceptance Not Required for Having Copies.  You are not required to accept this License in order to receive or run a copy of the Program.  Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance.  However, nothing other than this License grants you permission to propagate or modify any covered work.  These actions infringe copyright if you do not accept this License.  Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.  10. Automatic Licensing of Downstream Recipients.  Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License.  You are not responsible for enforcing compliance by third parties with this License.  An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations.  If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.  You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License.  For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.  11. Patents.  A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based.  The work thus licensed is called the contributor's "contributor version".  A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version.  For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.  Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.  In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement).  To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.  If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients.  "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.  If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.  A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License.  You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.  Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.  12. No Surrender of Others' Freedom.  If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License.  If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all.  For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.  13. Use with the GNU Affero General Public License.  Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work.  The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.  14. Revised Versions of this License.  The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time.  Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.  Each version is given a distinguishing version number.  If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation.  If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.  If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.  Later license versions may give you additional or different permissions.  However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.  15. Disclaimer of Warranty.  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.  16. Limitation of Liability.  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  17. Interpretation of Sections 15 and 16.  If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.  END OF TERMS AND CONDITIONS  How to Apply These Terms to Your New Programs  If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.  To do so, attach the following notices to the program.  It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.  availsim4core Copyright (C) 2022  Availsim4  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  You should have received a copy of the GNU General Public License along with this program.  If not, see <https://www.gnu.org/licenses/>.  Also add information on how to contact you by electronic and paper mail.  If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:  <program>  Copyright (C) 2022  Availsim4 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.  The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License.  Of course, your program's commands might be different; for a GUI interface, you would use an "about box".  You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.  The GNU General Public License does not permit incorporating your program into proprietary programs.  If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library.  If this is what you want to do, use the GNU Lesser General Public License instead of this License.  But first, please read <https://www.gnu.org/licenses/why-not-lgpl.html>.


pkgId: c98533b1b51920648811342a6d5153054adfedb22155a157cf438e0910e76001
name: python-avar-help
arch: noarch
version: 0.1.5
epoch: 0
release: 1
summary: Development documents and examples for avar
url: https://gitlab.com/davidwoodburn/avar
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-avar-0.1.5-1.src.rpm
location_href: Packages/python-avar-help-0.1.5-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI Downloads](https://img.shields.io/pypi/dm/avar.svg?label=PyPI%20downloads)](https://pypi.org/project/avar/)



  ```python
  import avar
  ```

  or for specific functions (like `variance`)

  ```python
  from avar import variance
  ```



  ```python
  avar.windows(K, density=64)
  ```

  This will create an array `M` of integer window sizes. The averaging period
  `tau` would equal `M*T`, where `T` is the sampling period. The `density` is the
  target number of window sizes in the array per decade. Obviously, in the first
  decade it is not possible to have more than 9 window sizes: 1 through 9.



  ```python
  avar.variance(y, M)
  ```

  To get the actual Allan variance of a signal `y`, use this function. You must
  supply the array of window sizes `M` for which to calculate the Allan variance
  values. This function can take for `y` either a one-dimensional array or a
  two-dimensional array in which each row will be treated as a data set.



  ```python
  avar.ideal(tau, p)
  ```

  The `ideal` function will calculate the ideal Allan variances over an array of
  averaging periods `tau`. For any noise components you wish not to be included,
  set their corresponding variances to zero.

  This function make use of the `params` class. Objects of this type store the
  five basic component noise variances (quantization, white, flicker, walk, and
  ramp), `vc`, any first-order, Gauss-Markov (FOGM) noise variances, `vfogm`, and
  the corresponding FOGM time constants, `tfogm`. The `p` parameter is one such
  object. You can define it as shown in the following example:

  ```python
  p = avar.params(
          vc=np.array([0.5, 1.0, 0, 0.5, 0.1]) * 1e-9,
          vfogm=[1e-8, 1e-7],
          tfogm=[0.1, 1.0])
  ```

  The `ideal` function will return the total Allan variance curve, `va`, as well
  as a matrix, `vac`, whose rows represent the component Allan variances over
  `tau`.



  ```python
  avar.fit(tau, va, mask=None, fogms=0, tol=0.007, vtol=0.0)
  ```

  Given the Allan variance curve of some signal, `va`, at various averaging
  periods `tau`, you can get the best fit using the five basic component noises
  and `fogms` number of first-order, Gauss-Markov (FOGM) noises. By default, this
  function will automatically attempt to determine if certain component noises are
  even at play based on the tolerance value `tol`. However, you can directly
  control which component noises you wish to include or exclude with the `mask`
  array. For each element of `mask` that is `False` the corresponding component
  noise will be excluded. This function will iterate through the various
  permutations of component noises, starting with 0 FOGMs. If a fit satisfies the
  specified `tol` tolerance, the search will end. Otherwise, the best fit will be
  used. The `vtol` parameter is the minimum allowed variance for any fitted
  component noise variance.

  The return values are the fitted Allan variance curve, `vf`, and a `params`
  object, `p` (see the section on Ideal Allan Variance), containing the variances
  of the basic component noise variances (quantization, white, flicker, walk, and
  ramp), `vc`, any first-order, Gauss-Markov (FOGM) noise variances, `vfogm`, and
  the corresponding FOGM time constants, `tfogm`.



  ```python
  avar.noise(K, T, p)
  ```

  Generate a noise signal of length `K`, sampling period `T`, and parameters `p`.
  Parameter `p` is a `params` object (see the section on Ideal Allan Variance).

  This function returns the noise signal `y`.

  For flicker (bias-instability) noise, multiple, balanced FOGMs are used.



  For instructions on using pip, visit
  <https://pip.pypa.io/en/stable/getting-started/>.

  To install from pypi.org,

  ```bash
  pip install avar
  ```

  Or, from the directory of the cloned repo, run

  ```bash
  pip install .
  ```


pkgId: d69e2bfa66bd98e5be356a1e652d9a8f5a64d1f12c314ece16ea56c13f0b5018
name: python-avar-help
arch: noarch
version: 0.1.6
epoch: 0
release: 1
summary: Development documents and examples for avar
url: https://gitlab.com/davidwoodburn/avar
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-avar-0.1.6-1.src.rpm
location_href: Packages/python-avar-help-0.1.6-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI Downloads](https://img.shields.io/pypi/dm/avar.svg?label=PyPI%20downloads)](https://pypi.org/project/avar/)



  ```python
  import avar
  ```

  or for specific functions (like `variance`)

  ```python
  from avar import variance
  ```



  ```python
  avar.windows(K, min_size=1, density=64)
  ```

  This will create an array `M` of integer window sizes. The averaging period
  `tau` would equal `M*T`, where `T` is the sampling period. The `min_size` sets
  the minimum window size. The `density` is the target number of window sizes in
  the array per decade. Obviously, in the first decade it is not possible to have
  more than 9 window sizes: 1 through 9.



  ```python
  avar.variance(y, M)
  ```

  To get the actual Allan variance of a signal `y`, use this function. You must
  supply the array of window sizes `M` for which to calculate the Allan variance
  values. This function can take for `y` either a one-dimensional array or a
  two-dimensional array in which each row will be treated as a data set.



  ```python
  avar.ideal(tau, p)
  ```

  The `ideal` function will calculate the ideal Allan variances over an array of
  averaging periods `tau`. For any noise components you wish not to be included,
  set their corresponding variances to zero.

  This function make use of the `params` class. Objects of this type store the
  five basic component noise variances (quantization, white, flicker, walk, and
  ramp), `vc`, any first-order, Gauss-Markov (FOGM) noise variances, `vfogm`, and
  the corresponding FOGM time constants, `tfogm`. The `p` parameter is one such
  object. You can define it as shown in the following example:

  ```python
  p = avar.params(
          vc=np.array([0.5, 1.0, 0, 0.5, 0.1]) * 1e-9,
          vfogm=[1e-8, 1e-7],
          tfogm=[0.1, 1.0])
  ```

  The `ideal` function will return the total Allan variance curve, `va`, as well
  as a matrix, `vac`, whose rows represent the component Allan variances over
  `tau`.



  ```python
  avar.fit(tau, va, mask=None, fogms=0, tol=0.007, vtol=0.0)
  ```

  Given the Allan variance curve of some signal, `va`, at various averaging
  periods `tau`, you can get the best fit using the five basic component noises
  and `fogms` number of first-order, Gauss-Markov (FOGM) noises. By default, this
  function will automatically attempt to determine if certain component noises are
  even at play based on the tolerance value `tol`. However, you can directly
  control which component noises you wish to include or exclude with the `mask`
  array. For each element of `mask` that is `False` the corresponding component
  noise will be excluded. This function will iterate through the various
  permutations of component noises, starting with 0 FOGMs. If a fit satisfies the
  specified `tol` tolerance, the search will end. Otherwise, the best fit will be
  used. The `vtol` parameter is the minimum allowed variance for any fitted
  component noise variance.

  The return values are the fitted Allan variance curve, `vf`, and a `params`
  object, `p` (see the section on Ideal Allan Variance), containing the variances
  of the basic component noise variances (quantization, white, flicker, walk, and
  ramp), `vc`, any first-order, Gauss-Markov (FOGM) noise variances, `vfogm`, and
  the corresponding FOGM time constants, `tfogm`.



  ```python
  avar.noise(K, T, p)
  ```

  Generate a noise signal of length `K`, sampling period `T`, and parameters `p`.
  Parameter `p` is a `params` object (see the section on Ideal Allan Variance).

  This function returns the noise signal `y`.

  For flicker (bias-instability) noise, multiple, balanced FOGMs are used.



  For instructions on using pip, visit
  <https://pip.pypa.io/en/stable/getting-started/>.

  To install from pypi.org,

  ```bash
  pip install avar
  ```

  Or, from the directory of the cloned repo, run

  ```bash
  pip install .
  ```


pkgId: ab69aa672011344f0e630785e24fc03d53b6392141dffa47256dc293bd2bcb06
name: python-aviary.gsm8k-help
arch: noarch
version: 0.13.0
epoch: 0
release: 1
summary: Development documents and examples for aviary.gsm8k
url: https://pypi.org/project/aviary.gsm8k/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aviary.gsm8k-0.13.0-1.src.rpm
location_href: Packages/python-aviary.gsm8k-help-0.13.0-1.noarch.rpm
checksum_type: sha256
description:
  GSM8k environment implemented with aviary,
  allowing agents to solve math word problems from the GSM8k dataset.



  The citation for GSM8k is given below:

  ```bibtex
  @article{gsm8k-paper,
      title = {Training verifiers to solve math word problems},
      author = {Cobbe, Karl and Kosaraju, Vineet and Bavarian, Mohammad and Chen, Mark and Jun, Heewoo and Kaiser, Lukasz and
   Plappert, Matthias and Tworek, Jerry and Hilton, Jacob and Nakano, Reiichiro and others},
      journal = {arXiv preprint arXiv:2110.14168},
      year = {2021}
  }
  ```



  [1] Cobbe, K., Kosaraju, V., Bavarian, M., Chen, M., Jun, H., Kaiser, L., Plappert, M., Tworek, J., Hilton, J., Nakano,
  R. and Hesse, C., 2021.
  [Training verifiers to solve math word problems](https://arxiv.org/abs/2110.14168). arXiv preprint arXiv:2110.14168.



  To install the GSM8k environment, run the following command:

  ```bash
  pip install fhaviary[gsm8k]
  ```


pkgId: c23487ce16768483ed3d125c5ac0447fd97e26a48a9ee88e2986b8e940567c6e
name: python-aviary.hotpotqa-help
arch: noarch
version: 0.13.0
epoch: 0
release: 1
summary: Development documents and examples for aviary.hotpotqa
url: https://pypi.org/project/aviary.hotpotqa/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aviary.hotpotqa-0.13.0-1.src.rpm
location_href: Packages/python-aviary.hotpotqa-help-0.13.0-1.noarch.rpm
checksum_type: sha256
description:
  HotPotQA environment implemented with aviary,
  allowing agents to perform multi-hop question answering on the HotPotQA dataset.



  [1] Yang et al. [HotpotQA: A Dataset for Diverse,
  Explainable Multi-Hop Question Answering](https://aclanthology.org/D18-1259/). EMNLP, 2018.

  [2] Yao et al.,
  [ReAct: Synergizing Reasoning and Acting in Language Models](https://openreview.net/forum?id=WE_vluYUL-X).
  In The Eleventh International Conference on Learning Representations. 2023



  To install the HotPotQA environment, run the following command:

  ```bash
  pip install fhaviary[hotpotqa]
  ```


pkgId: 77e920a688090c0973301415ab6e427131f18e62bda4996e1b31e8213c2abf0b
name: python-avionmqtt-help
arch: noarch
version: 1.3.9
epoch: 0
release: 1
summary: Development documents and examples for avionmqtt
url: https://github.com/oyvindkinsey/avionmqtt
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-avionmqtt-1.3.9-1.src.rpm
location_href: Packages/python-avionmqtt-help-1.3.9-1.noarch.rpm
checksum_type: sha256
description:
  A python library to bridge between Avi-on based lights and Home Assistant using MQTT


  This should support any devices that uses Avi-on's technology, including Halo Home and GE branded BLE lights (both discontinued, but both supported by Avi-on's cloud infra and mobile apps).


  - creates lights for devices and groups in Home Assistant
    - supports creating meta lights such as for 'all', usefull for automation of color temperature
  - supports changing brightness and color temperature
    - for:
      - individidual devices
      - groups
      - the entire mesh at once
    - color temperature can be set *without* turning on the light
  - polls the whole network on startup to get the current state of each device
  - updates Home Assistant whenever devices are updated externally



  ```bash

  pip install avionmqtt
  python -m avionmqtt -s settings.yaml --log=DEBUG
  ```
   
   See [Running as a service.md](resources/Running%20as%20a%20service.md) for how to install this as a service using systemd.



  ```yaml
  avion:
      email: email@example.com
      password: ********

  mqtt:
      host: mqtt_broker.local
      username: avion
      password: avion

  devices:
      import: true
      
      include:
        - abcde...
        - bcdef...
      
      exclude:
        - abcde...
        - bcdef...
      
      exclude_in_group: true

  groups:
      import: true
      include:
      exclude:


  single_device: true



  capabilities_overrides:
    dimming:
      - 123
      - 234
    color_temp:
      - 123
  ```


  This project would not have been possible without the original work done in https://github.com/nkaminski/csrmesh and https://github.com/nayaverdier/halohome


pkgId: e17652388127aecadb1eb7e685660b59e0f5ed6a57cc2fdc66c1266098305764
name: python-avoca-help
arch: noarch
version: 0.7.0
epoch: 0
release: 1
summary: Development documents and examples for avoca
url: https://gitlab.com/empa503/atmospheric-measurements/avoca
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-avoca-0.7.0-1.src.rpm
location_href: Packages/python-avoca-help-0.7.0-1.noarch.rpm
checksum_type: sha256
description:
  Python package for Quality assessement of data.

  Official name is `@voc@` but it is called `avoca` for simplicity.



  A documentation can be found at (http://avoca.readthedocs.io/)




  This project is licensed under the MIT License.

  It is managed by the a group of researchers at [Empa](https://www.empa.ch/web/s503/climate-gases)


pkgId: 50056f905ccb78b9456ce5d97b225d671bb9c3ec8d8001497cf53814c0e1f546
name: python-avro-dbo-help
arch: noarch
version: 0.1.1
epoch: 0
release: 1
summary: Development documents and examples for avro-dbo
url: https://pypi.org/project/avro-dbo/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-avro-dbo-0.1.1-1.src.rpm
location_href: Packages/python-avro-dbo-help-0.1.1-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI version](https://badge.fury.io/py/avro-dbo.svg)](https://badge.fury.io/py/avro-dbo)
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
  [![Python Versions](https://img.shields.io/pypi/pyversions/avro-dbo.svg)](https://pypi.org/project/avro-dbo/)

  A powerful Python library for working with Apache Avro schemas, providing seamless integration with data serialization and schema management. Perfect for data engineering pipelines and stream processing applications.



  - 🏗️ **Schema-First Development** - Generate Python classes directly from Avro schemas
  - 🔄 **Full Type Support** - Complete support for all Avro logical types
  - 🛠️ **Custom Serialization** - Flexible serializers and deserializers
  - 🌐 **Schema Registry Integration** - Native support for Confluent Schema Registry
  - 🔒 **Type Safety** - Full static type checking support
  - ⚡ **High Performance** - Optimized for production workloads





  ```bash
  pip install avro-dbo
  ```



  **UV is required to build and publish the package.**



  ```bash
  curl -LsSf https://astral.sh/uv/install.sh | sh
  ```



  ```bash
  uv sync --upgrade
  uv build
  ```



  For detailed usage instructions, type hints, and examples, please refer to the [documentation](https://avro-dbo.readthedocs.io/en/latest/).



  We welcome contributions! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.



  This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.


pkgId: d3977846ea930cd40bcc3f7c7c812b652e0dc8a041598c975eb1a360a2b4151c
name: python-avtdl-help
arch: noarch
version: 2.1
epoch: 0
release: 1
summary: Development documents and examples for avtdl
url: https://github.com/15532th/avtdl
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-avtdl-2.1-1.src.rpm
location_href: Packages/python-avtdl-help-2.1-1.noarch.rpm
checksum_type: sha256
description:
  Tool to monitor Youtube and some other streaming platforms for new streams and uploads and execute user-defined commands when it happens. It aims to provide a highly configurable environment for setting up automated archiving of new content with filtering and notification support. It does not try to provide downloading streams itself and instead relies on executing commonly used well-known solutions for the task, such as `yt-dlp`.

  Refer to [documentation](https://github.com/15532th/avtdl?tab=readme-ov-file#avtdl) for full list of available features and description of configuration process.



  Some of the supported features include:

  - monitoring Youtube channels using RSS feed
  - monitoring Youtube channels, individual tabs of a channel or playlists by parsing html. With authorization cookies from Youtube account it's possible to get notifications for member-only and in any other way restricted streams and uploads, as well as to monitor the entire subscriptions feed
  - monitoring Youtube channel community tab for new posts (including member-only with authorization cookies)
  - monitoring other streaming platforms, such as Twitch and Twitcasting, for events of a channel going live
  - filtering new videos and streams by channel name, presence or absense of pre-defined keywords in video title or description, picking up only upcoming streams or only member-only content, deduplication of the same stream or video url coming from multiple sources
  - sending notifications to a Discord channel and/or as a Jabber message


pkgId: 4d72559c43274a74afc0905dc6faa7d549b44e5349035defafa4c93d41c503ae
name: python-aws-cdk-common-help
arch: noarch
version: 0.1.29
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk-common
url: https://pypi.org/project/aws-cdk-common/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk-common-0.1.29-1.src.rpm
location_href: Packages/python-aws-cdk-common-help-0.1.29-1.noarch.rpm
checksum_type: sha256
description:
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

  `aws-cdk-common` is a shared package for common modules and constants for AWS Lambda applications based on AWS CDK.



  [Poetry](https://python-poetry.org/) is a tool to manage Python projects in a deterministic way.


  `pipx` installs and run Python applications in isolated environment. Follow the instructions listed in [pipx documentation](https://github.com/pypa/pipx) for your specific environment.



  ```bash
  pipx install poetry
  ```


  To install required modules, run:

  ```bash
  poetry install --no-root
  ```

  To install required modules for development, run:
  ```bash
  poetry install --with dev --no-root
  ```

  We use `pre-commit` to ensure consistent code quality. Install the pre-commit hooks by running:
  ```bash
  poetry run pre-commit install
  ```

  - To format code with **Black**:
  ```bash
  poetry run black .
  ```
  - To sort imports with **isort**:
  ```bash
  pipenv run isort .
  ```
  - To check code quality with **Flake8**:
  ```bash
  poetry run flake8 .
  ```
  These tools help maintain code quality and consistency across the project.




  To run unit tests, after installing required modules for development, run:
  ```bash
  poetry shell
  pytest tests/unit
  ```


  To run unit tests, after installing required modules for development, run:
  ```bash
  poetry shell
  pytest tests/integration
  ```


  You can also run all tests (unit and integration) by running:
  ```bash
  poetry shell
  pytest
  ```


pkgId: 7943cdf151ba7b13fea18c222a10c5b2a1cd89b25b0131335fd95864453bd6a2
name: python-aws-cdk-lib-help
arch: noarch
version: 2.173.1
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk-lib
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk-lib-2.173.1-1.src.rpm
location_href: Packages/python-aws-cdk-lib-help-2.173.1-1.noarch.rpm
checksum_type: sha256
description:
  The AWS CDK construct library provides APIs to define your CDK application and add
  CDK constructs to the application.





  When upgrading from CDK 1.x, remove all dependencies to individual CDK packages
  from your dependencies file and follow the rest of the sections.



  To use this package, you need to declare this package and the `constructs` package as
  dependencies.

  According to the kind of project you are developing:

  For projects that are CDK libraries in NPM, declare them both under the `devDependencies` **and** `peerDependencies` sections.
  To make sure your library is compatible with the widest range of CDK versions: pick the minimum `aws-cdk-lib` version
  that your library requires; declare a range dependency with a caret on that version in peerDependencies, and declare a
  point version dependency on that version in devDependencies.

  For example, let's say the minimum version your library needs is `2.38.0`. Your `package.json` should look like this:

  ```javascript
  {
    "peerDependencies": {
      "aws-cdk-lib": "^2.38.0",
      "constructs": "^10.0.0"
    },
    "devDependencies": {
      /* Install the oldest version for testing so we don't accidentally use features from a newer version than we declare */
      "aws-cdk-lib": "2.38.0"
    }
  }
  ```

  For CDK apps, declare them under the `dependencies` section. Use a caret so you always get the latest version:

  ```json
  {
    "dependencies": {
      "aws-cdk-lib": "^2.38.0",
      "constructs": "^10.0.0"
    }
  }
  ```





  You can use a classic import to get access to each service namespaces:

  ```python
  from aws_cdk import Stack, App, aws_s3 as s3

  app = App()
  stack = Stack(app, "TestStack")

  s3.Bucket(stack, "TestBucket")
  ```



  Alternatively, you can use "barrel" imports:

  ```python
  from aws_cdk import App, Stack
  from aws_cdk.aws_s3 import Bucket

  app = App()
  stack = Stack(app, "TestStack")

  Bucket(stack, "TestBucket")
  ```

  <!--BEGIN CORE DOCUMENTATION-->



  A `Stack` is the smallest physical unit of deployment, and maps directly onto
  a CloudFormation Stack. You define a Stack by defining a subclass of `Stack`
  -- let's call it `MyStack` -- and instantiating the constructs that make up
  your application in `MyStack`'s constructor. You then instantiate this stack
  one or more times to define different instances of your application. For example,
  you can instantiate it once using few and cheap EC2 instances for testing,
  and once again using more and bigger EC2 instances for production.

  When your application grows, you may decide that it makes more sense to split it
  out across multiple `Stack` classes. This can happen for a number of reasons:

  * You could be starting to reach the maximum number of resources allowed in a single
    stack (this is currently 500).
  * You could decide you want to separate out stateful resources and stateless resources
    into separate stacks, so that it becomes easy to tear down and recreate the stacks
    that don't have stateful resources.
  * There could be a single stack with resources (like a VPC) that are shared
    between multiple instances of other stacks containing your applications.

  As soon as your conceptual application starts to encompass multiple stacks,
  it is convenient to wrap them in another construct that represents your
  logical application. You can then treat that new unit the same way you used
  to be able to treat a single stack: by instantiating it multiple times
  for different instances of your application.

  You can define a custom subclass of `Stage`, holding one or more
  `Stack`s, to represent a single logical instance of your application.

  As a final note: `Stack`s are not a unit of reuse. They describe physical
  deployment layouts, and as such are best left to application builders to
  organize their deployments with. If you want to vend a reusable construct,
  define it as a subclasses of `Construct`: the consumers of your construct
  will decide where to place it in their own stacks.



  Each Stack has a *synthesizer*, an object that determines how and where
  the Stack should be synthesized and deployed. The synthesizer controls
  aspects like:

  * How does the stack reference assets? (Either through CloudFormation
    parameters the CLI supplies, or because the Stack knows a predefined
    location where assets will be uploaded).
  * What roles are used to deploy the stack? These can be bootstrapped
    roles, roles created in some other way, or just the CLI's current
    credentials.

  The following synthesizers are available:

  * `DefaultStackSynthesizer`: recommended. Uses predefined asset locations and
    roles created by the modern bootstrap template. Access control is done by
    controlling who can assume the deploy role. This is the default stack
    synthesizer in CDKv2.
  * `LegacyStackSynthesizer`: Uses CloudFormation parameters to communicate
    asset locations, and the CLI's current permissions to deploy stacks. This
    is the default stack synthesizer in CDKv1.
  * `CliCredentialsStackSynthesizer`: Uses predefined asset locations, and the
    CLI's current permissions.

  Each of these synthesizers takes configuration arguments. To configure
  a stack with a synthesizer, pass it as one of its properties:

  ```python
  MyStack(app, "MyStack",
      synthesizer=DefaultStackSynthesizer(
          file_assets_bucket_name="amzn-s3-demo-bucket"
      )
  )
  ```

  For more information on bootstrapping accounts and customizing synthesis,
  see [Bootstrapping in the CDK Developer Guide](https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html).



  [Nested stacks](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html) are stacks created as part of other stacks. You create a nested stack within another stack by using the `NestedStack` construct.

  As your infrastructure grows, common patterns can emerge in which you declare the same components in multiple templates. You can separate out these common components and create dedicated templates for them. Then use the resource in your template to reference other templates, creating nested stacks.

  For example, assume that you have a load balancer configuration that you use for most of your stacks. Instead of copying and pasting the same configurations into your templates, you can create a dedicated template for the load balancer. Then, you just use the resource to reference that template from within other templates.

  The following example will define a single top-level stack that contains two nested stacks: each one with a single Amazon S3 bucket:

  ```python
  class MyNestedStack(cfn.NestedStack):
      def __init__(self, scope, id, *, parameters=None, timeout=None, notifications=None):
          super().__init__(scope, id, parameters=parameters, timeout=timeout, notifications=notifications)

          s3.Bucket(self, "NestedBucket")

  class MyParentStack(Stack):
      def __init__(self, scope, id, *, description=None, env=None, stackName=None, tags=None, notificationArns=None, synthesizer=None, terminationProtection=None, analyticsReporting=None, crossRegionReferences=None, permissionsBoundary=None, suppressTemplateIndentation=None):
          super().__init__(scope, id, description=description, env=env, stackName=stackName, tags=tags, notificationArns=notificationArns, synthesizer=synthesizer, terminationProtection=terminationProtection, analyticsReporting=analyticsReporting, crossRegionReferences=crossRegionReferences, permissionsBoundary=permissionsBoundary, suppressTemplateIndentation=suppressTemplateIndentation)

          MyNestedStack(self, "Nested1")
          MyNestedStack(self, "Nested2")
  ```

  Resources references across nested/parent boundaries (even with multiple levels of nesting) will be wired by the AWS CDK
  through CloudFormation parameters and outputs. When a resource from a parent stack is referenced by a nested stack,
  a CloudFormation parameter will automatically be added to the nested stack and assigned from the parent; when a resource
  from a nested stack is referenced by a parent stack, a CloudFormation output will be automatically be added to the
  nested stack and referenced using `Fn::GetAtt "Outputs.Xxx"` from the parent.

  Nested stacks also support the use of Docker image and file assets.



  You can access resources in a different stack, as long as they are in the
  same account and AWS Region (see [next section](#accessing-resources-in-a-different-stack-and-region) for an exception).
  The following example defines the stack `stack1`,
  which defines an Amazon S3 bucket. Then it defines a second stack, `stack2`,
  which takes the bucket from stack1 as a constructor property.

  ```python
  prod = {"account": "123456789012", "region": "us-east-1"}

  stack1 = StackThatProvidesABucket(app, "Stack1", env=prod)


  stack2 = StackThatExpectsABucket(app, "Stack2",
      bucket=stack1.bucket,
      env=prod
  )
  ```

  If the AWS CDK determines that the resource is in the same account and
  Region, but in a different stack, it automatically synthesizes AWS
  CloudFormation
  [Exports](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-stack-exports.html)
  in the producing stack and an
  [Fn::ImportValue](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html)
  in the consuming stack to transfer that information from one stack to the
  other.



  > **This feature is currently experimental**

  You can enable the Stack property `crossRegionReferences`
  in order to access resources in a different stack *and* region. With this feature flag
  enabled it is possible to do something like creating a CloudFront distribution in `us-east-2` and
  an ACM certificate in `us-east-1`.

  ```python
  stack1 = Stack(app, "Stack1",
      env=Environment(
          region="us-east-1"
      ),
      cross_region_references=True
  )
  cert = acm.Certificate(stack1, "Cert",
      domain_name="*.example.com",
      validation=acm.CertificateValidation.from_dns(route53.PublicHostedZone.from_hosted_zone_id(stack1, "Zone", "Z0329774B51CGXTDQV3X"))
  )

  stack2 = Stack(app, "Stack2",
      env=Environment(
          region="us-east-2"
      ),
      cross_region_references=True
  )
  cloudfront.Distribution(stack2, "Distribution",
      default_behavior=cloudfront.BehaviorOptions(
          origin=origins.HttpOrigin("example.com")
      ),
      domain_names=["dev.example.com"],
      certificate=cert
  )
  ```

  When the AWS CDK determines that the resource is in a different stack *and* is in a different
  region, it will "export" the value by creating a custom resource in the producing stack which
  creates SSM Parameters in the consuming region for each exported value. The parameters will be
  created with the name '/cdk/exports/${consumingStackName}/${export-name}'.
  In order to "import" the exports into the consuming stack a [SSM Dynamic reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html#dynamic-references-ssm)
  is used to reference the SSM parameter which was created.

  In order to mimic strong references, a Custom Resource is also created in the consuming
  stack which marks the SSM parameters as being "imported". When a parameter has been successfully
  imported, the producing stack cannot update the value.

  > [!NOTE]
  > As a consequence of this feature being built on a Custom Resource, we are restricted to a
  > CloudFormation response body size limitation of [4096 bytes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html).
  > To prevent deployment errors related to the Custom Resource Provider response body being too
  > large, we recommend limiting the use of nested stacks and minimizing the length of stack names.
  > Doing this will prevent SSM parameter names from becoming too long which will reduce the size of the
  > response body.

  See the [adr](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/core/adr/cross-region-stack-references.md)
  for more details on this feature.



  The automatic references created by CDK when you use resources across stacks
  are convenient, but may block your deployments if you want to remove the
  resources that are referenced in this way. You will see an error like:

  ```text
  Export Stack1:ExportsOutputFnGetAtt-****** cannot be deleted as it is in use by Stack1
  ```

  Let's say there is a Bucket in the `stack1`, and the `stack2` references its
  `bucket.bucketName`. You now want to remove the bucket and run into the error above.

  It's not safe to remove `stack1.bucket` while `stack2` is still using it, so
  unblocking yourself from this is a two-step process. This is how it works:

  DEPLOYMENT 1: break the relationship

  * Make sure `stack2` no longer references `bucket.bucketName` (maybe the consumer
    stack now uses its own bucket, or it writes to an AWS DynamoDB table, or maybe you just
    remove the Lambda Function altogether).
  * In the `stack1` class, call `this.exportValue(this.bucket.bucketName)`. This
    will make sure the CloudFormation Export continues to exist while the relationship
    between the two stacks is being broken.
  * Deploy (this will effectively only change the `stack2`, but it's safe to deploy both).

  DEPLOYMENT 2: remove the resource

  * You are now free to remove the `bucket` resource from `stack1`.
  * Don't forget to remove the `exportValue()` call as well.
  * Deploy again (this time only the `stack1` will be changed -- the bucket will be deleted).



  To make specifications of time intervals unambiguous, a single class called
  `Duration` is used throughout the AWS Construct Library by all constructs
  that that take a time interval as a parameter (be it for a timeout, a
  rate, or something else).

  An instance of Duration is constructed by using one of the static factory
  methods on it:

  ```python
  Duration.seconds(300) # 5 minutes
  Duration.minutes(5) # 5 minutes
  Duration.hours(1) # 1 hour
  Duration.days(7) # 7 days
  Duration.parse("PT5M")
  ```

  Durations can be added or subtracted together:

  ```python
  Duration.minutes(1).plus(Duration.seconds(60)) # 2 minutes
  Duration.minutes(5).minus(Duration.seconds(10))
  ```



  To make specification of digital storage quantities unambiguous, a class called
  `Size` is available.

  An instance of `Size` is initialized through one of its static factory methods:

  ```python
  Size.kibibytes(200) # 200 KiB
  Size.mebibytes(5) # 5 MiB
  Size.gibibytes(40) # 40 GiB
  Size.tebibytes(200) # 200 TiB
  Size.pebibytes(3)
  ```

  Instances of `Size` created with one of the units can be converted into others.
  By default, conversion to a higher unit will fail if the conversion does not produce
  a whole number. This can be overridden by unsetting `integral` property.

  ```python
  Size.mebibytes(2).to_kibibytes() # yields 2048
  Size.kibibytes(2050).to_mebibytes(rounding=SizeRoundingBehavior.FLOOR)
  ```



  To help avoid accidental storage of secrets as plain text, we use the `SecretValue` type to
  represent secrets. Any construct that takes a value that should be a secret (such as
  a password or an access key) will take a parameter of type `SecretValue`.

  The best practice is to store secrets in AWS Secrets Manager and reference them using `SecretValue.secretsManager`:

  ```python
  secret = SecretValue.secrets_manager("secretId",
      json_field="password",  # optional: key of a JSON field to retrieve (defaults to all content),
      version_id="id",  # optional: id of the version (default AWSCURRENT)
      version_stage="stage"
  )
  ```

  Using AWS Secrets Manager is the recommended way to reference secrets in a CDK app.
  `SecretValue` also supports the following secret sources:

  * `SecretValue.unsafePlainText(secret)`: stores the secret as plain text in your app and the resulting template (not recommended).
  * `SecretValue.secretsManager(secret)`: refers to a secret stored in Secrets Manager
  * `SecretValue.ssmSecure(param, version)`: refers to a secret stored as a SecureString in the SSM
    Parameter Store. If you don't specify the exact version, AWS CloudFormation uses the latest
    version of the parameter.
  * `SecretValue.cfnParameter(param)`: refers to a secret passed through a CloudFormation parameter (must have `NoEcho: true`).
  * `SecretValue.cfnDynamicReference(dynref)`: refers to a secret described by a CloudFormation dynamic reference (used by `ssmSecure` and `secretsManager`).
  * `SecretValue.resourceAttribute(attr)`: refers to a secret returned from a CloudFormation resource creation.

  `SecretValue`s should only be passed to constructs that accept properties of type
  `SecretValue`. These constructs are written to ensure your secrets will not be
  exposed where they shouldn't be. If you try to use a `SecretValue` in a
  different location, an error about unsafe secret usage will be thrown at
  synthesis time.

  If you rotate the secret's value in Secrets Manager, you must also change at
  least one property on the resource where you are using the secret, to force
  CloudFormation to re-read the secret.

  `SecretValue.ssmSecure()` is only supported for a limited set of resources.
  [Click here for a list of supported resources and properties](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html#template-parameters-dynamic-patterns-resources).



  Sometimes you will need to put together or pick apart Amazon Resource Names
  (ARNs). The functions `stack.formatArn()` and `stack.splitArn()` exist for
  this purpose.

  `formatArn()` can be used to build an ARN from components. It will automatically
  use the region and account of the stack you're calling it on:

  ```python




  stack.format_arn(
      service="lambda",
      resource="function",
      arn_format=ArnFormat.COLON_RESOURCE_NAME,
      resource_name="MyFunction"
  )
  ```

  `splitArn()` can be used to get a single component from an ARN. `splitArn()`
  will correctly deal with both literal ARNs and deploy-time values (tokens),
  but in case of a deploy-time value be aware that the result will be another
  deploy-time value which cannot be inspected in the CDK application.

  ```python




  arn_components = stack.split_arn(arn, ArnFormat.COLON_RESOURCE_NAME)
  function_name = arn_components.resource_name
  ```

  Note that the format of the resource separator depends on the service and
  may be any of the values supported by `ArnFormat`. When dealing with these
  functions, it is important to know the format of the ARN you are dealing with.

  For an exhaustive list of ARN formats used in AWS, see [AWS ARNs and
  Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
  in the AWS General Reference.





  Sometimes AWS resources depend on other resources, and the creation of one
  resource must be completed before the next one can be started.

  In general, CloudFormation will correctly infer the dependency relationship
  between resources based on the property values that are used. In the cases where
  it doesn't, the AWS Construct Library will add the dependency relationship for
  you.

  If you need to add an ordering dependency that is not automatically inferred,
  you do so by adding a dependency relationship using
  `constructA.node.addDependency(constructB)`. This will add a dependency
  relationship between all resources in the scope of `constructA` and all
  resources in the scope of `constructB`.

  If you want a single object to represent a set of constructs that are not
  necessarily in the same scope, you can use a `DependencyGroup`. The
  following creates a single object that represents a dependency on two
  constructs, `constructB` and `constructC`:

  ```python

  b_and_c = DependencyGroup()
  b_and_c.add(construct_b)
  b_and_c.add(construct_c)


  construct_a.node.add_dependency(b_and_c)
  ```



  Two different stack instances can have a dependency on one another. This
  happens when an resource from one stack is referenced in another stack. In
  that case, CDK records the cross-stack referencing of resources,
  automatically produces the right CloudFormation primitives, and adds a
  dependency between the two stacks. You can also manually add a dependency
  between two stacks by using the `stackA.addDependency(stackB)` method.

  A stack dependency has the following implications:

  * Cyclic dependencies are not allowed, so if `stackA` is using resources from
    `stackB`, the reverse is not possible anymore.
  * Stacks with dependencies between them are treated specially by the CDK
    toolkit:

    * If `stackA` depends on `stackB`, running `cdk deploy stackA` will also
      automatically deploy `stackB`.
    * `stackB`'s deployment will be performed *before* `stackA`'s deployment.



  To make declaring dependencies between `CfnResource` objects easier, you can declare dependencies from one `CfnResource` object on another by using the `cfnResource1.addDependency(cfnResource2)` method. This method will work for resources both within the same stack and across stacks as it detects the relative location of the two resources and adds the dependency either to the resource or between the relevant stacks, as appropriate. If more complex logic is in needed, you can similarly remove, replace, or view dependencies between `CfnResource` objects with the `CfnResource` `removeDependency`, `replaceDependency`, and `obtainDependencies` methods, respectively.



  Custom Resources are CloudFormation resources that are implemented by arbitrary
  user code. They can do arbitrary lookups or modifications during a
  CloudFormation deployment.

  Custom resources are backed by *custom resource providers*. Commonly, these are
  Lambda Functions that are deployed in the same deployment as the one that
  defines the custom resource itself, but they can also be backed by Lambda
  Functions deployed previously, or code responding to SNS Topic events running on
  EC2 instances in a completely different account. For more information on custom
  resource providers, see the next section.

  Once you have a provider, each definition of a `CustomResource` construct
  represents one invocation. A single provider can be used for the implementation
  of arbitrarily many custom resource definitions. A single definition looks like
  this:

  ```python
  CustomResource(self, "MyMagicalResource",
      resource_type="Custom::MyCustomResource",  # must start with 'Custom::'

      
      properties={
          "Property1": "foo",
          "Property2": "bar"
      },

      
      
      
      service_token="ARN"
  )
  ```



  Custom resources are backed by a **custom resource provider** which can be
  implemented in one of the following ways. The following table compares the
  various provider types (ordered from low-level to high-level):

  | Provider                                                             | Compute Type | Error Handling | Submit to CloudFormation |   Max Timeout   | Language | Footprint |
  | -------------------------------------------------------------------- | :----------: | :------------: | :----------------------: | :-------------: | :------: | :-------: |
  | [sns.Topic](#amazon-sns-topic)                                       | Self-managed |     Manual     |          Manual          |    Unlimited    |   Any    |  Depends  |
  | [lambda.Function](#aws-lambda-function)                              |  AWS Lambda  |     Manual     |          Manual          |      15min      |   Any    |   Small   |
  | [core.CustomResourceProvider](#the-corecustomresourceprovider-class) |  AWS Lambda  |      Auto      |           Auto           |      15min      | Node.js  |   Small   |
  | [custom-resources.Provider](#the-custom-resource-provider-framework) |  AWS Lambda  |      Auto      |           Auto           | Unlimited Async |   Any    |   Large   |

  Legend:

  * **Compute type**: which type of compute can be used to execute the handler.
  * **Error Handling**: whether errors thrown by handler code are automatically
    trapped and a FAILED response is submitted to CloudFormation. If this is
    "Manual", developers must take care of trapping errors. Otherwise, events
    could cause stacks to hang.
  * **Submit to CloudFormation**: whether the framework takes care of submitting
    SUCCESS/FAILED responses to CloudFormation through the event's response URL.
  * **Max Timeout**: maximum allows/possible timeout.
  * **Language**: which programming languages can be used to implement handlers.
  * **Footprint**: how many resources are used by the provider framework itself.

  **A NOTE ABOUT SINGLETONS**

  When defining resources for a custom resource provider, you will likely want to
  define them as a *stack singleton* so that only a single instance of the
  provider is created in your stack and which is used by all custom resources of
  that type.

  Here is a basic pattern for defining stack singletons in the CDK. The following
  examples ensures that only a single SNS topic is defined:

  ```python
  def get_or_create(self, scope):
      stack = Stack.of(scope)
      uniqueid = "GloballyUniqueIdForSingleton" # For example, a UUID from `uuidgen`
      existing = stack.node.try_find_child(uniqueid)
      if existing:
          return existing
      return sns.Topic(stack, uniqueid)
  ```



  Every time a resource event occurs (CREATE/UPDATE/DELETE), an SNS notification
  is sent to the SNS topic. Users must process these notifications (e.g. through a
  fleet of worker hosts) and submit success/failure responses to the
  CloudFormation service.

  > You only need to use this type of provider if your custom resource cannot run on AWS Lambda, for reasons other than the 15
  > minute timeout. If you are considering using this type of provider because you want to write a custom resource provider that may need
  > to wait for more than 15 minutes for the API calls to stabilize, have a look at the [`custom-resources`](#the-custom-resource-provider-framework) module first.
  >
  > Refer to the [CloudFormation Custom Resource documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) for information on the contract your custom resource needs to adhere to.

  Set `serviceToken` to `topic.topicArn`  in order to use this provider:

  ```python
  topic = sns.Topic(self, "MyProvider")

  CustomResource(self, "MyResource",
      service_token=topic.topic_arn
  )
  ```



  An AWS lambda function is called *directly* by CloudFormation for all resource
  events. The handler must take care of explicitly submitting a success/failure
  response to the CloudFormation service and handle various error cases.

  > **We do not recommend you use this provider type.** The CDK has wrappers around Lambda Functions that make them easier to work with.
  >
  > If you do want to use this provider, refer to the [CloudFormation Custom Resource documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html) for information on the contract your custom resource needs to adhere to.

  Set `serviceToken` to `lambda.functionArn` to use this provider:

  ```python
  fn = lambda_.SingletonFunction(self, "MyProvider", function_props)

  CustomResource(self, "MyResource",
      service_token=fn.function_arn
  )
  ```



  The class [`@aws-cdk/core.CustomResourceProvider`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.CustomResourceProvider.html) offers a basic low-level
  framework designed to implement simple and slim custom resource providers. It
  currently only supports Node.js-based user handlers, represents permissions as raw
  JSON blobs instead of `iam.PolicyStatement` objects, and it does not have
  support for asynchronous waiting (handler cannot exceed the 15min lambda
  timeout). The `CustomResourceProviderRuntime` supports runtime `nodejs12.x`,
  `nodejs14.x`, `nodejs16.x`, `nodejs18.x`.

  > **As an application builder, we do not recommend you use this provider type.** This provider exists purely for custom resources that are part of the AWS Construct Library.
  >
  > The [`custom-resources`](#the-custom-resource-provider-framework) provider is more convenient to work with and more fully-featured.

  The provider has a built-in singleton method which uses the resource type as a
  stack-unique identifier and returns the service token:

  ```python
  service_token = CustomResourceProvider.get_or_create(self, "Custom::MyCustomResourceType",
      code_directory=f"{__dirname}/my-handler",
      runtime=CustomResourceProviderRuntime.NODEJS_18_X,
      description="Lambda function created by the custom resource provider"
  )

  CustomResource(self, "MyResource",
      resource_type="Custom::MyCustomResourceType",
      service_token=service_token
  )
  ```

  The directory (`my-handler` in the above example) must include an `index.js` file. It cannot import
  external dependencies or files outside this directory. It must export an async
  function named `handler`. This function accepts the CloudFormation resource
  event object and returns an object with the following structure:

  ```js
  exports.handler = async function(event) {
    const id = event.PhysicalResourceId; // only for "Update" and "Delete"
    const props = event.ResourceProperties;
    const oldProps = event.OldResourceProperties; // only for "Update"s

    switch (event.RequestType) {
      case "Create":
        // ...

      case "Update":
        // ...

        // if an error is thrown, a FAILED response will be submitted to CFN
        throw new Error('Failed!');

      case "Delete":
        // ...
    }

    return {
      // (optional) the value resolved from `resource.ref`
      // defaults to "event.PhysicalResourceId" or "event.RequestId"
      PhysicalResourceId: "REF",

      // (optional) calling `resource.getAtt("Att1")` on the custom resource in the CDK app
      // will return the value "BAR".
      Data: {
        Att1: "BAR",
        Att2: "BAZ"
      },

      // (optional) user-visible message
      Reason: "User-visible message",

      // (optional) hides values from the console
      NoEcho: true
    };
  }
  ```

  Here is an complete example of a custom resource that summarizes two numbers:

  `sum-handler/index.js`:

  ```js
  exports.handler = async (e) => {
    return {
      Data: {
        Result: e.ResourceProperties.lhs + e.ResourceProperties.rhs,
      },
    };
  };
  ```

  `sum.ts`:

  ```python
  from constructs import Construct
  from aws_cdk import CustomResource, CustomResourceProvider, CustomResourceProviderRuntime, Token

  class Sum(Construct):

      def __init__(self, scope, id, *, lhs, rhs):
          super().__init__(scope, id)

          resource_type = "Custom::Sum"
          service_token = CustomResourceProvider.get_or_create(self, resource_type,
              code_directory=f"{__dirname}/sum-handler",
              runtime=CustomResourceProviderRuntime.NODEJS_18_X
          )

          resource = CustomResource(self, "Resource",
              resource_type=resource_type,
              service_token=service_token,
              properties={
                  "lhs": lhs,
                  "rhs": rhs
              }
          )

          self.result = Token.as_number(resource.get_att("Result"))
  ```

  Usage will look like this:

  ```python
  sum = Sum(self, "MySum", lhs=40, rhs=2)
  CfnOutput(self, "Result", value=Token.as_string(sum.result))
  ```

  To access the ARN of the provider's AWS Lambda function role, use the `getOrCreateProvider()`
  built-in singleton method:

  ```python
  provider = CustomResourceProvider.get_or_create_provider(self, "Custom::MyCustomResourceType",
      code_directory=f"{__dirname}/my-handler",
      runtime=CustomResourceProviderRuntime.NODEJS_18_X
  )

  role_arn = provider.role_arn
  ```

  This role ARN can then be used in resource-based IAM policies.

  To add IAM policy statements to this role, use `addToRolePolicy()`:

  ```python
  provider = CustomResourceProvider.get_or_create_provider(self, "Custom::MyCustomResourceType",
      code_directory=f"{__dirname}/my-handler",
      runtime=CustomResourceProviderRuntime.NODEJS_18_X
  )
  provider.add_to_role_policy({
      "Effect": "Allow",
      "Action": "s3:GetObject",
      "Resource": "*"
  })
  ```

  Note that `addToRolePolicy()` uses direct IAM JSON policy blobs, *not* a
  `iam.PolicyStatement` object like you will see in the rest of the CDK.



  The [`@aws-cdk/custom-resources`](https://docs.aws.amazon.com/cdk/api/latest/docs/custom-resources-readme.html) module includes an advanced framework for
  implementing custom resource providers.

  Handlers are implemented as AWS Lambda functions, which means that they can be
  implemented in any Lambda-supported runtime. Furthermore, this provider has an
  asynchronous mode, which means that users can provide an `isComplete` lambda
  function which is called periodically until the operation is complete. This
  allows implementing providers that can take up to two hours to stabilize.

  Set `serviceToken` to `provider.serviceToken` to use this type of provider:

  ```python
  provider = customresources.Provider(self, "MyProvider",
      on_event_handler=on_event_handler,
      is_complete_handler=is_complete_handler
  )

  CustomResource(self, "MyResource",
      service_token=provider.service_token
  )
  ```

  See the [documentation](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-cdk-lib.custom_resources-readme.html) for more details.



  A CDK stack synthesizes to an AWS CloudFormation Template. This section
  explains how this module allows users to access low-level CloudFormation
  features when needed.



  CloudFormation [stack outputs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html) and exports are created using
  the `CfnOutput` class:

  ```python
  CfnOutput(self, "OutputName",
      value=my_bucket.bucket_name,
      description="The name of an S3 bucket",  # Optional
      export_name="TheAwesomeBucket"
  )
  ```



  CloudFormation templates support the use of [Parameters](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html) to
  customize a template. They enable CloudFormation users to input custom values to
  a template each time a stack is created or updated. While the CDK design
  philosophy favors using build-time parameterization, users may need to use
  CloudFormation in a number of cases (for example, when migrating an existing
  stack to the AWS CDK).

  Template parameters can be added to a stack by using the `CfnParameter` class:

  ```python
  CfnParameter(self, "MyParameter",
      type="Number",
      default=1337
  )
  ```

  The value of parameters can then be obtained using one of the `value` methods.
  As parameters are only resolved at deployment time, the values obtained are
  placeholder tokens for the real value (`Token.isUnresolved()` would return `true`
  for those):

  ```python
  param = CfnParameter(self, "ParameterName")


  param.value_as_string


  param.value_as_number


  param.value_as_list
  ```



  CloudFormation supports a number of [pseudo parameters](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html),
  which resolve to useful values at deployment time. CloudFormation pseudo
  parameters can be obtained from static members of the `Aws` class.

  It is generally recommended to access pseudo parameters from the scope's `stack`
  instead, which guarantees the values produced are qualifying the designated
  stack, which is essential in cases where resources are shared cross-stack:

  ```python

  stack = Stack.of(self)

  stack.account # Returns the AWS::AccountId for this stack (or the literal value if known)
  stack.region # Returns the AWS::Region for this stack (or the literal value if known)
  stack.partition
  ```



  CloudFormation resources can also specify [resource
  attributes](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-product-attribute-reference.html). The `CfnResource` class allows
  accessing those through the `cfnOptions` property:

  ```python
  raw_bucket = s3.CfnBucket(self, "Bucket")

  raw_bucket_alt = my_bucket.node.default_child


  raw_bucket.cfn_options.condition = CfnCondition(self, "EnableBucket")
  raw_bucket.cfn_options.metadata = {
      "metadata_key": "MetadataValue"
  }
  ```

  Resource dependencies (the `DependsOn` attribute) is modified using the
  `cfnResource.addDependency` method:

  ```python
  resource_a = CfnResource(self, "ResourceA", resource_props)
  resource_b = CfnResource(self, "ResourceB", resource_props)

  resource_b.add_dependency(resource_a)
  ```



  Some resources support a [CreationPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html) to be specified as a CfnOption.

  The creation policy is invoked only when AWS CloudFormation creates the associated resource. Currently, the only AWS CloudFormation resources that support creation policies are `CfnAutoScalingGroup`, `CfnInstance`, `CfnWaitCondition` and `CfnFleet`.

  The `CfnFleet` resource from the `aws-appstream` module supports specifying `startFleet` as
  a property of the creationPolicy on the resource options. Setting it to true will make AWS CloudFormation wait until the fleet is started before continuing with the creation of
  resources that depend on the fleet resource.

  ```python
  fleet = appstream.CfnFleet(self, "Fleet",
      instance_type="stream.standard.small",
      name="Fleet",
      compute_capacity=appstream.CfnFleet.ComputeCapacityProperty(
          desired_instances=1
      ),
      image_name="AppStream-AmazonLinux2-09-21-2022"
  )
  fleet.cfn_options.creation_policy = CfnCreationPolicy(
      start_fleet=True
  )
  ```

  The properties passed to the level 2 constructs `AutoScalingGroup` and `Instance` from the
  `aws-ec2` module abstract what is passed into the `CfnOption` properties `resourceSignal` and
  `autoScalingCreationPolicy`, but when using level 1 constructs you can specify these yourself.

  The CfnWaitCondition resource from the `aws-cloudformation` module suppports the `resourceSignal`.
  The format of the timeout is `PT#H#M#S`. In the example below AWS Cloudformation will wait for
  3 success signals to occur within 15 minutes before the status of the resource will be set to
  `CREATE_COMPLETE`.

  ```python



  resource.cfn_options.creation_policy = CfnCreationPolicy(
      resource_signal=CfnResourceSignal(
          count=3,
          timeout="PR15M"
      )
  )
  ```



  CloudFormation supports [intrinsic functions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html). These functions
  can be accessed from the `Fn` class, which provides type-safe methods for each
  intrinsic function as well as condition expressions:

  ```python





  Fn.base64("SGVsbG8gQ0RLIQo=")


  environment_parameter = CfnParameter(self, "Environment")
  Fn.condition_and(
      
      Fn.condition_equals("Production", environment_parameter),
      
      Fn.condition_not(Fn.condition_equals("us-east-1", Aws.REGION)))


  Fn.to_json_string(my_object_or_array)


  Fn.len(Fn.split(",", my_array))
  ```

  When working with deploy-time values (those for which `Token.isUnresolved`
  returns `true`), idiomatic conditionals from the programming language cannot be
  used (the value will not be known until deployment time). When conditional logic
  needs to be expressed with un-resolved values, it is necessary to use
  CloudFormation conditions by means of the `CfnCondition` class:

  ```python
  environment_parameter = CfnParameter(self, "Environment")
  is_prod = CfnCondition(self, "IsProduction",
      expression=Fn.condition_equals("Production", environment_parameter)
  )


  stage = Fn.condition_if(is_prod.logical_id, "Beta", "Prod").to_string()



  bucket = s3.Bucket(self, "Bucket")
  cfn_bucket = my_bucket.node.default_child
  cfn_bucket.cfn_options.condition = is_prod
  ```



  CloudFormation [mappings](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/mappings-section-structure.html) are created and queried using the
  `CfnMappings` class:

  ```python
  region_table = CfnMapping(self, "RegionTable",
      mapping={
          "us-east-1": {
              "region_name": "US East (N. Virginia)"
          },
          "us-east-2": {
              "region_name": "US East (Ohio)"
          }
      }
  )

  region_table.find_in_map(Aws.REGION, "regionName")
  ```

  This will yield the following template:

  ```yaml
  Mappings:
    RegionTable:
      us-east-1:
        regionName: US East (N. Virginia)
      us-east-2:
        regionName: US East (Ohio)
  ```

  Mappings can also be synthesized "lazily"; lazy mappings will only render a "Mappings"
  section in the synthesized CloudFormation template if some `findInMap` call is unable to
  immediately return a concrete value due to one or both of the keys being unresolved tokens
  (some value only available at deploy-time).

  For example, the following code will not produce anything in the "Mappings" section. The
  call to `findInMap` will be able to resolve the value during synthesis and simply return
  `'US East (Ohio)'`.

  ```python
  region_table = CfnMapping(self, "RegionTable",
      mapping={
          "us-east-1": {
              "region_name": "US East (N. Virginia)"
          },
          "us-east-2": {
              "region_name": "US East (Ohio)"
          }
      },
      lazy=True
  )

  region_table.find_in_map("us-east-2", "regionName")
  ```

  On the other hand, the following code will produce the "Mappings" section shown above,
  since the top-level key is an unresolved token. The call to `findInMap` will return a token that resolves to
  `{ "Fn::FindInMap": [ "RegionTable", { "Ref": "AWS::Region" }, "regionName" ] }`.

  ```python



  region_table.find_in_map(Aws.REGION, "regionName")
  ```

  An optional default value can also be passed to `findInMap`. If either key is not found in the map and the mapping is lazy, `findInMap` will return the default value and not render the mapping.
  If the mapping is not lazy or either key is an unresolved token, the call to `findInMap` will return a token that resolves to
  `{ "Fn::FindInMap": [ "MapName", "TopLevelKey", "SecondLevelKey", { "DefaultValue": "DefaultValue" } ] }`, and the mapping will be rendered.
  Note that the `AWS::LanguageExtentions` transform is added to enable the default value functionality.

  For example, the following code will again not produce anything in the "Mappings" section. The
  call to `findInMap` will be able to resolve the value during synthesis and simply return
  `'Region not found'`.

  ```python
  region_table = CfnMapping(self, "RegionTable",
      mapping={
          "us-east-1": {
              "region_name": "US East (N. Virginia)"
          },
          "us-east-2": {
              "region_name": "US East (Ohio)"
          }
      },
      lazy=True
  )

  region_table.find_in_map("us-west-1", "regionName", "Region not found")
  ```



  CloudFormation supports [dynamically resolving](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html) values
  for SSM parameters (including secure strings) and Secrets Manager. Encoding such
  references is done using the `CfnDynamicReference` class:

  ```python
  CfnDynamicReference(CfnDynamicReferenceService.SECRETS_MANAGER, "secret-id:secret-string:json-key:version-stage:version-id")
  ```



  CloudFormation templates support a number of options, including which Macros or
  [Transforms](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html) to use when deploying the stack. Those can be
  configured using the `stack.templateOptions` property:

  ```python
  stack = Stack(app, "StackName")

  stack.template_options.description = "This will appear in the AWS console"
  stack.template_options.transforms = ["AWS::Serverless-2016-10-31"]
  stack.template_options.metadata = {
      "metadata_key": "MetadataValue"
  }
  ```



  The `CfnResource` class allows emitting arbitrary entries in the
  [Resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html) section of the CloudFormation template.

  ```python
  CfnResource(self, "ResourceId",
      type="AWS::S3::Bucket",
      properties={
          "BucketName": "amzn-s3-demo-bucket"
      }
  )
  ```

  As for any other resource, the logical ID in the CloudFormation template will be
  generated by the AWS CDK, but the type and properties will be copied verbatim in
  the synthesized template.



  When migrating a CloudFormation stack to the AWS CDK, it can be useful to
  include fragments of an existing template verbatim in the synthesized template.
  This can be achieved using the `CfnInclude` class.

  ```python
  CfnInclude(self, "ID",
      template={
          "Resources": {
              "Bucket": {
                  "Type": "AWS::S3::Bucket",
                  "Properties": {
                      "BucketName": "amzn-s3-demo-bucket"
                  }
              }
          }
      }
  )
  ```



  You can prevent a stack from being accidentally deleted by enabling termination
  protection on the stack. If a user attempts to delete a stack with termination
  protection enabled, the deletion fails and the stack--including its status--remains
  unchanged. Enabling or disabling termination protection on a stack sets it for any
  nested stacks belonging to that stack as well. You can enable termination protection
  on a stack by setting the `terminationProtection` prop to `true`.

  ```python
  stack = Stack(app, "StackName",
      termination_protection=True
  )
  ```

  You can also set termination protection with the setter after you've instantiated the stack.

  ```python
  stack = Stack(app, "StackName")
  stack.termination_protection = True
  ```

  By default, termination protection is disabled.



  You can add a description of the stack in the same way as `StackProps`.

  ```python
  stack = Stack(app, "StackName",
      description="This is a description."
  )
  ```



  `CfnJson` allows you to postpone the resolution of a JSON blob from
  deployment-time. This is useful in cases where the CloudFormation JSON template
  cannot express a certain value.

  A common example is to use `CfnJson` in order to render a JSON map which needs
  to use intrinsic functions in keys. Since JSON map keys must be strings, it is
  impossible to use intrinsics in keys and `CfnJson` can help.

  The following example defines an IAM role which can only be assumed by
  principals that are tagged with a specific tag.

  ```python
  tag_param = CfnParameter(self, "TagName")

  string_equals = CfnJson(self, "ConditionJson",
      value={
          "f"aws:PrincipalTag/{tagParam.valueAsString}"": True
      }
  )

  principal = iam.AccountRootPrincipal().with_conditions({
      "StringEquals": string_equals
  })

  iam.Role(self, "MyRole", assumed_by=principal)
  ```

  **Explanation**: since in this example we pass the tag name through a parameter, it
  can only be resolved during deployment. The resolved value can be represented in
  the template through a `{ "Ref": "TagName" }`. However, since we want to use
  this value inside a [`aws:PrincipalTag/TAG-NAME`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-principaltag)
  IAM operator, we need it in the *key* of a `StringEquals` condition. JSON keys
  *must be* strings, so to circumvent this limitation, we use `CfnJson`
  to "delay" the rendition of this template section to deploy-time. This means
  that the value of `StringEquals` in the template will be `{ "Fn::GetAtt": [ "ConditionJson", "Value" ] }`, and will only "expand" to the operator we synthesized during deployment.



  When deploying to AWS CloudFormation, it needs to keep in check the amount of resources being added inside a Stack. Currently it's possible to check the limits in the [AWS CloudFormation quotas](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) page.

  It's possible to synthesize the project with more Resources than the allowed (or even reduce the number of Resources).

  Set the context key `@aws-cdk/core:stackResourceLimit` with the proper value, being 0 for disable the limit of resources.



  The AWS CloudFormation templates generated by CDK include indentation by default.
  Indentation makes the templates more readable, but also increases their size,
  and CloudFormation templates cannot exceed 1MB.

  It's possible to reduce the size of your templates by suppressing indentation.

  To do this for all templates, set the context key `@aws-cdk/core:suppressTemplateIndentation` to `true`.

  To do this for a specific stack, add a `suppressTemplateIndentation: true` property to the
  stack's `StackProps` parameter. You can also set this property to `false` to override
  the context key setting.



  [Context values](https://docs.aws.amazon.com/cdk/v2/guide/context.html) are key-value pairs that can be associated with an app, stack, or construct.
  One common use case for context is to use it for enabling/disabling [feature flags](https://docs.aws.amazon.com/cdk/v2/guide/featureflags.html). There are several places
  where context can be specified. They are listed below in the order they are evaluated (items at the
  top take precedence over those below).

  * The `node.setContext()` method
  * The `postCliContext` prop when you create an `App`
  * The CLI via the `--context` CLI argument
  * The `cdk.json` file via the `context` key:
  * The `cdk.context.json` file:
  * The `~/.cdk.json` file via the `context` key:
  * The `context` prop when you create an `App`



  ```python
  App(
      context={
          "@aws-cdk/core:newStyleStackSynthesis": True
      }
  )
  ```

  ```python
  app = App()
  app.node.set_context("@aws-cdk/core:newStyleStackSynthesis", True)
  ```

  ```python
  App(
      post_cli_context={
          "@aws-cdk/core:newStyleStackSynthesis": True
      }
  )
  ```

  ```console
  cdk synth --context @aws-cdk/core:newStyleStackSynthesis=true
  ```

  *cdk.json*

  ```json
  {
    "context": {
      "@aws-cdk/core:newStyleStackSynthesis": true
    }
  }
  ```

  *cdk.context.json*

  ```json
  {
    "@aws-cdk/core:newStyleStackSynthesis": true
  }
  ```

  *~/.cdk.json*

  ```json
  {
    "context": {
      "@aws-cdk/core:newStyleStackSynthesis": true
    }
  }
  ```



  It is possible to apply an [IAM permissions boundary](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html)
  to all roles within a specific construct scope. The most common use case would
  be to apply a permissions boundary at the `Stage` level.

  ```python
  prod_stage = Stage(app, "ProdStage",
      permissions_boundary=PermissionsBoundary.from_name("cdk-${Qualifier}-PermissionsBoundary")
  )
  ```

  Any IAM Roles or Users created within this Stage will have the default
  permissions boundary attached.

  For more details see the [Permissions Boundary](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam-readme.html#permissions-boundaries) section in the IAM guide.



  If you or your organization use (or would like to use) any policy validation tool, such as
  [CloudFormation
  Guard](https://docs.aws.amazon.com/cfn-guard/latest/ug/what-is-guard.html) or
  [OPA](https://www.openpolicyagent.org/), to define constraints on your
  CloudFormation template, you can incorporate them into the CDK application.
  By using the appropriate plugin, you can make the CDK application check the
  generated CloudFormation templates against your policies immediately after
  synthesis. If there are any violations, the synthesis will fail and a report
  will be printed to the console or to a file (see below).

  > **Note**
  > This feature is considered experimental, and both the plugin API and the
  > format of the validation report are subject to change in the future.



  To use one or more validation plugins in your application, use the
  `policyValidationBeta1` property of `Stage`:

  ```python

  app = App(
      policy_validation_beta1=[
          
          ThirdPartyPluginX(),
          ThirdPartyPluginY()
      ]
  )


  prod_stage = Stage(app, "ProdStage",
      policy_validation_beta1=[
          ThirdPartyPluginX()
      ]
  )
  ```

  Immediately after synthesis, all plugins registered this way will be invoked to
  validate all the templates generated in the scope you defined. In particular, if
  you register the templates in the `App` object, all templates will be subject to
  validation.

  > **Warning**
  > Other than modifying the cloud assembly, plugins can do anything that your CDK
  > application can. They can read data from the filesystem, access the network
  > etc. It's your responsibility as the consumer of a plugin to verify that it is
  > secure to use.

  By default, the report will be printed in a human readable format. If you want a
  report in JSON format, enable it using the `@aws-cdk/core:validationReportJson`
  context passing it directly to the application:

  ```python
  app = App(
      context={"@aws-cdk/core:validationReportJson": True}
  )
  ```

  Alternatively, you can set this context key-value pair using the `cdk.json` or
  `cdk.context.json` files in your project directory (see
  [Runtime context](https://docs.aws.amazon.com/cdk/v2/guide/context.html)).

  If you choose the JSON format, the CDK will print the policy validation report
  to a file called `policy-validation-report.json` in the cloud assembly
  directory. For the default, human-readable format, the report will be printed to
  the standard output.



  The communication protocol between the CDK core module and your policy tool is
  defined by the `IPolicyValidationPluginBeta1` interface. To create a new plugin you must
  write a class that implements this interface. There are two things you need to
  implement: the plugin name (by overriding the `name` property), and the
  `validate()` method.

  The framework will call `validate()`, passing an `IPolicyValidationContextBeta1` object.
  The location of the templates to be validated is given by `templatePaths`. The
  plugin should return an instance of `PolicyValidationPluginReportBeta1`. This object
  represents the report that the user wil receive at the end of the synthesis.

  ```python
  @jsii.implements(IPolicyValidationPluginBeta1)
  class MyPlugin:

      def validate(self, context):
          

          
          
          return PolicyValidationPluginReportBeta1(
              success=False,
              violations=[PolicyViolationBeta1(
                  rule_name="CKV_AWS_117",
                  description="Ensure that AWS Lambda function is configured inside a VPC",
                  fix="https://docs.bridgecrew.io/docs/ensure-that-aws-lambda-function-is-configured-inside-a-vpc-1",
                  violating_resources=[PolicyViolatingResourceBeta1(
                      resource_logical_id="MyFunction3BAA72D1",
                      template_path="/home/johndoe/myapp/cdk.out/MyService.template.json",
                      locations=["Properties/VpcConfig"]
                  )]
              )]
          )
  ```

  In addition to the name, plugins may optionally report their version (`version`
  property ) and a list of IDs of the rules they are going to evaluate (`ruleIds`
  property).

  Note that plugins are not allowed to modify anything in the cloud assembly. Any
  attempt to do so will result in synthesis failure.

  If your plugin depends on an external tool, keep in mind that some developers may
  not have that tool installed in their workstations yet. To minimize friction, we
  highly recommend that you provide some installation script along with your
  plugin package, to automate the whole process. Better yet, run that script as
  part of the installation of your package. With `npm`, for example, you can run
  add it to the `postinstall`
  [script](https://docs.npmjs.com/cli/v9/using-npm/scripts) in the `package.json`
  file.



  Construct authors can add annotations to constructs to report at three different
  levels: `ERROR`, `WARN`, `INFO`.

  Typically warnings are added for things that are important for the user to be
  aware of, but will not cause deployment errors in all cases. Some common
  scenarios are (non-exhaustive list):

  * Warn when the user needs to take a manual action, e.g. IAM policy should be
    added to an referenced resource.
  * Warn if the user configuration might not follow best practices (but is still
    valid)
  * Warn if the user is using a deprecated API



  If you would like to run with `--strict` mode enabled (warnings will throw
  errors) it is possible to `acknowledge` warnings to make the warning go away.

  For example, if > 10 IAM managed policies are added to an IAM Group, a warning
  will be created:

  ```text
  IAM:Group:MaxPoliciesExceeded: You added 11 to IAM Group my-group. The maximum number of managed policies attached to an IAM group is 10.
  ```

  If you have requested a [quota increase](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entities)
  you may have the ability to add > 10 managed policies which means that this
  warning does not apply to you. You can acknowledge this by `acknowledging` the
  warning by the `id`.

  ```python
  Annotations.of(self).acknowledge_warning("IAM:Group:MaxPoliciesExceeded", "Account has quota increased to 20")
  ```

  <!--END CORE DOCUMENTATION-->


pkgId: 57c19983472015ddf5c7f504282ee4e848abbd53124f644e2b94744d18dd4e64
name: python-aws-cdk.app-staging-synthesizer-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.app-staging-synthesizer-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.app-staging-synthesizer-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.app-staging-synthesizer-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  This library includes constructs aimed at replacing the current model of bootstrapping and providing
  greater control of the bootstrap experience to the CDK user. The important constructs in this library
  are as follows:
  * the `IStagingResources` interface: a framework for an app-level bootstrap stack that handles
    file assets and docker assets.
  * the `DefaultStagingStack`, which is a works-out-of-the-box implementation of the `IStagingResources`
    interface.
  * the `AppStagingSynthesizer`, a new CDK synthesizer that will synthesize CDK applications with
    the staging resources provided.
  > As this library is `experimental`, there are features that are not yet implemented. Please look
  > at the list of [Known Limitations](#known-limitations) before getting started.
  To get started, update your CDK App with a new `defaultStackSynthesizer`:
  ```python
  from aws_cdk.aws_s3 import BucketEncryption
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.default_resources(
          app_id="my-app-id",  # put a unique id here
          staging_bucket_encryption=BucketEncryption.S3_MANAGED
      )
  )
  ```
  This will introduce a `DefaultStagingStack` in your CDK App and staging assets of your App
  will live in the resources from that stack rather than the CDK Bootstrap stack.
  If you are migrating from a different version of synthesis your updated CDK App will target
  the resources in the `DefaultStagingStack` and no longer be tied to the bootstrapped resources
  in your account.

  In our default bootstrapping process, when you run `cdk bootstrap aws://<account>/<region>`, the following
  resources are created:
  * It creates Roles to assume for cross-account deployments and for Pipeline deployments;
  * It creates staging resources: a global S3 bucket and global ECR repository to hold CDK assets;
  * It creates Roles to write to the S3 bucket and ECR repository;
  Because the bootstrapping resources include regional resources, you need to bootstrap
  every region you plan to deploy to individually. All assets of all CDK apps deploying
  to that account and region will be written to the single S3 Bucket and ECR repository.
  By using the synthesizer in this library, instead of the
  `DefaultStackSynthesizer`, a different set of staging resources will be created
  for every CDK application, and they will be created automatically as part of a
  regular deployment, in a separate Stack that is deployed before your application
  Stacks. The staging resources will be one S3 bucket, and *one ECR repository per
  image*, and Roles necessary to access those buckets and ECR repositories. The
  Roles from the default bootstrap stack are still used (though their use can be
  turned off).
  This has the following advantages:
  * Because staging resources are now application-specific, they can be fully cleaned up when you clean up
    the application.
  * Because there is now one ECR repository per image instead of one ECR repository for all images, it is
    possible to effectively use ECR life cycle rules (for example, retain only the most recent 5 images)
    to cut down on storage costs.
  * Resources between separate CDK Apps are separated so they can be cleaned up and lifecycle
    controlled individually.
  * Because the only shared bootstrapping resources required are Roles, which are global resources,
    you now only need to bootstrap every account in one Region (instead of every Region). This makes it
    easier to do with CloudFormation StackSets.
  For the deployment roles, this synthesizer still uses the Roles from the default
  bootstrap stack, and nothing else. The staging resources from that bootstrap
  stack will be unused. You can customize the template to remove those resources
  if you prefer.  In the future, we will provide a bootstrap stack template with
  only those Roles, specifically for use with this synthesizer.

  The most common use case will be to use the built-in default resources. In this scenario, the
  synthesizer will create a new Staging Stack in each environment the CDK App is deployed to store
  its staging resources. To use this kind of synthesizer, use `AppStagingSynthesizer.defaultResources()`.
  ```python
  from aws_cdk.aws_s3 import BucketEncryption
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.default_resources(
          app_id="my-app-id",
          staging_bucket_encryption=BucketEncryption.S3_MANAGED,
          
          
          deployment_identities=DeploymentIdentities.default_bootstrap_roles(bootstrap_region="us-east-1")
      )
  )
  ```
  Every CDK App that uses the `DefaultStagingStack` must include an `appId`. This should
  be an identifier unique to the app and is used to differentiate staging resources associated
  with the app.

  The Default Staging Stack includes all the staging resources necessary for CDK Assets. The below example
  is of a CDK App using the `AppStagingSynthesizer` and creating a file asset for the Lambda Function
  source code. As part of the `DefaultStagingStack`, an S3 bucket and IAM role will be created that will be
  used to upload the asset to S3.
  ```python
  from aws_cdk.aws_s3 import BucketEncryption
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.default_resources(
          app_id="my-app-id",
          staging_bucket_encryption=BucketEncryption.S3_MANAGED
      )
  )
  stack = Stack(app, "my-stack")
  lambda_.Function(stack, "lambda",
      code=lambda_.AssetCode.from_asset(path.join(__dirname, "assets")),
      handler="index.handler",
      runtime=lambda_.Runtime.PYTHON_3_9
  )
  app.synth()
  ```

  You can customize some or all of the roles you'd like to use in the synthesizer as well,
  if all you need is to supply custom roles (and not change anything else in the `DefaultStagingStack`):
  ```python
  from aws_cdk.aws_s3 import BucketEncryption
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.default_resources(
          app_id="my-app-id",
          staging_bucket_encryption=BucketEncryption.S3_MANAGED,
          deployment_identities=DeploymentIdentities.specify_roles(
              cloud_formation_execution_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Execute"),
              deployment_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Deploy"),
              lookup_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Lookup")
          )
      )
  )
  ```
  Or, you can ask to use the CLI credentials that exist at deploy-time.
  These credentials must have the ability to perform CloudFormation calls,
  lookup resources in your account, and perform CloudFormation deployment.
  For a full list of what is necessary, see `LookupRole`, `DeploymentActionRole`,
  and `CloudFormationExecutionRole` in the
  [bootstrap template](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml).
  ```python
  from aws_cdk.aws_s3 import BucketEncryption
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.default_resources(
          app_id="my-app-id",
          staging_bucket_encryption=BucketEncryption.S3_MANAGED,
          deployment_identities=DeploymentIdentities.cli_credentials()
      )
  )
  ```
  The default staging stack will create roles to publish to the S3 bucket and ECR repositories,
  assumable by the deployment role. You can also specify an existing IAM role for the
  `fileAssetPublishingRole` or `imageAssetPublishingRole`:
  ```python
  from aws_cdk.aws_s3 import BucketEncryption
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.default_resources(
          app_id="my-app-id",
          staging_bucket_encryption=BucketEncryption.S3_MANAGED,
          file_asset_publishing_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/S3Access"),
          image_asset_publishing_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/ECRAccess")
      )
  )
  ```

  There are two types of assets:
  * Assets used only during deployment. These are used to hand off a large piece of data to another
    service, that will make a private copy of that data. After deployment, the asset is only necessary for
    a potential future rollback.
  * Assets accessed throughout the running life time of the application.
  Examples of assets that are only used at deploy time are CloudFormation Templates and Lambda Code
  bundles. Examples of assets accessed throughout the life time of the application are script files
  downloaded to run in a CodeBuild Project, or on EC2 instance startup. ECR images are always application
  life-time assets. S3 deploy time assets are stored with a `deploy-time/` prefix, and a lifecycle rule will collect them after a configurable number of days.
  Lambda assets are by default marked as deploy time assets:
  ```python

  lambda_.Function(stack, "lambda",
      code=lambda_.AssetCode.from_asset(path.join(__dirname, "assets")),  # lambda marks deployTime = true
      handler="index.handler",
      runtime=lambda_.Runtime.PYTHON_3_9
  )
  ```
  Or, if you want to create your own deploy time asset:
  ```python
  from aws_cdk.aws_s3_assets import Asset

  asset = Asset(stack, "deploy-time-asset",
      deploy_time=True,
      path=path.join(__dirname, "deploy-time-asset")
  )
  ```
  By default, we store deploy time assets for 30 days, but you can change this number by specifying
  `deployTimeFileAssetLifetime`. The number you specify here is how long you will be able to roll back
  to a previous version of an application just by doing a CloudFormation deployment with the old
  template, without rebuilding and republishing assets.
  ```python
  from aws_cdk.aws_s3 import BucketEncryption
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.default_resources(
          app_id="my-app-id",
          staging_bucket_encryption=BucketEncryption.S3_MANAGED,
          deploy_time_file_asset_lifetime=Duration.days(100)
      )
  )
  ```

  By default, we store a maximum of 3 revisions of a particular docker image asset. This allows
  for smooth faciliation of rollback scenarios where we may reference previous versions of an
  image. When more than 3 revisions of an asset exist in the ECR repository, the oldest one is
  purged.
  To change the number of revisions stored, use `imageAssetVersionCount`:
  ```python
  from aws_cdk.aws_s3 import BucketEncryption
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.default_resources(
          app_id="my-app-id",
          staging_bucket_encryption=BucketEncryption.S3_MANAGED,
          image_asset_version_count=10
      )
  )
  ```

  By default, the staging resources will be cleaned up on stack deletion. That means that the
  S3 Bucket and ECR Repositories are set to `RemovalPolicy.DESTROY` and have `autoDeleteObjects`
  or `emptyOnDelete` turned on. This creates custom resources under the hood to facilitate
  cleanup. To turn this off, specify `autoDeleteStagingAssets: false`.
  ```python
  from aws_cdk.aws_s3 import BucketEncryption
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.default_resources(
          app_id="my-app-id",
          staging_bucket_encryption=BucketEncryption.S3_MANAGED,
          auto_delete_staging_assets=False
      )
  )
  ```

  You must explicitly specify the encryption type for the staging bucket via the `stagingBucketEncryption` property. In
  future versions of this package, the default will be `BucketEncryption.S3_MANAGED`.
  In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost
  $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module
  we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3
  managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required.
  If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to
  `BucketEncryption.KMS`. If you are creating a new staging bucket, you can set this property to
  `BucketEncryption.S3_MANAGED` to avoid the cost of a KMS key.
  You can learn more about choosing a bucket encryption type in the
  [S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html).

  If you want to customize some behavior that is not configurable via properties,
  you can implement your own class that implements `IStagingResources`. To get a head start,
  you can subclass `DefaultStagingStack`.
  ```python
  class CustomStagingStack(DefaultStagingStack):
      pass
  ```
  Or you can roll your own staging resources from scratch, as long as it implements `IStagingResources`.
  ```python
  @jsii.implements(IStagingResources)
  class CustomStagingStack(Stack):
      def __init__(self, scope, id, *, description=None, env=None, stackName=None, tags=None, notificationArns=None, synthesizer=None, terminationProtection=None, analyticsReporting=None, crossRegionReferences=None, permissionsBoundary=None, suppressTemplateIndentation=None):
          super().__init__(scope, id, description=description, env=env, stackName=stackName, tags=tags, notificationArns=notificationArns, synthesizer=synthesizer, terminationProtection=terminationProtection, analyticsReporting=analyticsReporting, crossRegionReferences=crossRegionReferences, permissionsBoundary=permissionsBoundary, suppressTemplateIndentation=suppressTemplateIndentation)
      def add_file(self, *, sourceHash, executable=None, fileName=None, packaging=None, deployTime=None):
          return FileStagingLocation(
              bucket_name="amzn-s3-demo-bucket",
              assume_role_arn="myArn",
              dependency_stack=self
          )
      def add_docker_image(self, *, sourceHash, executable=None, directoryName=None, dockerBuildArgs=None, dockerBuildSecrets=None, dockerBuildSsh=None, dockerBuildTarget=None, dockerFile=None, repositoryName=None, networkMode=None, platform=None, dockerOutputs=None, assetName=None, dockerCacheFrom=None, dockerCacheTo=None, dockerCacheDisabled=None):
          return ImageStagingLocation(
              repo_name="myRepo",
              assume_role_arn="myArn",
              dependency_stack=self
          )
  ```
  Using your custom staging resources means implementing a `CustomFactory` class and calling the
  `AppStagingSynthesizer.customFactory()` static method. This has the benefit of providing a
  custom Staging Stack that can be created in every environment the CDK App is deployed to.
  ```python
  @jsii.implements(IStagingResourcesFactory)
  class CustomFactory:
      def obtain_staging_resources(self, stack, *, environmentString, deployRoleArn=None, qualifier):
          my_app = App.of(stack)
          return CustomStagingStack(my_app, f"CustomStagingStack-{context.environmentString}")
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.custom_factory(
          factory=CustomFactory(),
          once_per_env=True
      )
  )
  ```

  Use `AppStagingSynthesizer.customResources()` to supply an existing stack as the Staging Stack.
  Make sure that the custom stack you provide implements `IStagingResources`.
  ```python
  resource_app = App()
  resources = CustomStagingStack(resource_app, "CustomStagingStack")
  app = App(
      default_stack_synthesizer=AppStagingSynthesizer.custom_resources(
          resources=resources
      )
  )
  ```

  Since this module is experimental, there are some known limitations:
  * Currently this module does not support CDK Pipelines. You must deploy CDK Apps using this
    synthesizer via `cdk deploy`. Please upvote [this issue](https://github.com/aws/aws-cdk/issues/26118)
    to indicate you want this.
  * This synthesizer only needs a bootstrap stack with Roles, without staging resources. We
    haven't written such a bootstrap stack yet; at the moment you can use the existing modern
    bootstrap stack, the staging resources in them will just go unused. You can customize the
    template to remove them if desired.
  * Due to limitations on the CloudFormation template size, CDK Applications can have
    at most 20 independent ECR images. Please upvote [this issue](https://github.com/aws/aws-cdk/issues/26119)
    if you need more than this.


pkgId: f91685c6f79ee41ffa3150ff1a9896bfefb58cf35cf5bd24215dbdbbed1a659b
name: python-aws-cdk.asset-awscli-v2-help
arch: noarch
version: 2.0.132
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.asset-awscli-v2
url: https://github.com/cdklabs/awscdk-asset-awscli#readme
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.asset-awscli-v2-2.0.132-1.src.rpm
location_href: Packages/python-aws-cdk.asset-awscli-v2-help-2.0.132-1.noarch.rpm
checksum_type: sha256
description:
  > This library is currently under development. Do not use!
  <!--END STABILITY BANNER-->
  This module exports a single class called `AwsCliAsset` which is an `s3_assets.Asset` that bundles the AWS CLI v2.
  Usage:
  ```python

  from aws_cdk.asset_awscli_v2 import AwsCliAsset
  import aws_cdk.aws_lambda as lambda_
  import aws_cdk.aws_s3_assets as s3_assets
  from aws_cdk import FileSystem

  awscli = AwsCliAsset(self, "AwsCliCode")
  fn.add_layers(lambda_.LayerVersion(self, "AwsCliLayer",
      code=lambda_.Code.from_bucket(awscli.bucket, awscli.s3_object_key)
  ))
  ```
  The CLI will be installed under `/opt/awscli/aws`.


pkgId: d4c431cff0eee2eb63cdde1cf4b1bb23f10a4e025463cc4f2931fa28aa1769a7
name: python-aws-cdk.aws-amplify-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-amplify-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-amplify-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-amplify-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  The AWS Amplify Console provides a Git-based workflow for deploying and hosting fullstack serverless web applications. A fullstack serverless app consists of a backend built with cloud resources such as GraphQL or REST APIs, file and data storage, and a frontend built with single page application frameworks such as React, Angular, Vue, or Gatsby.

  To set up an Amplify Console app, define an `App`:
  ```python
  import aws_cdk.aws_codebuild as codebuild
  amplify_app = amplify.App(self, "MyApp",
      source_code_provider=amplify.GitHubSourceCodeProvider(
          owner="<user>",
          repository="<repo>",
          oauth_token=SecretValue.secrets_manager("my-github-token")
      ),
      build_spec=codebuild.BuildSpec.from_object_to_yaml({
          
          "version": "1.0",
          "frontend": {
              "phases": {
                  "pre_build": {
                      "commands": ["yarn"
                      ]
                  },
                  "build": {
                      "commands": ["yarn build"
                      ]
                  }
              },
              "artifacts": {
                  "base_directory": "public",
                  "files": -"**/*"
              }
          }
      })
  )
  ```
  To connect your `App` to GitLab, use the `GitLabSourceCodeProvider`:
  ```python
  amplify_app = amplify.App(self, "MyApp",
      source_code_provider=amplify.GitLabSourceCodeProvider(
          owner="<user>",
          repository="<repo>",
          oauth_token=SecretValue.secrets_manager("my-gitlab-token")
      )
  )
  ```
  To connect your `App` to CodeCommit, use the `CodeCommitSourceCodeProvider`:
  ```python
  import aws_cdk.aws_codecommit as codecommit
  repository = codecommit.Repository(self, "Repo",
      repository_name="my-repo"
  )
  amplify_app = amplify.App(self, "App",
      source_code_provider=amplify.CodeCommitSourceCodeProvider(repository=repository)
  )
  ```
  The IAM role associated with the `App` will automatically be granted the permission
  to pull the CodeCommit repository.
  Add branches:
  ```python

  main = amplify_app.add_branch("main") # `id` will be used as repo branch name
  dev = amplify_app.add_branch("dev",
      performance_mode=True
  )
  dev.add_environment("STAGE", "dev")
  ```
  Auto build and pull request preview are enabled by default.
  Add custom rules for redirection:
  ```python

  amplify_app.add_custom_rule({
      "source": "/docs/specific-filename.html",
      "target": "/documents/different-filename.html",
      "status": amplify.RedirectStatus.TEMPORARY_REDIRECT
  })
  ```
  When working with a single page application (SPA), use the
  `CustomRule.SINGLE_PAGE_APPLICATION_REDIRECT` to set up a 200
  rewrite for all files to `index.html` except for the following
  file extensions: css, gif, ico, jpg, js, png, txt, svg, woff,
  ttf, map, json, webmanifest.
  ```python

  my_single_page_app.add_custom_rule(amplify.CustomRule.SINGLE_PAGE_APPLICATION_REDIRECT)
  ```
  Add a domain and map sub domains to branches:
  ```python



  domain = amplify_app.add_domain("example.com",
      enable_auto_subdomain=True,  # in case subdomains should be auto registered for branches
      auto_subdomain_creation_patterns=["*", "pr*"]
  )
  domain.map_root(main) # map main branch to domain root
  domain.map_sub_domain(main, "www")
  domain.map_sub_domain(dev)
  ```
  To specify a custom certificate for your custom domain use the `customCertificate` property:
  ```python


  domain = amplify_app.add_domain("example.com",
      custom_certificate=custom_certificate
  )
  ```

  Password protect the app with basic auth by specifying the `basicAuth` prop.
  Use `BasicAuth.fromCredentials` when referencing an existing secret:
  ```python
  amplify_app = amplify.App(self, "MyApp",
      source_code_provider=amplify.GitHubSourceCodeProvider(
          owner="<user>",
          repository="<repo>",
          oauth_token=SecretValue.secrets_manager("my-github-token")
      ),
      basic_auth=amplify.BasicAuth.from_credentials("username", SecretValue.secrets_manager("my-github-token"))
  )
  ```
  Use `BasicAuth.fromGeneratedPassword` to generate a password in Secrets Manager:
  ```python
  amplify_app = amplify.App(self, "MyApp",
      source_code_provider=amplify.GitHubSourceCodeProvider(
          owner="<user>",
          repository="<repo>",
          oauth_token=SecretValue.secrets_manager("my-github-token")
      ),
      basic_auth=amplify.BasicAuth.from_generated_password("username")
  )
  ```
  Basic auth can be added to specific branches:
  ```python

  amplify_app.add_branch("feature/next",
      basic_auth=amplify.BasicAuth.from_generated_password("username")
  )
  ```

  Use the `autoBranchCreation` and `autoBranchDeletion` props to control creation/deletion
  of branches:
  ```python
  amplify_app = amplify.App(self, "MyApp",
      source_code_provider=amplify.GitHubSourceCodeProvider(
          owner="<user>",
          repository="<repo>",
          oauth_token=SecretValue.secrets_manager("my-github-token")
      ),
      auto_branch_creation=amplify.AutoBranchCreation( # Automatically connect branches that match a pattern set
          patterns=["feature/*", "test/*"]),
      auto_branch_deletion=True
  )
  ```

  Use the `customResponseHeaders` prop to configure custom response headers for an Amplify app:
  ```python
  amplify_app = amplify.App(self, "App",
      source_code_provider=amplify.GitHubSourceCodeProvider(
          owner="<user>",
          repository="<repo>",
          oauth_token=SecretValue.secrets_manager("my-github-token")
      ),
      custom_response_headers=[amplify.CustomResponseHeader(
          pattern="*.json",
          headers={
              "custom-header-name-1": "custom-header-value-1",
              "custom-header-name-2": "custom-header-value-2"
          }
      ), amplify.CustomResponseHeader(
          pattern="/path/*",
          headers={
              "custom-header-name-1": "custom-header-value-2"
          }
      )
      ]
  )
  ```

  Setting the `platform` field on the Amplify `App` construct can be used to control whether the app will host only static assets or server side rendered assets in addition to static. By default, the value is set to `WEB` (static only), however, server side rendering can be turned on by setting to `WEB_COMPUTE` as follows:
  ```python
  amplify_app = amplify.App(self, "MyApp",
      platform=amplify.Platform.WEB_COMPUTE
  )
  ```

  Amplify uses Amazon CloudFront to manage the caching configuration for your hosted applications. A cache configuration is applied to each app to optimize for the best performance.
  Setting the `cacheConfigType` field on the Amplify `App` construct can be used to control cache configguration. By default, the value is set to `AMPLIFY_MANAGED`. If you want to exclude all cookies from the cache key, set `AMPLIFY_MANAGED_NO_COOKIES`.
  For more information, see [Managing the cache configuration for an app](https://docs.aws.amazon.com/amplify/latest/userguide/caching.html).
  ```python
  amplify_app = amplify.App(self, "MyApp",
      cache_config_type=amplify.CacheConfigType.AMPLIFY_MANAGED_NO_COOKIES
  )
  ```

  `sourceCodeProvider` is optional; when this is not specified the Amplify app can be deployed to using `.zip` packages. The `asset` property can be used to deploy S3 assets to Amplify as part of the CDK:
  ```python
  import aws_cdk.aws_s3_assets as assets


  branch = amplify_app.add_branch("dev", asset=asset)
  ```


pkgId: 942dfbe8f13e4ad3afe9767f5d6cd865c713c428720cd76195d6d72162a30b5b
name: python-aws-cdk.aws-apprunner-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-apprunner-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-apprunner-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-apprunner-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
  ```python
  import aws_cdk.aws_apprunner_alpha as apprunner
  ```

  AWS App Runner is a fully managed service that makes it easy for developers to quickly deploy containerized web applications and APIs, at scale and with no prior infrastructure experience required. Start with your source code or a container image. App Runner automatically builds and deploys the web application and load balances traffic with encryption. App Runner also scales up or down automatically to meet your traffic needs. With App Runner, rather than thinking about servers or scaling, you have more time to focus on your applications.

  The `Service` construct allows you to create AWS App Runner services with `ECR Public`, `ECR` or `Github` with the `source` property in the following scenarios:
  * `Source.fromEcr()` - To define the source repository from `ECR`.
  * `Source.fromEcrPublic()` - To define the source repository from `ECR Public`.
  * `Source.fromGitHub()` - To define the source repository from the `Github repository`.
  * `Source.fromAsset()` - To define the source from local asset directory.
  The `Service` construct implements `IGrantable`.

  To create a `Service` with ECR Public:
  ```python
  apprunner.Service(self, "Service",
      source=apprunner.Source.from_ecr_public(
          image_configuration=apprunner.ImageConfiguration(port=8000),
          image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
      )
  )
  ```

  To create a `Service` from an existing ECR repository:
  ```python
  import aws_cdk.aws_ecr as ecr
  apprunner.Service(self, "Service",
      source=apprunner.Source.from_ecr(
          image_configuration=apprunner.ImageConfiguration(port=80),
          repository=ecr.Repository.from_repository_name(self, "NginxRepository", "nginx"),
          tag_or_digest="latest"
      )
  )
  ```
  To create a `Service` from local docker image asset directory built and pushed to Amazon ECR:
  You can specify whether to enable continuous integration from the source repository with the `autoDeploymentsEnabled` flag.
  ```python
  import aws_cdk.aws_ecr_assets as assets
  image_asset = assets.DockerImageAsset(self, "ImageAssets",
      directory=path.join(__dirname, "docker.assets")
  )
  apprunner.Service(self, "Service",
      source=apprunner.Source.from_asset(
          image_configuration=apprunner.ImageConfiguration(port=8000),
          asset=image_asset
      ),
      auto_deployments_enabled=True
  )
  ```

  To create a `Service` from the GitHub repository, you need to specify an existing App Runner `Connection`.
  See [Managing App Runner connections](https://docs.aws.amazon.com/apprunner/latest/dg/manage-connections.html) for more details.
  ```python
  apprunner.Service(self, "Service",
      source=apprunner.Source.from_git_hub(
          repository_url="https://github.com/aws-containers/hello-app-runner",
          branch="main",
          configuration_source=apprunner.ConfigurationSourceType.REPOSITORY,
          connection=apprunner.GitHubConnection.from_connection_arn("CONNECTION_ARN")
      )
  )
  ```
  Use `codeConfigurationValues` to override configuration values with the `API` configuration source type.
  ```python
  apprunner.Service(self, "Service",
      source=apprunner.Source.from_git_hub(
          repository_url="https://github.com/aws-containers/hello-app-runner",
          branch="main",
          configuration_source=apprunner.ConfigurationSourceType.API,
          code_configuration_values=apprunner.CodeConfigurationValues(
              runtime=apprunner.Runtime.PYTHON_3,
              port="8000",
              start_command="python app.py",
              build_command="yum install -y pycairo && pip install -r requirements.txt"
          ),
          connection=apprunner.GitHubConnection.from_connection_arn("CONNECTION_ARN")
      )
  )
  ```

  You are allowed to define `instanceRole` and `accessRole` for the `Service`.
  `instanceRole` - The IAM role that provides permissions to your App Runner service. These are permissions that
  your code needs when it calls any AWS APIs. If not defined, a new instance role will be generated
  when required.
  To add IAM policy statements to this role, use `addToRolePolicy()`:
  ```python
  import aws_cdk.aws_iam as iam
  service = apprunner.Service(self, "Service",
      source=apprunner.Source.from_ecr_public(
          image_configuration=apprunner.ImageConfiguration(port=8000),
          image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
      )
  )
  service.add_to_role_policy(iam.PolicyStatement(
      effect=iam.Effect.ALLOW,
      actions=["s3:GetObject"],
      resources=["*"]
  ))
  ```
  `accessRole` - The IAM role that grants the App Runner service access to a source repository. It's required for
  ECR image repositories (but not for ECR Public repositories). If not defined, a new access role will be generated
  when required.
  See [App Runner IAM Roles](https://docs.aws.amazon.com/apprunner/latest/dg/security_iam_service-with-iam.html#security_iam_service-with-iam-roles) for more details.

  To associate an App Runner service with a custom Auto Scaling Configuration, define `autoScalingConfiguration` for the service.
  ```python
  auto_scaling_configuration = apprunner.AutoScalingConfiguration(self, "AutoScalingConfiguration",
      auto_scaling_configuration_name="MyAutoScalingConfiguration",
      max_concurrency=150,
      max_size=20,
      min_size=5
  )
  apprunner.Service(self, "DemoService",
      source=apprunner.Source.from_ecr_public(
          image_configuration=apprunner.ImageConfiguration(port=8000),
          image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
      ),
      auto_scaling_configuration=auto_scaling_configuration
  )
  ```

  To associate an App Runner service with a custom VPC, define `vpcConnector` for the service.
  ```python
  import aws_cdk.aws_ec2 as ec2
  vpc = ec2.Vpc(self, "Vpc",
      ip_addresses=ec2.IpAddresses.cidr("10.0.0.0/16")
  )
  vpc_connector = apprunner.VpcConnector(self, "VpcConnector",
      vpc=vpc,
      vpc_subnets=vpc.select_subnets(subnet_type=ec2.SubnetType.PUBLIC),
      vpc_connector_name="MyVpcConnector"
  )
  apprunner.Service(self, "Service",
      source=apprunner.Source.from_ecr_public(
          image_configuration=apprunner.ImageConfiguration(port=8000),
          image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
      ),
      vpc_connector=vpc_connector
  )
  ```

  To make your App Runner service private and only accessible from within a VPC use the `isPubliclyAccessible` property and associate it to a `VpcIngressConnection` resource.
  To set up a `VpcIngressConnection`, specify a VPC, a VPC Interface Endpoint, and the App Runner service.
  Also you must set `isPubliclyAccessible` property in ther `Service` to `false`.
  For more information, see [Enabling Private endpoint for incoming traffic](https://docs.aws.amazon.com/apprunner/latest/dg/network-pl.html).
  ```python
  import aws_cdk.aws_ec2 as ec2

  interface_vpc_endpoint = ec2.InterfaceVpcEndpoint(self, "MyVpcEndpoint",
      vpc=vpc,
      service=ec2.InterfaceVpcEndpointAwsService.APP_RUNNER_REQUESTS,
      private_dns_enabled=False
  )
  service = apprunner.Service(self, "Service",
      source=apprunner.Source.from_ecr_public(
          image_configuration=apprunner.ImageConfiguration(
              port=8000
          ),
          image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
      ),
      is_publicly_accessible=False
  )
  apprunner.VpcIngressConnection(self, "VpcIngressConnection",
      vpc=vpc,
      interface_vpc_endpoint=interface_vpc_endpoint,
      service=service
  )
  ```

  To use dual stack (IPv4 and IPv6) for your incoming public network configuration, set `ipAddressType` to `IpAddressType.DUAL_STACK`.
  ```python
  apprunner.Service(self, "Service",
      source=apprunner.Source.from_ecr_public(
          image_configuration=apprunner.ImageConfiguration(port=8000),
          image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
      ),
      ip_address_type=apprunner.IpAddressType.DUAL_STACK
  )
  ```
  **Note**: Currently, App Runner supports dual stack for only Public endpoint.
  Only IPv4 is supported for Private endpoint.
  If you update a service that's using dual-stack Public endpoint to a Private endpoint,
  your App Runner service will default to support only IPv4 for Private endpoint and fail
  to receive traffic originating from IPv6 endpoint.

  To include environment variables integrated with AWS Secrets Manager, use the `environmentSecrets` attribute.
  You can use the `addSecret` method from the App Runner `Service` class to include secrets from outside the
  service definition.
  ```python
  import aws_cdk.aws_secretsmanager as secretsmanager
  import aws_cdk.aws_ssm as ssm

  secret = secretsmanager.Secret(stack, "Secret")
  parameter = ssm.StringParameter.from_secure_string_parameter_attributes(stack, "Parameter",
      parameter_name="/name",
      version=1
  )
  service = apprunner.Service(stack, "Service",
      source=apprunner.Source.from_ecr_public(
          image_configuration=apprunner.ImageConfiguration(
              port=8000,
              environment_secrets={
                  "SECRET": apprunner.Secret.from_secrets_manager(secret),
                  "PARAMETER": apprunner.Secret.from_ssm_parameter(parameter),
                  "SECRET_ID": apprunner.Secret.from_secrets_manager_version(secret, version_id="version-id"),
                  "SECRET_STAGE": apprunner.Secret.from_secrets_manager_version(secret, version_stage="version-stage")
              }
          ),
          image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
      )
  )
  service.add_secret("LATER_SECRET", apprunner.Secret.from_secrets_manager(secret, "field"))
  ```

  To use a customer managed key for your source encryption, use the `kmsKey` attribute.
  ```python
  import aws_cdk.aws_kms as kms

  apprunner.Service(self, "Service",
      source=apprunner.Source.from_ecr_public(
          image_configuration=apprunner.ImageConfiguration(port=8000),
          image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
      ),
      kms_key=kms_key
  )
  ```

  To configure the health check for the service, use the `healthCheck` attribute.
  You can specify it by static methods `HealthCheck.http` or `HealthCheck.tcp`.
  ```python
  apprunner.Service(self, "Service",
      source=apprunner.Source.from_ecr_public(
          image_configuration=apprunner.ImageConfiguration(port=8000),
          image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
      ),
      health_check=apprunner.HealthCheck.http(
          healthy_threshold=5,
          interval=Duration.seconds(10),
          path="/",
          timeout=Duration.seconds(10),
          unhealthy_threshold=10
      )
  )
  ```

  To associate an App Runner service with a custom observability configuration, use the `observabilityConfiguration` property.
  ```python
  observability_configuration = apprunner.ObservabilityConfiguration(self, "ObservabilityConfiguration",
      observability_configuration_name="MyObservabilityConfiguration",
      trace_configuration_vendor=apprunner.TraceConfigurationVendor.AWSXRAY
  )
  apprunner.Service(self, "DemoService",
      source=apprunner.Source.from_ecr_public(
          image_configuration=apprunner.ImageConfiguration(port=8000),
          image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
      ),
      observability_configuration=observability_configuration
  )
  ```


pkgId: cc0dfe654b5942803c4fe7de734fbf9971f206bd7d01121f57a46f84b40d60dd
name: python-aws-cdk.aws-cloud9-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-cloud9-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-cloud9-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-cloud9-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
  AWS Cloud9 is a cloud-based integrated development environment (IDE) that lets you write, run, and debug your code with just a
  browser. It includes a code editor, debugger, and terminal. Cloud9 comes prepackaged with essential tools for popular
  programming languages, including JavaScript, Python, PHP, and more, so you don’t need to install files or configure your
  development machine to start new projects. Since your Cloud9 IDE is cloud-based, you can work on your projects from your
  office, home, or anywhere using an internet-connected machine. Cloud9 also provides a seamless experience for developing
  serverless applications enabling you to easily define resources, debug, and switch between local and remote execution of
  serverless applications. With Cloud9, you can quickly share your development environment with your team, enabling you to pair
  program and track each other's inputs in real time.

  EC2 Environments are defined with `Ec2Environment`. To create an EC2 environment in the private subnet, specify
  `subnetSelection` with private `subnetType`.
  ```python

  vpc = ec2.Vpc(self, "VPC", max_azs=3)
  cloud9.Ec2Environment(self, "Cloud9Env", vpc=vpc, image_id=cloud9.ImageId.AMAZON_LINUX_2)

  default_vpc = ec2.Vpc.from_lookup(self, "DefaultVPC", is_default=True)
  cloud9.Ec2Environment(self, "Cloud9Env2",
      vpc=default_vpc,
      instance_type=ec2.InstanceType("t3.large"),
      image_id=cloud9.ImageId.AMAZON_LINUX_2
  )

  c9env = cloud9.Ec2Environment(self, "Cloud9Env3",
      vpc=vpc,
      subnet_selection=ec2.SubnetSelection(
          subnet_type=ec2.SubnetType.PRIVATE_WITH_EGRESS
      ),
      image_id=cloud9.ImageId.AMAZON_LINUX_2
  )

  CfnOutput(self, "URL", value=c9env.ide_url)
  ```

  Use `imageId` to specify the EC2 AMI image to be used:
  ```python
  default_vpc = ec2.Vpc.from_lookup(self, "DefaultVPC", is_default=True)
  cloud9.Ec2Environment(self, "Cloud9Env2",
      vpc=default_vpc,
      instance_type=ec2.InstanceType("t3.large"),
      image_id=cloud9.ImageId.UBUNTU_18_04
  )
  ```

  Use `clonedRepositories` to clone one or multiple AWS Codecommit repositories into the environment:
  ```python
  import aws_cdk.aws_codecommit as codecommit



  repo_new = codecommit.Repository(self, "RepoNew",
      repository_name="new-repo"
  )

  repo_existing = codecommit.Repository.from_repository_name(self, "RepoExisting", "existing-repo")
  cloud9.Ec2Environment(self, "C9Env",
      vpc=vpc,
      cloned_repositories=[
          cloud9.CloneRepository.from_code_commit(repo_new, "/src/new-repo"),
          cloud9.CloneRepository.from_code_commit(repo_existing, "/src/existing-repo")
      ],
      image_id=cloud9.ImageId.AMAZON_LINUX_2
  )
  ```

  Every Cloud9 Environment has an **owner**. An owner has full control over the environment, and can invite additional members to the environment for collaboration purposes. For more information, see [Working with shared environments in AWS Cloud9](https://docs.aws.amazon.com/cloud9/latest/user-guide/share-environment.html)).
  By default, the owner will be the identity that creates the Environment, which is most likely your CloudFormation Execution Role when the Environment is created using CloudFormation. Provider a value for the `owner` property to assign a different owner, either a specific IAM User or the AWS Account Root User.
  `Owner` is an IAM entity that owns a Cloud9 environment. `Owner` has their own access permissions, and resources. You can specify an `Owner`in an EC2 environment which could be of the following types:
  1. Account Root
  2. IAM User
  3. IAM Federated User
  4. IAM Assumed Role
  The ARN of the owner must satisfy the following regular expression: `^arn:(aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b):(iam|sts)::\d+:(root|(user\/[\w+=/:,.@-]{1,64}|federated-user\/[\w+=/:,.@-]{2,32}|assumed-role\/[\w+=:,.@-]{1,64}\/[\w+=,.@-]{1,64}))$`
  Note: Using the account root user is not recommended, see [environment sharing best practices](https://docs.aws.amazon.com/cloud9/latest/user-guide/share-environment.html#share-environment-best-practices).
  To specify the AWS Account Root User as the environment owner, use `Owner.accountRoot()`
  ```python

  cloud9.Ec2Environment(self, "C9Env",
      vpc=vpc,
      image_id=cloud9.ImageId.AMAZON_LINUX_2,
      owner=cloud9.Owner.account_root("111111111")
  )
  ```
  To specify a specific IAM User as the environment owner, use `Owner.user()`. The user should have the `AWSCloud9Administrator` managed policy
  The user should have the `AWSCloud9User` (preferred) or `AWSCloud9Administrator` managed policy attached.
  ```python
  import aws_cdk.aws_iam as iam

  user = iam.User(self, "user")
  user.add_managed_policy(iam.ManagedPolicy.from_aws_managed_policy_name("AWSCloud9Administrator"))
  cloud9.Ec2Environment(self, "C9Env",
      vpc=vpc,
      image_id=cloud9.ImageId.AMAZON_LINUX_2,
      owner=cloud9.Owner.user(user)
  )
  ```
  To specify a specific IAM Federated User as the environment owner, use `Owner.federatedUser(accountId, userName)`.
  The user should have the `AWSCloud9User` (preferred) or `AWSCloud9Administrator` managed policy attached.
  ```python
  import aws_cdk.aws_iam as iam

  cloud9.Ec2Environment(self, "C9Env",
      vpc=vpc,
      image_id=cloud9.ImageId.AMAZON_LINUX_2,
      owner=cloud9.Owner.federated_user(Stack.of(self).account, "Admin/johndoe")
  )
  ```
  To specify an IAM Assumed Role as the environment owner, use `Owner.assumedRole(accountId: string, roleName: string)`.
  The role should have the `AWSCloud9User` (preferred) or `AWSCloud9Administrator` managed policy attached.
  ```python
  import aws_cdk.aws_iam as iam

  cloud9.Ec2Environment(self, "C9Env",
      vpc=vpc,
      image_id=cloud9.ImageId.AMAZON_LINUX_2,
      owner=cloud9.Owner.assumed_role(Stack.of(self).account, "Admin/johndoe-role")
  )
  ```

  A Cloud9 environment can automatically start and stop the associated EC2 instance to reduce costs.
  Use `automaticStop` to specify the number of minutes until the running instance is shut down after the environment was last used.
  ```python
  default_vpc = ec2.Vpc.from_lookup(self, "DefaultVPC", is_default=True)
  cloud9.Ec2Environment(self, "Cloud9Env2",
      vpc=default_vpc,
      image_id=cloud9.ImageId.AMAZON_LINUX_2,
      automatic_stop=Duration.minutes(30)
  )
  ```


pkgId: 47c70c7733282114b6961f2a2fdb5f3f24349cab9deec351b1c6e90d06ebb24d
name: python-aws-cdk.aws-codestar-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-codestar-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-codestar-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-codestar-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->

  To create a new GitHub Repository and commit the assets from S3 bucket into the repository after it is created:
  ```python
  import aws_cdk.aws_codestar_alpha as codestar
  import aws_cdk.aws_s3 as s3
  codestar.GitHubRepository(self, "GitHubRepo",
      owner="aws",
      repository_name="aws-cdk",
      access_token=SecretValue.secrets_manager("my-github-token",
          json_field="token"
      ),
      contents_bucket=s3.Bucket.from_bucket_name(self, "Bucket", "amzn-s3-demo-bucket"),
      contents_key="import.zip"
  )
  ```

  At this moment, updates to the `GitHubRepository` are not supported and the repository will not be deleted upon the deletion of the CloudFormation stack. You will need to update or delete the GitHub repository manually.


pkgId: b8e1a5c6239c1ee1ee38f0265536d7836691fe885db3f96b2559ab43290835d0
name: python-aws-cdk.aws-cognito-identitypool-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-cognito-identitypool-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-cognito-identitypool-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-cognito-identitypool-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  > **Identity Pools are in a separate module while the API is being stabilized. Once we stabilize the module, they will**
  > **be included into the stable [aws-cognito](../aws-cognito) library. Please provide feedback on this experience by**
  > **creating an [issue here](https://github.com/aws/aws-cdk/issues/new/choose)**
  [Amazon Cognito Identity Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html) enable you to grant your users access to other AWS services.
  Identity Pools are one of the two main components of [Amazon Cognito](https://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html), which provides authentication, authorization, and
  user management for your web and mobile apps. Your users can sign in through a a trusted identity provider, like a user
  pool or a SAML 2.0 service, as well as with third party providers such as Facebook, Amazon, Google or Apple.
  The other main component in Amazon Cognito is [user pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html). User Pools are user directories that provide sign-up and
  sign-in options for your app users.
  This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
  ```python
  from aws_cdk.aws_cognito_identitypool_alpha import IdentityPool, UserPoolAuthenticationProvider
  ```

  * [Identity Pools](#identity-pools)
    * [Authenticated and Unauthenticated Identities](#authenticated-and-unauthenticated-identities)
    * [Authentication Providers](#authentication-providers)
      * [User Pool Authentication Provider](#user-pool-authentication-provider)
      * [Server Side Token Check](#server-side-token-check)
      * [Associating an External Provider Directly](#associating-an-external-provider-directly)
      * [OpenIdConnect and Saml](#openid-connect-and-saml)
      * [Custom Providers](#custom-providers)
    * [Role Mapping](#role-mapping)
      * [Provider Urls](#provider-urls)
    * [Authentication Flow](#authentication-flow)
    * [Cognito Sync](#cognito-sync)
    * [Importing Identity Pools](#importing-identity-pools)

  Identity pools provide temporary AWS credentials for users who are guests (unauthenticated) and for users who have
  authenticated by presenting a token from another identity provider. An identity pool is a store of user identity data
  specific to an account.
  Identity pools can be used in conjunction with Cognito User Pools or by accessing external federated identity providers
  directly. Learn more at [Amazon Cognito Identity Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html).

  Identity pools define two types of identities: authenticated(`user`) and unauthenticated (`guest`). Every identity in
  an identity pool is either authenticated or unauthenticated. Each identity pool has a default role for authenticated
  identities, and a default role for unauthenticated identities. Absent other overriding rules (see below), these are the
  roles that will be assumed by the corresponding users in the authentication process.
  A basic Identity Pool with minimal configuration has no required props, with default authenticated (user) and
  unauthenticated (guest) roles applied to the identity pool:
  ```python
  IdentityPool(self, "myIdentityPool")
  ```
  By default, both the authenticated and unauthenticated roles will have no permissions attached. When granting permissions,
  you should ensure that you are granting the least privileged permissions required for your use case. Grant permissions
  to roles using the public `authenticatedRole` and `unauthenticatedRole` properties:
  ```python
  import aws_cdk.aws_dynamodb as dynamodb

  identity_pool = IdentityPool(self, "myIdentityPool")

  table.grant_read_write_data(identity_pool.authenticated_role)

  table.grant_read_data(identity_pool.unauthenticated_role)

  identity_pool.authenticated_role.add_to_principal_policy(iam.PolicyStatement(
      effect=iam.Effect.ALLOW,
      actions=["dynamodb:UpdateItem"],
      resources=[table.table_arn]
  ))
  ```
  The default roles can also be supplied in `IdentityPoolProps`:
  ```python
  stack = Stack()
  authenticated_role = iam.Role(self, "authRole",
      assumed_by=iam.ServicePrincipal("service.amazonaws.com")
  )
  unauthenticated_role = iam.Role(self, "unauthRole",
      assumed_by=iam.ServicePrincipal("service.amazonaws.com")
  )
  identity_pool = IdentityPool(self, "TestIdentityPoolActions",
      authenticated_role=authenticated_role,
      unauthenticated_role=unauthenticated_role
  )
  ```

  Authenticated identities belong to users who are authenticated by a public login provider (Amazon Cognito user pools,
  Login with Amazon, Sign in with Apple, Facebook, Google, SAML, or any OpenID Connect Providers) or a developer provider
  (your own backend authentication process).
  [Authentication providers](https://docs.aws.amazon.com/cognito/latest/developerguide/external-identity-providers.html) can be associated with an Identity Pool by first associating them with a Cognito User Pool or by
  associating the provider directly with the identity pool.

  In order to attach a user pool to an identity pool as an authentication provider, the identity pool needs properties
  from both the user pool and the user pool client. For this reason identity pools use a `UserPoolAuthenticationProvider`
  to gather the necessary properties from the user pool constructs.
  ```python
  user_pool = cognito.UserPool(self, "Pool")
  IdentityPool(self, "myidentitypool",
      identity_pool_name="myidentitypool",
      authentication_providers=IdentityPoolAuthenticationProviders(
          user_pools=[UserPoolAuthenticationProvider(user_pool=user_pool)]
      )
  )
  ```
  User pools can also be associated with an identity pool after instantiation. The Identity Pool's `addUserPoolAuthentication` method
  returns the User Pool Client that has been created:
  ```python

  user_pool = cognito.UserPool(self, "Pool")
  user_pool_client = identity_pool.add_user_pool_authentication(UserPoolAuthenticationProvider(
      user_pool=user_pool
  ))
  ```

  With the `IdentityPool` CDK Construct, by default the pool is configured to check with the integrated user pools to
  make sure that the user has not been globally signed out or deleted before the identity pool provides an OIDC token or
  AWS credentials for the user.
  If the user is signed out or deleted, the identity pool will return a 400 Not Authorized error. This setting can be
  disabled, however, in several ways.
  Setting `disableServerSideTokenCheck` to true will change the default behavior to no server side token check. Learn
  more [here](https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_CognitoIdentityProvider.html#CognitoIdentity-Type-CognitoIdentityProvider-ServerSideTokenCheck):
  ```python

  user_pool = cognito.UserPool(self, "Pool")
  identity_pool.add_user_pool_authentication(UserPoolAuthenticationProvider(
      user_pool=user_pool,
      disable_server_side_token_check=True
  ))
  ```

  One or more [external identity providers](https://docs.aws.amazon.com/cognito/latest/developerguide/external-identity-providers.html) can be associated with an identity pool directly using
  `authenticationProviders`:
  ```python
  IdentityPool(self, "myidentitypool",
      identity_pool_name="myidentitypool",
      authentication_providers=IdentityPoolAuthenticationProviders(
          amazon=IdentityPoolAmazonLoginProvider(
              app_id="amzn1.application.12312k3j234j13rjiwuenf"
          ),
          facebook=IdentityPoolFacebookLoginProvider(
              app_id="1234567890123"
          ),
          google=IdentityPoolGoogleLoginProvider(
              client_id="12345678012.apps.googleusercontent.com"
          ),
          apple=IdentityPoolAppleLoginProvider(
              services_id="com.myappleapp.auth"
          ),
          twitter=IdentityPoolTwitterLoginProvider(
              consumer_key="my-twitter-id",
              consumer_secret="my-twitter-secret"
          )
      )
  )
  ```
  To associate more than one provider of the same type with the identity pool, use User
  Pools, OpenIdConnect, or SAML. Only one provider per external service can be attached directly to the identity pool.

  [OpenID Connect](https://docs.aws.amazon.com/cognito/latest/developerguide/open-id.html) is an open standard for
  authentication that is supported by a number of login providers. Amazon Cognito supports linking of identities with
  OpenID Connect providers that are configured through [AWS Identity and Access Management](http://aws.amazon.com/iam/).
  An identity provider that supports [Security Assertion Markup Language 2.0 (SAML 2.0)](https://docs.aws.amazon.com/cognito/latest/developerguide/saml-identity-provider.html) can be used to provide a simple
  onboarding flow for users. The SAML-supporting identity provider specifies the IAM roles that can be assumed by users
  so that different users can be granted different sets of permissions. Associating an OpenId Connect or Saml provider
  with an identity pool:
  ```python


  IdentityPool(self, "myidentitypool",
      identity_pool_name="myidentitypool",
      authentication_providers=IdentityPoolAuthenticationProviders(
          open_id_connect_providers=[open_id_connect_provider],
          saml_providers=[saml_provider]
      )
  )
  ```

  The identity pool's behavior can be customized further using custom [developer authenticated identities](https://docs.aws.amazon.com/cognito/latest/developerguide/developer-authenticated-identities.html).
  With developer authenticated identities, users can be registered and authenticated via an existing authentication
  process while still using Amazon Cognito to synchronize user data and access AWS resources.
  Like the supported external providers, though, only one custom provider can be directly associated with the identity
  pool.
  ```python

  IdentityPool(self, "myidentitypool",
      identity_pool_name="myidentitypool",
      authentication_providers=IdentityPoolAuthenticationProviders(
          google=IdentityPoolGoogleLoginProvider(
              client_id="12345678012.apps.googleusercontent.com"
          ),
          open_id_connect_providers=[open_id_connect_provider],
          custom_provider="my-custom-provider.example.com"
      )
  )
  ```

  In addition to setting default roles for authenticated and unauthenticated users, identity pools can also be used to
  define rules to choose the role for each user based on claims in the user's ID token by using Role Mapping. When using
  role mapping, it's important to be aware of some of the permissions the role will need, and that the least privileged
  roles necessary are given for your specific use case. An in depth
  review of roles and role mapping can be found [here](https://docs.aws.amazon.com/cognito/latest/developerguide/role-based-access-control.html).
  Using a [token-based approach](https://docs.aws.amazon.com/cognito/latest/developerguide/role-based-access-control.html#using-tokens-to-assign-roles-to-users) to role mapping will allow mapped roles to be passed through the `cognito:roles` or
  `cognito:preferred_role` claims from the identity provider:
  ```python
  from aws_cdk.aws_cognito_identitypool_alpha import IdentityPoolProviderUrl
  IdentityPool(self, "myidentitypool",
      identity_pool_name="myidentitypool",
      role_mappings=[IdentityPoolRoleMapping(
          provider_url=IdentityPoolProviderUrl.AMAZON,
          use_token=True
      )]
  )
  ```
  Using a rule-based approach to role mapping allows roles to be assigned based on custom claims passed from the identity provider:
  ```python
  from aws_cdk.aws_cognito_identitypool_alpha import IdentityPoolProviderUrl, RoleMappingMatchType


  IdentityPool(self, "myidentitypool",
      identity_pool_name="myidentitypool",
      
      role_mappings=[IdentityPoolRoleMapping(
          provider_url=IdentityPoolProviderUrl.AMAZON,
          rules=[RoleMappingRule(
              claim="custom:admin",
              claim_value="admin",
              mapped_role=admin_role
          ), RoleMappingRule(
              claim="custom:admin",
              claim_value="admin",
              match_type=RoleMappingMatchType.NOTEQUAL,
              mapped_role=non_admin_role
          )
          ]
      )]
  )
  ```
  Role mappings can also be added after instantiation with the Identity Pool's `addRoleMappings` method:
  ```python
  from aws_cdk.aws_cognito_identitypool_alpha import IdentityPoolRoleMapping




  identity_pool.add_role_mappings(my_added_role_mapping1, my_added_role_mapping2, my_added_role_mapping3)
  ```

  Role mappings must be associated with the url of an Identity Provider which can be supplied
  `IdentityPoolProviderUrl`. Supported Providers have static Urls that can be used:
  ```python
  from aws_cdk.aws_cognito_identitypool_alpha import IdentityPoolProviderUrl
  IdentityPool(self, "myidentitypool",
      identity_pool_name="myidentitypool",
      role_mappings=[IdentityPoolRoleMapping(
          provider_url=IdentityPoolProviderUrl.FACEBOOK,
          use_token=True
      )]
  )
  ```
  For identity providers that don't have static Urls, a custom Url can be supplied:
  ```python
  from aws_cdk.aws_cognito_identitypool_alpha import IdentityPoolProviderUrl
  IdentityPool(self, "myidentitypool",
      identity_pool_name="myidentitypool",
      role_mappings=[IdentityPoolRoleMapping(
          provider_url=IdentityPoolProviderUrl.custom("my-custom-provider.com"),
          use_token=True
      )
      ]
  )
  ```
  If a provider URL is a CDK Token, as it will be if you are trying to use a previously defined Cognito User Pool, you will need to also provide a mappingKey.
  This is because by default, the key in the Cloudformation role mapping hash is the providerUrl, and Cloudformation map keys must be concrete strings, they
  cannot be references. For example:
  ```python
  from aws_cdk.aws_cognito import UserPool, UserPoolClient
  from aws_cdk.aws_cognito_identitypool_alpha import IdentityPoolProviderUrl


  IdentityPool(self, "myidentitypool",
      identity_pool_name="myidentitypool",
      role_mappings=[IdentityPoolRoleMapping(
          mapping_key="cognito",
          provider_url=IdentityPoolProviderUrl.user_pool(user_pool, user_pool_client),
          use_token=True
      )]
  )
  ```
  See [here](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-identitypoolroleattachment-rolemapping.html#cfn-cognito-identitypoolroleattachment-rolemapping-identityprovider) for more information.

  Identity Pool [Authentication Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) defaults to the enhanced, simplified flow. The Classic (basic) Authentication Flow
  can also be implemented using `allowClassicFlow`:
  ```python
  IdentityPool(self, "myidentitypool",
      identity_pool_name="myidentitypool",
      allow_classic_flow=True
  )
  ```

  It's now recommended to integrate [AWS AppSync](https://aws.amazon.com/appsync/) for synchronizing app data across devices, so
  Cognito Sync features like `PushSync`, `CognitoEvents`, and `CognitoStreams` are not a part of `IdentityPool`. More
  information can be found [here](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-sync.html).

  You can import existing identity pools into your stack using Identity Pool static methods with the Identity Pool Id or
  Arn:
  ```python
  IdentityPool.from_identity_pool_id(self, "my-imported-identity-pool", "us-east-1:dj2823ryiwuhef937")
  IdentityPool.from_identity_pool_arn(self, "my-imported-identity-pool", "arn:aws:cognito-identity:us-east-1:123456789012:identitypool/us-east-1:dj2823ryiwuhef937")
  ```


pkgId: 43e6b9af968867d101969c99a8aec1d020e9a14d122a155f106c55704f58157c
name: python-aws-cdk.aws-ec2-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-ec2-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-ec2-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-ec2-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->

  `VpcV2` is a re-write of the [`ec2.Vpc`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Vpc.html) construct. This new construct enables higher level of customization
  on the VPC being created. `VpcV2` implements the existing [`IVpc`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html), therefore,
  `VpcV2` is compatible with other constructs that accepts `IVpc` (e.g. [`ApplicationLoadBalancer`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer.html#construct-props)).
  To create a VPC with both IPv4 and IPv6 support:
  ```python
  stack = Stack()
  VpcV2(self, "Vpc",
      primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
      secondary_address_blocks=[
          IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIpv6")
      ]
  )
  ```
  `VpcV2` does not automatically create subnets or allocate IP addresses, which is different from the `Vpc` construct.

  `SubnetV2` is a re-write of the [`ec2.Subnet`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Subnet.html) construct.
  This new construct can be used to add subnets to a `VpcV2` instance:
  ```python
  stack = Stack()
  my_vpc = VpcV2(self, "Vpc",
      secondary_address_blocks=[
          IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonProvidedIp")
      ]
  )
  SubnetV2(self, "subnetA",
      vpc=my_vpc,
      availability_zone="us-east-1a",
      ipv4_cidr_block=IpCidr("10.0.0.0/24"),
      ipv6_cidr_block=IpCidr("2a05:d02c:25:4000::/60"),
      subnet_type=SubnetType.PRIVATE_ISOLATED
  )
  ```

  By default `VpcV2` uses `10.0.0.0/16` as the primary CIDR if none is defined.
  Additional CIDRs can be adding to the VPC via the `secondaryAddressBlocks` prop.
  The following example illustrates the different options of defining the address blocks:
  ```python
  stack = Stack()
  ipam = Ipam(self, "Ipam",
      operating_region=["us-west-1"]
  )
  ipam_public_pool = ipam.public_scope.add_pool("PublicPoolA",
      address_family=AddressFamily.IP_V6,
      aws_service=AwsServiceName.EC2,
      locale="us-west-1",
      public_ip_source=IpamPoolPublicIpSource.AMAZON
  )
  ipam_public_pool.provision_cidr("PublicPoolACidrA", netmask_length=52)
  ipam_private_pool = ipam.private_scope.add_pool("PrivatePoolA",
      address_family=AddressFamily.IP_V4
  )
  ipam_private_pool.provision_cidr("PrivatePoolACidrA", netmask_length=8)
  VpcV2(self, "Vpc",
      primary_address_block=IpAddresses.ipv4("10.0.0.0/24"),
      secondary_address_blocks=[
          IpAddresses.amazon_provided_ipv6(cidr_block_name="AmazonIpv6"),
          IpAddresses.ipv6_ipam(
              ipam_pool=ipam_public_pool,
              netmask_length=52,
              cidr_block_name="ipv6Ipam"
          ),
          IpAddresses.ipv4_ipam(
              ipam_pool=ipam_private_pool,
              netmask_length=8,
              cidr_block_name="ipv4Ipam"
          )
      ]
  )
  ```
  Since `VpcV2` does not create subnets automatically, users have full control over IP addresses allocation across subnets.

  `RouteTable` is a new construct that allows for route tables to be customized in a variety of ways. For instance, the following example shows how a custom route table can be created and appended to a subnet:
  ```python
  my_vpc = VpcV2(self, "Vpc")
  route_table = RouteTable(self, "RouteTable",
      vpc=my_vpc
  )
  subnet = SubnetV2(self, "Subnet",
      vpc=my_vpc,
      route_table=route_table,
      availability_zone="eu-west-2a",
      ipv4_cidr_block=IpCidr("10.0.0.0/24"),
      subnet_type=SubnetType.PRIVATE_ISOLATED
  )
  ```
  `Routes` can be created to link subnets to various different AWS services via gateways and endpoints. Each unique route target has its own dedicated construct that can be routed to a given subnet via the `Route` construct. An example using the `InternetGateway` construct can be seen below:
  ```python
  stack = Stack()
  my_vpc = VpcV2(self, "Vpc")
  route_table = RouteTable(self, "RouteTable",
      vpc=my_vpc
  )
  subnet = SubnetV2(self, "Subnet",
      vpc=my_vpc,
      availability_zone="eu-west-2a",
      ipv4_cidr_block=IpCidr("10.0.0.0/24"),
      subnet_type=SubnetType.PRIVATE_ISOLATED
  )
  igw = InternetGateway(self, "IGW",
      vpc=my_vpc
  )
  Route(self, "IgwRoute",
      route_table=route_table,
      destination="0.0.0.0/0",
      target={"gateway": igw}
  )
  ```
  Alternatively, `Routes` can also be created via method `addRoute` in the `RouteTable` class. An example using the `EgressOnlyInternetGateway` construct can be seen below:
  Note: `EgressOnlyInternetGateway` can only be used to set up outbound IPv6 routing.
  ```python
  stack = Stack()
  my_vpc = VpcV2(self, "Vpc",
      primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
      secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
          cidr_block_name="AmazonProvided"
      )]
  )
  eigw = EgressOnlyInternetGateway(self, "EIGW",
      vpc=my_vpc
  )
  route_table = RouteTable(self, "RouteTable",
      vpc=my_vpc
  )
  route_table.add_route("EIGW", "::/0", {"gateway": eigw})
  ```
  Other route targets may require a deeper set of parameters to set up properly. For instance, the example below illustrates how to set up a `NatGateway`:
  ```python
  my_vpc = VpcV2(self, "Vpc")
  route_table = RouteTable(self, "RouteTable",
      vpc=my_vpc
  )
  subnet = SubnetV2(self, "Subnet",
      vpc=my_vpc,
      availability_zone="eu-west-2a",
      ipv4_cidr_block=IpCidr("10.0.0.0/24"),
      subnet_type=SubnetType.PRIVATE_ISOLATED
  )
  natgw = NatGateway(self, "NatGW",
      subnet=subnet,
      vpc=my_vpc,
      connectivity_type=NatConnectivityType.PRIVATE,
      private_ip_address="10.0.0.42"
  )
  Route(self, "NatGwRoute",
      route_table=route_table,
      destination="0.0.0.0/0",
      target={"gateway": natgw}
  )
  ```
  It is also possible to set up endpoints connecting other AWS services. For instance, the example below illustrates the linking of a Dynamo DB endpoint via the existing `ec2.GatewayVpcEndpoint` construct as a route target:
  ```python
  stack = Stack()
  my_vpc = VpcV2(self, "Vpc")
  route_table = RouteTable(self, "RouteTable",
      vpc=my_vpc
  )
  subnet = SubnetV2(self, "Subnet",
      vpc=my_vpc,
      availability_zone="eu-west-2a",
      ipv4_cidr_block=IpCidr("10.0.0.0/24"),
      subnet_type=SubnetType.PRIVATE
  )
  dynamo_endpoint = ec2.GatewayVpcEndpoint(self, "DynamoEndpoint",
      service=ec2.GatewayVpcEndpointAwsService.DYNAMODB,
      vpc=my_vpc,
      subnets=[subnet]
  )
  Route(self, "DynamoDBRoute",
      route_table=route_table,
      destination="0.0.0.0/0",
      target={"endpoint": dynamo_endpoint}
  )
  ```

  VPC peering connection allows you to connect two VPCs and route traffic between them using private IP addresses. The VpcV2 construct supports creating VPC peering connections through the `VPCPeeringConnection` construct from the `route` module.
  Peering Connection cannot be established between two VPCs with overlapping CIDR ranges. Please make sure the two VPC CIDRs do not overlap with each other else it will throw an error.
  For more information, see [What is VPC peering?](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html).
  The following show examples of how to create a peering connection between two VPCs for all possible combinations of same-account or cross-account, and same-region or cross-region configurations.
  Note: You cannot create a VPC peering connection between VPCs that have matching or overlapping CIDR blocks
  **Case 1: Same Account and Same Region Peering Connection**
  ```python
  stack = Stack()
  vpc_a = VpcV2(self, "VpcA",
      primary_address_block=IpAddresses.ipv4("10.0.0.0/16")
  )
  vpc_b = VpcV2(self, "VpcB",
      primary_address_block=IpAddresses.ipv4("10.1.0.0/16")
  )
  peering_connection = vpc_a.create_peering_connection("sameAccountSameRegionPeering",
      acceptor_vpc=vpc_b
  )
  ```
  **Case 2: Same Account and Cross Region Peering Connection**
  There is no difference from Case 1 when calling `createPeeringConnection`. The only change is that one of the VPCs are created in another stack with a different region. To establish cross region VPC peering connection, acceptorVpc needs to be imported to the requestor VPC stack using `fromVpcV2Attributes` method.
  ```python
  app = App()
  stack_a = Stack(app, "VpcStackA", env=Environment(account="000000000000", region="us-east-1"))
  stack_b = Stack(app, "VpcStackB", env=Environment(account="000000000000", region="us-west-2"))
  vpc_a = VpcV2(stack_a, "VpcA",
      primary_address_block=IpAddresses.ipv4("10.0.0.0/16")
  )
  VpcV2(stack_b, "VpcB",
      primary_address_block=IpAddresses.ipv4("10.1.0.0/16")
  )
  vpc_b = VpcV2.from_vpc_v2_attributes(stack_a, "ImportedVpcB",
      vpc_id="MockVpcBid",
      vpc_cidr_block="10.1.0.0/16",
      region="us-west-2",
      owner_account_id="000000000000"
  )
  peering_connection = vpc_a.create_peering_connection("sameAccountCrossRegionPeering",
      acceptor_vpc=vpc_b
  )
  ```
  **Case 3: Cross Account Peering Connection**
  For cross-account connections, the acceptor account needs an IAM role that grants the requestor account permission to initiate the connection. Create a new IAM role in the acceptor account using method `createAcceptorVpcRole` to provide the necessary permissions.
  Once role is created in account, provide role arn for field `peerRoleArn` under method `createPeeringConnection`
  ```python
  stack = Stack()
  acceptor_vpc = VpcV2(self, "VpcA",
      primary_address_block=IpAddresses.ipv4("10.0.0.0/16")
  )
  acceptor_role_arn = acceptor_vpc.create_acceptor_vpc_role("000000000000")
  ```
  After creating an IAM role in the acceptor account, we can initiate the peering connection request from the requestor VPC. Import accpeptorVpc to the stack using `fromVpcV2Attributes` method, it is recommended to specify owner account id of the acceptor VPC in case of cross account peering connection, if acceptor VPC is hosted in different region provide region value for import as well.
  The following code snippet demonstrates how to set up VPC peering between two VPCs in different AWS accounts using CDK:
  ```python
  stack = Stack()
  acceptor_vpc = VpcV2.from_vpc_v2_attributes(self, "acceptorVpc",
      vpc_id="vpc-XXXX",
      vpc_cidr_block="10.0.0.0/16",
      region="us-east-2",
      owner_account_id="111111111111"
  )
  acceptor_role_arn = "arn:aws:iam::111111111111:role/VpcPeeringRole"
  requestor_vpc = VpcV2(self, "VpcB",
      primary_address_block=IpAddresses.ipv4("10.1.0.0/16")
  )
  peering_connection = requestor_vpc.create_peering_connection("crossAccountCrossRegionPeering",
      acceptor_vpc=acceptor_vpc,
      peer_role_arn=acceptor_role_arn
  )
  ```

  After establishing the VPC peering connection, routes must be added to the respective route tables in the VPCs to enable traffic flow. If a route is added to the requestor stack, information will be able to flow from the requestor VPC to the acceptor VPC, but not in the reverse direction. For bi-directional communication, routes need to be added in both VPCs from their respective stacks.
  For more information, see [Update your route tables for a VPC peering connection](https://docs.aws.amazon.com/vpc/latest/peering/vpc-peering-routing.html).
  ```python
  stack = Stack()
  acceptor_vpc = VpcV2(self, "VpcA",
      primary_address_block=IpAddresses.ipv4("10.0.0.0/16")
  )
  requestor_vpc = VpcV2(self, "VpcB",
      primary_address_block=IpAddresses.ipv4("10.1.0.0/16")
  )
  peering_connection = requestor_vpc.create_peering_connection("peeringConnection",
      acceptor_vpc=acceptor_vpc
  )
  route_table = RouteTable(self, "RouteTable",
      vpc=requestor_vpc
  )
  route_table.add_route("vpcPeeringRoute", "10.0.0.0/16", {"gateway": peering_connection})
  ```
  This can also be done using AWS CLI. For more information, see [create-route](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-route.html).
  ```bash

  aws ec2 create-route --route-table-id rtb-requestor --destination-cidr-block 10.0.0.0/16 --vpc-peering-connection-id pcx-xxxxxxxx

  aws ec2 create-route --route-table-id rtb-acceptor --destination-cidr-block 10.1.0.0/16 --vpc-peering-connection-id pcx-xxxxxxxx
  ```

  To delete a VPC peering connection, use the following command:
  ```bash
  aws ec2 delete-vpc-peering-connection --vpc-peering-connection-id pcx-xxxxxxxx
  ```
  For more information, see [Delete a VPC peering connection](https://docs.aws.amazon.com/vpc/latest/peering/create-vpc-peering-connection.html#delete-vpc-peering-connection).

  An egress-only internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows outbound communication over IPv6 from instances in your VPC to the internet, and prevents the internet from initiating an IPv6 connection with your instances.
  For more information see [Enable outbound IPv6 traffic using an egress-only internet gateway](https://docs.aws.amazon.com/vpc/latest/userguide/egress-only-internet-gateway.html).
  VpcV2 supports adding an egress only internet gateway to VPC using the `addEgressOnlyInternetGateway` method.
  By default, this method sets up a route to all outbound IPv6 address ranges, unless a specific destination is provided by the user. It can only be configured for IPv6-enabled VPCs.
  The `Subnets` parameter accepts a `SubnetFilter`, which can be based on a `SubnetType` in VpcV2. A new route will be added to the route tables of all subnets that match this filter.
  ```python
  stack = Stack()
  my_vpc = VpcV2(self, "Vpc",
      primary_address_block=IpAddresses.ipv4("10.1.0.0/16"),
      secondary_address_blocks=[IpAddresses.amazon_provided_ipv6(
          cidr_block_name="AmazonProvided"
      )]
  )
  route_table = RouteTable(self, "RouteTable",
      vpc=my_vpc
  )
  subnet = SubnetV2(self, "Subnet",
      vpc=my_vpc,
      availability_zone="eu-west-2a",
      ipv4_cidr_block=IpCidr("10.0.0.0/24"),
      ipv6_cidr_block=IpCidr("2001:db8:1::/64"),
      subnet_type=SubnetType.PRIVATE
  )
  my_vpc.add_egress_only_internet_gateway(
      subnets=[ec2.SubnetSelection(subnet_type=SubnetType.PRIVATE)],
      destination="::/60"
  )
  ```

  A NAT gateway is a Network Address Translation (NAT) service.You can use a NAT gateway so that instances in a private subnet can connect to services outside your VPC but external services cannot initiate a connection with those instances.
  For more information, see [NAT gateway basics](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html).
  When you create a NAT gateway, you specify one of the following connectivity types:
  **Public – (Default)**: Instances in private subnets can connect to the internet through a public NAT gateway, but cannot receive unsolicited inbound connections from the internet
  **Private**: Instances in private subnets can connect to other VPCs or your on-premises network through a private NAT gateway.
  To define the NAT gateway connectivity type as `ConnectivityType.Public`, you need to ensure that there is an IGW(Internet Gateway) attached to the subnet's VPC.
  Since a NATGW is associated with a particular subnet, providing `subnet` field in the input props is mandatory.
  Additionally, you can set up a route in any route table with the target set to the NAT Gateway. The function `addNatGateway` returns a `NATGateway` object that you can reference later.
  The code example below provides the definition for adding a NAT gateway to your subnet:
  ```python
  stack = Stack()
  my_vpc = VpcV2(self, "Vpc")
  route_table = RouteTable(self, "RouteTable",
      vpc=my_vpc
  )
  subnet = SubnetV2(self, "Subnet",
      vpc=my_vpc,
      availability_zone="eu-west-2a",
      ipv4_cidr_block=IpCidr("10.0.0.0/24"),
      subnet_type=SubnetType.PUBLIC
  )
  my_vpc.add_internet_gateway()
  my_vpc.add_nat_gateway(
      subnet=subnet,
      connectivity_type=NatConnectivityType.PUBLIC
  )
  ```

  A virtual private gateway is the endpoint on the VPC side of your VPN connection.
  For more information, see [What is AWS Site-to-Site VPN?](https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html).
  VPN route propagation is a feature in Amazon Web Services (AWS) that automatically updates route tables in your Virtual Private Cloud (VPC) with routes learned from a VPN connection.
  To enable VPN route propogation, use the `vpnRoutePropagation` property to specify the subnets as an input to the function. VPN route propagation will then be enabled for each subnet with the corresponding route table IDs.
  Additionally, you can set up a route in any route table with the target set to the VPN Gateway. The function `enableVpnGatewayV2` returns a `VPNGatewayV2` object that you can reference later.
  The code example below provides the definition for setting up a VPN gateway with `vpnRoutePropogation` enabled:
  ```python
  stack = Stack()
  my_vpc = VpcV2(self, "Vpc")
  vpn_gateway = my_vpc.enable_vpn_gateway_v2(
      vpn_route_propagation=[ec2.SubnetSelection(subnet_type=SubnetType.PUBLIC)],
      type=VpnConnectionType.IPSEC_1
  )
  route_table = RouteTable(stack, "routeTable",
      vpc=my_vpc
  )
  Route(stack, "route",
      destination="172.31.0.0/24",
      target={"gateway": vpn_gateway},
      route_table=route_table
  )
  ```

  An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet. It supports both IPv4 and IPv6 traffic.
  For more information, see [Enable VPC internet access using internet gateways](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-igw-internet-access.html).
  You can add an internet gateway to a VPC using `addInternetGateway` method. By default, this method creates a route in all Public Subnets with outbound destination set to `0.0.0.0` for IPv4 and `::0` for IPv6 enabled VPC.
  Instead of using the default settings, you can configure a custom destinatation range by providing an optional input `destination` to the method.
  The code example below shows how to add an internet gateway with a custom outbound destination IP range:
  ```python
  stack = Stack()
  my_vpc = VpcV2(self, "Vpc")
  subnet = SubnetV2(self, "Subnet",
      vpc=my_vpc,
      availability_zone="eu-west-2a",
      ipv4_cidr_block=IpCidr("10.0.0.0/24"),
      subnet_type=SubnetType.PUBLIC
  )
  my_vpc.add_internet_gateway(
      ipv4_destination="192.168.0.0/16"
  )
  ```

  You can import an existing VPC and its subnets using the `VpcV2.fromVpcV2Attributes()` method or an individual subnet using `SubnetV2.fromSubnetV2Attributes()` method.

  To import an existing VPC, use the `VpcV2.fromVpcV2Attributes()` method. You'll need to provide the VPC ID, primary CIDR block, and information about the subnets. You can import secondary address as well created through IPAM, BYOIP(IPv4) or enabled through Amazon Provided IPv6. You must provide VPC Id and its primary CIDR block for importing it.
  If you wish to add a new subnet to imported VPC, new subnet's IP range(IPv4) will be validated against provided secondary and primary address block to confirm that it is within the the range of VPC.
  Here's an example of importing a VPC with only the required parameters
  ```python
  stack = Stack()
  imported_vpc = VpcV2.from_vpc_v2_attributes(stack, "ImportedVpc",
      vpc_id="mockVpcID",
      vpc_cidr_block="10.0.0.0/16"
  )
  ```
  In case of cross account or cross region VPC, its recommended to provide region and ownerAccountId so that these values for the VPC can be used to populate correct arn value for the VPC. If a VPC region and account ID is not provided, then region and account configured in the stack will be used. Furthermore, these fields will be referenced later while setting up VPC peering connection, so its necessary to set these fields to a correct value.
  Below is an example of importing a cross region and cross acount VPC, VPC arn for this case would be 'arn:aws:ec2:us-west-2:123456789012:vpc/mockVpcID'
  ```python
  stack = Stack()

  imported_vpc = VpcV2.from_vpc_v2_attributes(stack, "ImportedVpc",
      vpc_id="mockVpcID",
      vpc_cidr_block="10.0.0.0/16",
      owner_account_id="123456789012",
      region="us-west-2"
  )
  ```
  Here's an example of how to import a VPC with multiple CIDR blocks, IPv6 support, and different subnet types:
  In this example, we're importing a VPC with:
  * A primary CIDR block (10.1.0.0/16)
  * One secondary IPv4 CIDR block (10.2.0.0/16)
  * Two secondary address using IPAM pool (IPv4 and IPv6)
  * VPC has Amazon-provided IPv6 CIDR enabled
  * An isolated subnet in us-west-2a
  * A public subnet in us-west-2b
  ```python
  stack = Stack()
  imported_vpc = VpcV2.from_vpc_v2_attributes(self, "ImportedVPC",
      vpc_id="vpc-XXX",
      vpc_cidr_block="10.1.0.0/16",
      secondary_cidr_blocks=[VPCCidrBlockattributes(
          cidr_block="10.2.0.0/16",
          cidr_block_name="ImportedBlock1"
      ), VPCCidrBlockattributes(
          ipv6_ipam_pool_id="ipam-pool-XXX",
          ipv6_netmask_length=52,
          cidr_block_name="ImportedIpamIpv6"
      ), VPCCidrBlockattributes(
          ipv4_ipam_pool_id="ipam-pool-XXX",
          ipv4_ipam_provisioned_cidrs=["10.2.0.0/16"],
          cidr_block_name="ImportedIpamIpv4"
      ), VPCCidrBlockattributes(
          amazon_provided_ipv6_cidr_block=True
      )
      ],
      subnets=[SubnetV2Attributes(
          subnet_name="IsolatedSubnet2",
          subnet_id="subnet-03cd773c0fe08ed26",
          subnet_type=SubnetType.PRIVATE_ISOLATED,
          availability_zone="us-west-2a",
          ipv4_cidr_block="10.2.0.0/24",
          route_table_id="rtb-0871c310f98da2cbb"
      ), SubnetV2Attributes(
          subnet_id="subnet-0fa477e01db27d820",
          subnet_type=SubnetType.PUBLIC,
          availability_zone="us-west-2b",
          ipv4_cidr_block="10.3.0.0/24",
          route_table_id="rtb-014f3043098fe4b96"
      )]
  )


  imported_subnet = SubnetV2(self, "NewSubnet",
      availability_zone="us-west-2a",
      ipv4_cidr_block=IpCidr("10.2.2.0/24"),
      vpc=imported_vpc,
      subnet_type=SubnetType.PUBLIC
  )

  imported_vpc.add_internet_gateway()
  imported_vpc.add_nat_gateway(subnet=imported_subnet)
  imported_vpc.add_egress_only_internet_gateway()
  ```
  You can add more subnets as needed by including additional entries in the `isolatedSubnets`, `publicSubnets`, or other subnet type arrays (e.g., `privateSubnets`).

  You can also import individual subnets using the `SubnetV2.fromSubnetV2Attributes()` method. This is useful when you need to work with specific subnets independently of a VPC.
  Here's an example of how to import a subnet:
  ```python
  SubnetV2.from_subnet_v2_attributes(self, "ImportedSubnet",
      subnet_id="subnet-0123456789abcdef0",
      availability_zone="us-west-2a",
      ipv4_cidr_block="10.2.0.0/24",
      route_table_id="rtb-0871c310f98da2cbb",
      subnet_type=SubnetType.PRIVATE_ISOLATED
  )
  ```
  By importing existing VPCs and subnets, you can easily integrate your existing AWS infrastructure with new resources created through CDK. This is particularly useful when you need to work with pre-existing network configurations or when you're migrating existing infrastructure to CDK.


pkgId: 5236f06300818b962224d1601030134c27073f288032042ab77d4eea991f2ed7
name: python-aws-cdk.aws-gamelift-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-gamelift-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-gamelift-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-gamelift-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  [Amazon GameLift](https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-intro.html) is a service used
  to deploy, operate, and scale dedicated, low-cost servers in the cloud for session-based multiplayer games. Built
  on AWS global computing infrastructure, GameLift helps deliver high-performance, high-reliability game servers
  while dynamically scaling your resource usage to meet worldwide player demand.
  GameLift is composed of three main components:
  * GameLift FlexMatch which is a customizable matchmaking service for
    multiplayer games. With FlexMatch, you can
    build a custom set of rules that defines what a multiplayer match looks like
    for your game, and determines how to
    evaluate and select compatible players for each match. You can also customize
    key aspects of the matchmaking
    process to fit your game, including fine-tuning the matching algorithm.
  * GameLift hosting for custom or realtime servers which helps you deploy,
    operate, and scale dedicated game servers. It regulates the resources needed to
    host games, finds available game servers to host new game sessions, and puts
    players into games.
  * GameLift FleetIQ to optimize the use of low-cost Amazon Elastic Compute Cloud
    (Amazon EC2) Spot Instances for cloud-based game hosting. With GameLift
    FleetIQ, you can work directly with your hosting resources in Amazon EC2 and
    Amazon EC2 Auto Scaling while taking advantage of GameLift optimizations to
    deliver inexpensive, resilient game hosting for your players
  This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project. It allows you to define components for your matchmaking
  configuration or game server fleet management system.


  FlexMatch is available both as a GameLift game hosting solution (including
  Realtime Servers) and as a standalone matchmaking service. To set up a
  FlexMatch matchmaker to process matchmaking requests, you have to create a
  matchmaking configuration based on a RuleSet.
  More details about matchmaking ruleSet are covered [below](#matchmaking-ruleset).
  There is two types of Matchmaking configuration:
  Through a game session queue system to let FlexMatch forms matches and uses the specified GameLift queue to start a game session for the match.
  ```python


  gamelift.QueuedMatchmakingConfiguration(self, "QueuedMatchmakingConfiguration",
      matchmaking_configuration_name="test-queued-config-name",
      game_session_queues=[queue],
      rule_set=rule_set
  )
  ```
  Or through a standalone version to let FlexMatch forms matches and returns match information in an event.
  ```python

  gamelift.StandaloneMatchmakingConfiguration(self, "StandaloneMatchmaking",
      matchmaking_configuration_name="test-standalone-config-name",
      rule_set=rule_set
  )
  ```
  More details about Game session queue are covered [below](#game-session-queue).

  Every FlexMatch matchmaker must have a rule set. The rule set determines the
  two key elements of a match: your game's team structure and size, and how to
  group players together for the best possible match.
  For example, a rule set might describe a match like this: Create a match with
  two teams of four to eight players each, one team is the cowboy and the other
  team the aliens. A team can have novice and experienced players, but the
  average skill of the two teams must be within 10 points of each other. If no
  match is made after 30 seconds, gradually relax the skill requirements.
  ```python
  gamelift.MatchmakingRuleSet(self, "RuleSet",
      matchmaking_rule_set_name="my-test-ruleset",
      content=gamelift.RuleSetContent.from_json_file(path.join(__dirname, "my-ruleset", "ruleset.json"))
  )
  ```

  You can monitor GameLift FlexMatch activity for matchmaking configurations and
  matchmaking rules using Amazon CloudWatch. These statistics are used to provide
  a historical perspective on how your Gamelift FlexMatch solution is performing.

  GameLift FlexMatch sends metrics to CloudWatch so that you can collect and
  analyze the activity of your matchmaking solution, including match acceptance
  workflow, ticket consumtion.
  You can then use CloudWatch alarms to alert you, for example, when matches has
  been rejected (potential matches that were rejected by at least one player
  since the last report) exceed a certain thresold which could means that you may
  have an issue in your matchmaking rules.
  CDK provides methods for accessing GameLift FlexMatch metrics with default configuration,
  such as `metricRuleEvaluationsPassed`, or `metricRuleEvaluationsFailed` (see
  [`IMatchmakingRuleSet`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-gamelift.IMatchmakingRuleSet.html)
  for a full list). CDK also provides a generic `metric` method that can be used
  to produce metric configurations for any metric provided by GameLift FlexMatch;
  the configurations are pre-populated with the correct dimensions for the
  matchmaking configuration.
  ```python


  rule_evaluation_ratio = cloudwatch.MathExpression(
      expression="1 - (ruleEvaluationsPassed / ruleEvaluationsFailed)",
      using_metrics={
          "rule_evaluations_passed": matchmaking_rule_set.metric_rule_evaluations_passed(statistic=cloudwatch.Statistic.SUM),
          "rule_evaluations_failed": matchmaking_rule_set.metric("ruleEvaluationsFailed")
      }
  )
  cloudwatch.Alarm(self, "Alarm",
      metric=rule_evaluation_ratio,
      threshold=0.1,
      evaluation_periods=3
  )
  ```
  See: [Monitoring Using CloudWatch Metrics](https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html)
  in the *Amazon GameLift Developer Guide*.


  Before deploying your GameLift-enabled multiplayer game servers for hosting with the GameLift service, you need to upload
  your game server files. This section provides guidance on preparing and uploading custom game server build
  files or Realtime Servers server script files. When you upload files, you create a GameLift build or script resource, which
  you then deploy on fleets of hosting resources.
  To troubleshoot fleet activation problems related to the server script, see [Debug GameLift fleet issues](https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html).

  Before uploading your configured game server to GameLift for hosting, package the game build files into a build directory.
  This directory must include all components required to run your game servers and host game sessions, including the following:
  * Game server binaries – The binary files required to run the game server. A build can include binaries for multiple game
    servers built to run on the same platform. For a list of supported platforms, see [Download Amazon GameLift SDKs](https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-supported.html).
  * Dependencies – Any dependent files that your game server executables require to run. Examples include assets, configuration
    files, and dependent libraries.
  * Install script – A script file to handle tasks that are required to fully install your game build on GameLift hosting
    servers. Place this file at the root of the build directory. GameLift runs the install script as part of fleet creation.
  You can set up any application in your build, including your install script, to access your resources securely on other AWS
  services.
  ```python

  build = gamelift.Build(self, "Build",
      content=gamelift.Content.from_bucket(bucket, "sample-asset-key")
  )
  CfnOutput(self, "BuildArn", value=build.build_arn)
  CfnOutput(self, "BuildId", value=build.build_id)
  ```
  To specify a server SDK version you used when integrating your game server build with Amazon GameLift use the `serverSdkVersion` parameter:
  > See [Integrate games with custom game servers](https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-custom-intro.html) for more details.
  ```python

  build = gamelift.Build(self, "Build",
      content=gamelift.Content.from_bucket(bucket, "sample-asset-key"),
      server_sdk_version="5.0.0"
  )
  ```

  Your server script can include one or more files combined into a single .zip file for uploading. The .zip file must contain
  all files that your script needs to run.
  You can store your zipped script files in either a local file directory or in an Amazon Simple Storage Service (Amazon S3)
  bucket or defines a directory asset which is archived as a .zip file and uploaded to S3 during deployment.
  After you create the script resource, GameLift deploys the script with a new Realtime Servers fleet. GameLift installs your
  server script onto each instance in the fleet, placing the script files in `/local/game`.
  ```python

  gamelift.Script(self, "Script",
      content=gamelift.Content.from_bucket(bucket, "sample-asset-key")
  )
  ```


  Your uploaded game servers are hosted on GameLift virtual computing resources,
  called instances. You set up your hosting resources by creating a fleet of
  instances and deploying them to run your game servers. You can design a fleet
  to fit your game's needs.
  ```python
  gamelift.BuildFleet(self, "Game server fleet",
      fleet_name="test-fleet",
      content=gamelift.Build.from_asset(self, "Build", path.join(__dirname, "CustomerGameServer")),
      instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE),
      runtime_configuration=gamelift.RuntimeConfiguration(
          server_processes=[gamelift.ServerProcess(
              launch_path="test-launch-path"
          )]
      )
  )
  ```

  GameLift uses a fleet's runtime configuration to determine the type and number
  of processes to run on each instance in the fleet. At a minimum, a runtime
  configuration contains one server process configuration that represents one
  game server executable. You can also define additional server process
  configurations to run other types of processes related to your game. Each
  server process configuration contains the following information:
  * The file name and path of an executable in your game build.
  * Optionally Parameters to pass to the process on launch.
  * The number of processes to run concurrently.
  A GameLift instance is limited to 50 processes running concurrently.
  ```python


  fleet = gamelift.BuildFleet(self, "Game server fleet",
      fleet_name="test-fleet",
      content=build,
      instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE),
      runtime_configuration=gamelift.RuntimeConfiguration(
          server_processes=[gamelift.ServerProcess(
              launch_path="/local/game/GameLiftExampleServer.x86_64",
              parameters="-logFile /local/game/logs/myserver1935.log -port 1935",
              concurrent_executions=100
          )]
      )
  )
  ```
  See [Managing how game servers are launched for hosting](https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-multiprocess.html)
  in the *Amazon GameLift Developer Guide*.

  GameLift uses Amazon Elastic Compute Cloud (Amazon EC2) resources, called
  instances, to deploy your game servers and host game sessions for your players.
  When setting up a new fleet, you decide what type of instances your game needs
  and how to run game server processes on them (using a runtime configuration). All instances in a fleet use the same type of resources and the same runtime
  configuration. You can edit a fleet's runtime configuration and other fleet
  properties, but the type of resources cannot be changed.
  ```python

  gamelift.BuildFleet(self, "Game server fleet",
      fleet_name="test-fleet",
      content=build,
      instance_type=ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE),
      runtime_configuration=gamelift.RuntimeConfiguration(
          server_processes=[gamelift.ServerProcess(
              launch_path="/local/game/GameLiftExampleServer.x86_64"
          )]
      )
  )
  ```

  When setting up your hosting resources, you have the option of using Spot
  Instances, On-Demand Instances, or a combination.
  By default, fleet are using on demand capacity.
  ```python

  gamelift.BuildFleet(self, "Game server fleet",
      fleet_name="test-fleet",
      content=build,
      instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE),
      runtime_configuration=gamelift.RuntimeConfiguration(
          server_processes=[gamelift.ServerProcess(
              launch_path="/local/game/GameLiftExampleServer.x86_64"
          )]
      ),
      use_spot=True
  )
  ```

  The allowed IP address ranges and port settings that allow inbound traffic to
  access game sessions on this fleet.
  New game sessions are assigned an IP address/port number combination, which
  must fall into the fleet's allowed ranges. Fleets with custom game builds must
  have permissions explicitly set. For Realtime Servers fleets, GameLift
  automatically opens two port ranges, one for TCP messaging and one for UDP.
  ```python

  fleet = gamelift.BuildFleet(self, "Game server fleet",
      fleet_name="test-fleet",
      content=build,
      instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE),
      runtime_configuration=gamelift.RuntimeConfiguration(
          server_processes=[gamelift.ServerProcess(
              launch_path="/local/game/GameLiftExampleServer.x86_64"
          )]
      ),
      ingress_rules=[gamelift.IngressRule(
          source=gamelift.Peer.any_ipv4(),
          port=gamelift.Port.tcp_range(100, 200)
      )]
  )

  fleet.add_ingress_rule(gamelift.Peer.ipv4("1.2.3.4/32"), gamelift.Port.udp(1111))
  ```

  A single Amazon GameLift fleet has a home Region by default (the Region you
  deploy it to), but it can deploy resources to any number of GameLift supported
  Regions. Select Regions based on where your players are located and your
  latency needs.
  By default, home region is used as default location but we can add new locations if needed and define desired capacity
  ```python


  fleet = gamelift.BuildFleet(self, "Game server fleet",
      fleet_name="test-fleet",
      content=build,
      instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE),
      runtime_configuration=gamelift.RuntimeConfiguration(
          server_processes=[gamelift.ServerProcess(
              launch_path="/local/game/GameLiftExampleServer.x86_64"
          )]
      ),
      locations=[gamelift.Location(
          region="eu-west-1",
          capacity=gamelift.LocationCapacity(
              desired_capacity=5,
              min_size=2,
              max_size=10
          )
      ), gamelift.Location(
          region="us-east-1",
          capacity=gamelift.LocationCapacity(
              desired_capacity=5,
              min_size=2,
              max_size=10
          )
      )]
  )

  fleet.add_location("ap-southeast-1", 5, 2, 10)
  ```

  Some GameLift features require you to extend limited access to your AWS
  resources. This is done by creating an AWS IAM role. The GameLift Fleet class
  automatically created an IAM role with all the minimum necessary permissions
  for GameLift to access your resources. If you wish, you may
  specify your own IAM role.
  ```python

  role = iam.Role(self, "Role",
      assumed_by=iam.CompositePrincipal(iam.ServicePrincipal("gamelift.amazonaws.com"))
  )
  role.add_managed_policy(iam.ManagedPolicy.from_aws_managed_policy_name("CloudWatchAgentServerPolicy"))
  fleet = gamelift.BuildFleet(self, "Game server fleet",
      fleet_name="test-fleet",
      content=build,
      instance_type=ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE),
      runtime_configuration=gamelift.RuntimeConfiguration(
          server_processes=[gamelift.ServerProcess(
              launch_path="/local/game/GameLiftExampleServer.x86_64"
          )]
      ),
      role=role
  )

  fleet.grant(role, "gamelift:ListFleets")
  ```

  A GameLift alias is used to abstract a fleet designation. Fleet designations
  tell Amazon GameLift where to search for available resources when creating new
  game sessions for players. By using aliases instead of specific fleet IDs, you
  can more easily and seamlessly switch player traffic from one fleet to another
  by changing the alias's target location.
  ```python


  live_alias = fleet.add_alias("live")

  gamelift.Alias(self, "TerminalAlias",
      alias_name="terminal-alias",
      terminal_message="A terminal message"
  )
  ```
  See [Add an alias to a GameLift fleet](https://docs.aws.amazon.com/gamelift/latest/developerguide/aliases-creating.html)
  in the *Amazon GameLift Developer Guide*.

  GameLift is integrated with CloudWatch, so you can monitor the performance of
  your game servers via logs and metrics.

  GameLift Fleet sends metrics to CloudWatch so that you can collect and analyze
  the activity of your Fleet, including game  and player sessions and server
  processes.
  You can then use CloudWatch alarms to alert you, for example, when matches has
  been rejected (potential matches that were rejected by at least one player
  since the last report) exceed a certain threshold which could means that you may
  have an issue in your matchmaking rules.
  CDK provides methods for accessing GameLift Fleet metrics with default configuration,
  such as `metricActiveInstances`, or `metricIdleInstances` (see [`IFleet`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-gamelift.IFleet.html)
  for a full list). CDK also provides a generic `metric` method that can be used
  to produce metric configurations for any metric provided by GameLift Fleet,
  Game sessions or server processes; the configurations are pre-populated with
  the correct dimensions for the matchmaking configuration.
  ```python


  instances_used_ratio = cloudwatch.MathExpression(
      expression="1 - (activeInstances / idleInstances)",
      using_metrics={
          "active_instances": fleet.metric("ActiveInstances", statistic=cloudwatch.Statistic.SUM),
          "idle_instances": fleet.metric_idle_instances()
      }
  )
  cloudwatch.Alarm(self, "Alarm",
      metric=instances_used_ratio,
      threshold=0.1,
      evaluation_periods=3
  )
  ```
  See: [Monitoring Using CloudWatch Metrics](https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html)
  in the *Amazon GameLift Developer Guide*.

  The game session queue is the primary mechanism for processing new game session
  requests and locating available game servers to host them. Although it is
  possible to request a new game session be hosted on specific fleet or location.
  The `GameSessionQueue` resource creates a placement queue that processes requests for
  new game sessions. A queue uses FleetIQ algorithms to determine the best placement
  locations and find an available game server, then prompts the game server to start a
  new game session. Queues can have destinations (GameLift fleets or aliases), which
  determine where the queue can place new game sessions. A queue can have destinations
  with varied fleet type (Spot and On-Demand), instance type, and AWS Region.
  ```python


  queue = gamelift.GameSessionQueue(self, "GameSessionQueue",
      game_session_queue_name="my-queue-name",
      destinations=[fleet]
  )
  queue.add_destination(alias)
  ```
  A more complex configuration can also be definied to override how FleetIQ algorithms prioritize game session placement in order to favour a destination based on `Cost`, `Latency`, `Destination order`or `Location`.
  ```python


  gamelift.GameSessionQueue(self, "MyGameSessionQueue",
      game_session_queue_name="test-gameSessionQueue",
      custom_event_data="test-event-data",
      allowed_locations=["eu-west-1", "eu-west-2"],
      destinations=[fleet],
      notification_target=topic,
      player_latency_policies=[gamelift.PlayerLatencyPolicy(
          maximum_individual_player_latency=Duration.millis(100),
          policy_duration=Duration.seconds(300)
      )],
      priority_configuration=gamelift.PriorityConfiguration(
          location_order=["eu-west-1", "eu-west-2"
          ],
          priority_order=[gamelift.PriorityType.LATENCY, gamelift.PriorityType.COST, gamelift.PriorityType.DESTINATION, gamelift.PriorityType.LOCATION
          ]
      ),
      timeout=Duration.seconds(300)
  )
  ```
  See [Setting up GameLift queues for game session placement](https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-script-uploading.html)
  in the *Amazon GameLift Developer Guide*.

  The GameLift FleetIQ solution is a game hosting layer that supplements the full
  set of computing resource management tools that you get with Amazon EC2 and
  Auto Scaling. This solution lets you directly manage your Amazon EC2 and Auto
  Scaling resources and integrate as needed with other AWS services.

  When using GameLift FleetIQ, you prepare to launch Amazon EC2 instances as
  usual: make an Amazon Machine Image (AMI) with your game server software,
  create an Amazon EC2 launch template, and define configuration settings for an
  Auto Scaling group. However, instead of creating an Auto Scaling group
  directly, you create a GameLift FleetIQ game server group with your Amazon EC2
  and Auto Scaling resources and configuration. All game server groups must have
  at least two instance types defined for it.
  Once a game server group and Auto Scaling group are up and running with
  instances deployed, when updating a Game Server Group instance, only certain
  properties in the Auto Scaling group may be overwrite. For all other Auto
  Scaling group properties, such as MinSize, MaxSize, and LaunchTemplate, you can
  modify these directly on the Auto Scaling group using the AWS Console or
  dedicated Api.
  ```python


  gamelift.GameServerGroup(self, "Game server group",
      game_server_group_name="sample-gameservergroup-name",
      instance_definitions=[gamelift.InstanceDefinition(
          instance_type=ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE)
      ), gamelift.InstanceDefinition(
          instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE)
      )],
      launch_template=launch_template,
      vpc=vpc
  )
  ```
  See [Manage game server groups](https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-integrate-gameservergroup.html)
  in the *Amazon GameLift FleetIQ Developer Guide*.

  The scaling policy uses the metric `PercentUtilizedGameServers` to maintain a
  buffer of idle game servers that can immediately accommodate new games and
  players.
  ```python


  gamelift.GameServerGroup(self, "Game server group",
      game_server_group_name="sample-gameservergroup-name",
      instance_definitions=[gamelift.InstanceDefinition(
          instance_type=ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE)
      ), gamelift.InstanceDefinition(
          instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE)
      )],
      launch_template=launch_template,
      vpc=vpc,
      auto_scaling_policy=gamelift.AutoScalingPolicy(
          estimated_instance_warmup=Duration.minutes(5),
          target_tracking_configuration=5
      )
  )
  ```
  See [Manage game server groups](https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-integrate-gameservergroup.html)
  in the *Amazon GameLift FleetIQ Developer Guide*.

  The GameLift FleetIQ class automatically creates an IAM role with all the minimum necessary
  permissions for GameLift to access your Amazon EC2 Auto Scaling groups. If you wish, you may
  specify your own IAM role. It must have the correct permissions, or FleetIQ creation or resource usage may fail.
  ```python


  role = iam.Role(self, "Role",
      assumed_by=iam.CompositePrincipal(iam.ServicePrincipal("gamelift.amazonaws.com"),
      iam.ServicePrincipal("autoscaling.amazonaws.com"))
  )
  role.add_managed_policy(iam.ManagedPolicy.from_aws_managed_policy_name("GameLiftGameServerGroupPolicy"))
  gamelift.GameServerGroup(self, "Game server group",
      game_server_group_name="sample-gameservergroup-name",
      instance_definitions=[gamelift.InstanceDefinition(
          instance_type=ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE)
      ), gamelift.InstanceDefinition(
          instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE)
      )],
      launch_template=launch_template,
      vpc=vpc,
      role=role
  )
  ```
  See [Controlling Access](https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-iam-permissions-roles.html)
  in the *Amazon GameLift FleetIQ Developer Guide*.

  GameLift FleetIQ use by default, all supported GameLift FleetIQ Availability
  Zones in your chosen region. You can override this parameter to specify VPCs
  subnets that you've set up.
  This property cannot be updated after the game server group is created, and the
  corresponding Auto Scaling group will always use the property value that is set
  with this request, even if the Auto Scaling group is updated directly.
  ```python


  gamelift.GameServerGroup(self, "GameServerGroup",
      game_server_group_name="sample-gameservergroup-name",
      instance_definitions=[gamelift.InstanceDefinition(
          instance_type=ec2.InstanceType.of(ec2.InstanceClass.C5, ec2.InstanceSize.LARGE)
      ), gamelift.InstanceDefinition(
          instance_type=ec2.InstanceType.of(ec2.InstanceClass.C4, ec2.InstanceSize.LARGE)
      )],
      launch_template=launch_template,
      vpc=vpc,
      vpc_subnets=ec2.SubnetSelection(subnet_type=ec2.SubnetType.PUBLIC)
  )
  ```

  GameLift FleetIQ sends metrics to CloudWatch so that you can collect and
  analyze the activity of your Game server fleet, including the number of
  utilized game servers, and the number of game server interruption due to
  limited Spot availability.
  You can then use CloudWatch alarms to alert you, for example, when the portion
  of game servers that are currently supporting game executions exceed a certain
  threshold which could means that your autoscaling policy need to be adjust to
  add more instances to match with player demand.
  CDK provides a generic `metric` method that can be used
  to produce metric configurations for any metric provided by GameLift FleetIQ;
  the configurations are pre-populated with the correct dimensions for the
  matchmaking configuration.
  ```python


  cloudwatch.Alarm(self, "Alarm",
      metric=game_server_group.metric("UtilizedGameServers"),
      threshold=0.9,
      evaluation_periods=2
  )
  ```
  See: [Monitoring with CloudWatch](https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-metrics.html)
  in the *Amazon GameLift FleetIQ Developer Guide*.


pkgId: fe05242c6e020d24f866a8dfa293bcafe344a440873362fc4e9422b092656220
name: python-aws-cdk.aws-glue-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-glue-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-glue-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-glue-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.

  A `Job` encapsulates a script that connects to data sources, processes them, and then writes output to a data target.
  There are 3 types of jobs supported by AWS Glue: Spark ETL, Spark Streaming, and Python Shell jobs.
  The `glue.JobExecutable` allows you to specify the type of job, the language to use and the code assets required by the job.
  `glue.Code` allows you to refer to the different code assets required by the job, either from an existing S3 location or from a local file path.
  `glue.ExecutionClass` allows you to specify `FLEX` or `STANDARD`. `FLEX` is appropriate for non-urgent jobs such as pre-production jobs, testing, and one-time data loads.

  These jobs run in an Apache Spark environment managed by AWS Glue.

  An ETL job processes data in batches using Apache Spark.
  ```python

  glue.Job(self, "ScalaSparkEtlJob",
      executable=glue.JobExecutable.scala_etl(
          glue_version=glue.GlueVersion.V4_0,
          script=glue.Code.from_bucket(bucket, "src/com/example/HelloWorld.scala"),
          class_name="com.example.HelloWorld",
          extra_jars=[glue.Code.from_bucket(bucket, "jars/HelloWorld.jar")]
      ),
      worker_type=glue.WorkerType.G_8X,
      description="an example Scala ETL job"
  )
  ```

  A Streaming job is similar to an ETL job, except that it performs ETL on data streams. It uses the Apache Spark Structured Streaming framework. Some Spark job features are not available to streaming ETL jobs.
  ```python
  glue.Job(self, "PythonSparkStreamingJob",
      executable=glue.JobExecutable.python_streaming(
          glue_version=glue.GlueVersion.V4_0,
          python_version=glue.PythonVersion.THREE,
          script=glue.Code.from_asset(path.join(__dirname, "job-script", "hello_world.py"))
      ),
      description="an example Python Streaming job"
  )
  ```

  A Python shell job runs Python scripts as a shell and supports a Python version that depends on the AWS Glue version you are using.
  This can be used to schedule and run tasks that don't require an Apache Spark environment. Currently, three flavors are supported:
  * PythonVersion.TWO (2.7; EOL)
  * PythonVersion.THREE (3.6)
  * PythonVersion.THREE_NINE (3.9)
  ```python

  glue.Job(self, "PythonShellJob",
      executable=glue.JobExecutable.python_shell(
          glue_version=glue.GlueVersion.V1_0,
          python_version=glue.PythonVersion.THREE,
          script=glue.Code.from_bucket(bucket, "script.py")
      ),
      description="an example Python Shell job"
  )
  ```

  These jobs run in a Ray environment managed by AWS Glue.
  ```python
  glue.Job(self, "RayJob",
      executable=glue.JobExecutable.python_ray(
          glue_version=glue.GlueVersion.V4_0,
          python_version=glue.PythonVersion.THREE_NINE,
          runtime=glue.Runtime.RAY_TWO_FOUR,
          script=glue.Code.from_asset(path.join(__dirname, "job-script", "hello_world.py"))
      ),
      worker_type=glue.WorkerType.Z_2X,
      worker_count=2,
      description="an example Ray job"
  )
  ```

  Enable Spark UI setting the `sparkUI` property.
  ```python
  glue.Job(self, "EnableSparkUI",
      job_name="EtlJobWithSparkUIPrefix",
      spark_uI=glue.SparkUIProps(
          enabled=True
      ),
      executable=glue.JobExecutable.python_etl(
          glue_version=glue.GlueVersion.V3_0,
          python_version=glue.PythonVersion.THREE,
          script=glue.Code.from_asset(path.join(__dirname, "job-script", "hello_world.py"))
      )
  )
  ```
  The `sparkUI` property also allows the specification of an s3 bucket and a bucket prefix.
  See [documentation](https://docs.aws.amazon.com/glue/latest/dg/add-job.html) for more information on adding jobs in Glue.

  AWS Glue job queuing monitors your account level quotas and limits. If quotas or limits are insufficient to start a Glue job run, AWS Glue will automatically queue the job and wait for limits to free up. Once limits become available, AWS Glue will retry the job run. Glue jobs will queue for limits like max concurrent job runs per account, max concurrent Data Processing Units (DPU), and resource unavailable due to IP address exhaustion in Amazon Virtual Private Cloud (Amazon VPC).
  Enable job run queuing by setting the `jobRunQueuingEnabled` property to `true`.
  ```python
  glue.Job(self, "EnableRunQueuing",
      job_name="EtlJobWithRunQueuing",
      executable=glue.JobExecutable.python_etl(
          glue_version=glue.GlueVersion.V4_0,
          python_version=glue.PythonVersion.THREE,
          script=glue.Code.from_asset(path.join(__dirname, "job-script", "hello_world.py"))
      ),
      job_run_queuing_enabled=True
  )
  ```

  A `Connection` allows Glue jobs, crawlers and development endpoints to access certain types of data stores. For example, to create a network connection to connect to a data source within a VPC:
  ```python


  glue.Connection(self, "MyConnection",
      type=glue.ConnectionType.NETWORK,
      
      security_groups=[security_group],
      
      subnet=subnet
  )
  ```
  For RDS `Connection` by JDBC, it is recommended to manage credentials using AWS Secrets Manager. To use Secret, specify `SECRET_ID` in `properties` like the following code. Note that in this case, the subnet must have a route to the AWS Secrets Manager VPC endpoint or to the AWS Secrets Manager endpoint through a NAT gateway.
  ```python



  glue.Connection(self, "RdsConnection",
      type=glue.ConnectionType.JDBC,
      security_groups=[security_group],
      subnet=subnet,
      properties={
          "JDBC_CONNECTION_URL": f"jdbc:mysql://{db.clusterEndpoint.socketAddress}/databasename",
          "JDBC_ENFORCE_SSL": "false",
          "SECRET_ID": db.secret.secret_name
      }
  )
  ```
  If you need to use a connection type that doesn't exist as a static member on `ConnectionType`, you can instantiate a `ConnectionType` object, e.g: `new glue.ConnectionType('NEW_TYPE')`.
  See [Adding a Connection to Your Data Store](https://docs.aws.amazon.com/glue/latest/dg/populate-add-connection.html) and [Connection Structure](https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-connections.html#aws-glue-api-catalog-connections-Connection) documentation for more information on the supported data stores and their configurations.

  A `SecurityConfiguration` is a set of security properties that can be used by AWS Glue to encrypt data at rest.
  ```python
  glue.SecurityConfiguration(self, "MySecurityConfiguration",
      cloud_watch_encryption=glue.CloudWatchEncryption(
          mode=glue.CloudWatchEncryptionMode.KMS
      ),
      job_bookmarks_encryption=glue.JobBookmarksEncryption(
          mode=glue.JobBookmarksEncryptionMode.CLIENT_SIDE_KMS
      ),
      s3_encryption=glue.S3Encryption(
          mode=glue.S3EncryptionMode.KMS
      )
  )
  ```
  By default, a shared KMS key is created for use with the encryption configurations that require one. You can also supply your own key for each encryption config, for example, for CloudWatch encryption:
  ```python

  glue.SecurityConfiguration(self, "MySecurityConfiguration",
      cloud_watch_encryption=glue.CloudWatchEncryption(
          mode=glue.CloudWatchEncryptionMode.KMS,
          kms_key=key
      )
  )
  ```
  See [documentation](https://docs.aws.amazon.com/glue/latest/dg/encryption-security-configuration.html) for more info for Glue encrypting data written by Crawlers, Jobs, and Development Endpoints.

  A `Database` is a logical grouping of `Tables` in the Glue Catalog.
  ```python
  glue.Database(self, "MyDatabase",
      database_name="my_database",
      description="my_database_description"
  )
  ```

  A Glue table describes a table of data in S3: its structure (column names and types), location of data (S3 objects with a common prefix in a S3 bucket), and format for the files (Json, Avro, Parquet, etc.):
  ```python

  glue.S3Table(self, "MyTable",
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      ), glue.Column(
          name="col2",
          type=glue.Schema.array(glue.Schema.STRING),
          comment="col2 is an array of strings"
      )],
      data_format=glue.DataFormat.JSON
  )
  ```
  By default, a S3 bucket will be created to store the table's data but you can manually pass the `bucket` and `s3Prefix`:
  ```python


  glue.S3Table(self, "MyTable",
      bucket=my_bucket,
      s3_prefix="my-table/",
      
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      data_format=glue.DataFormat.JSON
  )
  ```
  Glue tables can be configured to contain user-defined properties, to describe the physical storage of table data, through the `storageParameters` property:
  ```python

  glue.S3Table(self, "MyTable",
      storage_parameters=[
          glue.StorageParameter.skip_header_line_count(1),
          glue.StorageParameter.compression_type(glue.CompressionType.GZIP),
          glue.StorageParameter.custom("separatorChar", ",")
      ],
      
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      data_format=glue.DataFormat.JSON
  )
  ```
  Glue tables can also be configured to contain user-defined table properties through the [`parameters`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-tableinput.html#cfn-glue-table-tableinput-parameters) property:
  ```python

  glue.S3Table(self, "MyTable",
      parameters={
          "key1": "val1",
          "key2": "val2"
      },
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      data_format=glue.DataFormat.JSON
  )
  ```

  To improve query performance, a table can specify `partitionKeys` on which data is stored and queried separately. For example, you might partition a table by `year` and `month` to optimize queries based on a time window:
  ```python

  glue.S3Table(self, "MyTable",
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      partition_keys=[glue.Column(
          name="year",
          type=glue.Schema.SMALL_INT
      ), glue.Column(
          name="month",
          type=glue.Schema.SMALL_INT
      )],
      data_format=glue.DataFormat.JSON
  )
  ```

  Another way to improve query performance is to specify partition indexes. If no partition indexes are
  present on the table, AWS Glue loads all partitions of the table and filters the loaded partitions using
  the query expression. The query takes more time to run as the number of partitions increase. With an
  index, the query will try to fetch a subset of the partitions instead of loading all partitions of the
  table.
  The keys of a partition index must be a subset of the partition keys of the table. You can have a
  maximum of 3 partition indexes per table. To specify a partition index, you can use the `partitionIndexes`
  property:
  ```python

  glue.S3Table(self, "MyTable",
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      partition_keys=[glue.Column(
          name="year",
          type=glue.Schema.SMALL_INT
      ), glue.Column(
          name="month",
          type=glue.Schema.SMALL_INT
      )],
      partition_indexes=[glue.PartitionIndex(
          index_name="my-index",  # optional
          key_names=["year"]
      )],  # supply up to 3 indexes
      data_format=glue.DataFormat.JSON
  )
  ```
  Alternatively, you can call the `addPartitionIndex()` function on a table:
  ```python

  my_table.add_partition_index(
      index_name="my-index",
      key_names=["year"]
  )
  ```

  If you have a table with a large number of partitions that grows over time, consider using AWS Glue partition indexing and filtering.
  ```python

  glue.S3Table(self, "MyTable",
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      partition_keys=[glue.Column(
          name="year",
          type=glue.Schema.SMALL_INT
      ), glue.Column(
          name="month",
          type=glue.Schema.SMALL_INT
      )],
      data_format=glue.DataFormat.JSON,
      enable_partition_filtering=True
  )
  ```

  Glue connections allow external data connections to third party databases and data warehouses. However, these connections can also be assigned to Glue Tables, allowing you to query external data sources using the Glue Data Catalog.
  Whereas `S3Table` will point to (and if needed, create) a bucket to store the tables' data, `ExternalTable` will point to an existing table in a data source. For example, to create a table in Glue that points to a table in Redshift:
  ```python


  glue.ExternalTable(self, "MyTable",
      connection=my_connection,
      external_data_location="default_db_public_example",  # A table in Redshift
      
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      data_format=glue.DataFormat.JSON
  )
  ```

  You can enable encryption on a Table's data:
  * [S3Managed](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) - (default) Server side encryption (`SSE-S3`) with an Amazon S3-managed key.
  ```python

  glue.S3Table(self, "MyTable",
      encryption=glue.TableEncryption.S3_MANAGED,
      
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      data_format=glue.DataFormat.JSON
  )
  ```
  * [Kms](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) - Server-side encryption (`SSE-KMS`) with an AWS KMS Key managed by the account owner.
  ```python


  glue.S3Table(self, "MyTable",
      encryption=glue.TableEncryption.KMS,
      
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      data_format=glue.DataFormat.JSON
  )

  glue.S3Table(self, "MyTable",
      encryption=glue.TableEncryption.KMS,
      encryption_key=kms.Key(self, "MyKey"),
      
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      data_format=glue.DataFormat.JSON
  )
  ```
  * [KmsManaged](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) - Server-side encryption (`SSE-KMS`), like `Kms`, except with an AWS KMS Key managed by the AWS Key Management Service.
  ```python

  glue.S3Table(self, "MyTable",
      encryption=glue.TableEncryption.KMS_MANAGED,
      
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      data_format=glue.DataFormat.JSON
  )
  ```
  * [ClientSideKms](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html#client-side-encryption-kms-managed-master-key-intro) - Client-side encryption (`CSE-KMS`) with an AWS KMS Key managed by the account owner.
  ```python


  glue.S3Table(self, "MyTable",
      encryption=glue.TableEncryption.CLIENT_SIDE_KMS,
      
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      data_format=glue.DataFormat.JSON
  )

  glue.S3Table(self, "MyTable",
      encryption=glue.TableEncryption.CLIENT_SIDE_KMS,
      encryption_key=kms.Key(self, "MyKey"),
      
      database=my_database,
      columns=[glue.Column(
          name="col1",
          type=glue.Schema.STRING
      )],
      data_format=glue.DataFormat.JSON
  )
  ```
  *Note: you cannot provide a `Bucket` when creating the `S3Table` if you wish to use server-side encryption (`KMS`, `KMS_MANAGED` or `S3_MANAGED`)*.

  A table's schema is a collection of columns, each of which have a `name` and a `type`. Types are recursive structures, consisting of primitive and complex types:
  ```python

  glue.S3Table(self, "MyTable",
      columns=[glue.Column(
          name="primitive_column",
          type=glue.Schema.STRING
      ), glue.Column(
          name="array_column",
          type=glue.Schema.array(glue.Schema.INTEGER),
          comment="array<integer>"
      ), glue.Column(
          name="map_column",
          type=glue.Schema.map(glue.Schema.STRING, glue.Schema.TIMESTAMP),
          comment="map<string,string>"
      ), glue.Column(
          name="struct_column",
          type=glue.Schema.struct([
              name="nested_column",
              type=glue.Schema.DATE,
              comment="nested comment"
          ]),
          comment="struct<nested_column:date COMMENT 'nested comment'>"
      )],
      
      database=my_database,
      data_format=glue.DataFormat.JSON
  )
  ```


  | Name      	| Type     	| Comments                                                                                                          |
  |-----------	|----------	|------------------------------------------------------------------------------------------------------------------	|
  | FLOAT     	| Constant 	| A 32-bit single-precision floating point number                                                                   |
  | INTEGER   	| Constant 	| A 32-bit signed value in two's complement format, with a minimum value of -2^31 and a maximum value of 2^31-1 	|
  | DOUBLE    	| Constant 	| A 64-bit double-precision floating point number                                                                   |
  | BIG_INT   	| Constant 	| A 64-bit signed INTEGER in two’s complement format, with a minimum value of -2^63 and a maximum value of 2^63 -1  |
  | SMALL_INT 	| Constant 	| A 16-bit signed INTEGER in two’s complement format, with a minimum value of -2^15 and a maximum value of 2^15-1   |
  | TINY_INT  	| Constant 	| A 8-bit signed INTEGER in two’s complement format, with a minimum value of -2^7 and a maximum value of 2^7-1      |

  | Name      	| Type     	| Comments                                                                                                                                                                	|
  |-----------	|----------	|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------	|
  | DATE      	| Constant 	| A date in UNIX format, such as YYYY-MM-DD.                                                                                                                              	|
  | TIMESTAMP 	| Constant 	| Date and time instant in the UNiX format, such as yyyy-mm-dd hh:mm:ss[.f...]. For example, TIMESTAMP '2008-09-15 03:04:05.324'. This format uses the session time zone. 	|

  | Name                                       	| Type     	| Comments                                                                                                                                                                                          	|
  |--------------------------------------------	|----------	|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------	|
  | STRING                                     	| Constant 	| A string literal enclosed in single or double quotes                                                                                                                                              	|
  | decimal(precision: number, scale?: number) 	| Function 	| `precision` is the total number of digits. `scale` (optional) is the number of digits in fractional part with a default of 0. For example, use these type definitions: decimal(11,5), decimal(15) 	|
  | char(length: number)                       	| Function 	| Fixed length character data, with a specified length between 1 and 255, such as char(10)                                                                                                          	|
  | varchar(length: number)                    	| Function 	| Variable length character data, with a specified length between 1 and 65535, such as varchar(10)                                                                                                  	|

  | Name    	| Type     	| Comments                      	|
  |---------	|----------	|-------------------------------	|
  | BOOLEAN 	| Constant 	| Values are `true` and `false` 	|
  | BINARY  	| Constant 	| Value is in binary            	|

  | Name                                	| Type     	| Comments                                                          	|
  |-------------------------------------	|----------	|-------------------------------------------------------------------	|
  | array(itemType: Type)               	| Function 	| An array of some other type                                       	|
  | map(keyType: Type, valueType: Type) 	| Function 	| A map of some primitive key type to any value type                	|
  | struct(collumns: Column[])          	| Function 	| Nested structure containing individually named and typed collumns 	|

  A `DataQualityRuleset` specifies a data quality ruleset with DQDL rules applied to a specified AWS Glue table. For example, to create a data quality ruleset for a given table:
  ```python
  glue.DataQualityRuleset(self, "MyDataQualityRuleset",
      client_token="client_token",
      description="description",
      ruleset_name="ruleset_name",
      ruleset_dqdl="ruleset_dqdl",
      tags={
          "key1": "value1",
          "key2": "value2"
      },
      target_table=glue.DataQualityTargetTable("database_name", "table_name")
  )
  ```
  For more information, see [AWS Glue Data Quality](https://docs.aws.amazon.com/glue/latest/dg/glue-data-quality.html).


pkgId: 3d486ad39f26e6800733ca95af358a03b7ddb9052492136ded3b9194595807a2
name: python-aws-cdk.aws-iot-actions-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-iot-actions-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-iot-actions-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-iot-actions-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  This library contains integration classes to send data to any number of
  supported AWS Services. Instances of these classes should be passed to
  `TopicRule` defined in `aws-cdk-lib/aws-iot`.
  Currently supported are:
  * Republish a message to another MQTT topic
  * Invoke a Lambda function
  * Put objects to a S3 bucket
  * Put logs to CloudWatch Logs
  * Capture CloudWatch metrics
  * Change state for a CloudWatch alarm
  * Put records to Kinesis Data stream
  * Put records to Kinesis Data Firehose stream
  * Send messages to SQS queues
  * Publish messages on SNS topics
  * Write messages into columns of DynamoDB
  * Put messages IoT Events input
  * Send messages to HTTPS endpoints

  The code snippet below creates an AWS IoT Rule that republish a message to
  another MQTT topic when it is triggered.
  ```python
  iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, timestamp() as timestamp, temperature FROM 'device/+/data'"),
      actions=[
          actions.IotRepublishMqttAction("${topic()}/republish",
              quality_of_service=actions.MqttQualityOfService.AT_LEAST_ONCE
          )
      ]
  )
  ```

  The code snippet below creates an AWS IoT Rule that invoke a Lambda function
  when it is triggered.
  ```python
  func = lambda_.Function(self, "MyFunction",
      runtime=lambda_.Runtime.NODEJS_LATEST,
      handler="index.handler",
      code=lambda_.Code.from_inline("""
              exports.handler = (event) => {
                console.log("It is test for lambda action of AWS IoT Rule.", event);
              };""")
  )
  iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, timestamp() as timestamp, temperature FROM 'device/+/data'"),
      actions=[actions.LambdaFunctionAction(func)]
  )
  ```

  The code snippet below creates an AWS IoT Rule that puts objects to a S3 bucket
  when it is triggered.
  ```python
  bucket = s3.Bucket(self, "MyBucket")
  iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id FROM 'device/+/data'"),
      actions=[actions.S3PutObjectAction(bucket)]
  )
  ```
  The property `key` of `S3PutObjectAction` is given the value `${topic()}/${timestamp()}` by default. This `${topic()}`
  and `${timestamp()}` is called Substitution templates. For more information see
  [this documentation](https://docs.aws.amazon.com/iot/latest/developerguide/iot-substitution-templates.html).
  In above sample, `${topic()}` is replaced by a given MQTT topic as `device/001/data`. And `${timestamp()}` is replaced
  by the number of the current timestamp in milliseconds as `1636289461203`. So if the MQTT broker receives an MQTT topic
  `device/001/data` on `2021-11-07T00:00:00.000Z`, the S3 bucket object will be put to `device/001/data/1636243200000`.
  You can also set specific `key` as following:
  ```python
  bucket = s3.Bucket(self, "MyBucket")
  iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"),
      actions=[
          actions.S3PutObjectAction(bucket,
              key="${year}/${month}/${day}/${topic(2)}"
          )
      ]
  )
  ```
  If you wanna set access control to the S3 bucket object, you can specify `accessControl` as following:
  ```python
  bucket = s3.Bucket(self, "MyBucket")
  iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT * FROM 'device/+/data'"),
      actions=[
          actions.S3PutObjectAction(bucket,
              access_control=s3.BucketAccessControl.PUBLIC_READ
          )
      ]
  )
  ```

  The code snippet below creates an AWS IoT Rule that puts logs to CloudWatch Logs
  when it is triggered.
  ```python
  import aws_cdk.aws_logs as logs
  log_group = logs.LogGroup(self, "MyLogGroup")
  iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id FROM 'device/+/data'"),
      actions=[actions.CloudWatchLogsAction(log_group)]
  )
  ```

  The code snippet below creates an AWS IoT Rule that capture CloudWatch metrics
  when it is triggered.
  ```python
  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, namespace, unit, value, timestamp FROM 'device/+/data'"),
      actions=[
          actions.CloudWatchPutMetricAction(
              metric_name="${topic(2)}",
              metric_namespace="${namespace}",
              metric_unit="${unit}",
              metric_value="${value}",
              metric_timestamp="${timestamp}"
          )
      ]
  )
  ```

  The code snippet below creates an AWS IoT Rule that starts a Step Functions State Machine
  when it is triggered.
  ```python
  state_machine = stepfunctions.StateMachine(self, "SM",
      definition_body=stepfunctions.DefinitionBody.from_chainable(stepfunctions.Wait(self, "Hello", time=stepfunctions.WaitTime.duration(Duration.seconds(10))))
  )
  iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT * FROM 'device/+/data'"),
      actions=[
          actions.StepFunctionsStateMachineAction(state_machine)
      ]
  )
  ```

  The code snippet below creates an AWS IoT Rule that changes the state of an Amazon CloudWatch alarm when it is triggered:
  ```python
  import aws_cdk.aws_cloudwatch as cloudwatch
  metric = cloudwatch.Metric(
      namespace="MyNamespace",
      metric_name="MyMetric",
      dimensions_map={"MyDimension": "MyDimensionValue"}
  )
  alarm = cloudwatch.Alarm(self, "MyAlarm",
      metric=metric,
      threshold=100,
      evaluation_periods=3,
      datapoints_to_alarm=2
  )
  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id FROM 'device/+/data'"),
      actions=[
          actions.CloudWatchSetAlarmStateAction(alarm,
              reason="AWS Iot Rule action is triggered",
              alarm_state_to_set=cloudwatch.AlarmState.ALARM
          )
      ]
  )
  ```

  The code snippet below creates an AWS IoT Rule that puts records to Kinesis Data
  stream when it is triggered.
  ```python
  import aws_cdk.aws_kinesis as kinesis
  stream = kinesis.Stream(self, "MyStream")
  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT * FROM 'device/+/data'"),
      actions=[
          actions.KinesisPutRecordAction(stream,
              partition_key="${newuuid()}"
          )
      ]
  )
  ```

  The code snippet below creates an AWS IoT Rule that puts records to Put records
  to Kinesis Data Firehose stream when it is triggered.
  ```python
  import aws_cdk.aws_kinesisfirehose_alpha as firehose
  import aws_cdk.aws_kinesisfirehose_destinations_alpha as destinations
  bucket = s3.Bucket(self, "MyBucket")
  stream = firehose.DeliveryStream(self, "MyStream",
      destination=destinations.S3Bucket(bucket)
  )
  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT * FROM 'device/+/data'"),
      actions=[
          actions.FirehosePutRecordAction(stream,
              batch_mode=True,
              record_separator=actions.FirehoseRecordSeparator.NEWLINE
          )
      ]
  )
  ```

  The code snippet below creates an AWS IoT Rule that send messages
  to an SQS queue when it is triggered:
  ```python
  import aws_cdk.aws_sqs as sqs
  queue = sqs.Queue(self, "MyQueue")
  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"),
      actions=[
          actions.SqsQueueAction(queue,
              use_base64=True
          )
      ]
  )
  ```

  The code snippet below creates and AWS IoT Rule that publishes messages to an SNS topic when it is triggered:
  ```python
  import aws_cdk.aws_sns as sns
  topic = sns.Topic(self, "MyTopic")
  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'"),
      actions=[
          actions.SnsTopicAction(topic,
              message_format=actions.SnsActionMessageFormat.JSON
          )
      ]
  )
  ```

  The code snippet below creates an AWS IoT rule that writes all or part of an
  MQTT message to DynamoDB using the DynamoDBv2 action.
  ```python
  import aws_cdk.aws_dynamodb as dynamodb

  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT * FROM 'device/+/data'"),
      actions=[
          actions.DynamoDBv2PutItemAction(table)
      ]
  )
  ```

  The code snippet below creates an AWS IoT Rule that puts messages
  to an IoT Events input when it is triggered:
  ```python
  import aws_cdk.aws_iotevents_alpha as iotevents
  import aws_cdk.aws_iam as iam

  input = iotevents.Input(self, "MyInput",
      attribute_json_paths=["payload.temperature", "payload.transactionId"]
  )
  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT * FROM 'device/+/data'"),
      actions=[
          actions.IotEventsPutMessageAction(input,
              batch_mode=True,  # optional property, default is 'false'
              message_id="${payload.transactionId}",  # optional property, default is a new UUID
              role=role
          )
      ]
  )
  ```

  The code snippet below creates an AWS IoT Rule that sends messages
  to an HTTPS endpoint when it is triggered:
  ```python
  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'")
  )
  topic_rule.add_action(
      actions.HttpsAction("https://example.com/endpoint",
          confirmation_url="https://example.com",
          headers=[actions.HttpActionHeader(key="key0", value="value0"), actions.HttpActionHeader(key="key1", value="value1")
          ],
          auth=actions.HttpActionSigV4Auth(service_name="serviceName", signing_region="us-east-1")
      ))
  ```

  The code snippet below creates an AWS IoT Rule that writes data
  to an Open Search Service when it is triggered:
  ```python
  import aws_cdk.aws_opensearchservice as opensearch

  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, year, month, day FROM 'device/+/data'")
  )
  topic_rule.add_action(actions.OpenSearchAction(domain,
      id="my-id",
      index="my-index",
      type="my-type"
  ))
  ```


pkgId: 403496843e1d5c6deb48c8046b2b00e0039373c848a866f80e19c446c025a8e0
name: python-aws-cdk.aws-iot-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-iot-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-iot-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-iot-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  AWS IoT Core lets you connect billions of IoT devices and route trillions of
  messages to AWS services without managing infrastructure.

  Create a topic rule that give your devices the ability to interact with AWS services.
  You can create a topic rule with an action that invoke the Lambda action as following:
  ```python
  func = lambda_.Function(self, "MyFunction",
      runtime=lambda_.Runtime.NODEJS_LATEST,
      handler="index.handler",
      code=lambda_.Code.from_inline("""
              exports.handler = (event) => {
                console.log("It is test for lambda action of AWS IoT Rule.", event);
              };""")
  )
  iot.TopicRule(self, "TopicRule",
      topic_rule_name="MyTopicRule",  # optional
      description="invokes the lambda function",  # optional
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, timestamp() as timestamp FROM 'device/+/data'"),
      actions=[actions.LambdaFunctionAction(func)]
  )
  ```
  Or, you can add an action after constructing the `TopicRule` instance as following:
  ```python

  topic_rule = iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, timestamp() as timestamp FROM 'device/+/data'")
  )
  topic_rule.add_action(actions.LambdaFunctionAction(func))
  ```
  You can also supply `errorAction` as following,
  and the IoT Rule will trigger it if a rule's action is unable to perform:
  ```python
  import aws_cdk.aws_logs as logs
  log_group = logs.LogGroup(self, "MyLogGroup")
  iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, timestamp() as timestamp FROM 'device/+/data'"),
      error_action=actions.CloudWatchLogsAction(log_group)
  )
  ```
  If you wanna make the topic rule disable, add property `enabled: false` as following:
  ```python
  iot.TopicRule(self, "TopicRule",
      sql=iot.IotSql.from_string_as_ver20160323("SELECT topic(2) as device_id, timestamp() as timestamp FROM 'device/+/data'"),
      enabled=False
  )
  ```
  See also [@aws-cdk/aws-iot-actions-alpha](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-iot-actions-alpha-readme.html) for other actions.

  AWS IoT provides a [logging feature](https://docs.aws.amazon.com/iot/latest/developerguide/configure-logging.html) that allows you to monitor and log AWS IoT activity.
  You can enable IoT logging with the following code:
  ```python
  iot.Logging(self, "Logging",
      log_level=iot.LogLevel.INFO
  )
  ```
  **Note**: All logs are forwarded to the `AWSIotLogsV2` log group in CloudWatch.

  An [AWS IoT Device Defender audit looks](https://docs.aws.amazon.com/iot-device-defender/latest/devguide/device-defender-audit.html) at account- and device-related settings and policies to ensure security measures are in place.
  An audit can help you detect any drifts from security best practices or access policies.

  The IoT audit includes [various audit checks](https://docs.aws.amazon.com/iot-device-defender/latest/devguide/device-defender-audit-checks.html), and it is necessary to configure settings to enable those checks.
  You can enable an account audit configuration with the following code:
  ```python


  iot.AccountAuditConfiguration(self, "AuditConfiguration",
      target_topic=target_topic
  )
  ```
  By default, all audit checks are enabled, but it is also possible to enable only specific audit checks.
  ```python
  iot.AccountAuditConfiguration(self, "AuditConfiguration",
      check_configuration=iot.CheckConfiguration(
          
          authenticated_cognito_role_overly_permissive_check=True,
          
          ca_certificate_expiring_check=undefined,
          
          ca_certificate_key_quality_check=False,
          conflicting_client_ids_check=False,
          device_certificate_expiring_check=False,
          device_certificate_key_quality_check=False,
          device_certificate_shared_check=False,
          intermediate_ca_revoked_for_active_device_certificates_check=False,
          io_tPolicy_potential_mis_configuration_check=False,
          iot_policy_overly_permissive_check=False,
          iot_role_alias_allows_access_to_unused_services_check=False,
          iot_role_alias_overly_permissive_check=False,
          logging_disabled_check=False,
          revoked_ca_certificate_still_active_check=False,
          revoked_device_certificate_still_active_check=False,
          unauthenticated_cognito_role_overly_permissive_check=False
      )
  )
  ```

  You can create a [scheduled audit](https://docs.aws.amazon.com/iot-device-defender/latest/devguide/AuditCommands.html#device-defender-AuditCommandsManageSchedules) that is run at a specified time interval. Checks must be enabled for your account by creating `AccountAuditConfiguration`.
  ```python


  daily_audit = iot.ScheduledAudit(self, "DailyAudit",
      account_audit_configuration=config,
      frequency=iot.Frequency.DAILY,
      audit_checks=[iot.AuditCheck.AUTHENTICATED_COGNITO_ROLE_OVERLY_PERMISSIVE_CHECK
      ]
  )

  weekly_audit = iot.ScheduledAudit(self, "WeeklyAudit",
      account_audit_configuration=config,
      frequency=iot.Frequency.WEEKLY,
      day_of_week=iot.DayOfWeek.SUNDAY,
      audit_checks=[iot.AuditCheck.CA_CERTIFICATE_EXPIRING_CHECK
      ]
  )

  monthly_audit = iot.ScheduledAudit(self, "MonthlyAudit",
      account_audit_configuration=config,
      frequency=iot.Frequency.MONTHLY,
      day_of_month=iot.DayOfMonth.of(1),
      audit_checks=[iot.AuditCheck.CA_CERTIFICATE_KEY_QUALITY_CHECK
      ]
  )
  ```


pkgId: 0f740be222ef085831ef1bd4bf047b4006481abcd8b7d7e9714209dde32ccef9
name: python-aws-cdk.aws-iotevents-actions-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-iotevents-actions-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-iotevents-actions-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-iotevents-actions-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  This library contains integration classes to specify actions of state events of Detector Model in `@aws-cdk/aws-iotevents-alpha`.
  Instances of these classes should be passed to `State` defined in `@aws-cdk/aws-iotevents-alpha`
  You can define built-in actions to use a timer or set a variable, or send data to other AWS resources.
  This library contains integration classes to use a timer or set a variable, or send data to other AWS resources.
  AWS IoT Events can trigger actions when it detects a specified event or transition event.
  Currently supported are:
  * Use timer
  * Set variable to detector instance
  * Invoke a Lambda function

  The code snippet below creates an Action that creates the timer with duration in seconds.
  ```python

  import aws_cdk.aws_iotevents_alpha as iotevents
  import aws_cdk.aws_iotevents_actions_alpha as actions

  state = iotevents.State(
      state_name="MyState",
      on_enter=[iotevents.Event(
          event_name="test-event",
          condition=iotevents.Expression.current_input(input),
          actions=[
              actions.SetTimerAction("MyTimer", {
                  "duration": cdk.Duration.seconds(60)
              })
          ]
      )]
  )
  ```
  Setting duration by [IoT Events Expression](https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-expressions.html):
  ```python

  actions.SetTimerAction("MyTimer",
      duration_expression=iotevents.Expression.input_attribute(input, "payload.durationSeconds")
  )
  ```
  And the timer can be reset and cleared. Below is an example of general
  [Device HeartBeat](https://docs.aws.amazon.com/iotevents/latest/developerguide/iotevents-examples-dhb.html)
  Detector Model:
  ```python

  online = iotevents.State(
      state_name="Online",
      on_enter=[{
          "event_name": "enter-event",
          "condition": iotevents.Expression.current_input(input),
          "actions": [
              actions.SetTimerAction("MyTimer",
                  duration=cdk.Duration.seconds(60)
              )
          ]
      }],
      on_input=[{
          "event_name": "input-event",
          "condition": iotevents.Expression.current_input(input),
          "actions": [
              actions.ResetTimerAction("MyTimer")
          ]
      }],
      on_exit=[{
          "event_name": "exit-event",
          "actions": [
              actions.ClearTimerAction("MyTimer")
          ]
      }]
  )
  offline = iotevents.State(state_name="Offline")
  online.transition_to(offline, when=iotevents.Expression.timeout("MyTimer"))
  offline.transition_to(online, when=iotevents.Expression.current_input(input))
  ```

  The code snippet below creates an Action that set variable to detector instance
  when it is triggered.
  ```python
  import aws_cdk.aws_iotevents_alpha as iotevents
  import aws_cdk.aws_iotevents_actions_alpha as actions

  state = iotevents.State(
      state_name="MyState",
      on_enter=[iotevents.Event(
          event_name="test-event",
          condition=iotevents.Expression.current_input(input),
          actions=[
              actions.SetVariableAction("MyVariable",
                  iotevents.Expression.input_attribute(input, "payload.temperature"))
          ]
      )]
  )
  ```

  The code snippet below creates an Action that invoke a Lambda function
  when it is triggered.
  ```python
  import aws_cdk.aws_iotevents_alpha as iotevents
  import aws_cdk.aws_iotevents_actions_alpha as actions
  import aws_cdk.aws_lambda as lambda_


  state = iotevents.State(
      state_name="MyState",
      on_enter=[iotevents.Event(
          event_name="test-event",
          condition=iotevents.Expression.current_input(input),
          actions=[actions.LambdaInvokeAction(func)]
      )]
  )
  ```


pkgId: 0b6752dc29e2c49619d23a00648f07f80cd7b01f88234ef52d5973d910ead7c2
name: python-aws-cdk.aws-iotevents-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-iotevents-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-iotevents-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-iotevents-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  AWS IoT Events enables you to monitor your equipment or device fleets for
  failures or changes in operation, and to trigger actions when such events
  occur.

  The following example creates an AWS IoT Events detector model to your stack.
  The detector model need a reference to at least one AWS IoT Events input.
  AWS IoT Events inputs enable the detector to get MQTT payload values from IoT Core rules.
  You can define built-in actions to use a timer or set a variable, or send data to other AWS resources.
  See also [@aws-cdk/aws-iotevents-actions-alpha](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-iotevents-actions-alpha-readme.html) for other actions.
  ```python
  import aws_cdk.aws_iotevents_alpha as iotevents
  import aws_cdk.aws_iotevents_actions_alpha as actions
  import aws_cdk.aws_lambda as lambda_

  input = iotevents.Input(self, "MyInput",
      input_name="my_input",  # optional
      attribute_json_paths=["payload.deviceId", "payload.temperature"]
  )
  warm_state = iotevents.State(
      state_name="warm",
      on_enter=[iotevents.Event(
          event_name="test-enter-event",
          condition=iotevents.Expression.current_input(input),
          actions=[actions.LambdaInvokeAction(func)]
      )],
      on_input=[iotevents.Event( # optional
          event_name="test-input-event",
          actions=[actions.LambdaInvokeAction(func)])],
      on_exit=[iotevents.Event( # optional
          event_name="test-exit-event",
          actions=[actions.LambdaInvokeAction(func)])]
  )
  cold_state = iotevents.State(
      state_name="cold"
  )

  warm_state.transition_to(cold_state,
      event_name="to_coldState",  # optional property, default by combining the names of the States
      when=iotevents.Expression.lt(
          iotevents.Expression.input_attribute(input, "payload.temperature"),
          iotevents.Expression.from_string("15")),
      executing=[actions.LambdaInvokeAction(func)]
  )

  cold_state.transition_to(warm_state,
      when=iotevents.Expression.gte(
          iotevents.Expression.input_attribute(input, "payload.temperature"),
          iotevents.Expression.from_string("15"))
  )
  iotevents.DetectorModel(self, "MyDetectorModel",
      detector_model_name="test-detector-model",  # optional
      description="test-detector-model-description",  # optional property, default is none
      evaluation_method=iotevents.EventEvaluation.SERIAL,  # optional property, default is iotevents.EventEvaluation.BATCH
      detector_key="payload.deviceId",  # optional property, default is none and single detector instance will be created and all inputs will be routed to it
      initial_state=warm_state
  )
  ```
  To grant permissions to put messages in the input,
  you can use the `grantWrite()` method:
  ```python
  import aws_cdk.aws_iam as iam
  import aws_cdk.aws_iotevents_alpha as iotevents

  input = iotevents.Input.from_input_name(self, "MyInput", "my_input")
  input.grant_write(grantable)
  ```


pkgId: d34edf207d02fe5dba5c3087b475cf9ab0c65f6c2955b4c37f08fec8b2677917
name: python-aws-cdk.aws-ivs-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-ivs-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-ivs-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-ivs-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  Amazon Interactive Video Service (Amazon IVS) is a managed live streaming
  solution that is quick and easy to set up, and ideal for creating interactive
  video experiences. Send your live streams to Amazon IVS using streaming software
  and the service does everything you need to make low-latency live video
  available to any viewer around the world, letting you focus on building
  interactive experiences alongside the live video. You can easily customize and
  enhance the audience experience through the Amazon IVS player SDK and timed
  metadata APIs, allowing you to build a more valuable relationship with your
  viewers on your own websites and applications.
  This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.

  An Amazon IVS channel stores configuration information related to your live
  stream. You first create a channel and then contribute video to it using the
  channel’s stream key to start your live stream.
  You can create a channel
  ```python
  my_channel = ivs.Channel(self, "Channel")
  ```
  You can use Advanced Channel type by setting the `type` property to
  `ivs.ChannelType.ADVANCED_HD` or `ivs.ChannelType.ADVANCED_SD`.
  Additionally, when using the Advanced Channel type, you can set
  the `preset` property to `ivs.Preset.CONSTRAINED_BANDWIDTH_DELIVERY`
  or `ivs.Preset.HIGHER_BANDWIDTH_DELIVERY`.
  For more information, see [Amazon IVS Streaming Configuration](https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/streaming-config.html).
  ```python
  my_channel = ivs.Channel(self, "myChannel",
      type=ivs.ChannelType.ADVANCED_HD,
      preset=ivs.Preset.CONSTRAINED_BANDWIDTH_DELIVERY
  )
  ```
  If you want to use RTMP ingest, set `insecureIngest` property to `true`.
  By default, `insecureIngest` is `false` which means using RTMPS ingest.
  **⚠ Note:** RTMP ingest might result in reduced security for your streams. AWS recommends that you use RTMPS for ingest, unless you have specific and verified use cases. For more information, see [Encoder Settings](https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/streaming-config.html#streaming-config-settings).
  ```python
  my_rtmp_channel = ivs.Channel(self, "myRtmpChannel",
      type=ivs.ChannelType.STANDARD,
      insecure_ingest=True
  )
  ```

  You can reference an existing channel, for example, if you need to create a
  stream key for an existing channel
  ```python
  my_channel = ivs.Channel.from_channel_arn(self, "Channel", my_channel_arn)
  ```

  A Stream Key is used by a broadcast encoder to initiate a stream and identify
  to Amazon IVS which customer and channel the stream is for. If you are
  storing this value, it should be treated as if it were a password.
  You can create a stream key for a given channel
  ```python
  my_stream_key = my_channel.add_stream_key("StreamKey")
  ```

  Amazon IVS offers the ability to create private channels, allowing
  you to restrict your streams by channel or viewer. You control access
  to video playback by enabling playback authorization on channels and
  generating signed JSON Web Tokens (JWTs) for authorized playback requests.
  A playback token is a JWT that you sign (with a playback authorization key)
  and include with every playback request for a channel that has playback
  authorization enabled.
  In order for Amazon IVS to validate the token, you need to upload
  the public key that corresponds to the private key you use to sign the token.
  ```python
  key_pair = ivs.PlaybackKeyPair(self, "PlaybackKeyPair",
      public_key_material=my_public_key_pem_string
  )
  ```
  Then, when creating a channel, specify the authorized property
  ```python
  my_channel = ivs.Channel(self, "Channel",
      authorized=True
  )
  ```

  An Amazon IVS Recording Configuration stores settings that specify how a channel's live streams should be recorded.
  You can configure video quality, thumbnail generation, and where recordings are stored in Amazon S3.
  For more information about IVS recording, see [IVS Auto-Record to Amazon S3 | Low-Latency Streaming](https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/record-to-s3.html).
  You can create a recording configuration:
  ```python

  recording_bucket = s3.Bucket(self, "RecordingBucket")

  recording_configuration = ivs.RecordingConfiguration(self, "RecordingConfiguration",
      bucket=recording_bucket
  )
  ```

  When you stream content to an Amazon IVS channel, auto-record-to-s3 uses the source video to generate multiple renditions.
  For more information, see [Discovering the Renditions of a Recording](https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/record-to-s3.html#r2s3-recording-renditions).
  ```python

  recording_configuration = ivs.RecordingConfiguration(self, "RecordingConfiguration",
      bucket=recording_bucket,
      
      rendition_configuration=ivs.RenditionConfiguration.custom([ivs.Resolution.HD, ivs.Resolution.SD])
  )
  ```

  You can enable or disable the recording of thumbnails for a live session and modify the interval at which thumbnails are generated for the live session.
  Thumbnail intervals may range from 1 second to 60 seconds; by default, thumbnail recording is enabled, at an interval of 60 seconds.
  For more information, see [Thumbnails](https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/record-to-s3.html#r2s3-thumbnails).
  ```python

  recording_configuration = ivs.RecordingConfiguration(self, "RecordingConfiguration",
      bucket=recording_bucket,
      
      thumbnail_configuration=ivs.ThumbnailConfiguration.interval(ivs.Resolution.HD, [ivs.Storage.LATEST, ivs.Storage.SEQUENTIAL], Duration.seconds(30))
  )
  ```

  The `recordingReconnectWindow` property allows you to specify a window of time (in seconds) during which, if your stream is interrupted and a new stream is started, Amazon IVS tries to record to the same S3 prefix as the previous stream.
  In other words, if a broadcast disconnects and then reconnects within the specified interval, the multiple streams are considered a single broadcast and merged together.
  For more information, see [Merge Fragmented Streams](https://docs.aws.amazon.com/ivs/latest/LowLatencyUserGuide/record-to-s3.html#r2s3-merge-fragmented-streams).
  ```python

  recording_configuration = ivs.RecordingConfiguration(self, "RecordingConfiguration",
      bucket=recording_bucket,
      
      recording_reconnect_window=Duration.seconds(60)
  )
  ```

  To enable recording for a channel, specify the recording configuration when creating the channel:
  ```python

  channel = ivs.Channel(self, "Channel",
      
      recording_configuration=recording_configuration
  )
  ```


pkgId: 40e3379ccf8abd5bb96168a502c3a4cbe9eb4bb8d9cdd793103f924b49eaa186
name: python-aws-cdk.aws-kinesisanalytics-flink-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-kinesisanalytics-flink-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-kinesisanalytics-flink-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-kinesisanalytics-flink-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  This package provides constructs for creating Kinesis Analytics Flink
  applications. To learn more about using using managed Flink applications, see
  the [AWS developer
  guide](https://docs.aws.amazon.com/kinesisanalytics/latest/java/).

  To create a new Flink application, use the `Application` construct:
  ```python
  import path as path
  import aws_cdk.aws_cloudwatch as cloudwatch
  import aws_cdk as core
  import aws_cdk.integ_tests_alpha as integ
  import aws_cdk.aws_kinesisanalytics_flink_alpha as flink
  app = core.App()
  stack = core.Stack(app, "FlinkAppTest")
  flink_runtimes = [flink.Runtime.FLINK_1_6, flink.Runtime.FLINK_1_8, flink.Runtime.FLINK_1_11, flink.Runtime.FLINK_1_13, flink.Runtime.FLINK_1_15, flink.Runtime.FLINK_1_18, flink.Runtime.FLINK_1_19, flink.Runtime.FLINK_1_20
  ]
  flink_runtimes.for_each((runtime) => {
        const flinkApp = new flink.Application(stack, `App-${runtime.value}`, {
          code: flink.ApplicationCode.fromAsset(path.join(__dirname, 'code-asset')),
          runtime: runtime,
        });
        new cloudwatch.Alarm(stack, `Alarm-${runtime.value}`, {
          metric: flinkApp.metricFullRestarts(),
          evaluationPeriods: 1,
          threshold: 3,
        });
      })
  integ.IntegTest(app, "ApplicationTest",
      test_cases=[stack]
  )
  ```
  The `code` property can use `fromAsset` as shown above to reference a local jar
  file in s3 or `fromBucket` to reference a file in s3.
  ```python
  import path as path
  import aws_cdk.aws_s3_assets as assets
  import aws_cdk as core
  import aws_cdk.aws_kinesisanalytics_flink_alpha as flink
  app = core.App()
  stack = core.Stack(app, "FlinkAppCodeFromBucketTest")
  asset = assets.Asset(stack, "CodeAsset",
      path=path.join(__dirname, "code-asset")
  )
  bucket = asset.bucket
  file_key = asset.s3_object_key
  flink.Application(stack, "App",
      code=flink.ApplicationCode.from_bucket(bucket, file_key),
      runtime=flink.Runtime.FLINK_1_19
  )
  app.synth()
  ```
  The `propertyGroups` property provides a way of passing arbitrary runtime
  properties to your Flink application. You can use the
  aws-kinesisanalytics-runtime library to [retrieve these
  properties](https://docs.aws.amazon.com/kinesisanalytics/latest/java/how-properties.html#how-properties-access).
  ```python

  flink_app = flink.Application(self, "Application",
      property_groups={
          "FlinkApplicationProperties": {
              "input_stream_name": "my-input-kinesis-stream",
              "output_stream_name": "my-output-kinesis-stream"
          }
      },
      
      runtime=flink.Runtime.FLINK_1_20,
      code=flink.ApplicationCode.from_bucket(bucket, "my-app.jar")
  )
  ```
  Flink applications also have specific configuration for passing parameters
  when the Flink job starts. These include parameters for checkpointing,
  snapshotting, monitoring, and parallelism.
  ```python

  flink_app = flink.Application(self, "Application",
      code=flink.ApplicationCode.from_bucket(bucket, "my-app.jar"),
      runtime=flink.Runtime.FLINK_1_20,
      checkpointing_enabled=True,  # default is true
      checkpoint_interval=Duration.seconds(30),  # default is 1 minute
      min_pause_between_checkpoints=Duration.seconds(10),  # default is 5 seconds
      log_level=flink.LogLevel.ERROR,  # default is INFO
      metrics_level=flink.MetricsLevel.PARALLELISM,  # default is APPLICATION
      auto_scaling_enabled=False,  # default is true
      parallelism=32,  # default is 1
      parallelism_per_kpu=2,  # default is 1
      snapshots_enabled=False,  # default is true
      log_group=logs.LogGroup(self, "LogGroup")
  )
  ```
  Flink applications can optionally be deployed in a VPC:
  ```python


  flink_app = flink.Application(self, "Application",
      code=flink.ApplicationCode.from_bucket(bucket, "my-app.jar"),
      runtime=flink.Runtime.FLINK_1_20,
      vpc=vpc
  )
  ```


pkgId: 9a77ae942c39679eafe7ee34aa1fc6e3126a526a9101d08a6f698f65f4067266
name: python-aws-cdk.aws-kinesisfirehose-alpha-help
arch: noarch
version: 2.173.1a0
epoch: 0
release: 1
summary: Development documents and examples for aws-cdk.aws-kinesisfirehose-alpha
url: https://github.com/aws/aws-cdk
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-aws-cdk.aws-kinesisfirehose-alpha-2.173.1a0-1.src.rpm
location_href: Packages/python-aws-cdk.aws-kinesisfirehose-alpha-help-2.173.1a0-1.noarch.rpm
checksum_type: sha256
description:
  <!--END STABILITY BANNER-->
  [Amazon Data Firehose](https://docs.aws.amazon.com/firehose/latest/dev/what-is-this-service.html), [formerly known as Amazon Kinesis Data Firehose](https://aws.amazon.com/about-aws/whats-new/2024/02/amazon-data-firehose-formerly-kinesis-data-firehose/),
  is a service for fully-managed delivery of real-time streaming data to storage services
  such as Amazon S3, Amazon Redshift, Amazon Elasticsearch, Splunk, or any custom HTTP
  endpoint or third-party services such as Datadog, Dynatrace, LogicMonitor, MongoDB, New
  Relic, and Sumo Logic.
  Amazon Data Firehose delivery streams are distinguished from Kinesis data streams in
  their models of consumption. Whereas consumers read from a data stream by actively pulling
  data from the stream, a delivery stream pushes data to its destination on a regular
  cadence. This means that data streams are intended to have consumers that do on-demand
  processing, like AWS Lambda or Amazon EC2. On the other hand, delivery streams are
  intended to have destinations that are sources for offline processing and analytics, such
  as Amazon S3 and Amazon Redshift.
  This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk)
  project. It allows you to define Amazon Data Firehose delivery streams.

  In order to define a Delivery Stream, you must specify a destination. An S3 bucket can be
  used as a destination. Currently the CDK supports only S3 as a destination which is covered [below](#destinations).
  ```python
  bucket = s3.Bucket(self, "Bucket")
  firehose.DeliveryStream(self, "Delivery Stream",
      destination=destinations.S3Bucket(bucket)
  )
  ```
  The above example defines the following resources:
  * An S3 bucket
  * An Amazon Data Firehose delivery stream with Direct PUT as the source and CloudWatch
    error logging turned on.
  * An IAM role which gives the delivery stream permission to write to the S3 bucket.

  An Amazon Data Firehose delivery stream can accept data from three main sources: Kinesis Data Streams, Managed Streaming for Apache Kafka (MSK), or via a "direct put" (API calls). Currently only Kinesis Data Streams and direct put are supported in the CDK.
  See: [Sending Data to a Delivery Stream](https://docs.aws.amazon.com/firehose/latest/dev/basic-write.html)
  in the *Amazon Data Firehose Developer Guide*.

  A delivery stream can read directly from a Kinesis data stream as a consumer of the data
  stream. Configure this behaviour by passing in a data stream in the `source`
  property via the `KinesisStreamSource` class when constructing a delivery stream:
  ```python

  source_stream = kinesis.Stream(self, "Source Stream")
  firehose.DeliveryStream(self, "Delivery Stream",
      source=firehose.KinesisStreamSource(source_stream),
      destination=destination
  )
  ```

  Data must be provided via "direct put", ie., by using a `PutRecord` or
  `PutRecordBatch` API call. There are a number of ways of doing so, such as:
  * Kinesis Agent: a standalone Java application that monitors and delivers files while
    handling file rotation, checkpointing, and retries. See: [Writing to Amazon Data Firehose Using Kinesis Agent](https://docs.aws.amazon.com/firehose/latest/dev/writing-with-agents.html)
    in the *Amazon Data Firehose Developer Guide*.
  * AWS SDK: a general purpose solution that allows you to deliver data to a delivery stream
    from anywhere using Java, .NET, Node.js, Python, or Ruby. See: [Writing to Amazon Data Firehose Using the AWS SDK](https://docs.aws.amazon.com/firehose/latest/dev/writing-with-sdk.html)
    in the *Amazon Data Firehose Developer Guide*.
  * CloudWatch Logs: subscribe to a log group and receive filtered log events directly into
    a delivery stream. See: [logs-destinations](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-logs-destinations-readme.html).
  * Eventbridge: add an event rule target to send events to a delivery stream based on the
    rule filtering. See: [events-targets](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-events-targets-readme.html).
  * SNS: add a subscription to send all notifications from the topic to a delivery
    stream. See: [sns-subscriptions](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-sns-subscriptions-readme.html).
  * IoT: add an action to an IoT rule to send various IoT information to a delivery stream

  Amazon Data Firehose supports multiple AWS and third-party services as destinations, including Amazon S3, Amazon Redshift, and more. You can find the full list of supported destination [here](https://docs.aws.amazon.com/firehose/latest/dev/create-destination.html).
  Currently in the AWS CDK, only S3 is implemented as an L2 construct destination. Other destinations can still be configured using L1 constructs. See [kinesisfirehose-destinations](https://docs.aws.amazon.com/cdk/api/latest/docs/aws-kinesisfirehose-destinations-readme.html)
  for the implementations of these destinations.

  Defining a delivery stream with an S3 bucket destination:
  ```python

  s3_destination = destinations.S3Bucket(bucket)
  firehose.DeliveryStream(self, "Delivery Stream",
      destination=s3_destination
  )
  ```
  The S3 destination also supports custom dynamic prefixes. `dataOutputPrefix`
  will be used for files successfully delivered to S3. `errorOutputPrefix` will be added to
  failed records before writing them to S3.
  ```python

  s3_destination = destinations.S3Bucket(bucket,
      data_output_prefix="myFirehose/DeliveredYear=!{timestamp:yyyy}/anyMonth/rand=!{firehose:random-string}",
      error_output_prefix="myFirehoseFailures/!{firehose:error-output-type}/!{timestamp:yyyy}/anyMonth/!{timestamp:dd}"
  )
  ```
  See: [Custom S3 Prefixes](https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
  in the *Amazon Data Firehose Developer Guide*.

  Enabling server-side encryption (SSE) requires Amazon Data Firehose to encrypt all data
  sent to delivery stream when it is stored at rest. This means that data is encrypted
  before being written to the service's internal storage layer and decrypted after it is
  received from the internal storage layer. The service manages keys and cryptographic
  operations so that sources and destinations do not need to, as the data is encrypted and
  decrypted at the boundaries of the service (i.e., before the data is delivered to a
  destination). By default, delivery streams do not have SSE enabled.
  The Key Management Service keys (KMS keys) used for SSE can either be AWS-owned or
  customer-managed. AWS-owned KMS keys are created, owned and managed by AWS for use in
  multiple AWS accounts. As a customer, you cannot view, use, track, or manage these keys,
  and you are not charged for their use. On the other hand, customer-managed KMS keys are
  created and owned within your account and managed entirely by you. As a customer, you are
  responsible for managing access, rotation, aliases, and deletion for these keys, and you
  are changed for their use.
  See: [AWS KMS keys](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys)
  in the *KMS Developer Guide*.
  ```python




  firehose.DeliveryStream(self, "Delivery Stream with AWS Owned Key",
      encryption=firehose.StreamEncryption.aws_owned_key(),
      destination=destination
  )

  firehose.DeliveryStream(self, "Delivery Stream with Customer Managed Key",
      encryption=firehose.StreamEncryption.customer_managed_key(),
      destination=destination
  )
  firehose.DeliveryStream(self, "Delivery Stream with Customer Managed and Provided Key",
      encryption=firehose.StreamEncryption.customer_managed_key(key),
      destination=destination
  )
  ```
  See: [Data Protection](https://docs.aws.amazon.com/firehose/latest/dev/encryption.html)
  in the *Amazon Data Firehose Developer Guide*.

  Amazon Data Firehose is integrated with CloudWatch, so you can monitor the performance of
  your delivery streams via logs and metrics.

  Amazon Data Firehose will send logs to CloudWatch when data transformation or data
  delivery fails. The CDK will enable logging by default and create a CloudWatch LogGroup
  and LogStream with default settings for your Delivery Stream.
  When creating a destination, you can provide an `ILoggingConfig`, which can either be an `EnableLogging` or `DisableLogging` instance.
  If you use `EnableLogging`, the CDK will create a CloudWatch LogGroup and LogStream with all CloudFormation default settings for you, or you can optionally
  specify your own log group to be used for capturing and storing log events. For example:
  ```python
  import aws_cdk.aws_logs as logs

  log_group = logs.LogGroup(self, "Log Group")
  destination = destinations.S3Bucket(bucket,
      logging_config=destinations.EnableLogging(log_group)
  )
  firehose.DeliveryStream(self, "Delivery Stream",
      destination=destination
  )
  ```
  Logging can also be disabled:
  ```python

  destination = destinations.S3Bucket(bucket,
      logging_config=destinations.DisableLogging()
  )
  firehose.DeliveryStream(self, "Delivery Stream",
      destination=destination
  )
  ```
  See: [Monitoring using CloudWatch Logs](https://docs.aws.amazon.com/firehose/latest/dev/monitoring-with-cloudwatch-logs.html)
  in the *Amazon Data Firehose Developer Guide*.

  Amazon Data Firehose sends metrics to CloudWatch so that you can collect and analyze the
  performance of the delivery stream, including data delivery, data ingestion, data
  transformation, format conversion, API usage, encryption, and resource usage. You can then
  use CloudWatch alarms to alert you, for example, when data freshness (the age of the
  oldest record in the delivery stream) exceeds the buffering limit (indicating that data is
  not being delivered to your destination), or when the rate of incoming records exceeds the
  limit of records per second (indicating data is flowing into your delivery stream faster
  than it is configured to process).
  CDK provides methods for accessing delivery stream metrics with default configuration,
  such as `metricIncomingBytes`, and `metricIncomingRecords` (see [`IDeliveryStream`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-kinesisfirehose.IDeliveryStream.html)
  for a full list). CDK also provides a generic `metric` method that can be used to produce
  metric configurations for any metric provided by Amazon Data Firehose; the configurations
  are pre-populated with the correct dimensions for the delivery stream.
  ```python
  import aws_cdk.aws_cloudwatch as cloudwatch


  incoming_bytes_percent_of_limit = cloudwatch.MathExpression(
      expression="incomingBytes / 300 / bytePerSecLimit",
      using_metrics={
          "incoming_bytes": delivery_stream.metric_incoming_bytes(statistic=cloudwatch.Statistic.SUM),
          "byte_per_sec_limit": delivery_stream.metric("BytesPerSecondLimit")
      }
  )
  cloudwatch.Alarm(self, "Alarm",
      metric=incoming_bytes_percent_of_limit,
      threshold=0.9,
      evaluation_periods=3
  )
  ```
  See: [Monitoring Using CloudWatch Metrics](https://docs.aws.amazon.com/firehose/latest/dev/monitoring-with-cloudwatch-metrics.html)
  in the *Amazon Data Firehose Developer Guide*.

  Your data can automatically be compressed when it is delivered to S3 as either a final or
  an intermediary/backup destination. Supported compression formats are: gzip, Snappy,
  Hadoop-compatible Snappy, and ZIP, except for Redshift destinations, where Snappy
  (regardless of Hadoop-compatibility) and ZIP are not supported. By default, data is
  delivered to S3 without compression.
  ```python


  s3_destination = destinations.S3Bucket(bucket,
      compression=destinations.Compression.SNAPPY
  )
  firehose.DeliveryStream(self, "Delivery Stream",
      destination=s3_destination
  )
  ```

  Incoming data is buffered before it is delivered to the specified destination. The
  delivery stream will wait until the amount of incoming data has exceeded some threshold
  (the "buffer size") or until the time since the last data delivery occurred exceeds some
  threshold (the "buffer interval"), whichever happens first. You can configure these
  thresholds based on the capabilities of the destination and your use-case. By default, the
  buffer size is 5 MiB and the buffer interval is 5 minutes.
  ```python


  destination = destinations.S3Bucket(bucket,
      buffering_interval=Duration.minutes(10),
      buffering_size=Size.mebibytes(8)
  )
  firehose.DeliveryStream(self, "Delivery Stream",
      destination=destination
  )
  ```
  See: [Data Delivery Frequency](https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#frequency)
  in the *Amazon Data Firehose Developer Guide*.
  Zero buffering, where Amazon Data Firehose stream can be configured to not buffer data before delivery, is supported by
  setting the "buffer interval" to 0.
  ```python


  destination = destinations.S3Bucket(bucket,
      buffering_interval=Duration.seconds(0)
  )
  firehose.DeliveryStream(self, "ZeroBufferDeliveryStream",
      destination=destination
  )
  ```
  See: [Buffering Hints](https://docs.aws.amazon.com/firehose/latest/dev/buffering-hints.html).

  Your data can be automatically encrypted when it is delivered to S3 as a final or an
  intermediary/backup destination. Amazon Data Firehose supports Amazon S3 server-side
  encryption with AWS Key Management Service (AWS KMS) for encrypting delivered data in
  Amazon S3. You can choose to not encrypt the data or to encrypt with a key from the list
  of AWS KMS keys that you own. For more information,
  see [Protecting Data Using Server-Side Encryption with AWS KMS–Managed Keys (SSE-KMS)](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html).
  By default, encryption isn’t directly enabled on the delivery stream; instead, it uses the default encryption settings of the destination S3 bucket.
  ```python


  destination = destinations.S3Bucket(bucket,
      encryption_key=key
  )
  firehose.DeliveryStream(self, "Delivery Stream",
      destination=destination
  )
  ```

  A delivery stream can be configured to back up data to S3 that it attempted to deliver to
  the configured destination. Backed up data can be all the data that the delivery stream
  attempted to deliver or just data that it failed to deliver (Redshift and S3 destinations
  can only back up all data). CDK can create a new S3 bucket where it will back up data, or
  you can provide a bucket where data will be backed up. You can also provide a prefix under
  which your backed-up data will be placed within the bucket. By default, source data is not
  backed up to S3.
  ```python




  firehose.DeliveryStream(self, "Delivery Stream Backup All",
      destination=
      destinations.S3Bucket(bucket,
          s3_backup=destinations.DestinationS3BackupProps(
              mode=destinations.BackupMode.ALL
          )
      )
  )
  firehose.DeliveryStream(self, "Delivery Stream Backup All Explicit Bucket",
      destination=
      destinations.S3Bucket(bucket,
          s3_backup=destinations.DestinationS3BackupProps(
              bucket=backup_bucket
          )
      )
  )

  firehose.DeliveryStream(self, "Delivery Stream Backup All Explicit Prefix",
      destination=
      destinations.S3Bucket(bucket,
          s3_backup=destinations.DestinationS3BackupProps(
              mode=destinations.BackupMode.ALL,
              data_output_prefix="mybackup"
          )
      )
  )
  ```
  If any Data Processing or Transformation is configured on your Delivery Stream, the source
  records will be backed up in their original format.

  Data can be transformed before being delivered to destinations. There are two types of
  data processing for delivery streams: record transformation with AWS Lambda, and record
  format conversion using a schema stored in an AWS Glue table. If both types of data
  processing are configured, then the Lambda transformation is performed first. By default,
  no data processing occurs. This construct library currently only supports data
  transformation with AWS Lambda. See [#15501](https://github.com/aws/aws-cdk/issues/15501)
  to track the status of adding support for record format conversion.

  To transform the data, Amazon Data Firehose will call a Lambda function that you provide
  and deliver the data returned in place of the source record. The function must return a
  result that contains records in a specific format, including the following fields:
  * `recordId` -- the ID of the input record that corresponds the results.
  * `result` -- the status of the transformation of the record: "Ok" (success), "Dropped"
    (not processed intentionally), or "ProcessingFailed" (not processed due to an error).
  * `data` -- the transformed data, Base64-encoded.
  The data is buffered up to 1 minute and up to 3 MiB by default before being sent to the
  function, but can be configured using `bufferInterval` and `bufferSize`
  in the processor configuration (see: [Buffering](#buffering)). If the function invocation
  fails due to a network timeout or because of hitting an invocation limit, the invocation
  is retried 3 times by default, but can be configured using `retries` in the processor
  configuration.
  ```python



  lambda_function = lambda_.Function(self, "Processor",
      runtime=lambda_.Runtime.NODEJS_LATEST,
      handler="index.handler",
      code=lambda_.Code.from_asset(path.join(__dirname, "process-records"))
  )
  lambda_processor = firehose.LambdaFunctionProcessor(lambda_function,
      buffer_interval=Duration.minutes(5),
      buffer_size=Size.mebibytes(5),
      retries=5
  )
  s3_destination = destinations.S3Bucket(bucket,
      processor=lambda_processor
  )
  firehose.DeliveryStream(self, "Delivery Stream",
      destination=s3_destination
  )
  ```
  ```python
  import path as path
  import aws_cdk.aws_kinesisfirehose_alpha as firehose
  import aws_cdk.aws_kms as kms
  import aws_cdk.aws_lambda_nodejs as lambdanodejs
  import aws_cdk.aws_logs as logs
  import aws_cdk.aws_s3 as s3
  import aws_cdk as cdk
  import aws_cdk.aws_kinesisfirehose_destinations_alpha as destinations
  app = cdk.App()
  stack = cdk.Stack(app, "aws-cdk-firehose-delivery-stream-s3-all-properties")
  bucket = s3.Bucket(stack, "Bucket",
      removal_policy=cdk.RemovalPolicy.DESTROY,
      auto_delete_objects=True
  )
  backup_bucket = s3.Bucket(stack, "BackupBucket",
      removal_policy=cdk.RemovalPolicy.DESTROY,
      auto_delete_objects=True
  )
  log_group = logs.LogGroup(stack, "LogGroup",
      removal_policy=cdk.RemovalPolicy.DESTROY
  )
  data_processor_function = lambdanodejs.NodejsFunction(stack, "DataProcessorFunction",
      entry=path.join(__dirname, "lambda-data-processor.js"),
      timeout=cdk.Duration.minutes(1)
  )
  processor = firehose.LambdaFunctionProcessor(data_processor_function,
      buffer_interval=cdk.Duration.seconds(60),
      buffer_size=cdk.Size.mebibytes(1),
      retries=1
  )
  key = kms.Key(stack, "Key",
      removal_policy=cdk.RemovalPolicy.DESTROY
  )
  backup_key = kms.Key(stack, "BackupKey",
      removal_policy=cdk.RemovalPolicy.DESTROY
  )
  firehose.DeliveryStream(stack, "Delivery Stream",
      destination=destinations.S3Bucket(bucket,
          logging_config=destinations.EnableLogging(log_group),
          processor=processor,
          compression=destinations.Compression.GZIP,
          data_output_prefix="regularPrefix",
          error_output_prefix="errorPrefix",
          buffering_interval=cdk.Duration.seconds(60),
          buffering_size=cdk.Size.mebibytes(1),
          encryption_key=key,
          s3_backup=destinations.DestinationS3BackupProps(
              mode=destinations.BackupMode.ALL,
              bucket=backup_bucket,
              compression=destinations.Compression.ZIP,
              data_output_prefix="backupPrefix",
              error_output_prefix="backupErrorPrefix",
              buffering_interval=cdk.Duration.seconds(60),
              buffering_size=cdk.Size.mebibytes(1),
              encryption_key=backup_key
          )
      )
  )
  firehose.DeliveryStream(stack, "ZeroBufferingDeliveryStream",
      destination=destinations.S3Bucket(bucket,
          compression=destinations.Compression.GZIP,
          data_output_prefix="regularPrefix",
          error_output_prefix="errorPrefix",
          buffering_interval=cdk.Duration.seconds(0)
      )
  )
  app.synth()
  ```
  See: [Data Transformation](https://docs.aws.amazon.com/firehose/latest/dev/data-transformation.html)
  in the *Amazon Data Firehose Developer Guide*.

  The DeliveryStream class automatically creates IAM service roles with all the minimum
  necessary permissions for Amazon Data Firehose to access the resources referenced by your
  delivery stream. One service role is created for the delivery stream that allows Amazon
  Data Firehose to read from a Kinesis data stream (if one is configured as the delivery
  stream source) and for server-side encryption. Note that if the DeliveryStream is created
  without specifying a `source` or `encryptionKey`, this role is not created as it is not needed.
  Another service role is created for each destination, which gives Amazon Data Firehose write
  access to the destination resource, as well as the ability to invoke data transformers and
  read schemas for record format conversion. If you wish, you may specify your own IAM role for
  either the delivery stream or the destination service role, or both. It must have the correct
  trust policy (it must allow Amazon Data Firehose to assume it) or delivery stream creation or
  data delivery will fail. Other required permissions to destination resources, encryption keys, etc.,
  will be provided automatically.
  ```python






  delivery_stream_role = iam.Role(self, "Delivery Stream Role",
      assumed_by=iam.ServicePrincipal("firehose.amazonaws.com")
  )
  destination_role = iam.Role(self, "Destination Role",
      assumed_by=iam.ServicePrincipal("firehose.amazonaws.com")
  )
  destination = destinations.S3Bucket(bucket, role=destination_role)
  firehose.DeliveryStream(self, "Delivery Stream",
      destination=destination,
      role=delivery_stream_role
  )
  ```
  See [Controlling Access](https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html)
  in the *Amazon Data Firehose Developer Guide*.

  IAM roles, users or groups which need to be able to work with delivery streams should be
  granted IAM permissions.
  Any object that implements the `IGrantable` interface (i.e., has an associated principal)
  can be granted permissions to a delivery stream by calling:
  * `grantPutRecords(principal)` - grants the principal the ability to put records onto the
    delivery stream
  * `grant(principal, ...actions)` - grants the principal permission to a custom set of
    actions
  ```python


  lambda_role = iam.Role(self, "Role",
      assumed_by=iam.ServicePrincipal("lambda.amazonaws.com")
  )
  delivery_stream.grant_put_records(lambda_role)
  ```
  The following write permissions are provided to a service principal by the
  `grantPutRecords()` method:
  * `firehose:PutRecord`
  * `firehose:PutRecordBatch`

  Conversely to the above, Amazon Data Firehose requires permissions in order for delivery
  streams to interact with resources that you own. For example, if an S3 bucket is specified
  as a destination of a delivery stream, the delivery stream must be granted permissions to
  put and get objects from the bucket. When using the built-in AWS service destinations
  found in the `@aws-cdk/aws-kinesisfirehose-destinations-alpha` module, the CDK grants the
  permissions automatically. However, custom or third-party destinations may require custom
  permissions. In this case, use the delivery stream as an `IGrantable`, as follows:
  ```python

  fn = lambda_.Function(self, "Function",
      code=lambda_.Code.from_inline("exports.handler = (event) => {}"),
      runtime=lambda_.Runtime.NODEJS_LATEST,
      handler="index.handler"
  )
  fn.grant_invoke(delivery_stream)
  ```


