poseidon / Terraform Provider Ct
Programming Languages
terraform-provider-ct
terraform-provider-ct
allows Terraform to validate a Container Linux Config or Fedora CoreOS Config and transpile it as Ignition for machine consumption.
Usage
Configure the config transpiler provider (e.g. providers.tf
).
provider "ct" {}
terraform {
required_providers {
ct = {
source = "poseidon/ct"
version = "0.8.0"
}
}
}
Define a Container Linux Config (CLC) or Fedora CoreOS Config (FCC).
# Container Linux Config
---
passwd:
users:
- name: core
ssh_authorized_keys:
- ssh-key foo
# Fedora CoreOS Config
---
variant: fcos
version: 1.3.0
passwd:
users:
- name: core
ssh_authorized_keys:
- ssh-key foo
Define a ct_config
data source and render for machine consumption.
data "ct_config" "worker" {
content = file("worker.yaml")
strict = true
pretty_print = false
snippets = [
file("units.yaml"),
file("storage.yaml"),
]
}
resource "aws_instance" "worker" {
user_data = data.ct_config.worker.rendered
}
Run terraform init
to ensure plugin version requirements are met.
$ terraform init
Requirements
- Terraform v0.13+ installed
Versions
Fedora CoreOS Config's contain a version
that is associated with an Ignition format verison. For example, a FCC with version: 1.0.0
would produce Ignition 3.0.0
, across future releases.
Container Linux Configs render a fixed Ignition version, depending on the terraform-provider-ct
release, so updating alters the rendered Ignition version.
terraform-provider-ct | CLC to Ignition | FCC to Ignition |
---|---|---|
0.8.x | Renders 2.3.0 | FCC (1.0, 1.1, 1.2, 1.3) -> Ignition (3.0, 3.1, 3.2, 3.2) |
0.7.x | Renders 2.3.0 | FCC (1.0, 1.1, 1.2) -> Ignition (3.0, 3.1, 3.2) |
0.6.x | Renders 2.3.0 | FCC 1.0.0 -> Ignition 3.0.0, FCC 1.1.0 -> Ignition v3.1.0 |
0.5.x | Renders 2.2.0 | FCC 1.0.0 -> Ignition 3.0.0 |
0.4.x | Renders 2.2.0 | FCC 1.0.0 -> Ignition 3.0.0 |
0.3.x | Renders 2.2.0 | NA |
0.2.x | Renders 2.0.0 | NA |
Notes:
- Fedora CoreOS Config
snippets
must match the version set in the content. Version skew among snippets is not supported.
Development
Binary
To develop the provider plugin locally, build an executable with Go v1.13+.
make
Vendor
Add or update dependencies in go.mod
and vendor.
make update
make vendor