Mapping

The mapping method maps to the CloudFormation Template Anatomy Mappings section.

Example Snippets

There are 2 forms for mapping. Here are example snippets:

# medium form
mapping("AmiMap",
  "ap-northeast-1": {ami: "ami-084cb340923dc7101"},
  "ap-south-1":     {ami: "ami-0d7805fed18723d71"},
)

# long form
mapping("ImageMap" => {
  "ap-northeast-1": {ami: "ami-084cb340923dc7101"},
  "ap-south-1":     {ami: "ami-0d7805fed18723d71"},
})

Example Outputs

Mappings:
  AmiMap:
    ap-northeast-1:
      Ami: ami-084cb340923dc7101
    ap-south-1:
      Ami: ami-0d7805fed18723d71
  ImageMap:
    ap-northeast-1:
      Ami: ami-084cb340923dc7101
    ap-south-1:
      Ami: ami-0d7805fed18723d71

Note, the second level keys in the mapping structure do not automatically get camelized because they contain dashes. Lono uses transform the keys of the Hash structure according so some Camelize Conventions.

Back to DSL List Docs.

Pro tip: Use the <- and -> arrow keys to move back and forward.

Edit this page

See a typo or an error? You can improve this page. This website is available on GitHub and contributions are encouraged and welcomed. We love pull requests from you!