Skip to main content

Manage Lagoon hosting platform resources as infrastructure-as-code.

Project description

Pulumi Lagoon Provider — Python SDK

PyPI version License

A Pulumi provider for managing Lagoon resources as infrastructure-as-code.

Installation

pip install pulumi-lagoon

Configuration

pulumi config set lagoon:apiUrl https://api.lagoon.example.com/graphql
pulumi config set --secret lagoon:token YOUR_TOKEN

Or via environment variables:

export LAGOON_API_URL=https://api.lagoon.example.com/graphql
export LAGOON_TOKEN=YOUR_TOKEN

Supported Resources

Resource Description
Project Lagoon projects (applications/sites)
Environment Environments (branch/PR deployments)
Variable Project and environment variables
DeployTarget Kubernetes cluster deploy targets
DeployTargetConfig Branch-pattern routing to deploy targets
NotificationSlack Slack deployment notifications
NotificationRocketChat RocketChat deployment notifications
NotificationEmail Email deployment notifications
NotificationMicrosoftTeams Microsoft Teams deployment notifications
ProjectNotification Link notifications to projects
Task Advanced task definitions (command and image types)
Group Groups for organizing projects and users

Usage

import pulumi
from pulumi_lagoon.lagoon import Project, Environment, Variable, Group

project = Project("my-site",
    name="my-drupal-site",
    git_url="git@github.com:org/repo.git",
    deploytarget_id=1,
    production_environment="main",
    branches="^(main|develop|stage)$",
)

prod_env = Environment("production",
    name="main",
    project_id=project.lagoon_id,
    deploy_type="branch",
    deploy_base_ref="main",
    environment_type="production",
)

db_config = Variable("db-host",
    name="DATABASE_HOST",
    value="mysql.production.example.com",
    project_id=project.lagoon_id,
    environment_id=prod_env.lagoon_id,
    scope="runtime",
)

team = Group("my-team",
    name="my-team",
)

pulumi.export("project_id", project.lagoon_id)

Importing Existing Resources

pulumi import lagoon:lagoon:Project my-site 123
pulumi import lagoon:lagoon:Environment prod-env 123:main
pulumi import lagoon:lagoon:Variable api-key 123::API_KEY
pulumi import lagoon:lagoon:Group my-team my-team

Multi-Language Support

This provider also has SDKs for TypeScript/JavaScript and Go.

Documentation

License

Apache License 2.0

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_lagoon-0.3.0.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

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

pulumi_lagoon-0.3.0-py3-none-any.whl (53.0 kB view details)

Uploaded Python 3

File details

Details for the file pulumi_lagoon-0.3.0.tar.gz.

File metadata

  • Download URL: pulumi_lagoon-0.3.0.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pulumi_lagoon-0.3.0.tar.gz
Algorithm Hash digest
SHA256 76c9228c32868f9f34b1534e8caafcac8f0a749b3c67b536e9ac47c1325f04a4
MD5 85f52957ad42804ea6495dd40cdeba45
BLAKE2b-256 0285e253e81548c4db6124b24617d0da89b538ac010fe8556637185619a0a104

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulumi_lagoon-0.3.0.tar.gz:

Publisher: publish.yml on tag1consulting/pulumi-lagoon-provider

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_lagoon-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pulumi_lagoon-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 53.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pulumi_lagoon-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a30ba9eb1afbc43395b1d69c9a7315d281ffcb20a61cd94daf57506acd07672
MD5 8823c54840fbf69d7d89581489e8d07a
BLAKE2b-256 28f290908c30f022e92ee5ad684c6a987f68e3ef2b3bcd5b7413cb9076121aed

See more details on using hashes here.

Provenance

The following attestation bundles were made for pulumi_lagoon-0.3.0-py3-none-any.whl:

Publisher: publish.yml on tag1consulting/pulumi-lagoon-provider

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