Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File interpolation is not interpolating #159

Closed
myoung34 opened this issue Aug 7, 2014 · 7 comments
Closed

File interpolation is not interpolating #159

myoung34 opened this issue Aug 7, 2014 · 7 comments

Comments

@myoung34
Copy link
Contributor

myoung34 commented Aug 7, 2014

Related to GH-145, but I'm having the issue in 0.1.1, which should include the hash related to it.

I have a lunch configuration with user_data = ${file("CDR.ps1")}

Build succeeds with

aws_launch_configuration.as_conf: Creating...
  image_id:          "" => "..."
  instance_type:     "" => "..."
  key_name:          "" => "..."
  name:              "" => "CDR..."
  security_groups.#: "" => "2"
  security_groups.0: "" => "sg-..."
  security_groups.1: "" => "sg-...."
  user_data:         "" => "${file(\"CDR.ps1\")}"
aws_launch_configuration.as_conf: Creation complete

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

The userdata in the LC is ${file("CDR.ps1")}

Same effect with:

  • user_data = ${file('CDR.ps1')}
  • user_data = "${file(\"CDR.ps1\")}"
  • user_data = "${file('CDR.ps1')}"
@mitchellh
Copy link
Contributor

Hm, I thought this was the same as #215 but maybe it isn't. Let me try.

@mitchellh
Copy link
Contributor

Fixed

@myoung34
Copy link
Contributor Author

Thanks! Can't wait to see more enhancements. Terraform is the solution to something we need in the future.

@jwestboston
Copy link

Just a heads up, the documentation seems to be out of sync with this ticket.

https://terraform.io/docs/configuration/interpolation.html

^ "file(path) - Reads the contents of a file into the string. Variables in this file are not interpolated. The contents of the file are read as-is."

but from this ticket, looks like interpolation of the contents of a file is indeed supported.

@mitchellh
Copy link
Contributor

Interpolation within the file is not allowed, a separate issue was fixed.

@jwestboston
Copy link

My bad. Also, probably a good idea for security reasons.

@ghost
Copy link

ghost commented May 4, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants