Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle non-standard package names for Pulumi providers #42

Closed
sammyjoyce opened this issue Mar 20, 2024 · 1 comment
Closed

Handle non-standard package names for Pulumi providers #42

sammyjoyce opened this issue Mar 20, 2024 · 1 comment

Comments

@sammyjoyce
Copy link
Contributor

https://github.com/sst/ion/blob/4fdc960ccf1cc35ab76d4050eeb012c6a336c2d5/pkg/project/install.go#L12C1-L14C2

Currently, ion assumes that all Pulumi provider packages follow the naming convention "@pulumi/provider". However, some providers, such as the Upstash provider, use a different package name format ("@upstash/pulumi").

I am happy to create a pull request to handle any of the non-standard package names if helpful, but thought I'd raise the issue prior in case you already have plans to handle it.

@sammyjoyce
Copy link
Contributor Author

It can be worked around by not including the provider in app.providers (thanks to Garret in the sst discord):

/// <reference path="./.sst/platform/config.d.ts" />
import * as upstash from "@upstash/pulumi"

export default $config({
  app(input) {
    return {
      name: "sst",
      removal: input?.stage === "production" ? "retain" : "remove",
      home: "cloudflare",
      providers: {
        cloudflare: true
      }
    };
  },
  async run() {
    const provider = new upstash.Provider("Upstash", {
      apiKey: process.env.UPSTASH_API_KEY!,
      email: process.env.UPSTASH_EMAIL!
    })

    new upstash.RedisDatabase("SSTUpstash", {
      databaseName: "sst",
      region: "us-east-1",
    }, { provider })
  },
});

@thdxr thdxr closed this as completed in a4447ae Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant