skip to Main Content

Received this error message from Cloudformation after adding output block below:

Template format error: Every Value member must be a string.


Outputs:
  NetFwEndpointIds:
    Description: Array for Network FW Endpoint Ids
    Value: !GetAtt NetFw.EndpointIds
    Export:
      Name: !Sub '${AWS::StackName}-EndpointIds'

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-networkfirewall-firewall.html

EndpointIds

The unique IDs of the firewall endpoints for all of the subnets that you attached to the firewall. The subnets are not listed in any particular order. For example: ["us-west-2c:vpce-111122223333", "us-west-2a:vpce-987654321098", "us-west-2b:vpce-012345678901"].

Looking for a workaround to share these endpoints across nested stack templates. Thanks!

Received this error message from Cloudformation after adding output block below:

Template format error: Every Value member must be a string.

Outputs:
NetFwEndpointIds:
Description: Array for Network FW Endpoint Ids
Value: !GetAtt NetFw.EndpointIds
Export:
Name: !Sub ‘${AWS::StackName}-EndpointIds’
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-networkfirewall-firewall.html

EndpointIds

The unique IDs of the firewall endpoints for all of the subnets that you attached to the firewall. The subnets are not listed in any particular order. For example: ["us-west-2c:vpce-111122223333", "us-west-2a:vpce-987654321098", "us-west-2b:vpce-012345678901"].

Looking for a workaround to share these endpoints across nested stack templates. Thanks!

2

Answers


  1. Use Join to convert your list of ids to a string.

    Login or Signup to reply.
  2. You need to convert the array to string using join, like this:

    Outputs:
      NetFwEndpointIds:
          Description: Array for Network FW Endpoint Ids
          Value: !Join
              - ','
              - !GetAtt NetFw.EndpointIds
          Export:
            Name: !Sub "${AWS::StackName}-EndpointIds"
    

    https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-join.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search