### Complete Status Page Setup Example Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/better-uptime/status-page.mdx A comprehensive example setting up a status page with company details, sections, monitors, and resources, including export of the status URL. ```typescript import * as betteruptime from "pulumi-better-uptime"; // Create status page const statusPage = new betteruptime.StatusPage("company-status", { companyName: "Acme Corp", companyUrl: "https://acme.com", subdomain: "status", timezone: "America/New_York", logoUrl: "https://acme.com/logo.png", subscribeBySms: true, smsNotificationsEnabled: true, }); // Create sections const coreSection = new betteruptime.StatusPageSection("core", { statusPageId: statusPage.id, name: "Core Services", position: 1, }); const apiSection = new betteruptime.StatusPageSection("apis", { statusPageId: statusPage.id, name: "APIs", position: 2, }); // Add monitors const webMonitor = new betteruptime.Monitor("web", { url: "https://www.acme.com", monitorType: "status", }); const apiMonitor = new betteruptime.Monitor("api", { url: "https://api.acme.com", monitorType: "status", }); // Add to status page const webResource = new betteruptime.StatusPageResource("web-resource", { statusPageId: statusPage.id, statusPageSectionId: coreSection.id, monitorId: webMonitor.id, publicName: "Website", position: 1, }); const apiResource = new betteruptime.StatusPageResource("api-resource", { statusPageId: statusPage.id, statusPageSectionId: apiSection.id, monitorId: apiMonitor.id, publicName: "REST API", position: 1, }); export const statusUrl = statusPage.url; ``` -------------------------------- ### OpenFGA Quick Start with Pulumi Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/openfga/index.mdx A quick start example demonstrating the creation of an OpenFGA store, authorization model, and a relationship tuple using Pulumi. ```typescript import * as openfga from "pulumi-openfga"; // 1. Create a store. const store = new openfga.Store("docs-app", { name: "docs-app", }); // 2. Define an authorization model from an OpenFGA DSL document. const modelDoc = openfga.getAuthorizationModelDocumentOutput({ dsl: ` model schema 1.1 type user type document relations define viewer: [user] define editor: [user] `, }); const model = new openfga.AuthorizationModel("docs-app-model", { storeId: store.id, modelJson: modelDoc.result, }); // 3. Write a relationship tuple: alice can view document:readme. const tuple = new openfga.RelationshipTuple("alice-can-view-readme", { storeId: store.id, authorizationModelId: model.id, user: "user:alice", relation: "viewer", object: "document:readme", }); export const storeId = store.id; export const modelId = model.id; ``` -------------------------------- ### Configure Complete DNS Setup Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/namecheap/domain-records.mdx This example demonstrates how to configure a complete DNS setup, including A, CNAME, MX, and TXT records, using the OVERWRITE mode. It also exports the domain records ID. ```typescript import * as namecheap from "@pulumi-any-terraform/namecheap"; const dnsConfig = new namecheap.DomainRecords("complete-dns", { domain: "example.com", mode: "OVERWRITE", emailType: "MX", records: [ // Root domain A record { hostname: "@", type: "A", address: "192.0.2.1", ttl: 3600, }, // WWW subdomain { hostname: "www", type: "CNAME", address: "example.com", ttl: 3600, }, // Mail exchanger { hostname: "@", type: "MX", address: "mail.example.com", mxPref: 10, ttl: 3600, }, { hostname: "@", type: "MX", address: "mail2.example.com", mxPref: 20, ttl: 3600, }, // TXT record for SPF { hostname: "@", type: "TXT", address: "v=spf1 include:_spf.example.com ~all", ttl: 3600, }, // API subdomain { hostname: "api", type: "A", address: "192.0.2.2", ttl: 1800, }, ], }); export const recordsId = dnsConfig.domainRecordsId; ``` -------------------------------- ### Basic Time Provider Setup Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/time/configuration.mdx Import and use Time provider resources directly without explicit provider configuration. This is the simplest way to get started. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as time from "@pulumi/time"; // No provider configuration needed // Resources can be used directly const offset = new time.Offset("example", { offsetDays: 7, }); ``` -------------------------------- ### Install Dependencies with pnpm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/AGENTS.md Installs all project dependencies using pnpm. This is the initial setup step for the monorepo. ```bash # Install pnpm install ``` -------------------------------- ### Install PostHog Provider (bun) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/posthog/index.mdx Install the PostHog provider using bun. ```bash bun add pulumi-posthog ``` -------------------------------- ### Install PostHog Provider (yarn) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/posthog/index.mdx Install the PostHog provider using yarn. ```bash yarn add pulumi-posthog ``` -------------------------------- ### Install Namecheap Provider (bun) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/namecheap/index.mdx Install the Namecheap provider package using bun. ```bash bun add @pulumi-any-terraform/namecheap ``` -------------------------------- ### Install Portainer Provider with bun Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/portainer/README.md Install the Portainer provider package using bun. ```bash bun add portainer-portainer ``` -------------------------------- ### Install PostHog Provider (pnpm) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/posthog/index.mdx Install the PostHog provider using pnpm. ```bash pnpm add pulumi-posthog ``` -------------------------------- ### Verify Setup Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/contributing.mdx Run this command to verify your development environment setup and check for any configuration issues. ```bash pnpm run syncpack:check ``` -------------------------------- ### Install Namecheap Provider (npm) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/namecheap/index.mdx Install the Namecheap provider package using npm. ```bash npm install @pulumi-any-terraform/namecheap ``` -------------------------------- ### Install PostHog Provider (npm) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/posthog/index.mdx Install the PostHog provider using npm. ```bash npm install pulumi-posthog ``` -------------------------------- ### Install Namecheap Provider (yarn) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/namecheap/index.mdx Install the Namecheap provider package using yarn. ```bash yarn add @pulumi-any-terraform/namecheap ``` -------------------------------- ### Install Bunny Provider (Bun) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/bunnynet/index.mdx Install the Bunnynet provider package using Bun. ```bash bun add pulumi-bunnynet ``` -------------------------------- ### Install Dependencies Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/contributing.mdx Install project dependencies using pnpm. Ensure you have Node.js and pnpm installed. ```bash pnpm install ``` -------------------------------- ### Install pulumi-time with yarn Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/time/README.md Install the pulumi-time package using yarn. ```bash yarn add pulumi-time ``` -------------------------------- ### Install and Use Namecheap Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/index.mdx Install the Pulumi Namecheap provider using npm and use it to create DNS records within your Pulumi program. This example demonstrates basic resource creation with specific domain, type, and address configurations. ```bash npm install pulumi-namecheap ``` ```typescript import * as namecheap from "pulumi-namecheap"; const record = new namecheap.Record("www", { domain: "example.com", type: "A", address: "192.168.1.1" }); ``` -------------------------------- ### Install Bunny Provider (Yarn) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/bunnynet/index.mdx Install the Bunnynet provider package using Yarn. ```bash yarn add pulumi-bunnynet ``` -------------------------------- ### Install Bunny Provider (npm) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/bunnynet/index.mdx Install the Bunnynet provider package using npm. ```bash npm install pulumi-bunnynet ``` -------------------------------- ### Advanced Domain Records and Email Setup with Namecheap Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/namecheap/README.md Configure advanced domain records, including email setup for Gmail, using the `namecheap.DomainRecords` resource. This example shows managing A, CNAME, MX, and TXT records with specific email configurations and merge mode. ```typescript import * as namecheap from 'pulumi-namecheap' const domainRecords = new namecheap.DomainRecords('example-domain', { domain: 'example.com', emailType: 'GMAIL', // Configure Gmail for email mode: 'MERGE', records: [ // A record for root domain { hostname: '@', type: 'A', address: '203.0.113.1', ttl: 1800, }, // CNAME for www subdomain { hostname: 'www', type: 'CNAME', address: 'example.com', ttl: 1800, }, // Multiple MX records for redundancy { hostname: '@', type: 'MX', address: 'aspmx.l.google.com', mxPref: 1, ttl: 3600, }, { hostname: '@', type: 'MX', address: 'alt1.aspmx.l.google.com', mxPref: 5, ttl: 3600, }, // TXT record for domain verification { hostname: '@', type: 'TXT', address: 'google-site-verification=your-verification-string', ttl: 3600, }, ], }) // Export the domain records ID export const domainRecordsId = domainRecords.domainRecordsId ``` -------------------------------- ### Install Namecheap Provider (pnpm) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/namecheap/index.mdx Install the Namecheap provider package using pnpm. ```bash pnpm add @pulumi-any-terraform/namecheap ``` -------------------------------- ### Install pulumi-time with npm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/time/README.md Install the pulumi-time package using npm. ```bash npm install pulumi-time ``` -------------------------------- ### Install Bunny Provider (pnpm) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/bunnynet/index.mdx Install the Bunnynet provider package using pnpm. ```bash pnpm add pulumi-bunnynet ``` -------------------------------- ### Install Pulumi TeamCity Provider with pnpm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/teamcity/README.md Install the TeamCity provider using pnpm. ```bash pnpm add pulumi-teamcity ``` -------------------------------- ### Run Development Server Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/README.md Commands to start the development server using npm, pnpm, or yarn. ```bash npm run dev # or pnpm dev # or yarn dev ``` -------------------------------- ### Install Portainer Provider with npm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/portainer/README.md Install the Portainer provider package using npm. ```bash npm install pulumi-portainer ``` -------------------------------- ### Quick Start: Create a Delay and Use in Dependencies Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/time/index.mdx Demonstrates creating a delay resource and using it to manage resource dependencies. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as time from "pulumi-time"; // Create a delay const delay = new time.Sleep("wait-for-deployment", { createDuration: "30s", // Wait 30 seconds }); // Use the delay in resource dependencies const resource = new SomeResource("dependent", { // Resource properties }, { dependsOn: [delay] }); ``` -------------------------------- ### Install Pulumi TeamCity Provider with yarn Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/teamcity/README.md Install the TeamCity provider using yarn. ```bash yarn add pulumi-teamcity ``` -------------------------------- ### Install Pulumi TeamCity Provider with npm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/teamcity/README.md Install the TeamCity provider using npm. ```bash npm install pulumi-teamcity ``` -------------------------------- ### Install OpenFGA Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/openfga/index.mdx Install the OpenFGA provider package using your preferred package manager. ```bash bun add pulumi-openfga ``` ```bash pnpm add pulumi-openfga ``` ```bash yarn add pulumi-openfga ``` ```bash npm install pulumi-openfga ``` -------------------------------- ### Install pulumi-time with pnpm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/time/README.md Install the pulumi-time package using pnpm. ```bash pnpm add pulumi-time ``` -------------------------------- ### Install Type Definitions Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/troubleshooting.mdx Install necessary type definition packages for TypeScript. ```bash npm install @types/node ``` -------------------------------- ### Install Portainer Provider with pnpm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/portainer/README.md Install the Portainer provider package using pnpm. ```bash pnpm add portainer-portainer ``` -------------------------------- ### Install Pulumi Buildkite Provider (npm) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/buildkite/index.mdx Install the Buildkite provider package using npm. ```bash npm install pulumi-buildkite ``` -------------------------------- ### Install Portainer Provider with yarn Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/portainer/README.md Install the Portainer provider package using yarn. ```bash yarn add portainer-portainer ``` -------------------------------- ### Test Infisical Setup with Data Source Queries Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/infisical/README.md Demonstrates querying for projects and groups using Infisical data sources to test authentication setup. ```typescript import * as infisical from 'pulumi-infisical' // Test with a simple data source query const projects = infisical.getProjects({}) const groups = infisical.getGroups({}) ``` -------------------------------- ### Install Pulumi OpenFGA Provider with bun Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/openfga/README.md Install the Pulumi OpenFGA provider package using bun. This is a fast all-in-one JavaScript runtime. ```bash bun add pulumi-openfga ``` -------------------------------- ### Multi-Provider Infrastructure Example Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/README.md This TypeScript example demonstrates how to use multiple Pulumi providers (Namecheap and Better Uptime) to configure DNS records and set up monitoring for an API. It requires importing the respective Pulumi provider packages. ```typescript import * as pulumi from '@pulumi/pulumi' import * as namecheap from 'pulumi-namecheap' import * as betteruptime from 'pulumi-better-uptime' // DNS Configuration const apiRecord = new namecheap.Record('api', { domain: 'example.com', hostname: 'api', type: 'A', address: '192.168.1.100', }) // Monitoring const monitor = new betteruptime.Monitor('api-monitor', { url: pulumi.interpolate`https://${apiRecord.hostname}.${apiRecord.domain}`, monitorType: 'status', checkFrequency: 60, }) export const apiUrl = pulumi.interpolate`https://${apiRecord.hostname}.${apiRecord.domain}` export const monitorId = monitor.id ``` -------------------------------- ### Install Local Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/local/index.mdx Install the Local provider package using your preferred package manager. ```bash bun add pulumi-local ``` ```bash pnpm add pulumi-local ``` ```bash yarn add pulumi-local ``` ```bash npm install pulumi-local ``` -------------------------------- ### Install Namecheap Provider with npm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/getting-started.mdx Add the pulumi-namecheap provider to your project using npm. ```bash npm install pulumi-namecheap ``` -------------------------------- ### Install Pulumi Namecheap Provider with bun Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/namecheap/README.md Install the Namecheap provider using bun. This command adds the provider to your project's dependencies. ```bash bun add namecheap ``` -------------------------------- ### Install Pulumi Buildkite Provider with bun Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/buildkite/README.md Use this command to add the Buildkite provider to your project when using bun. ```bash bun add pulumi-buildkite ``` -------------------------------- ### Install Namecheap Provider with pnpm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/getting-started.mdx Add the pulumi-namecheap provider to your project using pnpm. ```bash pnpm add pulumi-namecheap ``` -------------------------------- ### Install Pulumi Infisical Provider with bun Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/infisical/README.md Install the provider using bun. This command adds the Infisical provider to your project's dependencies. ```bash bun add pulumi-infisical ``` -------------------------------- ### Create a Local File Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/local/README.md Example of creating a JSON configuration file using the local.File resource. The content is stringified JSON. ```typescript import * as pulumi from '@pulumi/pulumi' import * as local from 'pulumi-local' // Create a local file const config = new local.File('app-config', { filename: '/tmp/config.json', content: JSON.stringify({ environment: 'production', debug: false, }), }) // Export the file path export const configPath = config.filename ``` -------------------------------- ### Organized DNS Records Example Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/namecheap/domain-records.mdx An example demonstrating how to organize multiple DNS records within an array for web servers, mail servers, email authentication, and services. This follows best practices for grouping related records. ```typescript const records = [ // Web servers { hostname: "@", type: "A", address: "192.0.2.1", ttl: 3600 }, { hostname: "www", type: "A", address: "192.0.2.1", ttl: 3600 }, // Mail servers { hostname: "@", type: "MX", address: "mail1.example.com", mxPref: 10, ttl: 3600 }, { hostname: "@", type: "MX", address: "mail2.example.com", mxPref: 20, ttl: 3600 }, // Email authentication { hostname: "@", type: "TXT", address: "v=spf1 include:_spf.example.com ~all", ttl: 3600 }, { hostname: "_dmarc", type: "TXT", address: "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com", ttl: 3600 }, // Services { hostname: "api", type: "A", address: "192.0.2.2", ttl: 1800 }, { hostname: "cdn", type: "CNAME", address: "cdn.provider.com", ttl: 3600 }, ]; ``` -------------------------------- ### Install Pulumi Time Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/time/index.mdx Install the pulumi-time package using your preferred package manager. ```bash bun add pulumi-time ``` ```bash pnpm add pulumi-time ``` ```bash yarn add pulumi-time ``` ```bash npm install pulumi-time ``` -------------------------------- ### Create a BunnyNet DNS Zone and Record Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/bunnynet/index.mdx Example of creating a DNS zone for a domain and then adding an A record with a specific TTL. ```typescript const dnsZone = new bunnynet.DnsZone("dns", { domain: "example.com", }); const dnsRecord = new bunnynet.DnsRecord("www", { zoneId: dnsZone.id, name: "www", type: "A", value: "192.168.1.1", ttl: 300, }); ``` -------------------------------- ### Multi-Cluster Setup with Agent Tokens Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/buildkite/index.mdx Set up two distinct clusters (staging and production) and create specific agent tokens for each. ```typescript const stagingCluster = new buildkite.Cluster("staging", { name: "Staging", description: "Staging environment agents", }); const prodCluster = new buildkite.Cluster("production", { name: "Production", description: "Production environment agents", }); // Create agent tokens for each cluster const stagingToken = new buildkite.ClusterAgentToken("staging-token", { clusterId: stagingCluster.id, description: "Staging agent token", }); const prodToken = new buildkite.ClusterAgentToken("prod-token", { clusterId: prodCluster.id, description: "Production agent token", }); ``` -------------------------------- ### Install Infisical Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/infisical/index.mdx Install the Infisical provider package using your preferred package manager. ```bash bun add pulumi-infisical ``` ```bash pnpm add pulumi-infisical ``` ```bash yarn add pulumi-infisical ``` ```bash npm install pulumi-infisical ``` -------------------------------- ### Install Pulumi OpenFGA Provider with npm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/openfga/README.md Install the Pulumi OpenFGA provider package using npm. This is the first step to using the provider in your project. ```bash npm install pulumi-openfga ``` -------------------------------- ### Install Pulumi CLI Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/getting-started.mdx Install the Pulumi CLI using package managers for macOS, Windows, or Linux. ```bash brew install pulumi/tap/pulumi ``` ```bash choco install pulumi ``` ```bash curl -fsSL https://get.pulumi.com | sh ``` -------------------------------- ### Install Namecheap Provider with yarn Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/getting-started.mdx Add the pulumi-namecheap provider to your project using yarn. ```bash yarn add pulumi-namecheap ``` -------------------------------- ### Test BunnyNet Provider Setup Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/bunnynet/README.md A simple query to test the BunnyNet provider setup by fetching available regions. ```typescript import * as bunnynet from 'pulumi-bunnynet' // Test with a simple resource query const regions = bunnynet.getRegion({}) ``` -------------------------------- ### Basic Local File Setup Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/local/configuration.mdx Demonstrates the basic usage of the `local.File` resource without explicit provider configuration. Resources can be used directly after importing the provider. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as local from "pulumi-local"; // No provider configuration needed // Resources can be used directly const file = new local.File("example", { filename: "/tmp/example.txt", content: "Hello, world!", }); ``` -------------------------------- ### Install Pulumi Infisical Provider with npm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/infisical/README.md Install the provider using npm. This is the first step to integrating Infisical with your Pulumi projects. ```bash npm install pulumi-infisical ``` -------------------------------- ### Install Pulumi Namecheap Package Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/README.md Install the Pulumi Namecheap package using npm, yarn, or pnpm. ```bash npm install pulumi-namecheap # or yarn add pulumi-namecheap # or pnpm add pulumi-namecheap ``` -------------------------------- ### Install Pulumi Local Provider with bun Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/local/README.md Use bun to add the pulumi-local package to your project dependencies. ```bash bun add pulumi-local ``` -------------------------------- ### Preview and Deploy Infrastructure Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/getting-started.mdx Preview the infrastructure changes before deployment and then deploy them using the Pulumi CLI. ```bash # Preview changes pulumi preview # Deploy changes pulumi up ``` -------------------------------- ### Install Pulumi Buildkite Provider with yarn Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/buildkite/README.md Use this command to add the Buildkite provider to your project when using yarn. ```bash yarn add pulumi-buildkite ``` -------------------------------- ### Multi-Region DNS Setup with Health Checking Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/namecheap/dns-guide.mdx Configure DNS for a multi-region application, including primary and secondary region records with low TTL for quick failover, and region-specific endpoints. This example uses OVERWRITE mode. ```typescript const primaryRegion = new namecheap.DomainRecords("multi-region-dns", { domain: "example.com", mode: "OVERWRITE", records: [ // Primary region { hostname: "@", type: "A", address: "192.0.2.1", ttl: 300 // Low TTL for quick failover }, // Secondary region (manual failover) { hostname: "backup", type: "A", address: "192.0.2.2", ttl: 300 }, // Region-specific endpoints { hostname: "us-east", type: "A", address: "192.0.2.1", }, { hostname: "eu-west", type: "A", address: "192.0.2.3", }, ], }); ``` -------------------------------- ### Install Pulumi Infisical Provider with yarn Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/infisical/README.md Install the provider using yarn. This command adds the Infisical provider to your project's dependencies. ```bash yarn add pulumi-infisical ``` -------------------------------- ### CDN and Load Balancer Setup with CNAME and A Records Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/namecheap/dns-guide.mdx Configure DNS for Content Delivery Networks (CDNs) and load balancers using CNAME records for services like Cloudflare and A records for direct IP address mapping. This example uses OVERWRITE mode. ```typescript const cdnSetup = new namecheap.DomainRecords("cdn-setup", { domain: "example.com", mode: "OVERWRITE", records: [ // Main site through CDN { hostname: "@", type: "CNAME", address: "example.cdn.cloudflare.net.", }, { hostname: "www", type: "CNAME", address: "example.cdn.cloudflare.net.", }, // Assets subdomain { hostname: "assets", type: "CNAME", address: "assets.example.cdn.net.", }, // API through load balancer { hostname: "api", type: "A", address: "192.0.2.10", }, ], }); ``` -------------------------------- ### Install Pulumi Local Provider with npm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/local/README.md Use npm to add the pulumi-local package to your project dependencies. ```bash npm install pulumi-local ``` -------------------------------- ### Maintenance Window Calculation Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/time/offset.mdx Calculates the start and end times for a 4-hour maintenance window starting 7 days and 2 hours from now. Exports the start, end, and duration. ```typescript const maintenanceStart = new time.Offset("maintenance-start", { offsetDays: 7, offsetHours: 2, // 2 AM next week }); const maintenanceEnd = new time.Offset("maintenance-end", { baseRfc3339: maintenanceStart.rfc3339, offsetHours: 4, // 4-hour window }); export const maintenanceWindow = { start: maintenanceStart.rfc3339, end: maintenanceEnd.rfc3339, duration: "4 hours", }; ``` -------------------------------- ### Install Pulumi Buildkite Provider with pnpm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/buildkite/README.md Use this command to add the Buildkite provider to your project when using pnpm. ```bash pnpm add pulumi-buildkite ``` -------------------------------- ### Complete Monitoring Setup Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/better-uptime/index.mdx A comprehensive setup including a monitor group, website and API monitors linked to the group, and an incident policy. Exports the dashboard URL. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as betteruptime from "pulumi-better-uptime"; // Monitor group const monitorGroup = new betteruptime.MonitorGroup("production", { name: "Production Services", }); // Website monitor const webMonitor = new betteruptime.Monitor("website", { url: "https://example.com", monitorType: "status", checkFrequency: 60, monitorGroupId: monitorGroup.id, }); // API monitor const apiMonitor = new betteruptime.Monitor("api", { url: "https://api.example.com/health", monitorType: "status", checkFrequency: 30, monitorGroupId: monitorGroup.id, }); // Incident policy const policy = new betteruptime.Policy("critical", { name: "Critical Incidents", repeatCount: 5, repeatDelay: 300, }); // Link monitors to policy const policyLink = new betteruptime.MonitorGroupPolicy("policy-link", { monitorGroupId: monitorGroup.id, policyId: policy.id, }); export const dashboardUrl = pulumi.interpolate`https://betteruptime.com/team/monitors`; ``` -------------------------------- ### Example: Deploying a Feature Flag with a Self-Hosted PostHog Instance Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/posthog/configuration.mdx Demonstrates how to configure the PostHog provider for a self-hosted instance and then deploy a feature flag using that provider. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as posthog from "pulumi-posthog"; const config = new pulumi.Config("posthog"); // Configure provider for self-hosted instance const provider = new posthog.Provider("self-hosted", { host: "https://posthog.yourcompany.com", apiKey: config.requireSecret("apiKey"), }); // Use the provider const flag = new posthog.FeatureFlag("beta-feature", { key: "new-feature", name: "New Feature", active: true, }, { provider }); ``` -------------------------------- ### Multi-Account Setup Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/better-uptime/configuration.mdx Configure separate Better Uptime providers for different accounts, such as production and staging, by using distinct Pulumi configurations. ```typescript // Production account const prodProvider = new betteruptime.Provider("prod", { apiToken: prodConfig.requireSecret("apiToken"), }); // Staging account const stagingProvider = new betteruptime.Provider("staging", { apiToken: stagingConfig.requireSecret("apiToken"), }); ``` -------------------------------- ### Build and Check New Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/contributing.mdx Build the new provider package using Nx and then check for any issues. These commands are run from the project root. ```bash # Build the provider pnpm nx run my-provider:build # Check for issues pnpm nx run my-provider:check ``` -------------------------------- ### Initialize Pulumi Project Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/getting-started.mdx Create a new directory and initialize a Pulumi project with TypeScript. ```bash mkdir my-infrastructure cd my-infrastructure pulumi new typescript ``` -------------------------------- ### Verify Pulumi Installation Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/getting-started.mdx Check your Pulumi installation by running the version command. ```bash pulumi version ``` -------------------------------- ### Force Dependency Installation Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/troubleshooting.mdx Use to resolve dependency conflicts by forcing installation with pnpm. ```bash pnpm install --force ``` -------------------------------- ### Install TeamCity Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/teamcity/index.mdx Install the TeamCity provider package using your preferred package manager. ```bash bun add pulumi-teamcity ``` ```bash pnpm add pulumi-teamcity ``` ```bash yarn add pulumi-teamcity ``` ```bash npm install pulumi-teamcity ``` -------------------------------- ### Install Portainer Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/portainer/index.mdx Install the Portainer provider package using your preferred package manager. ```bash bun add pulumi-portainer ``` ```bash pnpm add pulumi-portainer ``` ```bash yarn add pulumi-portainer ``` ```bash npm install pulumi-portainer ``` -------------------------------- ### Create a Buildkite Pipeline with Pulumi Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/buildkite/README.md Example of creating a new Buildkite pipeline with specified repository, default branch, and build steps using the Pulumi Buildkite provider. ```typescript import * as pulumi from '@pulumi/pulumi' import * as buildkite from 'pulumi-buildkite' // Create a pipeline const pipeline = new buildkite.Pipeline('my-app', { name: 'My Application', repository: 'https://github.com/myorg/myapp.git', defaultBranch: 'main', steps: ` steps: - label: ":hammer: Build" command: "npm run build" - label: ":test_tube: Test" command: "npm test" `, }) // Export the pipeline slug export const pipelineSlug = pipeline.slug ``` -------------------------------- ### Configure OpenFGA Provider with Pulumi Config (API Token) Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/openfga/README.md Configure the OpenFGA provider using Pulumi's configuration system with an API token for authentication. Set the API URL and the secret API token. ```bash # API token pulumi config set openfga:apiUrl https://api.us1.fga.dev pulumi config set --secret openfga:apiToken your-api-token ``` -------------------------------- ### Install Logtail Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/logtail/index.mdx Install the Logtail provider package using your preferred package manager. ```bash bun add pulumi-logtail ``` ```bash pnpm add pulumi-logtail ``` ```bash yarn add pulumi-logtail ``` ```bash npm install pulumi-logtail ``` -------------------------------- ### Install with Legacy Peer Dependencies Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/troubleshooting.mdx Use this flag to install npm packages when facing dependency conflicts. ```bash npm install --legacy-peer-deps ``` -------------------------------- ### Initialize and Configure Stacks for Environments Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/getting-started.mdx Initialize new stacks for different environments (e.g., production, staging) and set environment-specific configuration values. ```bash # Create production stack pulumi stack init production pulumi config set myProvider:endpoint https://api.production.com # Create staging stack pulumi stack init staging pulumi config set myProvider:endpoint https://api.staging.com ``` -------------------------------- ### Install Pulumi Better Uptime Provider Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/better-uptime/index.mdx Install the Better Uptime provider package using your preferred package manager. ```bash bun add pulumi-better-uptime ``` ```bash pnpm add pulumi-better-uptime ``` ```bash yarn add pulumi-better-uptime ``` ```bash npm install pulumi-better-uptime ``` -------------------------------- ### Basic PostHog Provider Setup Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/posthog/configuration.mdx Initializes the PostHog provider configuration using Pulumi's config system to retrieve the API key and optionally the host URL. ```typescript import * as posthog from "pulumi-posthog"; import * as pulumi from "@pulumi/pulumi"; const config = new pulumi.Config("posthog"); const apiKey = config.requireSecret("apiKey"); const host = config.get("host") || "https://us.posthog.com"; ``` -------------------------------- ### Multi-Project PostHog Provider Setup Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/posthog/configuration.mdx Demonstrates how to configure separate PostHog providers for different projects, each potentially using a different API key and PostHog instance host. ```typescript // Project A const projectAConfig = new pulumi.Config("posthog-project-a"); const projectAProvider = new posthog.Provider("project-a", { apiKey: projectAConfig.requireSecret("apiKey"), host: "https://us.posthog.com", }); // Project B const projectBConfig = new pulumi.Config("posthog-project-b"); const projectBProvider = new posthog.Provider("project-b", { apiKey: projectBConfig.requireSecret("apiKey"), host: "https://eu.posthog.com", }); ``` -------------------------------- ### Install Pulumi Logtail with yarn Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/logtail/README.md Install the Pulumi Logtail provider using yarn. This command adds the provider as a dependency to your project. ```bash yarn add pulumi-logtail ``` -------------------------------- ### TrendsQuery Example Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/posthog/insight.mdx Example JSON payload for a TrendsQuery, used to track event volumes over time. Specify the event and date range. ```typescript queryJson: JSON.stringify({ kind: "TrendsQuery", series: [{ kind: "EventsNode", event: "event_name", }], dateRange: { date_from: "-30d" }, }) ``` -------------------------------- ### Multi-Resource Deployment with Better Uptime Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/getting-started.mdx Example of deploying multiple resources using the Better Uptime provider, including a monitor and a policy, and associating them. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as betteruptime from "pulumi-better-uptime"; // Create a monitor const monitor = new betteruptime.Monitor("api-monitor", { url: "https://api.example.com/health", monitorType: "status", checkFrequency: 60, // Check every 60 seconds confirmationPeriod: 120, requestTimeout: 30, recoveryPeriod: 0, ssl: { checkExpiry: true, expiryThreshold: 30, }, pronounceableName: "API Health Monitor", }); // Create an incident policy const policy = new betteruptime.Policy("critical-policy", { name: "Critical Alerts", repeatCount: 3, repeatDelay: 300, }); // Associate monitor with policy const policyMonitor = new betteruptime.MonitorGroupPolicy("monitor-policy", { monitorGroupId: monitor.id, policyId: policy.id, }); // Export monitor URL export const monitorUrl = pulumi.interpolate`https://betteruptime.com/monitors/${monitor.id}`; ``` -------------------------------- ### Install Pulumi Logtail with pnpm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/logtail/README.md Install the Pulumi Logtail provider using pnpm. This command ensures the provider is available for your Pulumi project. ```bash pnpm add pulumi-logtail ``` -------------------------------- ### Install Pulumi Logtail with npm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/logtail/README.md Install the Pulumi Logtail provider using npm. This is the first step to integrating Logtail with your Pulumi projects. ```bash npm install pulumi-logtail ``` -------------------------------- ### Create a DNS Record with Pulumi Namecheap Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/README.md This example demonstrates how to configure the Namecheap provider and create a DNS 'A' record for a domain. Ensure provider configuration is set up, either via Pulumi config or environment variables. ```typescript import * as pulumi from '@pulumi/pulumi' import * as namecheap from 'pulumi-namecheap' // Configure provider (or use environment variables) const config = new pulumi.Config('namecheap') // Create a DNS record const record = new namecheap.Record('www-record', { domain: 'example.com', hostname: 'www', type: 'A', address: '192.168.1.1', ttl: 300, }) // Export the record ID export const recordId = record.id ``` -------------------------------- ### Create TeamCity Project, VCS Root, and Build Configuration Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/teamcity/README.md Set up a basic TeamCity project, define a VCS root for a Git repository, and create a build configuration with specified steps. ```typescript import * as teamcity from 'pulumi-teamcity' // Create a project const project = new teamcity.Project('my-project', { name: 'My Application', projectId: 'MyApp', description: 'Main application project', }) // Create a VCS root const vcsRoot = new teamcity.Vcsroot('my-vcs', { name: 'Main Repository', vcsName: 'jetbrains.git', projectId: project.projectId, properties: { branch: 'refs/heads/main', url: 'https://github.com/example/my-app.git', authMethod: 'PASSWORD', username: 'git-user', password: 'git-token', }, }) // Create a build configuration const buildConfig = new teamcity.BuildConfiguration('my-build', { name: 'Build and Test', projectId: project.projectId, vcsRoots: [ { id: vcsRoot.id, checkoutRules: '+:. => source', }, ], steps: [ { type: 'simpleRunner', name: 'Build', properties: { script: 'npm install && npm run build', }, }, ], }) ``` -------------------------------- ### Install Pulumi Infisical Provider with pnpm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/infisical/README.md Install the provider using pnpm. This ensures the Infisical provider is available for your Pulumi infrastructure code. ```bash pnpm add pulumi-infisical ``` -------------------------------- ### Create a Buildkite Cluster and Queue with Pulumi Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/buildkite/README.md Example of creating a Buildkite cluster and a default queue within that cluster using the Pulumi Buildkite provider. ```typescript import * as pulumi from '@pulumi/pulumi' import * as buildkite from 'pulumi-buildkite' // Create a cluster for production agents const prodCluster = new buildkite.Cluster('production', { name: 'Production', description: 'Cluster for production build agents', }) // Create a queue within the cluster const defaultQueue = new buildkite.ClusterQueue('default-queue', { clusterId: prodCluster.id, key: 'default', description: 'Default queue for production builds', }) export const clusterId = prodCluster.id ``` -------------------------------- ### FunnelsQuery Example Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/posthog/insight.mdx Example JSON payload for a FunnelsQuery, used to analyze conversion funnels. Define multiple event steps and a date range. ```typescript queryJson: JSON.stringify({ kind: "FunnelsQuery", series: [ { kind: "EventsNode", event: "step_1" }, { kind: "EventsNode", event: "step_2" }, { kind: "EventsNode", event: "step_3" }, ], dateRange: { date_from: "-30d" }, }) ``` -------------------------------- ### Install Pulumi OpenFGA Provider with pnpm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/openfga/README.md Install the Pulumi OpenFGA provider package using pnpm. This is another package manager for Node.js projects. ```bash pnpm add pulumi-openfga ``` -------------------------------- ### Install Pulumi OpenFGA Provider with yarn Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/openfga/README.md Install the Pulumi OpenFGA provider package using yarn. This is an alternative package manager for Node.js projects. ```bash yarn add pulumi-openfga ``` -------------------------------- ### Configure OpenFGA Provider with API Token Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/providers/openfga/index.mdx Configure the OpenFGA provider using an API token via Pulumi config or environment variables. ```bash pulumi config set openfga:apiUrl https://api.us1.fga.dev pulumi config set openfga:apiToken YOUR_API_TOKEN --secret ``` ```bash export FGA_API_URL="https://api.us1.fga.dev" export FGA_API_TOKEN="your-api-token" ``` -------------------------------- ### Install Pulumi Better Uptime with yarn Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/better-uptime/README.md Install the Better Uptime Pulumi provider using yarn. This command adds the provider to your project dependencies. ```bash yarn add pulumi-better-uptime ``` -------------------------------- ### Create Provider Documentation File Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/contributing.mdx Command to create the initial Markdown file for provider documentation within the docs site structure. ```bash # Create provider docs docs/content/docs/providers/my-provider.mdx ``` -------------------------------- ### Install Pulumi Better Uptime with pnpm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/better-uptime/README.md Install the Better Uptime Pulumi provider using pnpm. This command ensures the provider is available for your Pulumi project. ```bash pnpm add pulumi-better-uptime ``` -------------------------------- ### Using Multiple Providers in a Project Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/docs/content/docs/general/getting-started.mdx Example demonstrating how to use both Namecheap and Better Uptime providers within the same Pulumi project to manage different resources. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as namecheap from "pulumi-namecheap"; import * as betteruptime from "pulumi-better-uptime"; // Domain configuration const apiRecord = new namecheap.Record("api-record", { domain: "example.com", hostname: "api", type: "A", address: "192.168.1.100", }); // Monitor the domain const apiMonitor = new betteruptime.Monitor("api-monitor", { url: pulumi.interpolate`https://api.example.com/health`, monitorType: "status", checkFrequency: 60, }); export const apiUrl = pulumi.interpolate`https://api.example.com`; export const monitorId = apiMonitor.id; ``` -------------------------------- ### Install Pulumi Better Uptime with npm Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/better-uptime/README.md Install the Better Uptime Pulumi provider using npm. This is the first step to integrating Better Uptime with your infrastructure as code. ```bash npm install pulumi-better-uptime ``` -------------------------------- ### Create OpenFGA Store and Authorization Model in TypeScript Source: https://github.com/hckhanh/pulumi-any-terraform/blob/main/packages/openfga/README.md Create an OpenFGA store and define an authorization model using OpenFGA DSL, then convert it to JSON for the Pulumi provider. This example demonstrates managing basic user and document types with viewer, editor, and owner relations. ```typescript import * as openfga from 'pulumi-openfga' // Create a store const store = new openfga.Store('docs-app', { name: 'docs-app', }) // Author the model in OpenFGA DSL and convert to canonical JSON const modelDoc = openfga.getAuthorizationModelDocumentOutput({ dsl: ` model schema 1.1 type user type document relations define viewer: [user] define editor: [user] define owner: [user] `, }) // Apply the model to the store const model = new openfga.AuthorizationModel('docs-app-model', { storeId: store.id, modelJson: modelDoc.result, }) export const storeId = store.id export const modelId = model.id ```