R015

ResourcesStandard

check for (*schema.ResourceData).SetId() receiver method usage with unstable resource.UniqueId() value

The R015 analyzer reports (*schema.ResourceData).SetId() usage with unstable resource.UniqueId() value. Schema attributes should be stable across Terraform runs.

Examples

d.SetId(resource.UniqueId())
d.SetId("stablestring")

Ignoring reports

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

//lintignore:R015
d.SetId(resource.UniqueId())

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