Skip to main content

Extra Pulumi utilities and resources for the Python runtime.

Project description

pulumi-extra

License: MIT codecov PyPI - Version

Extra Pulumi utilities and resources for the Python runtime.

✨ Features

  • Shortcuts for working with Pulumi resources, such as transforms, stack references, and template rendering
  • Pulumi transforms to automatically tag (AWS) or label (GCP) resources
  • Pulumi policies to require description (or tag/label if unsupported) on resources (both AWS and GCP)

🚀 Quick start

The most common use case for pulumi-extra is auto-tagging AWS resources and auto-labeling GCP resources. For example, in your stack's __main__.py file:

from pulumi_extra.contrib.aws import register_auto_tagging
from pulumi_extra.contrib.gcp import register_auto_labeling

register_auto_labeling()
register_auto_tagging()

... # Define your resources

To use policies, add the following to your policy module entrypoint (for example, policy/__main__.py):

import pulumi_policy as policy
from pulumi_extra.contrib.aws import policies as aws_policies
from pulumi_extra.contrib.gcp import policies as gcp_policies

policy.PolicyPack(
    name="default",
    policies=[
        aws_policies.require_tags,
        aws_policies.require_description,
        gcp_policies.require_labels,
        gcp_policies.require_description,
    ],
)

Example policy-config.json:

{
  "all": "advisory",
  "aws:require-description": {
    "exclude": [
      "aws:organizations/*"
    ]
  },
  "aws:require-tags": {
    "exclude": [
      "aws:organizations/*"
    ],
    "required-tags": [
      "Managed-By",
      "pulumi:Organization",
      "pulumi:Project",
      "pulumi:Stack"
    ]
  },
  "gcp:require-labels": {
    "required-labels": [
      "managed-by",
      "pulumi-organization",
      "pulumi-project",
      "pulumi-stack"
    ]
  }
}

You can pass the policy pack to pulumi preview like this:

$ pulumi preview \
  --policy-pack-config=<path_to_your_policy_config.json> \
  --policy-pack=<path_to_your_policy_module>

See the documentation for the full list of supported utilities.

💖 Contributing

Please refer to CONTRIBUTING.md for more information on how to contribute to this project.

📜 License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulumi_extra-0.3.2.tar.gz (116.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pulumi_extra-0.3.2-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file pulumi_extra-0.3.2.tar.gz.

File metadata

  • Download URL: pulumi_extra-0.3.2.tar.gz
  • Upload date:
  • Size: 116.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pulumi_extra-0.3.2.tar.gz
Algorithm Hash digest
SHA256 326ca2910c119de7d1313288401ae84cae2a2f4f53660b9c4a3df70f2c9bc416
MD5 6c79514c915d783e386e3a4ab240743e
BLAKE2b-256 5daee689ae05e6b188d6854299e91ffae18b2a360baf3970952cbbb409ead0ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulumi_extra-0.3.2.tar.gz:

Publisher: release.yaml on lasuillard-s/pulumi-extra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pulumi_extra-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: pulumi_extra-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pulumi_extra-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 673c65d4f8439afa1b5321907809b05275f033d56e84df57b05358d067d4f6b6
MD5 589d3d5b8b49d7d20160eab1cc691ffb
BLAKE2b-256 80b49d1ff09c4443a6aaee210bc9c05790d7788af8ef36ba2f683f55f978a156

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulumi_extra-0.3.2-py3-none-any.whl:

Publisher: release.yaml on lasuillard-s/pulumi-extra

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page