Skip to main content

GCP provider for Pragmatiks

Project description

GCP Provider

GCP provider for Pragmatiks - manage Google Cloud resources declaratively.

Available Resources

Secret (gcp/secret)

Manages secrets in GCP Secret Manager using user-provided service account credentials.

from gcp_provider import Secret, SecretConfig

# Define a secret
secret = Secret(
    name="my-api-key",
    config=SecretConfig(
        project_id="my-gcp-project",
        secret_id="api-key",
        data="super-secret-value",
        credentials={"type": "service_account", ...},  # or JSON string
    ),
)

Config:

  • project_id - GCP project ID where the secret will be created
  • secret_id - Identifier for the secret (must be unique per project)
  • data - Secret payload data to store
  • credentials - GCP service account credentials (JSON object or string)

Outputs:

  • resource_name - Full GCP resource name (projects/{project}/secrets/{id})
  • version_name - Full version resource name including version number
  • version_id - The version number as a string

Installation

pip install pragmatiks-gcp-provider

Development

Testing

# 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 Secret, SecretConfig

async def test_create_secret():
    harness = ProviderHarness()
    result = await harness.invoke_create(
        Secret,
        name="test-secret",
        config=SecretConfig(
            project_id="test-project",
            secret_id="my-secret",
            data="secret-value",
            credentials=mock_credentials,
        ),
    )
    assert result.success
    assert result.outputs.resource_name is not None

Deployment

Push your provider to Pragmatiks platform:

pragma provider push

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.127.0.tar.gz (12.4 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.127.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pragmatiks_gcp_provider-0.127.0.tar.gz
Algorithm Hash digest
SHA256 0745c63a7302c422cb1b6851000955a3f747cd84ed5f8312e9c93b73635347b4
MD5 158d59c41a6910d54ab2cd817ba951ce
BLAKE2b-256 f761a49d222ff6b0fdcc0855b4cdc5168dcf0af9f45120130a4722d828b8e01f

See more details on using hashes here.

Provenance

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

Publisher: publish.yaml on pragmatiks/pragma-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.127.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pragmatiks_gcp_provider-0.127.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6ec9eadb721b3c900d57d002e08ea443112dd1d291915a979fbd6957c4281d6
MD5 b1ee4ba586dc33c5c5966f362f49edf2
BLAKE2b-256 a9c06ac28b09742056b191b79300f42afa250931f7eb38c143d4014d2347f49d

See more details on using hashes here.

Provenance

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

Publisher: publish.yaml on pragmatiks/pragma-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