Skip to content
Terraform provider for Container Linux Configs
Branch: master
Clone or download
dghubble Add .travis.yml test coverage for Go v1.12.x
* Test the latest 3 versions of Go for consistency across
projects
Latest commit f830530 May 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ct ct: update tests to work with Ignition spec v2.2 Apr 25, 2018
example Upgrade terraform dependency to v0.12.0-beta1 Mar 12, 2019
vendor Vendor updated Terraform module dependency Mar 12, 2019
.gitignore *: Prepare for v0.2.0 release Aug 3, 2017
.travis.yml Add .travis.yml test coverage for Go v1.12.x May 8, 2019
CHANGES.md Rename module to github.com/poseidon/terraform-provider-ct May 8, 2019
CONTRIBUTING.md Add license and other docs Aug 15, 2016
DCO update CoC and legalese Jan 4, 2018
LICENSE Add license and other docs Aug 15, 2016
MAINTAINERS Add a MAINTAINERS file Jan 5, 2019
Makefile Rename module to github.com/poseidon/terraform-provider-ct May 8, 2019
NOTICE Add license and other docs Aug 15, 2016
README.md Rename module to github.com/poseidon/terraform-provider-ct May 8, 2019
code-of-conduct.md update CoC and legalese Jan 4, 2018
go.mod Rename module to github.com/poseidon/terraform-provider-ct May 8, 2019
go.sum
main.go Rename module to github.com/poseidon/terraform-provider-ct May 8, 2019

README.md

terraform-provider-ct

terraform-provider-ct allows defining a ct_config Container Linux Config resource to validate the content and render an Ignition document. Rendered Ignition may be used as input to other Terraform resources (e.g. instance user-data).

Requirements

Install

Add the terraform-provider-ct plugin binary for your system to the Terraform 3rd-party plugin directory ~/.terraform.d/plugins.

VERSION=v0.3.1
wget https://github.com/poseidon/terraform-provider-ct/releases/download/$VERSION/terraform-provider-ct-$VERSION-linux-amd64.tar.gz
tar xzf terraform-provider-ct-$VERSION-linux-amd64.tar.gz
mv terraform-provider-ct-$VERSION-linux-amd64/terraform-provider-ct ~/.terraform.d/plugins/terraform-provider-ct_$VERSION

Terraform plugin binary names are versioned to allow for migrations of managed infrastructure.

$ tree ~/.terraform.d/
/home/user/.terraform.d/
└── plugins
    ├── terraform-provider-ct_v0.3.0
    └── terraform-provider-ct_v0.3.1

Usage

Configure the ct provider in a providers.tf file.

provider "ct" {
  version = "0.3.1"
}

Run terraform init to ensure plugin version requirements are met.

$ terraform init

Declare a ct_config resource in Terraform.

data "ct_config" "worker" {
  content      = "${file("worker.yaml")}"
  platform     = "ec2"
  pretty_print = false

  snippets = [
    "${file("units.yaml")}",
    "${file("storage.yaml")}",
  ]
}

resource "aws_instance" "worker" {
  user_data = "${data.ct_config.worker.rendered}"
}

Set the content to the contents of a Container Linux Config that should be validated and rendered as Ignition. Optionally, use the snippets field to append a list of Container Linux Config snippets. Use platform if platform-specific susbstitution is desired.

Ignition schema output

Each minor version of terraform-provider-ct is tightly coupled with a minor version of the Ignition schema. Ignition transparently handles old Ignition schema versions, so this isn't normally an issue.

Upgrading between versions for existing managed clusters may not be safe. Check your usage to determine whether a user_data change to an instance would re-provision a machine (important machines may be configured to ignore user_data changes).

terraform-provider-ct Ignition schema version
0.2.x 2.0
0.3.x 2.2

Development

Binary

To develop the provider plugin locally, build an executable with Go v1.11+.

make

Vendor

Add or update dependencies in go.mod and vendor.

make update
make vendor
You can’t perform that action at this time.