How do I access CloudFormation stack name from the Macro Handler?

0

Hi, Can you please suggest a way to access the cloud formation stack name from the Macro lambda handler? I don't see the stack name getting passed in the event or context parameter of the handler function.

demandé il y a 3 ans1,1 k vues
1 réponse
1

I don't see a way to do it, but here's an idea for a workaround that may help depending on how you invoke stack create/update. Add a "StackName" parameter to your template, and set it to the name of the stack when it's created. Template parameters like this get passed to the Lambda function.

EXPERT
répondu il y a 3 ans
  • Thanks for your response. Yes, I managed to get it working using parameters and accessing the parameter in the handler using 'event.templateParameterValues.stack'. I was expecting a more direct way to get this value as CF is already aware of the stack name.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions