aws-cloudformation / aws-cloudformation-macros

This repository hosts examples of AWS CloudFormation macros.
Apache License 2.0
83 stars 49 forks source link

Unresolved resource dependencies [mytestserver1] in the Outputs block of the template #15

Closed rohan-1995 closed 4 months ago

rohan-1995 commented 3 years ago

I am creating multiple ec2 instances using Count macro. Macro code does not account Outputs section when I try to obtain physical ids of launched EC2 Instances.

MrAliMohsin commented 2 years ago

Hey, I am having the same problem. I am unable to output the resources that are being created using the Count macro. The error states: Unresolved resource dependencies [RDSDBInstance2] in the Outputs block of the template

I also considered it as a list of strings and tried joining the output, using the below script

RDSDBInstance2:
    Description: Aurora Database instance
    Value: !Join
        - ''
        - ','
        - !Ref RDSDBInstance2

this time the error was: Template error: every Fn::Join object requires two parameters, (1) a string delimiter and (2) a list of strings to be joined or a function that returns a list of strings (such as Fn::GetAZs) to be joined.

If anyone has solved this problem, kindly help me.

MrAliMohsin commented 2 years ago

I even tried using count in output block but got below error

Error: Template format error: Invalid outputs property : [Count].

RDSDBInstance:
    Description: Aurora Database instance
    Value: !Ref RDSDBInstance
    Count: !Ref DBInstancesCount
ericzbeard commented 4 months ago

We are archiving this repository in favor of similar content located here: https://github.com/aws-cloudformation/aws-cloudformation-templates/tree/main/aws/services/CloudFormation/MacrosExamples