Skip to content

(@aws-cdk/core): CfnMapping overview example throws Template format error: Mappings attribute name 'us-east-1' must contain only alphanumeric characters. #16866

@gmedard

Description

@gmedard

link to reference doc page

https://docs.aws.amazon.com/cdk/api/latest/docs/core-readme.html#mappings

Describe your issue?

Attempting to define a region template mapping:

  const regionTable = new cdk.CfnMapping(this, "RegionTable", {
  mapping: {
    regionName: {
      "us-east-1": "value-one",
      "us-west-2": "value-two",
    },
  },
});

However, this is not working as documented. It's throwing this error:
"Template format error: Mappings attribute name 'us-east-1' must contain only alphanumeric characters."

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationThis is a problem with documentation.feature-requestA feature should be added or improved.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions