Multi-line Variable problem


I am confused :slight_smile: The documentation states “The text fields for variable values can handle multi-line text (typed or pasted) without any special effort.”

But I run into a error message “Value cannot contain newlines in environment variables” when trying to save a variable which contains an API key in PEM format


IT was originally copy & pasted. Removing the line breaks manually and pressing enter again in the text field didn’t help.

Am I doing something wrong?
Is there maybe a way to upload such files for referencing within the .tf which I didn’t see?

Thanks for help,


1 Like

Tracking this as I’m guessing you are doing your variables for the OCI provider in Terraform Cloud? I never figured this out.

Terraform Cloud has two types of variables: Terraform input variables, and shell environment variables. Only Terraform input variables may contain newlines.

If you’re trying to use this value in your Terraform configuration, make sure to add it under the “Terraform Variables” section of your Terraform Cloud workspace.

Hope this helps!

Yes, that makes sense. Thanks for tipping me off into the right direction :slight_smile: