Skip to main content

Terraform Provider

The official ImageFactory Terraform provider allows you to manage your image building lifecycle as code. By using the provider, you can automate the onboarding of cloud accounts, define image templates, manage custom components, and configure access control within your GitOps workflows.

The provider (nordcloud/imagefactory) is published on the Terraform Registry.

Provider Version

The current stable version of the provider is 1.14.1.

Installation

To use the provider, add the following block to your Terraform configuration:

terraform {
required_providers {
imagefactory = {
source = "nordcloud/imagefactory"
version = "~> 1.14.1"
}
}
}

Authentication

The provider authenticates with the ImageFactory API using an API Key. An API Key consists of an ID and a Secret, formatted as API_KEY_ID/API_KEY_SECRET.

You can create and manage API keys in the ImageFactory UI under Access Management > API Keys.

Configuration

Configure the provider with your API key and the API endpoint:

provider "imagefactory" {
api_key = "your-api-key-id/your-api-key-secret"
api_url = "https://api.imagefactory.nordcloudapp.com/graphql"
}

Environment Variables

You can also provide credentials via environment variables, which is recommended for CI/CD environments:

  • IMAGEFACTORY_API_KEY: Your API key in the ID/SECRET format.
  • IMAGEFACTORY_API_URL: The API endpoint (defaults to the production URL if not set).

Resources and Data Sources

The provider supports managing the following resources:

ResourceDescription
Cloud AccountsOnboard AWS, Azure, GCP, Exoscale, and IBM Cloud accounts.
TemplatesDefine and manage image templates.
Custom ComponentsCreate build and test components.
Access ManagementManage roles, role bindings, and API keys.
VariablesDefine global variables for use in components.

You can also use data sources to look up existing resources:

Data SourceDescription
Data SourcesLook up distributions, components, roles, and API keys.