### Install Upstash Pulumi Provider for Go (go get) Source: https://github.com/upstash/pulumi-upstash/blob/master/README.md Installs the Upstash Pulumi provider package for use in Go projects using go get. ```bash go get github.com/upstash/pulumi-upstash/sdk/go/... ``` -------------------------------- ### Install Pulumi Upstash Provider Binary Source: https://github.com/upstash/pulumi-upstash/blob/master/docs/installation-configuration.md Installs the Upstash provider binary for Pulumi using the `pulumi plugin install` command. This command fetches the provider from a specified server URL. ```bash pulumi plugin install resource upstash --server https://github.com/upstash/pulumi-upstash/releases/download/v0.2.0 ``` -------------------------------- ### Create a Team Resource (Go) Source: https://github.com/upstash/pulumi-upstash/blob/master/sdk/python/README.md Shows how to create an Upstash Team resource using the Upstash Pulumi Provider in Go. This example defines a team with specified members and configurations. ```go package main import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/upstash/pulumi-upstash/sdk/go/upstash" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { createdTeam, err := upstash.NewTeam(ctx, "exampleTeam", &upstash.TeamArgs{ TeamName: pulumi.String("pulumi go team"), CopyCc: pulumi.Bool(false), TeamMembers: pulumi.StringMap{ "": pulumi.String("owner"), "": pulumi.String("dev"), }, }) if err != nil { return err } return nil }) } ``` -------------------------------- ### Create a Redis Database with Upstash (Python) Source: https://github.com/upstash/pulumi-upstash/blob/master/README.md An example in Python demonstrating the creation of an Upstash Redis database, specifying the database name, region, primary region, and TLS settings. ```python import pulumi import upstash_pulumi as upstash example_db = upstash.RedisDatabase("exampleDB", database_name="Pulumi DB", region="global", primary_region="us-east-1" tls=True ) ``` -------------------------------- ### Install Upstash Pulumi Provider for Node.js (npm/yarn) Source: https://github.com/upstash/pulumi-upstash/blob/master/README.md Installs the Upstash Pulumi provider package for use in Node.js projects via npm or yarn. ```bash npm install @upstash/pulumi ``` ```bash yarn add @upstash/pulumi ``` -------------------------------- ### Install Upstash Pulumi Provider for Python (pip) Source: https://github.com/upstash/pulumi-upstash/blob/master/README.md Installs the Upstash Pulumi provider package for use in Python projects using pip. ```bash pip install upstash_pulumi ``` -------------------------------- ### Set Upstash Environment Variables (Windows) Source: https://github.com/upstash/pulumi-upstash/blob/master/docs/installation-configuration.md Sets the Upstash email and API key as environment variables for Windows using PowerShell. These variables are necessary for the Pulumi Upstash provider to authenticate with Upstash services. ```powershell $env:UPSTASH_EMAIL = "" $env:UPSTASH_API_KEY = "" ``` -------------------------------- ### Set Upstash Environment Variables (Linux/macOS) Source: https://github.com/upstash/pulumi-upstash/blob/master/docs/installation-configuration.md Sets the Upstash email and API key as environment variables for Linux and macOS. These variables are required for the Pulumi Upstash provider to authenticate with Upstash services. ```bash export UPSTASH_EMAIL= export UPSTASH_API_KEY= ``` -------------------------------- ### Create an Upstash Team with Members (Go) Source: https://github.com/upstash/pulumi-upstash/blob/master/README.md Shows how to create an Upstash team with specified members and roles using the Upstash Pulumi provider in Go. It includes error handling for team creation. ```go package main import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/upstash/pulumi-upstash/sdk/go/upstash" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { createdTeam, err := upstash.NewTeam(ctx, "exampleTeam", &upstash.TeamArgs{ TeamName: pulumi.String("pulumi go team"), CopyCc: pulumi.Bool(false), TeamMembers: pulumi.StringMap{ "": pulumi.String("owner"), "": pulumi.String("dev"), }, }) if err != nil { return err } return nil }) } ``` -------------------------------- ### Create Redis Databases (TypeScript) Source: https://github.com/upstash/pulumi-upstash/blob/master/sdk/python/README.md Demonstrates creating multiple Upstash Redis databases programmatically using the Upstash Pulumi Provider in TypeScript. It iterates to create five databases with specified configurations. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as upstash from "@upstash/pulumi"; // multiple redis databases in a single for loop for (let i = 0; i < 5; i++) { new upstash.RedisDatabase("mydb" + i, { databaseName: "pulumi-ts-db" + i, region: "global", primaryRegion: "us-east-1", tls: true }) } ``` -------------------------------- ### Create Redis Database (Python) Source: https://github.com/upstash/pulumi-upstash/blob/master/sdk/python/README.md Illustrates creating an Upstash Redis database using the Upstash Pulumi Provider in Python. This snippet defines a single database with its name, region, primary region, and TLS settings. ```python import pulumi import upstash_pulumi as upstash example_db = upstash.RedisDatabase("exampleDB", database_name="Pulumi DB", region="global", primary_region="us-east-1" tls=True ) ``` -------------------------------- ### Create Multiple Redis Databases with Upstash (TypeScript) Source: https://github.com/upstash/pulumi-upstash/blob/master/README.md Demonstrates how to create multiple Upstash Redis databases programmatically using a for loop in TypeScript. It configures database name, region, primary region, and TLS settings. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as upstash from "@upstash/pulumi"; // multiple redis databases in a single for loop for (let i = 0; i < 5; i++) { new upstash.RedisDatabase("mydb" + i, { databaseName: "pulumi-ts-db" + i, region: "global", primaryRegion: "us-east-1", tls: true }) } ``` -------------------------------- ### Create Upstash Redis Database Source: https://github.com/upstash/pulumi-upstash/blob/master/docs/_index.md Provisions an Upstash Redis database instance. Requires Upstash API keys for authentication. Configurable with database name, region, primary region, TLS, and multizone settings. ```typescript import * as upstash from "@upstash/pulumi"; const createdDb = new upstash.RedisDatabase("mydb", { databaseName: "pulumi-ts-db", region: "global", primaryRegion: "us-east-1" tls: true, multizone: true }) ``` ```go import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/upstash/pulumi-upstash/sdk/go/upstash" ) func main() { pulumi.Run(func(ctx *pulumi.Context) error { createdDb, err := upstash.NewRedisDatabase(ctx, "exampleDB", &upstash.RedisDatabaseArgs{ DatabaseName: pulumi.String("pulumi-go-db"), Region: pulumi.String("global"), PrimaryRegion: pulumi.String("us-east-1"), Tls: pulumi.Bool(true), Multizone: pulumi.Bool(true), }) if err != nil { return err } ctx.Export("redisDB", createdDb) return nil }) } ``` ```python import upstash_pulumi as upstash example_db = upstash.RedisDatabase("exampleDB", database_name="Pulumi DB", region="global", primary_region="us-east-1" tls=True ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.