pulumi-stack-utils


Namepulumi-stack-utils JSON
Version 0.1.2 PyPI version JSON
download
home_page
SummaryUtilities for working with Pulumi stacks
upload_time2023-05-11 21:03:04
maintainer
docs_urlNone
author
requires_python
licenseBSD-2-Clause
keywords pulumi iac
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pulumi-stack-utils
![test workflow](https://github.com/rs21io/pulumi-stack-utils/actions/workflows/test.yml/badge.svg)

A collection of utilities for working with [Pulumi](https://pulumi.com) stacks

The original motivation for this package is to get around some limitations with the `StackReference`
available in the official [pulumi](https://pypi.org/project/pulumi/) Python package. Specifically around
reading outputs from other stacks. Currently, stacks need to share the same passphrase to read outputs
from each other, even if the output isn't secret.

More information can be found in [this issue](https://github.com/pulumi/pulumi/issues/2823).

## Installation

```bash
pip install pulumi-stack-utils
```

## Usage

Retrieve outputs from a stack using an S3 backend

```python
from pulumi_stack_utils import StackReference

# If backend_url isn't provided the package will try and read it
# from the Pulumi.yaml file in the cwd
ref = StackReference("project/my-stack", backend_url="s3://state-backend/prefix")
output = ref.get_output("myOutput")
```

Autotag resources created on AWS. Based on this [blog post](https://www.pulumi.com/blog/automatically-enforcing-aws-resource-tagging-policies/)

```python
import pulumi
from pulumi_stack_utils.aws.autotag import register_auto_tags

config = pulumi.config()
register_auto_tags({
    "user:Project": pulumi.get_project(),
    "user:Stack": pulumi.get_stack(),
    "user:Owner": config.require("stackOwner"),
})
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pulumi-stack-utils",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "pulumi,iac",
    "author": "",
    "author_email": "James Arnold <james@rs21.io>",
    "download_url": "https://files.pythonhosted.org/packages/95/85/23f3f0c2b8c1403c3ed8f67e0368d16be5177a36b68ff7209bcd18aa2ae1/pulumi-stack-utils-0.1.2.tar.gz",
    "platform": null,
    "description": "# pulumi-stack-utils\n![test workflow](https://github.com/rs21io/pulumi-stack-utils/actions/workflows/test.yml/badge.svg)\n\nA collection of utilities for working with [Pulumi](https://pulumi.com) stacks\n\nThe original motivation for this package is to get around some limitations with the `StackReference`\navailable in the official [pulumi](https://pypi.org/project/pulumi/) Python package. Specifically around\nreading outputs from other stacks. Currently, stacks need to share the same passphrase to read outputs\nfrom each other, even if the output isn't secret.\n\nMore information can be found in [this issue](https://github.com/pulumi/pulumi/issues/2823).\n\n## Installation\n\n```bash\npip install pulumi-stack-utils\n```\n\n## Usage\n\nRetrieve outputs from a stack using an S3 backend\n\n```python\nfrom pulumi_stack_utils import StackReference\n\n# If backend_url isn't provided the package will try and read it\n# from the Pulumi.yaml file in the cwd\nref = StackReference(\"project/my-stack\", backend_url=\"s3://state-backend/prefix\")\noutput = ref.get_output(\"myOutput\")\n```\n\nAutotag resources created on AWS. Based on this [blog post](https://www.pulumi.com/blog/automatically-enforcing-aws-resource-tagging-policies/)\n\n```python\nimport pulumi\nfrom pulumi_stack_utils.aws.autotag import register_auto_tags\n\nconfig = pulumi.config()\nregister_auto_tags({\n    \"user:Project\": pulumi.get_project(),\n    \"user:Stack\": pulumi.get_stack(),\n    \"user:Owner\": config.require(\"stackOwner\"),\n})\n```\n",
    "bugtrack_url": null,
    "license": "BSD-2-Clause",
    "summary": "Utilities for working with Pulumi stacks",
    "version": "0.1.2",
    "project_urls": {
        "repository": "https://github.com/rs21io/pulumi-stack-utils"
    },
    "split_keywords": [
        "pulumi",
        "iac"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e033697cbc1285656799e3253c7901775a9d5a1f94428ac411e6b979309251c",
                "md5": "3caeff1bf716411269fbebc2bebd2560",
                "sha256": "18d484dfe792393d80b247505e0585e10135f5bccc1c8b7e13e6cc8b328e3bc4"
            },
            "downloads": -1,
            "filename": "pulumi_stack_utils-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3caeff1bf716411269fbebc2bebd2560",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5065,
            "upload_time": "2023-05-11T21:03:01",
            "upload_time_iso_8601": "2023-05-11T21:03:01.824530Z",
            "url": "https://files.pythonhosted.org/packages/6e/03/3697cbc1285656799e3253c7901775a9d5a1f94428ac411e6b979309251c/pulumi_stack_utils-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "958523f3f0c2b8c1403c3ed8f67e0368d16be5177a36b68ff7209bcd18aa2ae1",
                "md5": "a3c18ba560a90318735ce00f051069ae",
                "sha256": "b4fc69e009a285e24789e8840e46db12fc4ac737a9114c7c3e3ac2b8a2f3df78"
            },
            "downloads": -1,
            "filename": "pulumi-stack-utils-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a3c18ba560a90318735ce00f051069ae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4885,
            "upload_time": "2023-05-11T21:03:04",
            "upload_time_iso_8601": "2023-05-11T21:03:04.151702Z",
            "url": "https://files.pythonhosted.org/packages/95/85/23f3f0c2b8c1403c3ed8f67e0368d16be5177a36b68ff7209bcd18aa2ae1/pulumi-stack-utils-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-11 21:03:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rs21io",
    "github_project": "pulumi-stack-utils",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pulumi-stack-utils"
}
        
Elapsed time: 0.08254s