Skip to main content

GCP provider for Pragmatiks

Project description

gcp Provider

GCP provider for Pragmatiks

Resources

Define your resources in src/gcp_provider/resources.py:

from pragma_sdk import Resource, Config, Outputs, Field
from typing import ClassVar

class MyResourceConfig(Config):
    name: Field[str]
    size: Field[int] = 10

class MyResourceOutputs(Outputs):
    url: str
    created_at: str

class MyResource(Resource[MyResourceConfig, MyResourceOutputs]):
    provider: ClassVar[str] = "gcp"
    resource: ClassVar[str] = "my_resource"

    async def on_create(self) -> MyResourceOutputs:
        # Create the resource
        return MyResourceOutputs(url="...", created_at="...")

    async def on_update(self, previous_config: MyResourceConfig) -> MyResourceOutputs:
        # Update the resource
        return self.outputs

    async def on_delete(self) -> None:
        # Delete the resource
        pass

Development

Testing

Test your resource lifecycle methods with ProviderHarness:

# Install dependencies
uv sync --dev

# Run tests
uv run pytest tests/

Writing Tests

Use ProviderHarness to test lifecycle methods:

from pragma_sdk.provider import ProviderHarness
from gcp_provider import ExampleResource, ExampleConfig

async def test_create():
    harness = ProviderHarness()
    result = await harness.invoke_create(
        ExampleResource,
        name="test",
        config=ExampleConfig(name="my-resource", size=10),
    )
    assert result.success
    assert result.outputs.url is not None

Deployment

Push your provider to Pragmatiks platform:

pragma provider push

The platform handles all runtime infrastructure - you just push your code.

Updating This Project

This project was created with Copier. To update to the latest template:

copier update

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

pragmatiks_gcp_provider-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

pragmatiks_gcp_provider-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file pragmatiks_gcp_provider-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for pragmatiks_gcp_provider-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0452acb3aaeac7b1d03d1cd5885a357e8d1c149331fb9f529266e8fd6903e8a2
MD5 8facfb4808cb182926cfcfab4ee99b45
BLAKE2b-256 bec4b03acb359331e9ec62ff9f4b1dac1411469c93555121799d6a16c1e60c78

See more details on using hashes here.

Provenance

The following attestation bundles were made for pragmatiks_gcp_provider-0.1.0.tar.gz:

Publisher: publish.yaml on pragmatiks/providers

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

File details

Details for the file pragmatiks_gcp_provider-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pragmatiks_gcp_provider-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b36c66ead5c6b605159e2e23359dcdf00f9f17f9d1e7af24601c82652a52027
MD5 0dedd46291112f6c09ae21c210e28744
BLAKE2b-256 2ccb4e7712ad132cfe93952f02aab2cfa3c7fd8a78f9222ce4b5afd2664663ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for pragmatiks_gcp_provider-0.1.0-py3-none-any.whl:

Publisher: publish.yaml on pragmatiks/providers

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