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

Launch configuration user_data can't handle binary #5654

Closed
FransUrbo opened this issue Mar 16, 2016 · 3 comments
Closed

Launch configuration user_data can't handle binary #5654

FransUrbo opened this issue Mar 16, 2016 · 3 comments

Comments

@FransUrbo
Copy link

I have a script, called from a aws_launch_configuration in a provisioner "local-exec" that creates a setup script with a embedded BZ2 tarball.

This resulting script is then used in a user_data:

  provisioner "local-exec" {
    command = "./bin/package_files_for_LC.sh [options]"
  }

  user_data = "${file("..../userdata-script.sh")}"

If I include the tarball in binary form

./bin/package_files_for_LC.sh:

#!/bin/sh
[misc other stuff]
cat <<EOF > "..../userdata-script.sh"
#!/bin/sh
[misc other stuff]
`cat "../file.tar.bz2"`

TF will refuse to create the launch configuration.

However, if i uuencode it, it will work:

./bin/package_files_for_LC.sh:

#!/bin/sh
[misc other stuff]
cat <<EOF > "..../userdata-script.sh"
#!/bin/sh
[misc other stuff]
`cat "../file.tar.bz2" | uuencode -`

However, the resulting file gets quite big. So far the tarball is quite small (just a bunch of other setup shell scripts that I'll need in the provisioning of the instance), so I don't know if there's a size limit on the user_data part.

@FransUrbo
Copy link
Author

This might be a size issue, so possibly related to #5525.

@mitchellh
Copy link
Contributor

If you use cloudinit user data parts, then you can upload binary data.

@ghost
Copy link

ghost commented Apr 19, 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 Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants