Terraform Provider for Container Linux Configs
The ct
provider provides a ct_config
data source that parses a Container Linux Config, validates the content, and renders Ignition. The rendered strings can be used as input to other Terraform resources (e.g. user-data for instances).
Requirements
- Terraform 0.9.x
Installation
Add the terraform-provider-ct
plugin binary on your filesystem.
# dev
go get -u github.com/coreos/terraform-provider-ct
Register the plugin in ~/.terraformrc
.
providers {
ct = "/$GOPATH/bin/terraform-provider-ct"
}
Usage
data "ct_config" "worker" {
content = "${file("worker.yaml")}"
platform = "ec2"
pretty_print = false
}
resource "aws_instance" "worker" {
user_data = "${data.ct_config.worker.rendered}"
}
The optional platform can be "azure", "ec2", "gce", or others to perform platform-specific susbstitutions. By default, platform is "" (none, for bare-metal).
Development
To develop the provider plugin locally, set up Go 1.8+ and a valid GOPATH. Build the plugin locally.
make
Optionally, install the plugin to $(GOPATH)/bin
.
make install
Vendor
Add or update dependencies in glide.yaml and vendor. The glide and glide-vc tools vendor and prune dependencies.
make vendor