Skip to content

Rule for upper-case in labels blocks #413

Open
@wyardley

Description

@wyardley

Labels blocks for most / all services will allow you to define a label like:

resource "google_pubsub_topic" "foo" {
  name = "foo"
  labels = {
    Team = "Foobar"
  }
}

This will plan fine, but then bail on apply with an error like:

Error: Error creating Topic: googleapi: Error 400: You have passed an invalid argument to the service (argument=Invalid labels: Invalid field "labels"; key "Team" does not conform to regular expression "[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}"; first character "T" is not a non-uppercased letter (Unicode character class Ll or Lo)).

I spot-checked another resource type, and saw the same behavior.

While TPG could also probably do better validation, might be good to have a tflint error for it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions