Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

495
Views
Template format error: Every Mappings attribute must be a String or a List

I wanted to have some quick references at the top of my CloudFormation template, so that I don't have to write out a complex reference every time i need it throughout the template.

So I wrote this:

Mappings:
  StandardResourcesMap:
    AWSExecuteApi:
      string: !Join [ ':' , ['arn', !Sub '${AWS::Partition}', 'execute-api', !Sub '${AWS::Region}', !Sub '${AWS::AccountId}'] ]
    AWSLambdaFunctions:
      string: !Join [ ':' , ['arn', !Sub '${AWS::Partition}', 'apigateway', !Sub '${AWS::Region}', 'lambda:path/2015-03-31/functions/'] ]

The rest of the CloudFormation template follows this, and, without the lines above, the template deploys (an S3 bucket, DynamoDB table and a python 3.7-based Lambda).

The hope was that I could then just use:

!FindInMap [StandardResourcesMap,AWSExecuteApi,string]

whenever i needed the long-winded value, however the template fails validation with:

An error occurred (ValidationError) when calling the CreateChangeSet operation: Template format error: Every Mappings attribute must be a String or a List.

as the title says.

I have tried a number of variations on the Mappings such as using the !Ref variant:

Mappings:
  StandardResourcesMap:
    AWSExecuteApi:
      string: !Join [ ':' , ['arn', !Ref 'AWS::Partition', 'execute-api', !Ref 'AWS::Region', !Ref 'AWS::AccountId'] ]
    AWSLambdaFunctions:
      string: !Join [ ':' , ['arn', !Ref 'AWS::Partition', 'apigateway', !Ref 'AWS::Region', 'lambda:path/2015-03-31/functions/'] ]

and I just get pulled up on various validation errors, centring on the one presented above.

any help would be greatly appreciated.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The problem is this: You cannot include parameters, pseudo parameters, or intrinsic functions in the Mappings section. Mappings

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!