Skip to content

Migrating Configuration

Teemu Matilainen edited this page Jan 4, 2019 · 5 revisions

Backend configuration

In YleTf version 1.1 the format for the Terraform backend configuration changed to be more flexible. See the readme for current syntax. The new format allows using basically all backends and their options that Terraform supports.

In essence all but the type key from the backend: block should be moved under the <type>: block. Some keys must be renamed.

YleTf warns and displays the migrated configuration if it finds that old backend configuration is used. You can run tf <env> _config --debug for more details how the configuration is built. The warning can be suppressed by setting TF_OLD_CONFIG_WARNINGS environment variable to "false".

file backend

Old configuration:

backend:
  type: file
  file: <path>

New configuration:

backend:
  type: file
  file:
    path: <path>

S3 backend

Old configuration:

backend:
  type: s3
  region: <region>
  bucket: <bucket>
  file: <path>
  encrypt: <encrypt>

New configuration:

backend:
  type: s3
  s3:
    region: <region>
    bucket: <bucket>
    key: <path>
    encrypt: <encrypt>
    # [other s3 backend config]

Swift backend

Old configuration:

backend:
  type: swift
  region: <region>
  container: <bucket>
  archive_container: <archive_container>

New configuration:

backend:
  type: swift
  swift:
    region_name: <region>
    container: <bucket>
    archive_container: <archive_container>
    # [other swift backend config]
Clone this wiki locally