packaged by Chainguard
Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.
This Crossplane provider runs OpenTofu modules as Workspace managed resources, so infrastructure defined in OpenTofu can be provisioned, updated, and destroyed declaratively from a Crossplane control plane.
Chainguard Containers are regularly-updated, secure-by-default container images.
For those with access, this container image is available on cgr.dev:
Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.
The Chainguard crossplane-provider-opentofu container image is a drop-in replacement for the upstream provider-opentofu Crossplane package published at xpkg.upbound.io/upbound/provider-opentofu.
The image ships the provider binary together with the Crossplane package metadata and CRDs in /package.yaml, so you can reference it directly in a Provider resource.
Like the upstream image, it uses crossplane-opentofu-provider as the entrypoint, provides the provider and OpenTofu at upstream's paths, /usr/local/bin/crossplane-opentofu-provider and /usr/local/bin/tofu, and sets TF_IN_AUTOMATION=1 and TF_PLUGIN_CACHE_DIR=/tofu/plugin-cache.
The bundled OpenTofu comes from the same minor release that upstream ships.
The provider keeps a working directory for each Workspace under /tofu, which belongs to UID 2000, the UID Crossplane runs provider pods as, the same as in the upstream image.
The image differs from upstream in a few ways:
.git-credentials file from a ProviderConfig is configured in /etc/gitconfig instead of /.gitconfig, so git finds it whatever the home directory is.bash and curl. This image includes git and BusyBox, which provides sh and the core utilities the provider calls, but not bash or curl. Modules that run local-exec provisioners can only use the tools the image ships.65532 with GID 0 and no user entry. This image runs as the nonroot user, with UID and GID 65532 and the home directory /home/nonroot. Both run as UID and GID 2000 when Crossplane starts the provider, so this only matters when you run the image directly.OPENTOFU_VERSION, which its build uses to download OpenTofu. The provider doesn't read it, and this image doesn't set it.You need a Kubernetes cluster with Crossplane v2.0 or later installed. If Crossplane is not installed yet, install it with Helm:
Create a Provider that points at the Chainguard image:
If your cluster needs credentials to pull from cgr.dev, add them to the Provider under spec.packagePullSecrets.
Wait for Crossplane to install the provider and report it as healthy:
The provider doesn't persist OpenTofu state itself, so modules must use a remote backend.
The following ProviderConfig keeps state in Secrets in the crossplane-system namespace through OpenTofu's kubernetes backend:
Next, create a Workspace with an inline module that generates a random ID and password:
Wait for the Workspace to become ready, then read its non-sensitive outputs:
The connection secret holds every output, including the sensitive password:
Deleting the Workspace runs tofu destroy and removes its state Secret:
Most Workspaces use a module from a Git repository rather than inline HCL.
For a private repository, store the credentials in the git credential store format and pass them to the provider through a ProviderConfig credential with the file name .git-credentials.
The provider writes that file for every Workspace that uses the ProviderConfig, and the credential helper in /etc/gitconfig reads it when the module is cloned:
Store the variables for the staging environment in a ConfigMap:
Add the credential to the ProviderConfig, and point a Workspace at the repository and the ConfigMap:
Replace USERNAME, TOKEN, and the repository URL with your own, and the module with one whose variables match staging.tfvars.
Pinning ref to a tag means an upstream change can't alter the Workspace until you move the tag in the spec.
With remotePullPolicy: IfNotPresent the provider clones the repository once and reuses the checkout on later reconciliations, instead of downloading it on every poll.
entrypoint runs OpenTofu from a subdirectory of the checkout, so modules in that directory can refer to siblings with relative paths such as ../modules/vpc.
Variables that differ per environment live in a ConfigMap, so the same module can back several Workspaces.
Chainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.
All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system designed to produce container images that meet the requirements of a more secure software supply chain.
The main features of Chainguard Containers include:
For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a development, or -dev, variant.
In all other cases, including Chainguard Containers tagged as :latest or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.
Although the -dev container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev variant into a more minimal production image.
To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl, or API.
To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.
Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.
This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.
Chainguard's container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:
GPL-3.0-or-later
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreementChainguard Containers are SLSA Level 3 compliant with detailed metadata and documentation about how it was built. We generate build provenance and a Software Bill of Materials (SBOM) for each release, with complete visibility into the software supply chain.
SLSA compliance at ChainguardThis image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.
PCI DSS at ChainguardA FIPS validated version of this image is available for FedRAMP compliance. STIG is included with FIPS image.