Comprehensive examples for using the Webflow Pulumi Provider across all supported languages and use cases.
- Pulumi CLI 3.0+
- Webflow Account with API access
- Language-specific runtime (Node.js, Python, Go, .NET, Java)
# 1. Choose an example directory
cd examples/robotstxt/typescript
# 2. Install dependencies
npm install
# 3. Create a new Pulumi stack
pulumi stack init dev
# 4. Configure your Webflow site ID
pulumi config set webflow:siteId your-site-id --secret
# 5. Preview and deploy
pulumi preview
pulumi up
# 6. Clean up
pulumi destroyGetting Started:
npm install
npm run build
pulumi upExample Locations:
- Quickstart:
examples/quickstart/typescript/ - RobotsTxt:
examples/robotstxt/typescript/ - Redirects:
examples/redirect/typescript/ - Site Management:
examples/site/typescript/
Key Files:
package.json- Dependenciestsconfig.json- TypeScript configurationindex.ts- Main Pulumi programPulumi.yaml- Stack configuration
Getting Started:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
pulumi upExample Locations:
- Quickstart:
examples/quickstart/python/ - RobotsTxt:
examples/robotstxt/python/ - Redirects:
examples/redirect/python/ - Site Management:
examples/site/python/
Key Files:
requirements.txt- Python dependencies__main__.py- Main Pulumi programPulumi.yaml- Stack configuration
Getting Started:
go mod download
pulumi upExample Locations:
- Quickstart:
examples/quickstart/go/ - RobotsTxt:
examples/robotstxt/go/ - Redirects:
examples/redirect/go/ - Site Management:
examples/site/go/
Key Files:
go.mod- Go module definitionmain.go- Main Pulumi programPulumi.yaml- Stack configuration
Getting Started:
dotnet restore
dotnet build
pulumi upExample Locations:
- RobotsTxt:
examples/robotstxt/csharp/ - Redirects:
examples/redirect/csharp/ - Site Management:
examples/site/csharp/
Key Files:
*.csproj- Project file with dependenciesProgram.cs- Main Pulumi programPulumi.yaml- Stack configuration
Getting Started:
mvn install
pulumi upExample Locations:
- RobotsTxt:
examples/robotstxt/java/ - Redirects:
examples/redirect/java/ - Site Management:
examples/site/java/
Key Files:
pom.xml- Maven dependenciesApp.java- Main Pulumi programPulumi.yaml- Stack configuration
The robots.txt file controls search engine crawler behavior on your site.
examples/robotstxt/
├── typescript/ - Complete TypeScript example
├── python/ - Complete Python example
├── go/ - Complete Go example
├── csharp/ - Complete C# example
└── java/ - Complete Java example
What's Included:
- Creating
robots.txtfiles - Allow all crawlers pattern
- Selective blocking patterns
- Directory restrictions
- Crawler-specific rules
See: RobotsTxt README
Manage URL redirects (301 permanent, 302 temporary, external).
examples/redirect/
├── typescript/ - Complete TypeScript example
├── python/ - Complete Python example
├── go/ - Complete Go example
├── csharp/ - Complete C# example
└── java/ - Complete Java example
What's Included:
- Permanent redirects (301)
- Temporary redirects (302)
- External domain redirects
- Bulk redirect patterns
- Redirect management
See: Redirect examples documentation
Manage Webflow sites including creation, configuration, and publishing.
examples/site/
├── typescript/ - Complete TypeScript example
├── python/ - Complete Python example
├── go/ - Complete Go example
├── csharp/ - Complete C# example
└── java/ - Complete Java example
What's Included:
- Site creation and configuration
- Custom domain setup
- Timezone configuration
- Site publishing
- Site state management
- Import existing sites
See: Site management documentation
Manage multiple Webflow sites in a single Pulumi program.
examples/multi-site/
├── basic-typescript/
├── basic-python/
├── basic-go/
├── config-driven-typescript/
├── template-python/
└── multi-env-go/
Features:
- Create and manage multiple sites
- Configure different options per site
- Manage resources across sites
- Environment-specific configurations
Deploy to different environments (dev, staging, production).
examples/stack-config/
├── typescript-complete/
├── python-workflow/
├── go-advanced/
Features:
- Environment-specific configuration
- Stack-based deployments
- Configuration inheritance
- Secret management
Integrate Pulumi deployments with CI/CD pipelines.
examples/ci-cd/
├── github-actions/
Features:
- Automated deployments
- Pull request previews
- Environment promotion
- Deployment automation
Debug and troubleshoot Pulumi deployments.
examples/troubleshooting-logs/
├── typescript-troubleshooting/
├── python-cicd-logging/
└── go-log-analysis/
Features:
- Debug logging patterns
- Error analysis
- Performance monitoring
- Log aggregation
Tests validate that examples work correctly with the Webflow provider.
# Run all example tests
cd /path/to/pulumi-webflow
go test -v ./examples
# Run specific test
go test -v ./examples -run TestTypeScriptRobotsTxt
# Run with coverage
go test -v -cover ./examples// examples/robotstxt_test.go
package examples
import (
"path/filepath"
"testing"
"github.com/pulumi/providertest/pulumitest"
)
func TestTypeScriptRobotsTxtExample(t *testing.T) {
test := pulumitest.NewPulumiTest(t,
filepath.Join("robotstxt", "typescript"),
opttest.YarnLink("pulumi-webflow"),
opttest.AttachProviderServer("webflow", providerFactory),
)
test.Preview(t)
test.Up(t)
test.Destroy(t)
}- ✅ TypeScript examples tested with Yarn
- ✅ Python examples tested with pip
- ✅ Go examples tested with go mod
- ✅ C# examples tested with dotnet
- ✅ Java examples tested with Maven
Secret Values:
# Store secrets securely
pulumi config set webflow:siteId your-site-id --secretConfiguration Files:
# Pulumi.yaml
name: my-project
runtime: nodejs
config:
webflow:siteId:
description: Webflow site ID
secret: true
environment:
description: Deployment environment
default: developmentDifferent languages have different naming conventions:
| Language | Convention | Example |
|---|---|---|
| TypeScript | camelCase | siteId, content |
| Python | snake_case | site_id, content |
| Go | PascalCase | SiteId, Content |
| C# | PascalCase | SiteId, Content |
| Java | camelCase | siteId, content |
TypeScript/JavaScript:
try {
const robot = new webflow.RobotsTxt("example", {...});
} catch (error) {
console.error("Failed to create robots.txt:", error);
}Python:
try:
robot = webflow.RobotsTxt("example", ...)
except Exception as e:
print(f"Failed to create robots.txt: {e}")Go:
robot, err := webflow.NewRobotsTxt(ctx, "example", &webflow.RobotsTxtArgs{...})
if err != nil {
return fmt.Errorf("failed to create robots.txt: %w", err)
}Do:
- Group related resources logically
- Use meaningful resource names
- Document complex configurations
- Test your deployments
Don't:
- Hardcode sensitive values
- Create resources without naming them
- Deploy without previewing first
- Ignore error messages
Pre-Deployment Checklist:
- Review
pulumi previewoutput - Verify configuration values
- Run tests locally
- Check resource dependencies
- Backup existing configurations
Deployment:
pulumi preview # Review changes
pulumi up # Deploy
pulumi stack output # Verify resultsError: webflow::RobotsTxt creation failed: site not found
Solution:
- Verify your site ID: Settings → General in Webflow
- Ensure correct format:
abc123def456 - Check API token has access to site
Error: Cannot find module 'pulumi-webflow'
Solution:
# TypeScript/JavaScript
npm install
npm install --save pulumi-webflow
# Python
pip install -r requirements.txt
pip install pulumi-webflow
# Go
go get github.com/jdetmar/pulumi-webflow/sdk/go/webflow
# C#
dotnet add package Pulumi.Webflow
# Java
# Add to pom.xml or build.gradleError: Authentication failed - invalid API token
Solution:
- Check Pulumi config:
pulumi config list - Update credentials:
pulumi config set webflow:apiToken ... --secret - Verify token has necessary permissions in Webflow
Have an example you'd like to share? We'd love to include it!
- Create your example in the appropriate directory
- Include README with setup instructions
- Add tests using pulumitest
- Submit a pull request