GithubHelp home page GithubHelp logo

codegazers / terraform-provider-ct Goto Github PK

View Code? Open in Web Editor NEW

This project forked from poseidon/terraform-provider-ct

0.0 1.0 0.0 8.26 MB

Terraform provider for Fedora CoreOS Config (FCC) and Container Linux Config (CLC) validation and transpiling

Home Page: https://registry.terraform.io/providers/poseidon/ct/latest

License: Apache License 2.0

Makefile 14.07% Go 85.93%

terraform-provider-ct's Introduction

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.6.1"
    }
  }
}

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.1.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

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.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.12+.

make

Vendor

Add or update dependencies in go.mod and vendor.

make update
make vendor

Legacy Install

For Terraform v0.12, add the terraform-provider-ct plugin binary for your system to the Terraform 3rd-party plugin directory ~/.terraform.d/plugins.

VERSION=v0.6.0
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.6.0
    └── terraform-provider-ct_v0.5.1

terraform-provider-ct's People

Contributors

dghubble avatar sdemos avatar bison avatar dhensen avatar alekssaul avatar ericchiang avatar invidian avatar madorn avatar odidev avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.