This topic describes the parameters for configuring the tf-migrate
CLI.
A tf-migrate
configuration file supports the following parameters.
skip-dir
: list of stringsprojects
: list of objects
dir
: stringworkspaces
: list of objects
name
: stringenv-vars
:terraform-vars
: list of stringsThis section provides details about the fields you can configure in a tf-migrate
configuration file.
skip-dir
Specifies a list of paths to directories you want tf-migrate
to skip. This parameter is identical to using the -skip-dir
command-line flag. By default, tf-migrate
processes all child directories containing Terraform configuration files.
projects
Specifies a list of project configurations that align with local directories. The tf-migrate
tool creates one project in HCP Terraform or Terraform Enterprise per configuration. In each project, tf-migrate
creates one workspace per local workspace.
projects.dir
Specifies the relative or absolute path to the Terraform configuration to migrate.
projects.workspaces
Specifies workspace configurations in the project. Terraform creates a workspace in HCP Terraform or Terraform Enterprise for each workspace configuration. The following table describes the attributes you can configure in each item in the list of workspaces:
Attribute Description Data type Defaultname
Specifies the name of the local workspace. String None env-vars
Specifies a map of environment variables to set during the migration. Each key must start with TF_VAR
. You must specify env-vars
, terraform-vars
, or both. Object None terraform-vars
Specifies a list of Terraform variables files to use for configuring the workspace. Each file must end with either .tfvars
or tfvars.json
. You must specify terraform-vars
, env-vars
, or both. The path can be a relative or absolute path. List of strings None
In the following example, Terraform creates one project using data from the example/project1
directory. The project has a workspace named staging
and a workspace named dev
:
skip-dir = ["example/skip/dir1", "example/skip/dir2"]
projects = [
{
dir = "example/project1"
workspaces = [
{
name = "staging"
env-vars = {
"TF_VAR_region": "us-east-2"
}
terraform-vars = ["staging.tfvars"]
},
{
name = "dev"
terraform-vars = ["dev.tfvars"]
}
]
}
]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4