Skip to content

fix(misconf): ensure boolean metadata values are correctly interpreted #9762

@nikpivkin

Description

@nikpivkin

In Terraform, the metadata attribute of google_compute_instance is of type map(string). Non-string values (boolean, number) are automatically converted to strings (Terraform Type Conversion).

Since some metadata fields are used as boolean values in checks, we must explicitly transform strings and numbers to boolean values according to Google Cloud documentation:

For fields that accept boolean values, TRUE or FALSE, the following alternative values can also be used:
- TRUE: Y, Yes, 1
- FALSE: N, No, 0
Boolean values are not case-sensitive. For example, False, false, or FALSE can be used to disable a feature.

Discussed in #9716

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.scan/misconfigurationIssues relating to misconfiguration scanning

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions