A Pulumi provider for managing Stripe resources, built by bridging the official Stripe Terraform Provider using pulumi-terraform-bridge.
npm install @humanlayer/pulumi-stripeimport * as stripe from "@humanlayer/pulumi-stripe";
// Create a product
const product = new stripe.Product("my-product", {
name: "My SaaS",
description: "A product managed with Pulumi",
});
// Create a price for the product
const price = new stripe.Price("my-price", {
product: product.id,
currency: "usd",
unitAmount: 1999, // $19.99
recurring: {
interval: "month",
},
});
// Create a coupon
const coupon = new stripe.Coupon("launch-discount", {
percentOff: 25,
duration: "repeating",
durationInMonths: 3,
});
// Create a webhook endpoint
const webhook = new stripe.WebhookEndpoint("my-webhook", {
url: "https://api.example.com/stripe/webhooks",
enabledEvents: [
"customer.subscription.created",
"customer.subscription.deleted",
"invoice.paid",
],
});
export const productId = product.id;
export const priceId = price.id;Product- Products and servicesPrice- Pricing for productsCustomer- Customer recordsCoupon- Discount couponsPromotionCode- Promotion codes for couponsWebhookEndpoint- Webhook endpointsTaxRate- Tax ratesShippingRate- Shipping ratesBillingMeter- Usage-based billing metersEntitlementsFeature- Entitlement features
Set your Stripe API key:
export STRIPE_API_KEY=sk_test_...Or configure via Pulumi config:
pulumi config set stripe:apiKey sk_test_... --secretmake buildThis will:
- Generate the Pulumi schema from the Terraform provider
- Build the provider binary
- Generate and compile the TypeScript SDK
- Stripe Terraform Provider - Upstream provider
- pulumi-terraform-bridge - Bridge library
- pulumi-tf-provider-boilerplate - Project template
MIT