terraform-aws-modules / terraform-aws-autoscaling

Terraform module to create AWS Auto Scaling resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/autoscaling/aws
Apache License 2.0
292 stars 556 forks source link

user_data not applicable for launch templates #149

Closed baztian closed 3 years ago

baztian commented 3 years ago

Description

Setting up a launch template using this module does not work if you're using user_data.

Versions

Terraform v0.14.6

Reproduction

Steps to reproduce the behavior: Apply a stack with

  use_lt = true
  create_lt = true
  user_data = "..."

Expected behavior

A lauch template with the user_data is created.

Actual behavior

A launch template without any user_data is created.

Additional context

When using user_data_base64 instead everything works fine.

bryantbiggs commented 3 years ago

unlike launch configurations, launch templates take user data but it must be already base64 encoded (launch config has provisions for plain user data and user data thats base64 encoded). therefore, because the module was updated to accommodate both launch configs and launch templates, we pass in the user_data_base64 into the launch template because it only accepts base64 encoded user data

mbaquer6 commented 3 years ago

Hi, Can you add this to the module documentation? Thanks!

yanivpaz commented 3 years ago

+1 for updating the doc - user_data is not working

bryantbiggs commented 3 years ago

hi all - for as much time as it took here to post a message, a PR could have been opened to address this (per the doc update that is)

github-actions[bot] commented 1 year ago

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.