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

Added the launch_template_custom_user_data variable to the metaflow-computation #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

delagoya
Copy link

@delagoya delagoya commented Nov 8, 2024

Added the launch_template_custom_user_data variable to the metaflow-computation submodule.
Addresses issue #99

@madhur-ob
Copy link

I wonder if the variable should expect raw string instead? and we can then use terraform's base64encode. function: https://developer.hashicorp.com/terraform/language/functions/base64encode

so, something along the lines of:

variable "launch_template_custom_user_data" {
  type        = string
  description = "Custom user data script for the launch template provided as a string."
  nullable    = true
  default     = null
}

and

resource "aws_launch_template" "cpu" {
    # ... other configuration ...

    user_data = var.launch_template_custom_user_data != null ? base64encode(var.launch_template_custom_user_data) : null
}

One can then supply the variable as:

  launch_template_custom_user_data = <<-EOF
    #!/bin/bash
    echo "Hello, World!"
    yum update -y
  EOF

@delagoya
Copy link
Author

If that makes for a better user experience I think that would be a good change. Will implement and submit a new version after ReInvent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants