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

243
Views
Cómo poner etiquetas en los recursos de API Gateway V2 usando una plantilla YAML CloudFormation

Cómo poner etiquetas en los siguientes recursos usando una plantilla de CloudFormation:

  • AWS::ApiGatewayV2::Api
  • AWS::ApiGatewayV2::Nombre de dominio
  • AWS::ApiGatewayV2::Etapa

Para un recurso genérico de AWS::ApiGatewayV2::Api, probé lo siguiente en la sección Recursos de la plantilla de CloudFormation:

 MyApi: Type: 'AWS::ApiGatewayV2::Api' Properties: Name: MyApi ProtocolType: WEBSOCKET RouteSelectionExpression: $request.body.action ApiKeySelectionExpression: $request.header.x-api-key Tags: - Key: TagKey1 Value: MyFirstTag - Key: TagKey2 Value: !Ref MySecondTagAsParameter

En la vista Eventos de CloudFormation de Amazon Management Console, el recurso falló por el siguiente motivo:

Error de validación de la propiedad: [El valor de la propiedad {/Tags} no coincide con el tipo {Mapa}]

Busqué el Tipo, que parecía ser Json en la documentación :

 Tags The collection of tags. Each tag element is associated with a given resource. Required: No Type: Json Update requires: No interruption Required: No

Lo que me hizo probar lo siguiente:

 Tags: !Sub "{ \"TagKey1\" : \"MyFirstTag\", \"TagKey2\" : \"${MySecondTagAsParameter}\"}"

Eso tampoco funcionó, lo que me llevó a probar los literales YAML:

 Tags: !Sub | { "TagKey1": "MyFirstTag", "TagKey2": "${MySecondTagAsParameter}" }

Eso tampoco funcionó.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Lo siguiente hizo el truco:

 Tags: TagKey1: MyFirstTag TagKey2: !Ref MySecondTagAsParameter
over 4 years ago · Santiago Trujillo Report

0

Estabas muy cerca de la solución similar a json :

 Tags: { "TagKey1": "MyFirstTag", "TagKey2": !Ref MySecondTagAsParameter}
over 4 years ago · Santiago Trujillo Report

0

Para mí, la siguiente sintaxis funcionó:

 Tags: - Key: "keyname1" Value: "value1" - Key: "keyname2" Value: "value2"

Fuente: Documentación de AWS

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!