R011

ResourcesStandard

check for Resource that configure MigrateState

The R011 analyzer reports cases of Resource which configure MigrateState. After Terraform 0.12, resources must configure new state migrations via StateUpgraders. Existing implementations of MigrateState prior to Terraform 0.12 can be ignored currently.

For additional information, see the Extending Terraform documentation on state migrations.

Examples

&schema.Resource{
    MigrateState:  /* ... */,
    SchemaVersion: 1,
}
&schema.Resource{
    SchemaVersion:  1,
    StateUpgraders: /* ... */,
}

Ignoring reports

Singular reports can be ignored by adding a //lintignore:R011 Go code comment at the end of the offending line or on the line immediately preceding, e.g.

//lintignore:R011
&schema.Resource{
    MigrateState:  /* ... */,
    SchemaVersion: 1,
}

This page is generated from passes/R011/README.md, which lives beside the analyzer.