Skip to content

How to pass userdata when creating an ec2-instance with the service catalog? #77

Answered by zackproser
zackproser asked this question in Help
Discussion options

You must be logged in to vote

Let's first start by understanding how user data is currently configured and passed in the module.

In the ec2-instance service catalog module you indicated, the user-data script is specified in the user-data.sh file here (in the root of the same module).

You will notice that user-data.sh file is a template that has values expecting to be interpolated later, such as the following:

readonly users_for_ip_lockdown=(${ip_lockdown_users})
start_ec2_baseline \
  "${enable_cloudwatch_log_aggregation}" \
  "${enable_ssh_grunt}" \
  "${enable_fail2ban}" \
  "${enable_ip_lockdown}" \
  "${ssh_grunt_iam_group}" \
  "${ssh_grunt_iam_group_sudo}" \
  "${log_group_name}" \
  "${external_account_ssh_grun…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zackproser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment