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 theID/SECRETformat.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:
| Resource | Description |
|---|---|
| Cloud Accounts | Onboard AWS, Azure, GCP, Exoscale, and IBM Cloud accounts. |
| Templates | Define and manage image templates. |
| Custom Components | Create build and test components. |
| Access Management | Manage roles, role bindings, and API keys. |
| Variables | Define global variables for use in components. |
You can also use data sources to look up existing resources:
| Data Source | Description |
|---|---|
| Data Sources | Look up distributions, components, roles, and API keys. |