Manage Pulumi ESC resources using a Pulumi Program
Pulumi Service Provider empowers you to manage your entire infrastructure and application landscape through a unified approach. This means you can define environments, add version tags, and even control access using familiar Infrastructure as Code (IaC) practices ensuring consistency and repeatability across your deployments.
Here’s a list of ESC resources available through Pulumi Service Provider:
- Environment: Define new environments and create new revisions using the normal
pulumi up
command. Learn more here. - Environment Team Permission: Control permissions to your environments. Combines with Team and Environment resources easily! Learn more here.
- Environment Revision Tag: Add tags to your environment revision for flexible environment import and version control. Learn more here.
- ESC Webhook: Create webhooks to monitor or react to events on your environments. This can be configured for specific environments or at the organization level. Learn more here.
If you haven’t used Pulumi Service Provider before, see this installation and configuration guide.
Pulumi Service Provider ESC capabilities are available for TypeScript/JavaScript, Go, Python, C#, Java, and YAML. Here are examples of creating environments in TypeScript/JavaScript, Go, and Python:
import * as service from "@pulumi/pulumiservice";
import * as pulumi from "@pulumi/pulumi";
var environment = new service.Environment("testing-environment", {
organization: "service-provider-test-org",
name: "testing-environment-ts",
yaml: new pulumi.asset.StringAsset(
`values:
myKey1: "myValue1"
myNestedKey:
myKey2: "myValue2"
myNumber: 1`
)
})
import pulumi
from pulumi_pulumiservice import Environment
environment = Environment(
"testing-environment",
organization="service-provider-test-org",
name="testing-environment-py",
yaml=pulumi.StringAsset("""
values:
myKey1: "myValue1"
myNestedKey:
myKey2: "myValue2"
myNumber: 1
""")
)
package main
import (
"github.com/pulumi/pulumi-pulumiservice/sdk/go/pulumiservice"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := pulumiservice.NewEnvironment(ctx, "testing-environment", &pulumiservice.EnvironmentArgs{
Name: pulumi.String("testing-environment-go"),
Organization: pulumi.String("service-provider-test-org"),
Yaml: pulumi.NewStringAsset(`
values:
myKey1: "myValue1"
myNestedKey:
myKey2: "myValue2"
myNumber: 1`),
})
if err != nil {
return err
}
return nil
})
}
For more examples of Pulumi Service Provider usage, check out the examples folder in the Pulumi Service Provider GitHub repository. It is open source, and contributions are welcome!
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.