Neon Terraform providers
communityThe following is a list of community-created Terraform providers for managing Neon Postgres platform resources.
note
Community Terraform providers are not maintained or officially supported by Neon. Use these providers at your own discretion. If you have questions about the providers, please contact the the project maintainers.
-
Terraform Provider Neon — Maintainer: Dmitry Kisler (sponsored by Neon)
-
Terraform Neon Provider — Maintainer: Pavan Kumar Sunkara
Important usage notes
-
Provider upgrades: When using
terraform init -upgrade
to update a custom Terraform provider, be aware that changes in the provider’s schema or defaults can lead to unintended resource replacements. This may occur when certain attributes are altered or reset. For example, fields previously set to specific values might be reset tonull
, forcing the replacement of the entire resource.To avoid unintended resource replacements which can result in data loss:
- Review the provider’s changelog for any breaking changes that might affect your resources before upgrading to a new version.
- For CI pipelines and auto-approved pull requests, only use
terraform init
. Runningterraform init -upgrade
should be done manually followed by plan reviews. - Run
terraform plan
before applying any changes to detect potential differences and review the behavior of resource updates. - Use lifecycle protections on critical resources to ensure they're not recreated unintentionally.
- Explicitly define all critical resource parameters in your Terraform configurations, even if they had defaults previously.
- On Neon paid plans, you can enable branch protection to prevent unintended deletion of branches and projects. To learn more, see Protected branches.
-
Provider maintenance: As Neon enhances existing features and introduces new ones, the Neon API will continue to evolve. These changes may not immediately appear in community-maintained Terraform providers. If you notice that a provider requires an update, please reach out to the maintainer by opening an issue or contributing to the provider's GitHub repository.
Example application
The following example application demonstrates how to set up Terraform, connect to a Neon Postgres database, and perform a Terraform run that inserts data. It covers how to:
- Use Go's
os/exec
package to run Terraform commands - Write a Go test function to validate Terraform execution
- Execute Terraform commands such as
init
,plan
, andapply
View the YouTube tutorial: Neon Postgres for Terraform with Go.