Use CAPABILITY_AUTO_EXPAND for nested stacks on CloudFormation

I tried the solutions above and what worked for me today (June 2020) using the higher level sam was adding a space between the capabilities listed. It's complete insanity that there's no resilience in this text file interpretation. SAM's cli is open source so I guess I could put my code where my mouth is and submit a PR. Anyway.

samconfig.toml:

...
capabilities = "CAPABILITY_IAM CAPABILITY_AUTO_EXPAND"
...

Then:

sam deploy

Output:

...
Capabilities               : ["CAPABILITY_IAM", "CAPABILITY_AUTO_EXPAND"]
...

I tried another variant and it worked!

Configuration:
  ..
  Capabilities: CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND
  ...

I got the answer from Keeton Hodgson, this cli command works:

sam deploy --template-file output.yaml --stack-name <AppName> --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND

Notice that there is no comma.

I still don't know how to change the pipeline template for it to work.