Formal Provider
Installation
The Formal provider is available as a package in the following Pulumi languages:
- JavaScript/TypeScript:
@formalco/pulumi
- Python:
pulumi-formal
- Go:
github.com/formalco/pulumi-formal/sdk/go/formal
- .NET:
Formal.Pulumi
Overview
Use the Formal Pulumi Provider to interact with the many resources supported by Formal.
Use the navigation to the left to read about the available resources.
Authentication and Configuration
Configuration for the Formal Provider is derived from the API tokens you can generate via the Formal Console.
Provider Configuration
Warning: Hard-coded credentials are not recommended in any Pulumi configuration and risks secret leakage should this file ever be committed to a public version control system.
Credentials can be provided by adding an apiKey
:
# Pulumi.yaml provider configuration file
name: configuration-example
runtime:
config:
formal:apiKey:
value: '<apiKey>'
You can also use pulumi config set formal:apiKey <apiKey> --secret
to set the API key.
Credentials can also be provided by using the FORMAL_API_KEY
environment variable.
For example:
# Pulumi.yaml provider configuration file
name: configuration-example
runtime:
export FORMAL_API_KEY="some_api_key" pulumi up
Examples
package main
import (
formal "github.com/formalco/pulumi-formal/sdk/go/formal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create a new connector instance.
_, err := formal.NewConnector(ctx, "demo-connector", &formal.ConnectorArgs{
Name: pulumi.String("demo-connector"),
SpaceId: nil,
TerminationProtection: pulumi.Bool(false),
})
return err
})
}
import * as formal from "@formalco/pulumi";
new formal.Connector('demo-connector', {
name: 'demo-connector',
spaceId: undefined,
terminationProtection: false,
})
import pulumi_formal as formal
formal.Connector('demo-connector',
name='demo-connector',
space_id=None,
termination_protection=False,
)
using System.Collections.Generic;
using Pulumi;
using Formal.Pulumi;
return await Deployment.RunAsync(() =>
{
var connector = new Connector("demo-connector", new ConnectorArgs {
Name = "demo-connector",
SpaceId = null,
TerminationProtection = false
});
// Export outputs here
return new Dictionary<string, object?>
{
["demo-connector"] = connector.Id
};
});
More examples on how to deploy Formal resources are available in the examples/
folder of the Formal Pulumi repository.