Skip to main content
The provider block pins exact provider npm package versions in the generated package.json, enabling reproducible deploys.

Syntax

provider "name" {
  version = "~> 6.0"
}
Only version is supported in v1.

Example

provider "aws" {
  version = "~> 6.0"
}

provider "kubernetes" {
  version = "= 4.2.0"
}

Version Constraint Translation

ubx syntaxnpm equivalentMeaning
~> 6.0^6.0.0Compatible with 6.x
= 4.2.04.2.0Exact pin
>= 5.0.0>=5.0.0Minimum version

Supported Providers

ubx namenpm package
aws@pulumi/aws
gcp@pulumi/gcp
azure@pulumi/azure-native
kubernetes@pulumi/kubernetes
random@pulumi/random
tls@pulumi/tls
Unknown provider names produce a warning (not an error) — future providers are allowed.

No TypeScript Emitted

Provider blocks only affect package.json — no TypeScript is emitted for them.

Error Cases

# Duplicate provider — compile error
provider "aws" { version = "~> 6.0" }
provider "aws" { version = "~> 5.0" }
# ✗  a provider block for "aws" is already declared

# Unknown attribute — compile error
provider "aws" { version = "~> 6.0"; region = "eu-west-1" }
# ✗  provider blocks only support the "version" attribute in v1