Pulumi Spotinst Provider

raw JSON →
3.131.0 verified Sat May 09 auth: no python

A Pulumi package for managing Spot by NetApp cloud resources (Elastigroups, Ocean, etc.). It bridges Terraform provider spotinst to Pulumi. Current version: 3.131.0. Released frequently (multiple times per month) as a bridge update.

pip install pulumi-spotinst
error ModuleNotFoundError: No module named 'pulumi_spotinst.aws'
cause Importing from pulumi_spotinst.aws without having the package installed.
fix
Run 'pip install pulumi-spotinst' to install the package.
error pulumi_spotinst.exceptions.ResourceError: Missing required configuration keys: spotinst:account, spotinst:token
cause Provider credentials not set via Pulumi config or Provider resource.
fix
Set config: pulumi config set spotinst:account <account> and pulumi config set --secret spotinst:token <token>
error AttributeError: module 'pulumi_spotinst' has no attribute 'ElastigroupAWS'
cause Trying to import ElastigroupAWS from top-level package instead of subpackage.
fix
Use: from pulumi_spotinst.aws import ElastigroupAWS
gotcha Configuration via environment variables (SPOTINST_ACCOUNT, SPOTINST_TOKEN) is not automatically picked up by the Pulumi provider. You must pass credentials explicitly via Provider resource or Pulumi config.
fix Use Pulumi config keys 'spotinst:account' and 'spotinst:token', or create a Provider resource.
gotcha The SDK uses subpackages per cloud provider: pulumi_spotinst.aws, pulumi_spotinst.gcp, pulumi_spotinst.azure. Top-level exports are limited.
fix Always import from the specific subpackage (e.g., from pulumi_spotinst.aws import ElastigroupAWS).
breaking Major version bumps (v2 -> v3) may have removed deprecated resources or changed required fields. Always check the changelog when upgrading across major versions.
fix Review the provider's release notes on GitHub for any breaking changes before upgrading.

Create a basic AWS Elastigroup with Spotinst provider configuration.

import pulumi
import pulumi_spotinst as spotinst
from pulumi_spotinst.aws import ElastigroupAWS

config = pulumi.Config()
account = config.require("spotinst:account")
token = config.require_secret("spotinst:token")

provider = spotinst.Provider(
    "spotinst-provider",
    account=account,
    token=token,
)

group = ElastigroupAWS(
    "my-elastigroup",
    name="my-elastigroup",
    product="Linux/Unix",
    spot_types=["persistent"],
    desired_capacity=1,
    # ... other required fields
    opts=pulumi.ResourceOptions(provider=provider),
)

pulumi.export("group_id", group.id)