In cloudformation, want to assign a default value in case if the Fn::ImportValue variable or SSM parameter is not found or not created yet

0

I have a situation like, I wanted to fetch a exported variable from cloudformation export section or from SSM Parameter store. But i have not yet executed the required stack which pushes this variable by any of the means mentioned above. I have to execute the current stack first where it require/import the arn ( bucket arn ) in my current stack but it fails to find the variable. I want to execute this stack with some default or fixed arn and later re execute it when the variable is populated by the later stack. Can we do this? or any solution to overcome this dependency?

khalid
demandé il y a 3 mois121 vues
1 réponse
1

If you are deploying the CFN templates manually, then you can have the parameter as a default value initially and then update it after the second stack is deployed...

Something like this:

Parameters:
  BucketARN:
    Type: String
    Description: The ARN of the S3 bucket
    Default: "arn:aws:s3:::example-bucket" # Default or placeholder ARN

Then after second stack is deployed, you can just replace the parameter with !ImportValue and remove this particular parameter

répondu il y a 3 mois

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