Cloudformation YAML not well-formed I have a cloud formation template that I want to import some values from another template. Currently the other template exports a string by joining together an array (better way of doing this?). 

In my template I want to import into I am getting the below error when trying to update my stack in the AWS console.

Template format error: YAML not well-formed. (line 71, column 28)

Here is lines 70 and 71 from my YAML file

SubnetId: 
        Fn::Select [ "0", [ Fn::Split: [ ",", Fn::ImportValue [ !Sub "${ExportPrefix}-SubNets"] ] ] ]


Have also tried this..

Fn::Select [ "0", [ {Fn::Split: [ ",", Fn::ImportValue [ {Fn::Sub "${ExportPrefix}-SubNets"}] ]} ] ]


I have checked and all spaces should be spaces and all tabs be tabs.
The split function returns a list of strings. I believe encapsulating the function in a list is what is giving you the error. Have you tried removing the brackets around the split function? Something like:

!Select [ "0",  !Split [ "," , !ImportValue [ !Sub "${ExportPrefix}-SubNets" ] ] ]