Home > Mobile >  Cloudformation Outputs: Template format error: Every Value member must be a string
Cloudformation Outputs: Template format error: Every Value member must be a string

Time:02-02

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!

CodePudding user response:

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

CodePudding user response:

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

  • Related