Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

497
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda