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
질문됨 3달 전121회 조회
1개 답변
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

답변함 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠